Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; doubles the number, and outputs the result
- name double
- .model small
- .stack 100
- .data
- prompt db 0ah,0dh,"Enter a number < 5: $"
- resmes db 0ah,0dh,"Double your number is: "
- result db ?,0ah,0dh,"$"
- .code
- start:
- mov ax, @data
- mov ds, ax
- lea dx, prompt
- mov ah, 09h ;dos fn to output string up to $
- int 21h
- mov ah, 01h ;dos fn to input byte into al
- int 21h
- sub al, 30h ;convert from ascii to integer
- add al, al
- add al, 30h ;convert back to ascii
- mov result, al
- lea dx, resmes
- mov ah, 09h
- int 21h
- mov ax, 4c00h
- int 21h
- end start
Add Comment
Please, Sign In to add comment