[comp.binaries.apple2] Modem-based clock kludge

elliott@glacier.steinmetz (05/09/88)

Here is a set of simple little programs that I find quite useful since
I have yet to invest in a clock card, but have a perfectly decent
clock in my Courier 2400 modem. These programs let ProDOS query the
modem whenever it needs to find out what time it is.

Caveats: I'm working on a much more user-friendly version of this, as
I find the time. The current version requires you to have a 2400-baud
modem on a Super Serial Card (or //c serial port) in slot 2. The modem
of course must have a time-of-day mode (as opposed to call-timing)
activated by ATK1, and the clock must be set and queried by ATI3. And
the more Hayes-compatible the modem is, the better chance you have
that this will work.

Also: Since the modem-decoding program resides at $300, if you run a
program which uses that area, you'll have to turn off the clock first
or things will crash. For example, the clock cannot be active when
running Merlin Pro. (Though once you're inside Merlin Pro, you can
subsequently turn on the clock with no problem.) If anyone's
interested, I have a slightly different version of the patching
program that defines Merlin Pro's "USR" opcode to assemble the current
date and time into the object code.

After EXECing the file below, unbunny "JCLOCK" with BLU. You'll get
three BIN files:

JCLK is BRUN the first time after turning on the system. It
initializes the modem, then gives you a "?" prompt at which you should
type the current time in hh:mm:ss format, to be passed to the modem to
set its clock. Then JCLK installs the hooks for ProDOS to read the
clock in the modem.

JCLK2 is BRUN if you've rebooted or turned off the hooks by some other
means, but the modem's clock still is correct. It simply sets the
modem into the correct mode and installs the DATETIME hook in ProDOS
without asking you for the time.

JCLK.OFF disconnects the hooks so that you can safely run programs
that interfere with page 3, or use your modem.

Once I get the docs on how to do it I intend to make these into an
external command for DAVEX.

----------8<----------8<-------------------------->8---------->8----------
CALL-151
E00:38 A5 FF D0 32 D8 20 8E FD AD 30 BF 8D 6A 0E 20 00 BF C7 6D 0E 0D 80 02
E18:D0 1D 20 00 BF C5 69 0E B0 15 AD 81 02 29 0F AA E8 8E 80 02 A9 2F 8D 81
E30:02 20 00 BF C6 6D 0E A2 08 B0 0E 20 00 BF C3 70 0E B0 06 A2 26 20 53 0E
E48:AA 20 53 0E 4C D0 03 20 ED FD E8 BD 59 0E D0 F7 60 A0 F3 E1 F6 E5 E4 8D
E60:00 C5 F2 F2 EF F2 87 8D 00 02 00 81 02 01 80 02 07 7E 0E E3 06 00 00 00
E78:00 00 A8 B0 2E 12 06 CA C3 CC CF C3 CB 00
F00:D8 A0 00 84 FF 84 E0 A9 10 85 E1 20 67 FD E0 05 90 48 A2 00 20 5D 0F 85
F18:E2 A0 FF 66 E3 C8 20 5D 0F 06 E2 6A 06 E2 6A 91 E0 24 E3 30 04 45 FF 85
F30:FF C0 02 90 E8 24 E3 10 12 2A 85 E2 88 B1 E0 0A 0A 88 11 E0 91 E0 C8 C6
F48:E2 10 F9 98 65 E0 85 E0 90 C2 E6 E1 B0 BE 68 68 90 B1 4C 69 FF E8 BD 00
F60:02 0A C9 40 F0 F7 49 60 F0 07 49 60 E9 7E 90 E6 0A 60
F00G
#IIFKobE??_@@D?go@lQgOoPQBA?t???GiIBKaJmNgEE?0??Y_Y??0??K??B?0??B
#AA_FC_hJVLi?PhYL\j?hBL_eE_h@K_e_WhS_pe_hbY_eC_hLK_e_Vlg?G_lBOl?B
#PLE~Ol@BPLF~OlABPLG~Ph?LTQ~LUR~_Pa?|`T_\BBBgt_POxt_hDJLis?hYVLj?
#Ra?I|O|l\g?aDC|MDBLgt?lho?hO~oxIKOo__lB_`lB_A?_lAB_l?BhNTi|GEBXi
#AB_l?BhNIWxiEBXiNBG?FBO_G_lBG_lBPh?L\i?L\j?l`iBLTR~l`jBLUQ~_????
#Xa?MPRBl[h?hKGOJ~IOusMRB|OphH?_l]g?_??IS?]gqALrHgS@?dGlho?hO}oxg
#Hh~L]g?_0??CA?IFkKbE??_@@@?gOolQSgoT?QA?OJ@?ICIBgKJ?0??[_Y??0??P
#??@_P]_hDJLis?hYVLj?Ra?I|O|hAL_^E`h@G_^`WhS_`^`haY_^C`hLG_^`Vlg?
#G_lBrH?OCLh?VLi?VLj?UhFK|l|aE?|mK`oZG_^`W|m`rHLOCL_?SKRB^GO|sMRB
#~OwggKC_J_W{Th~DAr_it|M\C_a?O|?AG_^`|gk\F_OsOhL_`^`aD?M\N_IO||M\
#N_OwC_k_Ph?L\i?L]j?_C?a?[|M_O\BB|g_P]Ot_PlE~OL?BPlF~OL@BPlG~OLAB
#XhKLDE~hCBLFS~hBPLG~c_hJVLi?PhYL\j?aN?IOt|lgs?aCS|MBVLg?Vlh?BhOo
#{xIOqo_lAB_lCB_?G_lBG_lB@hNiS|GBWXiBG_lB?hNWgxiBWXiB{G?B[O___lB_
#`lBhD?Lit?Lju?liDBLRU~ljDBLQW~_?@??ad?MRDBlho?hGrOJI~OuMRRBOsph?
#d_lgw?_??IS]?gqLIrHSa@?GVlh?BhOowxghd~Lgw?_Li@SPApL@gSDoIL@S_Ro|
#AoL@gSJpIL@S_Hr|0??yIIFKobE??_@@D?go@lQgOoVQ?A?|?@?DiIBK_Jq?0??Z
#G?Y?0??QA?_YC_hJVLi?PhYL\j?h?L_ZE`h@?_Z`WhS_@Z`h_Y_ZC`hL?_Z`Vlg?
#G_lBPa?|Bi`o?Z_ZC`|iK`HLpOL_D?KRFBGO||MRNBOwwgKmA__gC_h?VLi?VLj?
#c_a?S|I_O\BB|g_P]Ot_PlE~OL?BPlF~OL@BPlG~OLABXhKLDE~hCBLFS~hBPLG~
#c_hJVLi?PhYL\j?aN?IOt|lgs?aCS|MBVLg?Vlh?BhOo{xIOqo_lAB_lCB_?G_lB
#G_lB@hNiS|GBWXiBG_lB?hNWgxiBWXiB{G?B[O___lB_`lBhD?Lit?Lju?liDBLR
#U~ljDBLQW~_?@??ad?MRDBlho?hGrOJI~OuMRRBOsph?d_lgw?_??IS]?gqLIrHS
#a@?GVlh?BhOowxghd~Lgw?_Li@SPApL@gSDoIL@S_Ro|?oL?0??_C?U?

BSAVE JCLOCK,A$1000,L$0600
E00G



 .     .    .    .   .  . ... .  .   .    .    .     .    .   .   .  . ... . .

 Jim Elliott                       /    ...!seismo!uunet!steinmetz!crd!elliott
                                  /
 "Don't look, son, it's          /      Jim_Elliott%mts@itsgw.rpi.edu [school]
  a secular humanist!"          /  (or)     elliott@ge-crd.arpa	      [work]
 .     .    .    .   .  . ... .  .   .    .    .     .    .   .   .  . ... . .