martes, 2 de abril de 2019

PRÁCTICA 2 - VÍDEO SALTOS CONDICIONALES CMP, JC, JZ, JNZ

CÓDIGO EMU8086:

INCLUDE 'emu8086.inc'
.MODEL SMALL
.STACK
.DATA
    num1 db 8
    num2 db 8
    msg1 db 'Numeros iguales','$'
    msg2 db 'Numeros 1 mayor','$'
    msg3 db 'Numeros 2 mayores','$'

.code
    main:
    mov ax, @data
    mov ds, ax 
      
    mov al, num1
    cmp al, num2
    
    jc mayor2
    jz igual
    jnz Mayor1
    
    
.exit

igual: 
    printn 'Son iguales'
    jmp fin

Mayor1:
    printn 'Es mayor el numero 2'  
    jmp fin
  
Mayor2:
   printn 'Es mayor el numero 1'
   mov ah, 09h
   lea dx, msg2
   int 21h
    
   jmp fin

fin:

END

No hay comentarios.:

Publicar un comentario