Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include 'emu8086.inc'
- data segment
- var dw 0
- b dw 0
- a dw 0
- vettore db 0
- ends
- stack segment
- dw 128 dup(0)
- ends
- code segment
- start:
- mov ax, data
- mov ds, ax
- mov es, ax
- call accapo
- Inserire:
- call pthis
- db 13,10,'Inserire a: ',0
- call scan_num
- mov a,cx
- call pthis
- db 13,10,'Inserire b:',0
- call scan_num
- mov b,cx
- call pthis
- db 13,10,'Calcoliamo il Mcd e il mcm',0
- xor ax,ax
- xor dx,dx
- xor bx,bx
- mov ax,a
- mov bx,b
- jl scambia
- mcd:
- div bx
- cmp dx,0
- je stmpmcd
- mov ax,bx
- mov bx,dx
- mov dx,0
- jmp mcd
- scambia:mov ax,b
- mov bx,a
- jmp mcd
- mcm:mov cx,var
- mov ax,a
- mov bx,b
- mul bx
- div cx
- call pthis
- db 13,10,"Il mcm e': ",0
- call print_num
- jmp fine
- stmpmcd:
- call accapo
- call pthis
- db 13,10,"Il mcd e': ",0
- mov var,bx
- mov ax,bx
- call print_num
- jmp mcm
- accapo proc
- mov ah,2
- mov dl,13
- int 21h
- mov ah,2
- mov dl,10
- int 21h
- ret
- accapo endp
- fine:
- ends
- DEFINE_PTHIS
- DEFINE_SCAN_NUM
- DEFINE_PRINT_NUM
- DEFINE_PRINT_NUM_UNS
- end start ;
Add Comment
Please, Sign In to add comment