The following code example places the letter 'A' in the upper left corner of the screen:
mov ax, 0B800h ;- set up es to point to video memory
mov es, ax
mov di, 0000 ;- point to first (upper left) character
mov al, 'A' ;- character to display
mov es:[di], al ;- display it
To display a null-terminated string:
mov ax, 0B800h
mov es, ax
mov di, 0000
mov bx, 0
lea si, String
LoopTop:
mov al, [si+bx]
cmp al, 0
jz Finished
mov es:[di+bx], al
inc bx
jmp LoopTop
If these code fragments are tested, it is important to clear the screen
from the DOS command prompt just prior to executing the test program.
If the command was typed on the bottom line of the screen, the screen
will scroll by 1 or 2 lines when the program returns to DOS, scrolling
the output off the screen faster than it can be seen.