Okay, I've made progress... 
Author Message
 Okay, I've made progress...

Okay all, I've made a bit of progress.  I can get the assembly program
to output "The date is: //".  And I think the date itself is in memory,
the problem is I can't figure out how to get it to the screen.  Could
you offer any help?  This is what I have so far:

INCLUDE PCMAC.INC  ;Macro file for _GetDate
EXTRN   PutDec: NEAR
        .MODEL          SMALL
        .STACK          100h
        .DATA
MESSAGE DB      'The current date is:', 13, 10, '$'
Save1   DB       ?
Save2   DB       ?
Save3   DW       ?
        .CODE
TODAY   PROC

        mov     ds, ax
        mov     dx, OFFSET message
        mov     ah, 9h
        int     21h

        _GetDate TODAY
        mov     Save1, dl
        mov     Save2, dh
        mov     Save3, cx
        mov     al, Save2
        mov     ah, 0
        call    PutDec
        _PutCh   '/'
        mov     al, Save1
        mov     ah, 0
        call    PutDec
        _PutCh   '/'
        mov     ax, Save3
        call    PutDec

        _Exit  0
TODAY   ENDP
        END     TODAY



Tue, 20 Mar 2001 03:00:00 GMT  
 Okay, I've made progress...

Quote:

> Okay all, I've made a bit of progress.  I can get the assembly program
> to output "The date is: //".  And I think the date itself is in memory,
> the problem is I can't figure out how to get it to the screen.  Could
> you offer any help?  This is what I have so far:

You can get the data using a DOS Fn. 2C, 2D or something like that. Or you
can get it directly from the clock chip (If you're running under plain DOS
or Windows, this works fine).

just read from the CMOS registers 0, 2 and 4, 6, 8 (sec, min, hour, day,
month, year in that order... check out Ralfs PORTS.LST for detail),

mov al,0
out 70h,al
in al,71h

This gives you seconds in AL



Tue, 20 Mar 2001 03:00:00 GMT  
 Okay, I've made progress...

Quote:

> > just read from the CMOS registers 0, 2 and 4, 6, 8 (sec, min, hour, day,
> > month, year in that order... check out Ralfs PORTS.LST for detail),

> > mov al,0
> > out 70h,al
> > in al,71h

> > This gives you seconds in AL

> May I suggest that you use the BIOS Int 1Ah instead. This avoids problems
> with the RTC's update cycle and the NMI line.

Of course, but it really doesn't matter. If the chip is updating the time, you
get the wrong bytes maybe... In any case they should be the same as the previous
ones... maybe a wrong second or something. Also the NMI stuff is overrated. If
you disable NMI by sending an index with bit 7 clear, it doesn't really matter.
I'm not even sure if newer chips cares about that bit or if it's there for
"compatibility".

Regards,
TK.



Tue, 20 Mar 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Okay, okay.

2. ANNC: Expect for Win32, progress has been made.

3. We've been /.'ed!

4. OT: (Humor/Humour) - Signs That You've Had Too Much Of The 90's:

5. i've been close to python's cradle :)

6. The Smalltalk Store: Why we've been slow, and why we're getting better

7. Okay, I'm stumped.

8. Okay I'm really dense but....

9. okay, all you Tcl'ing fools...

10. I think I've got 3 args, but python says I've got 4!

11. I've been waiting!

 

 
Powered by phpBB® Forum Software