Text Mode Programming in Assembly

JaveriaYaqoob2 1,932 views 9 slides Jan 22, 2018
Slide 1
Slide 1 of 9
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9

About This Presentation

Text Mode Programming in Assembly Lnaguage
Display Pages


Slide Content

TEXT MODE PROGRAMMING DISPLAY PAGES

IMPORTANT POINT Position on the screen may be located by giving its columns and rows. Screen in text mode is divided into 80 columns by 25 rows. 0-79 columns ....... 0-24 rows. The upper left corner has coordinate (0,0) Character display at a screen position is specified by the contents of a words in the display memory. The low byte of a word contains the characters ACSII code.

The high byte of the word contains its attributes.

DISPLAY PAGES For a MDA, the display memory can hold one screenful of data. A graphics adapter divides its display memory into DISPLAY PAGES. One page can hold the data for one screen. The page are numbered, starting with 0. The numbers of pages avaliable depends on the adapter and the select mode selected.

In the 80*25 text mode,each display pages 4 KB (4096 bytes). The Monochrome Display Adapter has only one page. The Color Graphics Adapter has four pages.

THE ACTIVE DISPLAY PAGE The active display page is the page currently being displayed . For 80*25 text mode, the memory requirement is 80*25 = 2000words = 4000 btyes. The vedio controller displays the first word in the active display page at the upper left corner of the screen (col 0,row 0). The next word is displayed in column 1, row 0. Active display page is displayed on the screen row by row.

AH register contains the functions number 00h set text mode 01h set cursor lines 02h set cursor position 03h get cursor position and size 06h scroll window up 07h scroll window down 08h read character and attributes 09h write character and attributes INT 10h vedio functions:

EXAMPLE: Select page 1 for the CGA solution: MOV AH,5 ;active display pg function MOV AL,1 ;pg 1 INT 10H ;select pg

EXAMPLE: Clear the screen to black for the 80*25 display. SOLUTION: MOV AH,6 ;scroll up function XOR AL,AL ;clr whole screen XOR CX,CX ;upper left corner is(0,0) MOV DX,184Fh ;lower rite corner is (4Fh,18h) MOV BH,7 ;normal video attribute INT 10h ;clr scr