You are on page 1of 14

UNIVERSIDAD NACIONAL ABIERTA Y A DISTANCIA

FACULTAD DE CIENCIAS BASICAS TECNOLOGÍA E INGENIERÍA

ARQUITECTURA DE COMPUTADORES

FASE 6: EVALUACION FINAL

TUTOR:
ANGELO GERLEY QUINTERO

PRESENTADO POR:
OSCAR JAVIER DELGADO Código: 80217860
CAMILO ANDRES DORADO Código:
JAIME ALEJANDRO TIRANO Código: 80243722
WILSON ESTEBAN PINTO Código: 80208473

301302_36

INGENIERIA DE SISTEMAS
CEAD JOSE ACEVEDO Y GOMEZ
BOGOTA D.C MAYO DE 2017
INTRODUCCION

El presente trabajo tiene como finalizar realizar la actividad individual de la Fase 6


del curso de acuerdo a los parámetros establecidos en la guía.

De acuerdo a lo anterior se elaborará el prototipo funcional en lenguaje


Ensamblador El cual contiene un menú con los datos del autor, la suma, resta,
multiplicación y división de dos números y su respectiva validación si es positivo
o negativo, se escogerá la mejor propuesta para presentar el informe
colaborativo final.
OBJETIVOS

Elabora un prototipo funcional en lenguaje Ensamblador, que incluya un


menú de opciones con datos del autor, suma de dos números, resta de dos
números, multiplicación de dos números, división de dos números, validación
de positivos y negativos y salir.

Adquirir las habilidades para el desarrollo de programas en el lenguaje


ensamblador.
DESARROLLO DE LA ACTIVIDAD

Prototipo funcional en lenguaje Ensamblador, con el siguiente menú de


opciones:

MENÚ
1. Datos del autor
2. Suma de dos números
3. Resta de dos números
4. Multiplicación de dos números
5. División de dos números
6. Validar si un número es positivo o negativo
7. Salir

CAPTURAS DE PANTALLA DE LA EJECUCION DEL PROGRAMA


CODIGO
.model small

name "---Menu----"
include 'emu8086.inc'

org 100h
.data
Suma db 2 dup (?)
Resta db 2 dup (?)
multi db 2 dup (?)
divis db 2 dup (?)
var1 db 0
var2 db 0
.code

jmp inicio
; define variables:

msg0 db " ",0Dh,0Ah


db "OSCAR JAVIER DELGADO VILLAMIL",0Dh,0Ah
db "ARQUITECTURA DE COMPUTADORES",0Dh,0Ah
db "UNIVERSIDAD NACIONAL ABIERTA Y A DISTANCIA UNAD",0Dh,0Ah
db "EVALUACION FINAL",0Dh,0Ah, 0Dh,0Ah,
msg1 db " Menu " ,0Dh,0Ah, 0Dh,0Ah,
db " 1. DATOS DE AUTOR ",0Dh,0Ah
db " 2. SUMA DE 2 NUMEROS ",0Dh,0Ah
db " 3. RESTA DE 2 NUMEROS ",0Dh,0Ah
db " 4. MULTIPLICACION DE 2 NUMEROS ",0Dh,0Ah
db " 5. DIVISION DE 2 NUMEROS ",0Dh,0Ah
db " 6. VALIDACION DE NUMERO POSITIVO O NEGATIVO",0Dh,0Ah
db " 7. SALIR",0Dh,0Ah ,'$'
db "SELECCIONE UNA OPCION",0Dh,0Ah,
db " ",0Dh,0Ah, '$'
msg3 db " Digite primer numero para sumar ==> $"
msg6 db " OSCAR JAVIER DELGADO VILLAMIL",0Dh,0Ah
db " Codigo 80217860",0Dh,0Ah
db " Grupo 301302_36",0Dh,0Ah,
db " CEAD JOSE ACEVEDO Y GOMEZ" ,0Dh,0Ah,
db " Fecha 22-05-2017",0Dh,0Ah ,
db " ",0Dh,0Ah, '$'
msg2 db " Numero positivo ",0Dh,0Ah,'$'
msg4 db " Numero negativo ",0Dh,0Ah,'$'
msg5 db " Numero igual a cero",0Dh,0Ah,'$'
mov dx, offset msg0
mov ah, 9
int 21h

inicio:

mov dx, offset msg1


mov ah, 9
int 21h

jmp leer_op

leer_op:
mov ah,8h
int 21h
cmp al,31h
je autor
cmp al,32h
je sumar
cmp al,33h
je restar
cmp al,34h
je multiplicar
cmp al,35h
je dividir
cmp al,36h
je autor
cmp al,37h
je autor
jne leer_op

autor:

mov dx, offset msg6


mov ah, 9
int 21h
jmp inicio

sumar proc
printn "Digitar el primer numero ==>"
call scan_num
mov suma[0],cl
printn ""
printn "Digitar el segundo numero ==>"
call scan_num
mov suma[1],cl

sub ax,ax
add al,suma[0]
add al,suma[1]

printn ""
printn "El resultado es: "
call print_num
call inicio
sumar endp

restar proc
printn "Digitar el primer numero ==>"
call scan_num
mov resta[0],cl
printn ""
printn "Digitar el segundo numero ==>"
call scan_num
mov resta[1],cl

xor ax,ax
add al,resta[0]
sub al,resta[1]
printn ""
printn "El resultado es: "
call print_num

call inicio
restar endp

multiplicar proc
printn "Digitar el primer numero ==>"
call scan_num
mov multi[0],cl
printn ""
printn "Digitar el segundo numero ==>"
call scan_num
mov multi[1],cl

xor ax,ax
add al,multi[0]
mul multi[1]
printn ""
printn "El resultado es: "
call print_num

call inicio
multiplicar endp
dividir proc
printn "Digitar el primer numero ==>"
call scan_num
mov divis[0],cl
printn ""
printn "Digitar el segundo numero ==>"
call scan_num
mov divis[1],cl

xor ax,ax
add al,divis[0]
div divis[1]
printn ""
printn "El resultado es: "
call print_num

call inicio
dividir endp

deter proc

mov ah, 09h


lea dx, msg3
int 21h

mov ah,01h
int 21h
sub al,30h
mov var1,al
int 21h
sub al,30h
mov ah,var1

mov bl,var1
cmp bl,var2

JC pos
JL nega
JE igu

pos:
mov ah,09h
lea dx,msg2
int 21h
jmp inicio

nega:
mov ah,09h
lea dx,msg4
int 21h
jmp inicio

igu:
mov ah,09h
lea dx,msg5
int 21h
jmp inicio
deter endp

proc far
mov ax, @data
mov ds,ax

mov ah, 00
mov dx, 03h
int 10h

mov ah,09h
lea dx, msg1
int 21h

mov ah,01h
int 21h
sub al,30h
mov var1,al
int 21h
sub al,30h
mov ah,var1
mov bl,var1
cmp bl,var2

;salto de etiquetas
JG positivo
JL negativo
JE igual

;etiquetas
positivo:
mov ah,09h
lea dx,msg2
int 21h
jmp exit

negativo:
mov ah,09h
lea dx,msg3
int 21h
jmp exit

igual:
mov ah,09h
lea dx,msg4
int 21h
jmp exit

exit:
mov ax, 4c00h
int 21h

define_print_string
define_print_num
define_print_num_uns
define_scan_num

salir:

int 21h

end
CONCLUSIONES

Al realizar el ejercicio propuesto se aplican conocimientos adquiridos como


son la funcionalidad que son sumamente indispensables en cada una de las
líneas de código en lo que concierne a la información visualizada a los
usuarios, tales como son la captura de datos, declaración y asignación de
variables, operaciones aritméticas.
BIBLIOGRAFIA

Universidad Carlos III de Madrid. (12 de 03 de 2016). OpenCourseWare.


Obtenido de
http://ocw.uc3m.es/ingenieria-informatica/arquitectura-de-
computadores-ii/otros-recursos-1/or-f-010.-clusters-y-
supercomputadores/view

Hurtado, A. V. (15 de 11 de 2016). http://www.abreojosensamblador.net.


Obtenido de
http://www.abreojosensamblador.net/Productos/AOE/html/Pags/Conteni
dos.html

Rocabado Moreno, S. H. (2016). Arquitectura y organización de la


computadora: microprocesadores y programación assembler (págs. 1-
95). Obtenido de:
http://bibliotecavirtual.unad.edu.co:2051/login.aspx?direct=true&db=ed
selb&AN=edselb.11200895&lang=es&site=eds-live

Hyde, R. (2010). The Art of Assembly Language. San Francisco: No Starch


Press (págs.1 - 150). Disponible en:
http://bibliotecavirtual.unad.edu.co:2048/login?url=http://search.ebsco
host.com/login.aspx?direct=true&db=e000xww&AN=440013&lang=es&s
ite=ehost-live

Soriano Payá, A. (2002). Estructuras de computadores: problemas


resueltos. [Alicante]: Digitalia (págs.13 - 50). Disponible en:
http://bibliotecavirtual.unad.edu.co:2051/login.aspx?direct=true&db=nl
ebk&AN=318079&lang=es&site=eds-live

You might also like