ECE 103 Engineering Programming Chapter 53 Generic Algorithms Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE 103 material.

Slides:



Advertisements
Similar presentations
ECE 103 Engineering Programming Chapter 54 Recursion Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE 103 material developed.
Advertisements

DOS and BIOS Interrupts DOS and BIOS interrupts are used to perform some very useful functions, such as displaying data to the monitor, reading data from.
©annax1 PC-technology Keyboard Graphics Interface cards.
BY Kamran Yousaf Application of Computer Graphics and Animation Using C++ Language.
Assembly Language for Intel-Based Computers Chapter 15: BIOS-Level Programming (c) Pearson Education, All rights reserved. You may modify and.
Chapter 7 Programming with DOS and BIOS Function Calls Objectives: The use of DOS and BIOS function call How to read the PC’s keyboard How to send text.
Screen Display Module M15.2 Sections 9.5, 13.1, 13.2.
CS 161 Introduction to Programming and Problem Solving Chapter 13 Console IO Herbert G. Mayer, PSU Status 9/8/2014 Initial content copied verbatim from.
ORG ; FOUR INT 21H and INT 10H Programming and Macros Dec Hex Bin
1 CS 106 Computing Fundamentals II Chapter 7 “Showing Developer Tab” Herbert G. Mayer, PSU CS status 6/17/2013 Initial content copied verbatim from CS.
ECE291 Computer Engineering II Lecture 9 Josh Potts University of Illinois at Urbana- Champaign.
BIOS and DOS Programming in DOS INT 10 and 21H. Interrupts There are some extremely useful subroutines within BIOS or DOS that are available to the user.
Another Example: #include<BIOS.H> #include<DOS.H>
ECE 103 Engineering Programming Chapter 57 Terminal Control Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE 103 material.
1 Screen and Keyboard Operations Suthida Chaichomchuen
ECE 103 Engineering Programming Chapter 40 C Graphing Libraries Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE 103 material.
ECE 103 Engineering Programming Chapter 5 Programming Languages Herbert G. Mayer, PSU CS Status 6/19/2015 Initial content copied verbatim from ECE 103.
ECE 103 Engineering Programming Chapter 1 Introduction Herbert G. Mayer, PSU CS Status 6/19/2015 Initial content copied verbatim from ECE 103 material.
1 Chapter 5: Procedures and Interrupts Assembly Language for Intel-Based Computers, Kip R. Irvine 3rd edition 3/17/2000.
Text-Mode Programming Question #1 What are the three levels of access to the video display when writing characters on the screen in text mode?
Lecture 10: BIOS and DOS Programming
ECE 103 Engineering Programming Chapter 48 Typedef and Enum Type Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE 103.
ECE 103 Engineering Programming Chapter 47 Dynamic Memory Alocation Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE 103.
ECE 103 Engineering Programming Chapter 24 Sorting Herbert G. Mayer, PSU CS Status 6/2/2015 Initial content copied verbatim from ECE 103 material developed.
ECE 103 Engineering Programming Chapter 9 gcc Compiler Herbert G. Mayer, PSU CS Status 6/19/2015 Initial content copied verbatim from ECE 103 material.
CS 161 Introduction to Programming and Problem Solving Chapter 19 Single-Dimensional Arrays Herbert G. Mayer, PSU Status 10/8/2014 Initial content copied.
Video systems. Lesson plan Review the code for the previous exercise Video systems Review for midterm exam.
ECE 103 Engineering Programming Chapter 44 File I/O Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE 103 material developed.
3 Types of Video Output for Text DOS-level INT (Int 21) Output can be easily redirected to other devices (printer, disk) Slow Speed Cannot control the.
ECE 103 Engineering Programming Chapter 36 C Storage Classes Herbert G. Mayer, PSU CS Status 8/4/2014 Initial content copied verbatim from ECE 103 material.
ECE 103 Engineering Programming Chapter 55 C Math Library Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE 103 material.
ECE 103 Engineering Programming Chapter 49 Structures Unions, Part 1 Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE.
CS1372: HELPING TO PUT THE COMPUTING IN ECE CS1372 Some Basics.
ECE 103 Engineering Programming Chapter 52 Generic Algorithm Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE 103 material.
1 CS 106 Computing Fundamentals II Chapter 21 “Computer Organization” Herbert G. Mayer, PSU CS Status 7/9/2013 Initial content copied verbatim from CS.
ECE 103 Engineering Programming Chapter 50 Structures Unions, Part 2 Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE.
10H Interrupt. Option 0H – Sets video mode. Registers used: – AH = 0H – AL = Video Mode. 3H - CGA Color text of 80X25 7H - Monochrome text of 80X25 Ex:
String Instructions String instructions were designed to operate on large data structures. The SI and DI registers are used as pointers to the data structures.
CS 161 Introduction to Programming and Problem Solving Chapter 18 Control Flow Through C++ Program Herbert G. Mayer, PSU Status 10/8/2014 Initial content.
Microprocessors Monday, Apr. 16 Dr. Asmaa Farouk Faculty of Engineering, Electrical Department, Assiut University.
ECE 103 Engineering Programming Chapter 31 C Scopes Herbert G. Mayer, PSU CS Status 8/1/2015 Initial content copied verbatim from ECE 103 material developed.
ROM BIOS Chapter 9. The ROM BIOS PC computer come with a set od built in routines collectively called the ROM BIOS. These routines are permanent part.
ECE 103 Engineering Programming Chapter 4 Operators Herbert G. Mayer, PSU CS Status 6/19/2015 Initial content copied verbatim from ECE 103 material developed.
ECE 103 Engineering Programming Chapter 23 Multi-Dimensional Arrays Herbert G. Mayer, PSU CS Status 6/24/2014 Initial content copied verbatim from ECE.
ECE 103 Engineering Programming Chapter 15 C Standard Library Herbert G. Mayer, PSU CS Status 7/19/2015 Initial content copied verbatim from ECE 103 material.
CS 161 Introduction to Programming and Problem Solving Chapter 17 Nested Loops Herbert G. Mayer, PSU Status 9/8/2014 Initial content copied verbatim from.
ECE 103 Engineering Programming Chapter 41 C Pointers, Part 3 Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE 103 material.
Lecture 11 Text mode video
Project Assignment Snake Game/Car Acceleration Meter Min 10 Pages 10 min Presentation Max 5 group members Submitting Date: lab 2:Dec 27, 2014 Lab 3: Dec.
Direct-Access Color Graphics Chapter 11. Graphics modes C++ provides a different combination of graphics characteristics. These characteristics include.
ECE 103 Engineering Programming Chapter 29 C Strings, Part 2 Herbert G. Mayer, PSU CS Status 7/30/2014 Initial content copied verbatim from ECE 103 material.
ECE 103 Engineering Programming Chapter 30 C Functions Herbert G. Mayer, PSU CS Status 8/9/2014 Initial content copied verbatim from ECE 103 material developed.
ECE 103 Engineering Programming Chapter 45 Pointers to Functions Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE 103.
Problems in IO CS 1550 Recitation December 2 nd /4 th, 2002 The questions in this slide are from Andrew S. Tanenbaum's textbook page 376, 377.
Computer Graphics Lecture 04 Point Taqdees A. Siddiqi
ACCEL SOFTWARE AND TECHNOLOGIES LTD.
Example 21H/42H: handle = open("c:\\abc.txt",O_RDONLY);
CS 301 Fall 2001 – Chapter 3 Slides by Prof. Hartman, following “IBM PC Assembly Language Programming” by Peter Abel 9/17/2018.
Microprocessor and Assembly Language
ECE 103 Engineering Programming Chapter 19 Nested Loops
ECE 103 Engineering Programming Chapter 12 More C Statements
ECE 103 Engineering Programming Chapter 51 Random Numbers
ECE 103 Engineering Programming Chapter 25 C Strings, Part 1
ECE 103 Engineering Programming Chapter 46 argc, argv, envp
ECE 103 Engineering Programming Chapter 37 C Macro Parameters
ECE 103 Engineering Programming Chapter 8 Data Types and Constants
ECE 103 Engineering Programming Chapter 64 Tree Implementation
ECE 103 Engineering Programming Chapter 20 Change in Flow of Control
ECE 103 Engineering Programming Chapter 35 C Pointers, Part 1
ECE 103 Engineering Programming Chapter 38 C Pointers, Part 2
Presentation transcript:

ECE 103 Engineering Programming Chapter 53 Generic Algorithms Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE 103 material developed by Professor Phillip PSU ECE

Syllabus CGA Video Adapter

3 From:Advanced C, © Brian Brown, Color Graphics Adapter (CGA) – 1981 This adapter supports the following display modes, using a 16 KB memory buffer starting at B800:0000. Text modes:40  25 BW/Color & 80  25 BW/Color Graphic modes :320  200 BW/4 Color & 640  200 BW In text mode, each screen location requires 2 bytes of storage: 1 byte to hold the character that will be displayed 1 byte to define the character’s attribute (e.g., color) Multiple display pages are supported. The adapter hardware continuously scans the video buffer and displays its contents to the video monitor.

4 CGA 40 column text mode – Coordinate grid: 40 columns across 25 rows HELLO,WORLD

5 Accessing the CGA Text Screen The original IBM PC offered BIOS (Basic Input Output System) INT 10h interrupt calls to control video output. While convenient to have a built-in way to write characters to the screen, the INT 10h method was relatively slow. To improve performance, many programmers bypassed certain INT 10h calls and wrote directly to the video buffer memory.

6 Some INT 10h routines are called to set up the desired text mode. Characters are sent to the video memory by using an offset from the start of the buffer. Suppose row and column are the desired coordinates, and pagenum is the display page. The offset for a 40 column screen is given by: offset = (( row * 0x28 + column ) * 2 ) + ( pagenum * 0x1000 )

7 #include /* TITLE 40x25 Color adapter (code will not work on Windows PC) */ #include union REGS regs; void setpage( unsigned int pagenum ) { regs.h.ah = 5; regs.h.al = pagenum; int86( 0x10, &regs, &regs ); } int main (void) { int x, y, offset; /* x=col, y=row, offset=from beginning of buffer */ char ch, attr; /* Character to write and its attribute */ char far *scrn = ( char far * ) 0xB ; /* Pointer to start of video buffer */ char *message = "Hello, world.\n"; regs.h.ah = 0; regs.h.al = 1; int86( 0x10, &regs, &regs ); /* Mode 40x25 color */ setpage(1); /* Set display to page 1 while writing to page 0 */ x = 0; y = 1; attr = 0x82; /* column 0, row 1, green blinking */ offset = (( y * 0x28 + x ) * 2 ) + ( 0 * 0x1000 ); while ( *message ) /* Write directly to page 0 */ { scrn[offset++] = *message++; scrn[offset++] = attr; } setpage(0); /* Set display to page 0 */ return 0; }