Guest User

Untitled

a guest
May 27th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. include 'emu8086.inc'
  2.  
  3. data segment
  4. var dw 0
  5. b dw 0
  6. a dw 0
  7. vettore db 0
  8. ends
  9.  
  10. stack segment
  11. dw 128 dup(0)
  12. ends
  13.  
  14. code segment
  15. start:
  16.  
  17. mov ax, data
  18. mov ds, ax
  19. mov es, ax
  20.  
  21. call accapo
  22.  
  23.  
  24.  
  25.  
  26.  
  27. Inserire:
  28. call pthis
  29. db 13,10,'Inserire a: ',0
  30.  
  31. call scan_num
  32. mov a,cx
  33.  
  34. call pthis
  35. db 13,10,'Inserire b:',0
  36.  
  37. call scan_num
  38. mov b,cx
  39.  
  40. call pthis
  41. db 13,10,'Calcoliamo il Mcd e il mcm',0
  42. xor ax,ax
  43. xor dx,dx
  44. xor bx,bx
  45. mov ax,a
  46. mov bx,b
  47. jl scambia
  48.  
  49.  
  50. mcd:
  51.  
  52. div bx
  53.  
  54. cmp dx,0
  55. je stmpmcd
  56. mov ax,bx
  57. mov bx,dx
  58. mov dx,0
  59. jmp mcd
  60.  
  61. scambia:mov ax,b
  62. mov bx,a
  63. jmp mcd
  64.  
  65.  
  66.  
  67. mcm:mov cx,var
  68.  
  69. mov ax,a
  70. mov bx,b
  71.  
  72. mul bx
  73. div cx
  74.  
  75. call pthis
  76. db 13,10,"Il mcm e': ",0
  77.  
  78.  
  79. call print_num
  80. jmp fine
  81.  
  82. stmpmcd:
  83. call accapo
  84. call pthis
  85. db 13,10,"Il mcd e': ",0
  86.  
  87. mov var,bx
  88. mov ax,bx
  89.  
  90. call print_num
  91. jmp mcm
  92.  
  93. accapo proc
  94. mov ah,2
  95. mov dl,13
  96. int 21h
  97. mov ah,2
  98. mov dl,10
  99. int 21h
  100. ret
  101. accapo endp
  102. fine:
  103. ends
  104. DEFINE_PTHIS
  105. DEFINE_SCAN_NUM
  106. DEFINE_PRINT_NUM
  107. DEFINE_PRINT_NUM_UNS
  108. end start ;
Add Comment
Please, Sign In to add comment