;this program waits for user input. if the user presses '1' it outputs a string, if '2' it exits .model small .stack 100h .data oneKey = 2 escKey = 3 key1 db 'Key 1 $' .code init: mov ax,@data ;initialize data sector mov ds,ax mov ax,3 ;initialize video mode: text int 10h top: in al,64h ;check port 64 - do nothing AND al,1 ;if no keys are pressed cmp al,1 jne top in al,60h ;read in key pressed cmp al,escKey je fin cmp al,oneKey ;compare with a specific key jne top lea dx,key1 ;print out key1 mov ah,9 ; int 21h ; jmp top fin: mov ah,4ch ;return control to OS int 21h end