Académique Documents
Professionnel Documents
Culture Documents
SEDE IBARRA
1. DATOS INFORMATIVOS
1.1 Nombre: Luis Viteri
1.2 Carrera: Sistemas
1.3 Nivel: 5to
1.4 Tema: Compiladores
1.5 Fecha: 27/04/15
2. DESCRIPCION
INSTALACION EMU8086
1) Descargar de la pgina Oficial el programa http://emu8086.waxoo.com y ejecutar el
instalador
2) Next
3) Next
5) Click en Install
7) Interfaz
EJERCICIOS
1) Hola Mundo:
Cdigo:
name "hi-world"
; this example prints out "hello world!"
; by writing directly to video memory.
; in vga memory: first byte is ascii character, byte that follows is character attribute.
; if you change the second byte, you can change the color of
; the character even after it is printed.
; character attribute is 8 bit value,
; high 4 bits set background color and low 4 bits set foreground color.
; hex
;
;0
;1
;2
;3
;4
;5
;6
;7
;8
;9
;a
;b
;c
;d
;e
bin
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
color
black
blue
green
cyan
red
magenta
brown
light gray
dark gray
light blue
light green
light cyan
light red
light magenta
yellow
;f
1111
white
org 100h
; set video mode
mov ax, 3 ; text mode 80x25, 16 colors, 8 pages (ah=0, al=3)
int 10h
; do it!
; cancel blinking and enable all 16 colors:
mov ax, 1003h
mov bx, 0
int 10h
Cdigo:
CODE SEGMENT
ASSUME CS:CODE, DS:CODE, SS:CODE, ES:CODE
ORG 100h
codigo:
Cdigo:
;URL
.model small
.stack
.data
var1 db ?
var2 db ?
msg1 db ' El primero es mayor $'
msg2 db ' El segundo es mayor$'
msg3 db ' Son iguales$'
msg4 db ' Primero numero $'
msg5 db ' Segundo numero $'
.code
.startup
mov ah,00h
mov al,03h
int 10h
mov ah,02h
mov dx,0510h
mov bh,0
int 10h
mov ah,09h
lea dx,msg4
int 21h
mov ah,07h
int 21h
mov ah, 02h
mov dl,al
int 21h
mov var1,al
mov ah,09h
lea dx,msg5
int 21h
mov ah,07h
int 21h
mov ah,02h
mov dl,al
int 21h
mov var2,al
cmp var1,al
ja mayor
jb menor
je igual
mayor:
mov ah,09h
lea dx,msg1
int 21h
jmp salir
menor:
mov ah,09h
lea dx,msg2
int 21h
jmp salir
igual:
mov ah,09h
lea dx,msg3
int 21h
jmp salir
salir:
.exit
end
vector.
Cdigo:
name "calc-sum"
; number of elements:
mov cx, 10
; bx is an index:
mov bx, 0
; sum elements:
next: add al, vector[bx]
; next byte:
inc bx
; store result in m:
mov m, al
ret
; variables:
vector db 5, 4, 5, 2, 1, 6, 8, 1, 2, 6
m db 0
print_al proc
cmp al, 0
jne print_al_r
push ax
mov al, '0'
mov ah, 0eh
int 10h
pop ax
ret
print_al_r:
pusha
mov ah, 0
cmp ax, 0
je pn_done
mov dl, 10
div dl
call print_al_r
mov al, ah
add al, 30h
mov ah, 0eh
int 10h
jmp pn_done
pn_done:
popa
ret
endp