Instalacion Emu8086 y Ejercicios
Instalacion Emu8086 y Ejercicios
Instalacion Emu8086 y Ejercicios
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"
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
hex
0
1
2
3
4
5
6
7
8
9
a
b
c
d
e
f
bin
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
color
black
blue
green
cyan
red
magenta
brown
light gray
dark gray
light blue
light green
light cyan
light red
light magenta
yellow
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
; set segment register:
mov
ax, 0b800h
mov
ds, ax
; print "hello world"
; first byte is ascii code, second byte is color code.
mov [02h], 'H'
mov [04h], 'o'
mov [06h], 'l'
mov [08h], 'a'
mov [0ah], ' '
mov [0ch], 'M'
mov [0eh], 'u'
mov [10h], 'n'
mov [12h], 'd'
mov [14h], 'o'
mov [16h], '!'
mov [18h], '!'
; color all characters:
mov cx, 12 ; number of characters.
mov di, 03h ; start from byte after 'h'
c: mov [di], 10101000b ; light red(1100) on yellow(1110)
add di, 2 ; skip over next ascii code in vga memory.
loop c
; wait for any key press:
mov ah, 0
int 16h
ret
Cdigo:
CODE SEGMENT
ASSUME CS:CODE, DS:CODE, SS:CODE, ES:CODE
ORG 100h
codigo:
mov ah, 0Fh
mov ah, 0
int 10h
CODE ENDS
end codigo
2 nmeros del 0 al 9.
Cdigo:
;URL
.model small
.stack
.data
var1 db ?
var2 db ?
msg1 db '
msg2 db '
msg3 db '
msg4 db '
msg5 db '
.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
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
int 21h
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