miércoles, 7 de marzo de 2018
jueves, 1 de marzo de 2018
Ejemplo ciclos emu8086
org 100h
.model small
.stack 64
.data
mensaje db 10,13 ,"Dame un numero",10,13,"$"
mensaje2 db 10,13 ,"Dame un la potencia",10,13,"$"
n1 db 0
n2 db 0
n3 db 0
.code
inicio: ;función inicio
mov ax,@data ;Movemos el segmento data a ax
mov ds,ax ; Movemos lo que esta en ax a ds
mov dx,offset mensaje ;Imprimimos el primer mensaje parte 1
mov ah, 09h ;Imprimimos el primer mensaje parte 2
int 21h ;Imprimimos el primer mensaje parte 3
mov ah,01 ;pausa y espera a que el usuario presione una tecla
int 21h ;interrupción para capturar
sub al,30h ;lo que el usuario presiono se guarda en al y se le resta 30h para convertirlo a un numero
mov n1,al ;Movemos lo que esta en al a la variable n1
mov n3,al ;Movemos lo que esta en al a la variable n3
mov ah, 09h ;imprimimos el mensaje 2 parte 1
mov dx,offset mensaje2 ;imprimimos el mensaje 2 parte 2
int 21h ;imprimimos el mensaje 2 parte 3
mov ah,01 ;pausa y espera a que el usuario presione una tecla
int 21h ;interrupcion para capturar
sub al,30h ;lo que el usuario presiono se guarda en al y se le resta 30h para convertirlo a un numero
mov n2,al ;Guardamos lo que el usuario preciono el n2
mov cl,al ; movemos lo que esta en al a cl para decirle al ciclo cuantas vueltas va a dar
sub cl,1 ;le restamos 1 para que no de una vuelta de mas
call ciclo ;llamada a ciclo
ciclo: ;Funcion
call ciclo1 ;llamada el procediemto 1
ciclo1 proc near : ;procedimiento ciclo
mov al,n1 ;potencia parte 1
mov bh,n3 ;potencia parte 2
mul bh ;potencia parte 3
mov n1,al
loop ciclo1 ;loop a la funcion ciclo
mov ax,4c00h ;fin parte 1
int 21h; fin parte 2
fin: ;funcion fin
mov ax,4c00h ;funcion que termina el programa
int 21h
end inicio
jueves, 22 de febrero de 2018
Programa-Ensamblador en pantalla - Manipulación de pantalla
Programa documentado:
https://drive.google.com/open?id=1XUd_pYgMQAmwMZrECZGg3Nu6KhKDwBUK
-------------
https://drive.google.com/open?id=1XUd_pYgMQAmwMZrECZGg3Nu6KhKDwBUK
-------------
miércoles, 21 de febrero de 2018
Programas del dia 20/02/018. Manejo del colores
FIN_4c00H EQU 4c00h
DOS_21h EQU 21h
BIOS_10h EQU 10h
pila segment stack
Dw 100 DUP('0')
pila ends
codigo segment
CLS proc Far
assume CS:codigo,SS:pila
CAll limpia
mov ax,FIN_4c00H
int DOS_21h
CLS ENDP
limpia proc near
mov ax,0600h
mov bh,0Ah
mov cx,001h
mov dx,484fh
int BIOS_10h
ret
limpia endp
codigo ends
end CLS
---------------------------------------------------------------------------------------------
org 100h
mov ah ,06h
mov bh, 9fh
mov cx ,0000h
mov dx,484fh
int 10h
mov ah,02h
mov bh ,00h
mov dx ,0000h
int 10h
int 21h
mov ax,4c00h
int 21h
ret
--------------------------------------------------------------------------------------------------
org 100h
.data
msg DB "color","$"
.code
mov ah ,06h
mov bh, 9fh
mov cx ,0000h
mov dx,484fh
int 10h
mov ah,02h
mov bh ,00h
mov dx ,0000h
int 10h
mov ax,@data
mov dx,ax
lea dx,msg
mov ah,9h
int 21h
mov ax,4c00h
int 21h
DOS_21h EQU 21h
BIOS_10h EQU 10h
pila segment stack
Dw 100 DUP('0')
pila ends
codigo segment
CLS proc Far
assume CS:codigo,SS:pila
CAll limpia
mov ax,FIN_4c00H
int DOS_21h
CLS ENDP
limpia proc near
mov ax,0600h
mov bh,0Ah
mov cx,001h
mov dx,484fh
int BIOS_10h
ret
limpia endp
codigo ends
end CLS
---------------------------------------------------------------------------------------------
org 100h
mov ah ,06h
mov bh, 9fh
mov cx ,0000h
mov dx,484fh
int 10h
mov ah,02h
mov bh ,00h
mov dx ,0000h
int 10h
int 21h
mov ax,4c00h
int 21h
ret
--------------------------------------------------------------------------------------------------
org 100h
.data
msg DB "color","$"
.code
mov ah ,06h
mov bh, 9fh
mov cx ,0000h
mov dx,484fh
int 10h
mov ah,02h
mov bh ,00h
mov dx ,0000h
int 10h
mov ax,@data
mov dx,ax
lea dx,msg
mov ah,9h
int 21h
mov ax,4c00h
int 21h
martes, 20 de febrero de 2018
Programas del dia 19/02/018
include 'emu8086.inc'
name "Muestra"
org 100h
call suma
call inicio
call resta
call final
inicio:
mov ax,20h
mov bx,13h
ret
suma:
add ax,1AAh
add bx,11ch
add ax,bx
ret
resta:
sub ax,3h
sub bx,2h
ret
final:
mov ax,4c00h
int 21h
ret
end
-------------------------------------------------------------------------
org 100h
CR EQU 13
lf EQU 10
imprimir EQU 9
fin EQU 4c00h
dos EQU 21h
.data
txt DB 'ejemplos',CR,lf,'$'
.stack 100h
.code
inicio:mov ax,@data
mov ds,ax
mov dx,offset txt
mov ah,imprimir
int dos
mov ax,fin
int dos
end inicio
ret
---------------------------------------------------------------------------------------
org 100h
CR EQU 13
lf EQU 10
imprimir EQU 9
fin EQU 4c00h
dos EQU 21h
.data
txt DB 'ejemplos',CR,lf,'$'
.stack 100h
.code
inicio proc
mov ax,@data
mov ds,ax
mov dx,offset txt
mov ah,imprimir
int dos
mov ax,fin
int dos
end inicio
ret
------------------------------------------------------------------------------------------------
include 'emu8086.inc'
name "Muestra"
org 100h
call suma
call inicio
call resta
call final
inicio proc
mov ax,20h
mov bx,13h
ret
suma proc
add ax,1AAh
add bx,11ch
add ax,bx
ret
resta proc
sub ax,3h
sub bx,2h
ret
final proc
mov ax,4c00h
int 21h
ret
end
-----------------------------------------------------------------------------------------------------------------------
name "Muestra"
org 100h
call suma
call inicio
call resta
call final
inicio:
mov ax,20h
mov bx,13h
ret
suma:
add ax,1AAh
add bx,11ch
add ax,bx
ret
resta:
sub ax,3h
sub bx,2h
ret
final:
mov ax,4c00h
int 21h
ret
end
-------------------------------------------------------------------------
org 100h
CR EQU 13
lf EQU 10
imprimir EQU 9
fin EQU 4c00h
dos EQU 21h
.data
txt DB 'ejemplos',CR,lf,'$'
.stack 100h
.code
inicio:mov ax,@data
mov ds,ax
mov dx,offset txt
mov ah,imprimir
int dos
mov ax,fin
int dos
end inicio
ret
---------------------------------------------------------------------------------------
org 100h
CR EQU 13
lf EQU 10
imprimir EQU 9
fin EQU 4c00h
dos EQU 21h
.data
txt DB 'ejemplos',CR,lf,'$'
.stack 100h
.code
inicio proc
mov ax,@data
mov ds,ax
mov dx,offset txt
mov ah,imprimir
int dos
mov ax,fin
int dos
end inicio
ret
------------------------------------------------------------------------------------------------
include 'emu8086.inc'
name "Muestra"
org 100h
call suma
call inicio
call resta
call final
inicio proc
mov ax,20h
mov bx,13h
ret
suma proc
add ax,1AAh
add bx,11ch
add ax,bx
ret
resta proc
sub ax,3h
sub bx,2h
ret
final proc
mov ax,4c00h
int 21h
ret
end
-----------------------------------------------------------------------------------------------------------------------
Suscribirse a:
Entradas (Atom)







