Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
649 B
1
Indexable
Never
.model small;
.stack 100h;
.code
main proc
    ;display prompt
    MOV AH,2; display character function
    MOV Dl,'?'; character is '?'
    INT 21H; display character
    
    ;input a character
    
    MOV AH,1; input key function
    INT 21H; ASCII code in AL
    mov bl,al; save it in bl
    
    ;go to a new line
    
    mov ah,2; display character function
    mov dl,0dh; carriage return
    int 21h; execute
    mov dl,0ah; line feed
    int 21h; execute
    
    ;display character
    mov dl,bl;
    int 21h;
    
    ;return to dos
    mov ah, 4ch;
    int 21h;
    
    main endp;
end main;