-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathholamundo.asm
58 lines (39 loc) · 1.01 KB
/
holamundo.asm
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
; HERBERTH GUILLERMO OBREGÓNN ESPINO - 201314237
ORG 100h
mov dx, menu ; coloar direccion de cadena en
mov ah,9 ; funcion 9, imprimir en pantalla
int 21h ; interrupcion DOS
mov ah,4ch ; funcion 4c finalizar ejecucion
int 21h ; interrupcion DOS
menu db "hola mundo!",13,10,'$'
; call <PROC>
IF:
mov ax, 01h ; asignar 1 al registro AX
cmp ax, 02h ; comparar el registro AX con 02h
je Es_1 ; si es igual saltar (jump equal)
jne No_es_2 ; si no es igual saltar (jump non equal)
Es_2:
jmp Siguiente
No_es_2:
jmp Siguiente
Siguiente:
ret
ret
SWITCH:
mov ax, 01h ; asignar 1 al registro AX
cmp ax, 01h ; comparar el registro AX con 02h
je Op1 ; Saltar a Op1
cmp ax, 02h ; comparar el registro AX con 02h
je Op2 ; Saltar a Op1
Op1:
jmp Fin
Op2:
jmp Fin
Fin:
ret
ret
FOR:
mov cx, 10h ; Se inicia el contador CX en 10
Cfor:
ret
loop Cfor ; dECREMENTA cx y salta a la etq hasta llegar a 0