[comp.sys.apple] Reading real time seconds from GS clock

joseph@elbereth.rutgers.edu (Seymour Joseph) (01/19/89)

I need to be able to read the exact time from the GS clock.  I bought
the firmware reference, hardware reference and programmers
introduction, but none of these manuals tell me how to read
hours:minutes:seconds.     I found how to read Hours:Minutes from an
old prodos manual, but I need seconds too.

Which manual do I need (oh no! not more $$$$$). and If it is easy,
how do I do it?

Thanks.

Seymour

jearls@polyslo.CalPoly.EDU (Johnson Michael Earls) (01/21/89)

In article <Jan.18.19.25.57.1989.12595@elbereth.rutgers.edu> joseph@elbereth.rutgers.edu (Seymour Joseph) writes:
>
>I need to be able to read the exact time from the GS clock.  I bought
>the firmware reference, hardware reference and programmers
>introduction, but none of these manuals tell me how to read
>hours:minutes:seconds.     I found how to read Hours:Minutes from an
>old prodos manual, but I need seconds too.
>
>Which manual do I need (oh no! not more $$$$$). and If it is easy,
>how do I do it?
>
>Thanks.
>
>Seymour


In the Miscellanous Tool Set, there is a routine called ReadTimeHex ($0D03)
that will return the day-of-the-week, the month, date, year, hour, minute, an
second.  The format is:

          pushword #0                    ; space
          pushword #0                    ;   for
          pushword #0                    ; result
          pushword #0

          _ReadTimeHex

          SHORTACC

          pla
          sta second
          pla
          sta minute
          pla
          sta hour                       ; Hour (0-23)
          pla
          sta curYear                    ; Year - 1900
          pla
          sta day                        ; Date - 1
          pla
          sta month                      ; Month (0-11, 0-Jan)
          pla                            ; unused space
          pla
          sta weekDay                    ; day of week (1-7, 1=Sun)


Hope this helps...
  ___ ____________________________________________________________________ ___
 |   :                                                                    :   |
 | O :                            Johnson Earls                           : O |
 |   :                                                                    :   |
 | O :                            "Still A Bum"                           : O |
 |   :                                                                    :   |
 | O :                          InterNet address                          : O |
 |   :                         ------------------                         :   |
 | O :                     jearls@polyslo.CalPoly.EDU                     : O |
 |   :                                                                    :   |
 | O :                            UUCP address                            : O |
 |   :                           --------------                           :   |
 | O :                 {pyramid|sdsu|ucsd}!polyslo!jearls                 : O |
 |___:____________________________________________________________________:___|