![]() |
![]() |
![]() |
|||
|
> SCHOOL > ICS 312 > INPUT/OUTPUT COMMANDS
If you want to send a character to the screen, you must first copy the character to the DL register. To print a string, copy the offset of the string variable to the DX register. This can be done by copying the offset of the string to DX (MOV DX,OFFSET VAR1) or loading the effective address to DX (LEA DX,VAR1). Note that strings must end with a terminator ('$'). Example: To print a question mark to the screen... MOV DL,'$'
MOV AH,2
INT 21H
The order in which the above MOV directives are issued is not important. INT 21H will execute whatever function number is currently in AH and print whatever is specified by DX (or DL). See Input/Output example for examples of getting an input character and displaying a string to the console.
|
|||||||||||||