Vous êtes sur la page 1sur 2

data segment

d1 db ?
d2 db ?
multi db ?
divi db ?
num1 db 13,10, "dame el primer valor numero 1 = $"
num2 db 13,10, "dame el primer valor numero 2 = $"
msg1 db 13,10, " Multiplicacion = $"
msg2 db 13,10, " Division = $"
ends
stack segment
dw 128 dup(0)
ends
code segment
start:
mov ax,@data
mov ds,ax
;ingresar numeros
mov
mov
int
mov
int
mov
sub

dx,offset num1
ah,09h
21h
ah,01h
21h
d1,al
d1,30h

mov
mov
int
mov
int
mov
sub

dx,offset num2
ah,09h
21h
ah,01h
21h
d2,al
d2,30h

;calculo de la multiplicacion
mov
mov
mul
aam
mov

ax,0h
al,d1
d2
; ajuste ascii *
bx,ax

;calculo de la division
mov
mov
div
aam
mov

ax,0h
al,d1
d2
; ajuste ascii *
bx,ax

;mostrar el resultado de la operacion


mov dx,offset msg1
mov ah,09h
int 21h
mov
add
mov
int

dl,bh
dl,30h
ah,02h
21h

;mostrar decenas

mov
add
mov
int

dl,bl
dl,30h
ah,02h
21h

;mostrar unidades

mov dx,offset msg2


mov ah,09h
int 21h
mov
add
mov
int

dl,bh
dl,30h
ah,02h
21h

;mostrar decenas

mov
add
mov
int

dl,bl
dl,30h
ah,02h
21h

;mostrar unidades

mov ax, 4c00h


int 21h
ends
end start

Vous aimerez peut-être aussi