VERS EQU 03 .Z80 COMMON /_CLKID/ DESCST: DEFW 0000 ; Add label here if a static year byte ; is used by your clock driver. The ; label should point to the year byte ; 123456789012345678901234 CLKNAM: DEFB 'Altair Z80 SIMH Clock ' ; Exactly 24 chars in name DEFB VERS/10+'0','.',VERS MOD 10 +'0',0 DESCR: DEFB 'This is the Altair Z80 SIMH clock',0 COMMON /_PARM_/ PARBAS: DEFW 0 ; # of parameters (Set to 00 if none) DEFW 0 ; Pointer to STRS (Set to 00 if none) CSEG ;----------------------------------------------------------- ; Z S D O S C L O C K H E A D E R ;----------------------------------------------------------- ; Enter: HL points to a 6-byte buffer to Get/Set time ; Exit : A=1 on Success, A=FFH if error ; HL points to last char in buffer ; E contains original seconds (HL+5) ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; R e a d T h e C l o c k ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - SIMHPORT EQU 0FEH READCLOCK EQU 7 WRITECLOCK EQU 8 PARBLOCKSIZE EQU 6 PRGBAS: JP GETTIM ; Jump to Read Clock JP WRCLK ; Jump to Set Clock GETTIM: LD A,READCLOCK OUT (SIMHPORT),A LD BC,256*(PARBLOCKSIZE-1)+SIMHPORT ; B := 5, C := 0FEH INIR ; bug fixed by Howard Goldstein (via Lee Bradley), 26-Jul-2007 LD E,(HL) ; Save original seconds in E INI ; READ SECONDS DEC HL LD A,1 ; Set OK status return RET WRCLK: LD A,WRITECLOCK OUT (SIMHPORT),A LD A,L OUT (SIMHPORT),A LD A,H OUT (SIMHPORT),A LD A,1 RET COMMON /_POST_/ RET ; This RETURN MUST be present even if no other ; code is included in this section COMMON /_PRE_/ ;--------------------------------------------------------------- ; Read clock and wait for seconds to roll - watchdog protected ; Enter with: DE pointing to relocated clock read routine ; HL pointing to base of high module TSTRD: JR TSTRD0 ; Jump around address store DEFW TSTRD ; Org location of the code TSTRD0: SCF LD A,1 RET END