Advertisement
MadCortez

Untitled

Mar 1st, 2021
1,206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.                 org 100h
  2. start:
  3.                 mov ah, $09
  4.                 mov dx, name_prog
  5.                 int 21h
  6.  
  7.                 mov ah, $02
  8.                 mov dx, 0x0D0A
  9.                 int 21h
  10.  
  11.                 mov ah, $09
  12.                 mov dx, str2
  13.                 int 21h
  14.  
  15.                 mov ah, $02
  16.                 mov dx,  0x0D0A
  17.                 int 21h
  18.  
  19.                 mov ah, $09 ;
  20.                 mov dx, result_is
  21.                 int 21h
  22.  
  23.                 mov ax, [a] ;
  24.                 mov bx, [b] ;
  25.                 sub ax, bx
  26.                 mov bx, $9
  27.                 mul bx
  28.                 mov bx, ax
  29.                 mov ax, [d]
  30.                 mov cx, $3
  31.  
  32.                 mul cx
  33.                 mov dx, ax
  34.                 sub dx, bx
  35.                 mov cx, [c]
  36.                 add cl, $10
  37.                 mov ax, dx
  38.                 div cl
  39.  
  40.                 mov [res],ax
  41.  
  42.                 mov ax, [res]
  43.                 add ax, '0'
  44.  
  45.                 mov bx,ax
  46.  
  47.                 mov ah, $02
  48.                 mov dx,bx
  49.                 int 21h
  50.  
  51.                 mov ah,$08
  52.                 int 21h
  53.  
  54.                 ret
  55.  
  56. name_prog       db "This program calculates (3 * d - (a - b) * 9 )/( c + 10)$"
  57. str2            db "where a=2, b=1, c=1, d=14$"
  58. result_is       db "result is equal to $"
  59. a               dw 2h
  60. b               dw 1h
  61. c               dw 1h
  62. d               dw 14h
  63. res             dw 0h
  64.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement