SALTO CONDICIONAL
1. CONTENIDO:


Hay más de 30 instrucciones de salto,
vamos a nombrar las más usadas:
INSTRUCCIÓN
|
DESCRIPCIÓN
|
jmp etiqueta
|
Salto incondicional directo
|
je etiqueta
|
Salto por igual
|
jne etiqueta
|
Salto por no igual
|
jg etiqueta
|
Salto por mayor
|
jng etiqueta
|
Salto por no mayor
|
jge etiqueta
|
Salto por mayor igual
|
jnge etiqueta
|
Salto por no mayor igual
|
jl etiqueta
|
Salto por menor
|
jnl etiqueta
|
Salto por no menor
|
jle etiqueta
|
Salto por menor igual
|
jnle etiqueta
|
Salto por no menor igual
|
js etiqueta
|
Salto negativo
|

Ø Permite
determinar si un numero ingresado por teclado es Cero, Positivo o Negativo:
;
INICIO:
.model small
.stack 64
.data
;
DECLARACIÓN DE VARIABLES:
num db 0
;
DEFINIR MENSAJES:
msg1 db 10,13, “Ingrese un numero ::”, ‘S’
msg2 db 10,13, “<<El numero es
cero>>”, ‘S’
msg3 db 10,13, “<<El numero es
positivo>>”, ‘S’
msg4 db 10,13, “<<El numero es negativo>>”,
‘S’
;
INICIALIZAR EL PROGRAMA:
.code
begin prod far
mov ax,@data
mov ds,ax
;
INGRESO DE DATOS:
mov ah,09
lea dx,msg1
int 21h
mov ah,01
int 21h
sub al.30h
mov num,al
;
CALCULOS:
cmp al,0
je CERO
jp POSITIVO
jl NEGATIVO
;
CONDICIONES:
CERO:
mov ah,09
lea dx,msg2
int 21h
jmp SALIR
POSITIVO:
mov ah,09
lea dx,msg3
int 21h
jmp SALIR
NEGATIVO:
mov ah,09
lea dx,msg4
int 21h
jmp SALIR
;SALIR:
mov ah,07
int 21h
mov ax,4ch
int 21h
begin endp
end
2. RESUMEN:
Una instrucción de salto produce un cambio en
la ejecución del programa pasando a una nueva posición, no secuencial. La
dirección del salto se representa con una etiqueta.
3. SUMMARY:
A jump
instruction produces a change in program execution moving to a new position,
not sequential. The jump direction is represented by a label.
4. RECOMENDACIONES:



5. CONCLUSIONES:


JE o JZ.

6. APRECIACIÓN
DEL EQUIPO:

DIAPOSTIVA:
7. LINKOGRAFÍA:
Buena PRESENTACION. Se recomienda ILUSTRAR el TEMA y agregar mas ejemplos. Gracias por su investigación y aporte. Saludos
ResponderEliminar