Salto Incondicional:
Programa 1:
Ejecución del programa:
Código:
mov ax, 5 ; set ax to 5.
mov bx, 2 ; set bx to 2.
jmp calc ; go to 'calc'.
back: jmp stop ; go to 'stop'.
calc:
add ax, bx ; add bx to ax.
jmp back ; go 'back'.
stop:
ret ; return to operating system.
Programa 2:
Ejecución del programa:
Código:
include "emu8086.inc"
org 100h
mov al, 25 ; set al to 25.
mov bl, 10 ; set bl to 10.
cmp al, bl ; compare al - bl.
je equal ; jump if al = bl (zf = 1).
printn 'no es igual' ; if it gets here, then al <> bl,
jmp stop ; so print 'n', and jump to stop.
equal: ; if gets here,
printn 'es igual' ; then al = bl, so print 'y'.
stop:
ret ; gets here no matter what.
No hay comentarios.:
Publicar un comentario