Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Assembly Language > Re: Make a TSR
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 9 Topic 5006 of 5113
Post > Topic >>

Re: Make a TSR

by Frank Kotler <fbkotler@[EMAIL PROTECTED] > May 17, 2008 at 07:47 PM

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
 




 9 Posts in Topic:
Make a TSR
"almas" <alm  2008-05-11 19:32:23 
Re: Make a TSR
"Rod Pemberton"  2008-05-11 13:24:02 
Re: Make a TSR
"Benjamin David Lunt  2008-05-11 12:18:11 
Re: Make a TSR
"Rod Pemberton"  2008-05-14 15:39:18 
Re: Make a TSR
"Benjamin David Lunt  2008-05-15 08:23:48 
Re: Make a TSR
Viel Spass <andy77017@  2008-05-17 06:07:01 
Re: Make a TSR
Frank Kotler <fbkotler  2008-05-17 19:47:38 
Re: Make a TSR
"Rod Pemberton"  2008-05-17 17:29:46 
Re: Make a TSR
Evenbit <nbaker2328@[E  2008-05-17 13:11:22 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Sep 6 22:23:03 CDT 2008.