SoloCodigo
Programación General => ASM (Ensamblador) => Mensaje iniciado por: vagop3 en Miércoles 2 de Diciembre de 2009, 18:53
-
tengo un error en este programa y la verda le di mil vueltas y no c q pasa noc si alguien me puede ayudar xfa
es un programa q lo saque d aca mismo pero no lo logro hacer correr y la verdad noc si tiene acceso x teclado, osea q presionando x ejemplo ctrl+e se ejecute
pantalla equ 0b800h
.model tiny
.code
org 100h
GET_INT macro n,s,o
ifnb <n>
mov al,n
endif
mov ah,35h
int 21h
ifnb <s>
mov s,ES
endif
ifnb <o>
mov o,BX
endif
endm
SET_INT macro n,s,o
ifnb <n>
mov al,n
endif
ifnb <s>
mov DS,s
endif
ifnb <o>
mov DX,offset o
endif
mov ah,25h
int 21h
endm
TSR_COM macro etq,c
mov dx,( etq-1)/16+1
ifnb <c>
mov al,c
endif
mov ah,31h
int 21h
endm
inicio:
jmp instalar
se_g dw 0
des dw 0
hora db 8 dup('?')
reloj proc
cli
push ax
push bx
push cx
push dx
push si
push di
push ds
push es
;;*****************
mov ax,40h
mov es,ax
mov si,6ch
mov ax,es:[si]
mov dx,es:[si+2]
mov bx,32761
div bx
shr ax,1
;;*******
jnc p0
add dx,bx
p0: mov ch,al
mov ax,dx
mov dx,0
mov bx,1092
div bx
mov cl,al
mov ax,dx
mov dx,0
mov bx,18
div bx
mov dh,al
;;******
mov bh,10
mov ah,0
mov al,ch
div bh
add ax,3030h
mov word ptr hora,ax
mov hora+2,':'
mov ah,0
mov al,cl
div bh
add ax,3030h
mov word ptr hora+3,ax
mov hora+5,':'
mov ah,0
mov al,dh
div bh
add ax,3030h
mov word ptr hora+6,ax
mov hora+8,':'
mov ah,0
mov al,dl
div bh
add ax,3030h
mov word ptr hora+9,ax
;;*********************************
mov ax,pantalla
mov es,ax
mov di,2*(80-length hora)
mov cx,length hora
mov si,0
mover:
mov al,hora[si]
mov es:[di],al
inc di
mov byte ptr es:[di],07h
inc si
inc di
loop mover
fin:
pop es
pop ds
pop di
pop si
pop dx
pop cx
pop bx
pop ax
sti
iret
reloj endp
instalar:
GET_INT 1ch,se_g,des
SET_INT 1ch,,reloj
TSR_COM<offset instalar-offset inicio+100h>
;;fin: int 20h
end inicio
xfavor una mano en este programa :hola:
-
Que yo sepa ninguna, simplemente muestra la hora automaticamente, usa un MS-DOS real para probarlo.
http://www.solocodigo.net/foros/viewtop ... 15&t=12464 (http://www.solocodigo.net/foros/viewtopic.php?f=15&t=12464" onclick="window.open(this.href);return false;)
viewtopic.php?f=15&t=14741 (http://foros.solocodigo.com/viewtopic.php?f=15&t=14741" onclick="window.open(this.href);return false;)