-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSuma2Num.asm
More file actions
82 lines (52 loc) · 1.31 KB
/
Suma2Num.asm
File metadata and controls
82 lines (52 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
;Hacer un prgrama que te sume 2 numeros y te lo imprima
.model Small
.stack 64
.data
num1 db 00
num2 db 00
resSuma db 00
mensaje db 10,13,'Escribe un numero ', '$'
mensaje2 db 10,13,'Escriba otro numero ', '$'
mensaje3 db 10,13,'la suma es: ', '$'
mensaje4 db 10,13,'la multiplicacion es: $'
unidades db ?
decenas db ?
caracter db ?
.code
main proc NEAR
MOV AX, @data
MOV DS, AX
;----------------------
;INTRODUCIR
;----------------------
mov AH, 09H ;imprime msg
lea DX, mensaje
int 21H
mov AH, 01H ;entrada teclado
int 21H
sub AL, 48
mov num1, AL
mov AH,09H ;imprime msg2
lea DX, mensaje2
int 21H
mov AH, 01H ;entrada teclado
int 21H
sub AL, 48
mov num2, AL
mov AL, num1
add AL, num2
add AL, 30H
mov resSuma, AL
mov AH, 09H
lea DX, mensaje3
int 21H
mov AH, 02H
mov DL, resSuma
int 21H
;--------------
;salir del DOS
;--------------
mov AX, 4C00h
int 21h
main endp
end main