Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .model small
- .data
- prompt db "Enter favorite number (0 - 9): $"
- result db ? 13, 10, "Value = $"
- .code
- main proc far
- mov ax, @data
- mov ds, ax
- lea dx, prompt ; print 'prompt' variable
- mov ah, 09h
- int 21h
- mov ah, 1 ; input number
- int 21h
- mov bl, al
- add bl, 10 ; add 10 to bl
- sub bl, 5 ; subtract 5 from bl
- lea dx, result ; print 'result' variable
- mov ah, 09h
- int 21h
- mov ah, 2 ; print the value in bl
- mov dl, bl
- int 21h
- mov ah, 4ch ; end program
- int 21h
- endp
- end main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement