Viel Spass wrote:
....
> ;Begin WRITE TIME
> mov ah,2 ; Get time from CMOS directly, (not
> from
> DOS)
> int 1Ah ; Use the interrrupt 1Ah to get real
> time
> cmp ch,25 ; from RTC (CMOS)
....
Hi Andy,
That's the most convoluted "display BCD" code I've ever seen! I like
this one:
; From: qscgz at aol dot com (QSCGZ)
; display the time , 24 bytes
; nasm -f bin -o tinyclok.com tinyclok.asm
org 0100h
segment .text
mov ah,2
int 1ah ; time in BCD , dl=0
push cx
push dx
pop eax
m1:
mov al,163
sub dl,160 ; gives c,c,nc,c,c,nc,c,nc+z
ja $+3 ; h h : m m : s s
rol eax,4
int 29h
jne m1
ret
;------------------
That doesn't solve the "Make a TSR" question. Oh, and a86 won't assemble
it. Lemmee see...
mov ah,2
int 1ah ; time in BCD , dl=0
push cx
push dx
db 66h
pop ax
m1:
mov al,163
sub dl,160 ; gives c,c,nc,c,c,nc,c,nc+z
ja $+3 ; h h : m m : s s
db 66h
rol ax,4
int 29h
jne m1
ret
;------------------
I think a86'll assemble that (untested). I don't imagine int 29h is a
good idea in a TSR. If es:di were set to B800:<(row * 80 + column) * 2>
in advance...
stosb
mov byte [es:di], 7 ; or other color
lea di, [di + 1] ; so as not to mess with flags
jne m1
should replace the int 29h (untested). Save regs around it, and it ought
to pretty much be your ISR... Dunno if it'll work under XP, though...
No need to get *that* obsessive - any "print hex" routine should display
BCD correctly. Painfully converting BCD to binary, and then back to
decimal... looks like something a compiler would generate! :)
(Project: a countdown timer showing days/hours/minutes/seconds until 12
noon EST, 1/20/09)
Best,
Frank


|