;; program1.asm -- This program reads a character from the keyboard and display ;; it at the beginning of the next line. .model small .stack 100 .data prompt db '?', 13, 10, '$' ; the '?' to be displayed. newline db 13, 10, '$' ; to move the cursor to a new line. .code prog proc mov ax, @data mov ds, ax lea dx, prompt ; or 'mov dx, offset prompt'. mov ah, 9h ; print out prompt which is a '?'. int 21h mov ah, 1h ; read one character with echo to int 21h ; the screen and store it in al. mov bl, al ; save the character in bl. lea dx, newline ; or 'mov dx, offset newline'. mov ah, 9h int 21h mov dl, bl ; display the character mov ah, 2h int 21h mov al, 0 ; return code of 0 mov ah, 4ch ; function code for exit to os int 21h prog endp end prog