Escolar Documentos
Profissional Documentos
Cultura Documentos
Presentado a:
Grupo: 301302_9
Noviembre de 2017
INTRODUCCIN
El siguiente trabajo, contiene un informe de las instrucciones de salto, que son trabajadas en
lenguaje ensamblador, tambin tiene un ejercicio que es desarrollado en lenguaje ensamblador,
donde se trabajan caractersticas como ciclos, saltos condicionales e incondicionales y manejo de
registros.
OBJETIVOS
.data
a db ?
msg1 db 'M E N U - P R I N C I P A L $'
msg2 db 10, 13,'1 - Datos del autor $'
msg3 db 10, 13,'2 - Sumar dos numeros $'
msg4 db 10, 13,'3 - Restar dos numero $'
msg5 db 10, 13,'4 - Multiplicar dos numero $'
msg6 db 10, 13,'5 - Dividir dos numero $'
msg7 db 10, 13,'6 - Validar si un numero es positivo, negativo o cero $'
msg8 db 10, 13,'7 - Salir $'
msg9 db 10, 13,'Seleccione una opcion [1..7]: $'
msg10 db 10, 13,'CESAR ALFONSO PALLARES TRESPALACIOS $'
msg11 db 10, 13,'UNAD - CEAD PAMPLONA $'
msg12 db 10, 13,'2 DE DICIEMBRE 2017 $'
msg13 db 10, 13,'Leer primer numero: $'
msg14 db 10, 13,'Leer segundo numero: $'
msg15 db 10, 13,'El resultado de la suma es: $'
msg16 db 10, 13,'El resultado de la resta es: $'
msg17 db 10, 13,'El resultado de la multiplicacion es: $'
msg18 db 10, 13,'El resultado de la division es: $'
msg19 db 10, 13,'COMPARAREMOS UN NUMERO$'
msg20 db 10, 13,'El numero es positivo $'
msg21 db 10, 13,'El numero es negativo $'
msg22 db 10, 13,'El numero es igual a cero $'
msg23 db 10, 13,'Presione una tecla para volver al menu'
.code
.startup
inicio:
mov ax,@data
mov ds,ax
;limpiar pantalla
mov ah,00
mov al,03h
int 10h
;compara opcion
cmp opcion, 1
jz autor
cmp opcion, 2
jz suma
cmp opcion, 3
jz resta
cmp opcion, 4
jz multiplicar
cmp opcion, 5
jz dividir
cmp opcion, 6
jz validar
cmp opcion, 7
jz finsi
leernumero:
mov ah,9
lea dx,msg13
int 21h
;lee numero 1
mov ah,01h
int 21h
sub al,30h
mov valor1, al
mov ah,9
lea dx,msg14
int 21h
;lee numero 2
mov ah,01h
int 21h
sub al,30h
mov valor2, al
ret
imprimir:
mov al, r
AAM
mov bx,ax
mov ah,02h
mov dl,bh
add dl,30h
int 21h
mov ah,02h
mov dl,bl
add dl,30h
int 21h
ret
autor:
mov ah,9
lea dx,msg10
int 21h
mov ah,9
lea dx,msg11
int 21h
mov ah,9
lea dx,msg12
int 21h
call fin:
ret
suma:
call leernumero
mov ah,9
lea dx,msg15
int 21h
call imprimir
call fin
ret
resta:
call leernumero
mov ah,9
lea dx,msg16
int 21h
call imprimir
call fin
ret
multiplicar:
call leernumero
call imprimir
call fin
ret
dividir:
call leernumero
xor ax, ax
mov al, valor1
mov bl, valor2
div bl
mov r, al
mov ah,9
lea dx,msg18
int 21h
call imprimir
call fin
ret
validar:
mov ah,9
lea dx,msg13
int 21h
;lee numero 1
mov ah,01h
int 21h
sub al,30h
mov valor1, al
cmp valor1,0
jg positivo
je cero
jl negativo
call fin
ret
positivo:
mov ah,9
lea dx,msg20
int 21h
call fin
ret
cero:
mov ah,9
lea dx,msg22
int 21h
call fin
ret
negativo:
mov ah,9
lea dx,msg21
int 21h
call fin
ret
fin:
mov ah,9
lea dx,msg23
int 21h
mov ah,01h
int 21h
sub al,30h
call inicio
finsi:
.exit
end
PROTOTIPO
CONCLUSIONES
Se trabajaron sentencias e instrucciones del sistema operativo para poder leer y escribir
caracteres en pantalla
Se comprendi el manejo de saltos condicionales y bucles
El manejo de los registros, se trabaj en formato de 16 y 8bit, comprendiendo ese concepto
para poder realizar operaciones.
BIBLIOGRAFA