Professional Documents
Culture Documents
ADVANCED TOPICS
Compiled by: Seble N.
Outlines
Rows and columns provide a grid of addressable locations, where the cursor can
be set
Decimal Hexadecimal
Screen Location Row Column Row Column
Upper left corner 00 00 00H 00H
Upper right corner 00 79 00H 4FH
Center 12 39 0CH 27H
Lower left corner 24 00 18H 00H
Lower right corner 24 79 18H 4FH
Displaying Data on the Screen
The interrupts that handle screen displays, transfer data directly to
the Video Display Area OR programs may transfer data directly to
the Video Display Area
The location of the Video Display Area varies based on the mode
the system is operating
40 – display string
INT 21h, 3FH
Accept string
NAME db 20 DUP(‘ ‘)
AH- function code 3fh
…
BX – file handle 00 MOV AH, 3FH
MOV BX, 00
CX – maximum input length
MOV CX, 20
DX- address of the area that is LEA DX, NAME
INT 21H
going to hold input
Does not check whether the number of characters exceeds the limit
The input characters are followed by 0DH and 0AH
Stores the actual input length in AX
File Handles
A file handle is a number that refers to a specific
device.
Handle Device
00 Keyboard
01 Screen
04 Printer
INT 21h, 0AH
Accept string
Define parameter list in the .DATA
form label byte PARA_LIST LABEL BYTE
NameOfTheParameter LABEL BYTE max_len DB 20
In the first byte of the parameter act_len DB ?
list define the maximum length of input DB 20 Dup(‘ ‘)
the input (0 -255)
The second byte is reserved for the
operation to store the actual length .CODE
of the input string MOV AH, 0Ah
The third byte begins a field that is LEA DX, PARA_LIST
to contain the typed characters
INT 21H
Checks input characters does not exceed the maximum value
Stores the enter character 0DH, but its not counted on the actual length
MOV name[act_len + 1], ‘$’ ;to set a delimiter
Using control characters
Control character ASCII Hex Effect on Cursor
Carriage Return 13 0Dh Resets to left position
Line feed 10 0Ah Advances to next line
Tab 09 09h Advances to next tab stop
Example
Msg db “Hello”, 13,10,’$’
Msg db 13,10,”Hello”,’$’
Example
CR equ 13
Lf equ 10