home *** CD-ROM | disk | FTP | other *** search
-
- ASEG
- ;
- TITLE 'ARK Time stamp VERS:- 00.02 DATE:- 12/22/88 TIME:- 22:13:44'
- ;
- ; Routine that reads clock and loads the five bytes in ARK for time
- ; stamping. Uses the same concept that TIMESTAMP does by overlaying the
- ; first JP in .ARK with a new one to a clock read routine past the end
- ; of .ARK. After the clock routine reads the clock, loads the bytes at
- ; 103h-107h of ARK, restores .ARK back to it original state and .ARK can
- ; reuse the space taken by this routine. You have to customize your own
- ; clock-read section
- ;
- ; Use MLOAD to add clock read routine to ARK.COM:
- ;
- ; MLOAD ARK.COM=ARK.COM,ARKTS
- ;
- ; by Harold H. Jones TERC PBBS (615)-239-8696
- ;
- ;-----------------------------------------------------------------------
- ;
- ; Byte in .ARK to put time date into
- ;
- YEAR EQU 103H ; In binary
- MONTH EQU 104H
- DAY EQU 105H
- HOUR EQU 106H
- MIN EQU 107H
- ;
- ENDARK EQU 3780H ; Address passed end of ARK.COM
- ; ; Each new version may vary
- OLDJMP EQU 28FAH ; Address to restore
- ; ; (May very with version.) Use DDT
- ; ; to check address at 0101h.
- ; ; At 101h
- JMPADD EQU 0100H ; Address of JP to this routine
- ;
- ORG JMPADD + 1
- DW ENDARK ; New JP to clock read routine. Overlay
- ; ; old JP with new one to clock read
- ORG ENDARK ; End of .ARK and start of clock read
- ;
- ; Clock read routine (Z-Time)
- ;
- PORT EQU 0E0H ; Data at port is in BCD
- ; ; 9-19-88 8:23:15
- ; ; E2h=15h
- ; ; E3h=23h
- ; ; E4h=20h
- ; ; E5h=02h
- ; ; E6h=19h
- ; ; E7h=09h
- ; ; E8h=00h
- ; ; E9h=88h
- ;
- READ: IN A,(PORT+3) ; Get minutes in BCD
- CALL BCDBIN ; Convert to binary
- LD (MIN),A ; Put where .ARK expects
- IN A,(PORT+4) ; Get hour
- CALL BCDBIN
- LD (HOUR),A
- IN A,(PORT+6) ; Get day
- CALL BCDBIN
- LD (DAY),A
- IN A,(PORT+7) ; Get month
- CALL BCDBIN
- LD (MONTH),A
- IN A,(PORT+9) ; Get year
- CALL BCDBIN
- LD (YEAR),A
- ;
- ; End of clock read
- ;
- ; Restore original JP address
- ;
- LD HL,OLDJMP ; Restore OLDJMP
- LD (JMPADD+1),HL
- JP OLDJMP ; Start .ARK
- ;
- ; Borrowed from BYE510
- ;
- ; BCD to Binary converter
- ; -----------------------
- ; This routine will convert an 8 bit BCD number (0-99) to binary.
- ;
- ; To use:
- ;
- ; LDA BCDNUMBER
- ; CALL BCDBIN
- ;
- ; The routine returns with the binary number in the A register.
- ;
- BCDBIN: PUSH DE
- LD E,A ; Save original byte
- AND 15
- LD D,A ; Save low nibble
- LD A,E
- AND 240 ; Mask LSN
- RRCA ; X2
- LD E,A
- RRCA ; X4
- RRCA ; X8
- ADD E ; X10
- ADD D ; Low nibble
- POP DE
- RET
- ;
- END