Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- org 100h
- start:
- mov ah, $09
- mov dx, name_prog
- int 21h
- mov ah, $02
- mov dx, 0x0D0A
- int 21h
- mov ah, $09
- mov dx, str2
- int 21h
- mov ah, $02
- mov dx, 0x0D0A
- int 21h
- mov ah, $09 ;
- mov dx, result_is
- int 21h
- mov ax, [a] ;
- mov bx, [b] ;
- sub ax, bx
- mov bx, $9
- mul bx
- mov bx, ax
- mov ax, [d]
- mov cx, $3
- mul cx
- mov dx, ax
- sub dx, bx
- mov cx, [c]
- add cl, $10
- mov ax, dx
- div cl
- mov [res],ax
- mov ax, [res]
- add ax, '0'
- mov bx,ax
- mov ah, $02
- mov dx,bx
- int 21h
- mov ah,$08
- int 21h
- ret
- name_prog db "This program calculates (3 * d - (a - b) * 9 )/( c + 10)$"
- str2 db "where a=2, b=1, c=1, d=14$"
- result_is db "result is equal to $"
- a dw 2h
- b dw 1h
- c dw 1h
- d dw 14h
- res dw 0h
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement