home *** CD-ROM | disk | FTP | other *** search
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; PATCHARK.AZM Copyright 1988 by Dale H. Cook ;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; ;
- ; * * ;
- ; ^ ** ** ;
- ; ^^^ * * * * *** * * ;
- ; ^^^^^ * * * * * * ;
- ; ^^^^^^^ * * * * * ;
- ; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ * * * * * ;
- ; ^^^^^^^^^^^^^^^^^^^^^^^^^^^ * * *** *** *** ;
- ; ^^^^^^^^^^^^^^^^^^^^^ ;
- ; ^^^^^^^^^^^^^^^ * * ;
- ; ^^^^^^^^^^^^^^^^^ ** ** ;
- ; ^^^^^^^^^^^^^^^^^^^ * * * * ***** * * ;
- ; ^^^^^^^^^^ ^^^^^^^^^^ * * * * ** * ;
- ; ^^^^^^^ ^^^^^^^ * * * * * * ;
- ; ^^^^ ^^^^ * * * * ** ;
- ; ^ ^ * * * * * * ;
- ; ;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; ;
- ; Mill Mountain Software ;
- ; ;
- ; This program may be freely distributed provided that it is dis- ;
- ; tributed in whole with no alteration or modification in form or ;
- ; content, that all copyright notices remain intact, and that no ;
- ; charge is made other than a nominal distribution fee. All com- ;
- ; mercial distribution of this program in part or in whole without ;
- ; the express written consent of the author is strictly prohibited. ;
- ; ;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; ;
- ; The author may be contacted at: ;
- ; CompuServe 71370,2635 GEnie DHCOOK ;
- ; ;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; ;
- ; Title: PATCHARK.AZM Version 1.0 ;
- ; ;
- ; Author: Dale H. Cook ;
- ; ;
- ; Description: Patches Brian Moore's ARK.COM, Version 03 or later to ;
- ; provide automatic date/time stamping of archives for ;
- ; '84 (graphics) Kaypro 4 and 10 real-time-clock. ;
- ; ;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; ;
- ; Revision History: 16AUG88 - Version 1.0 - first release version ;
- ; ;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- ORG 100H
- JP GET ; Set date-and time before running ARK
-
- ;
- ; ARK EQUATES
- ;
-
- START: EQU 285AH ; ARK035 has jp 285Ah at 100h
- ENDARK: EQU 36D6H ; First byte after the end of ARK035
- DATTIM: EQU 0103H ; Start of binary date-and-time within ARK
-
- ;
- ; KAYPRO RTC EQUATES
- ;
-
- PIOADD EQU 0FH ; Pio address
- CLKADD EQU 20H ; Rtc register select
- CLKCTL EQU 22H ; Rtc mode control
- CLKDAT EQU 24H ; Rtc data
- STATUS EQU 14H ; Rtc status register
- MONRTC EQU 07H ; Rtc months register
- DAYRTC EQU 06H ; Rtc days register
- HRSRTC EQU 04H ; Rtc hours register
- MINRTC EQU 03H ; Rtc minutes register
-
-
- ORG ENDARK ; Locate time/date routine beyond ARK
-
- ;
- ; FETCH RTC DATA
- ;
-
- GET: LD A,PIOADD ; Set pio to output
- OUT CLKCTL,A
- LD A,STATUS ; Clear status bit
- OUT CLKADD,A
- IN A,CLKDAT
-
- GET0: LD A,88H ; Year for Kaypro - change to current year
- CALL BCDBIN
- LD (DATTIM),A
-
- GET1: LD A,MONRTC ; Get month
- CALL GETDRI
- CALL BCDBIN
- LD (DATTIM+1),A
-
- LD A,DAYRTC ; Get day
- CALL GETDRI
- CALL BCDBIN
- LD (DATTIM+2),A
-
- LD A,HRSRTC ; Get hour
- CALL GETDRI
- CALL BCDBIN
- LD (DATTIM+3),A
-
- LD A,MINRTC ; Get minute
- CALL GETDRI
- CALL BCDBIN
- LD (DATTIM+4),A
-
- LD A,STATUS ; Check for rollover
- OUT CLKADD,A
- IN A,CLKDAT
- OR A ; Status bit = 0?
- JP Z,START ; Yes - jump to ARK
- JR GET1 ; No - try again
-
- ;
- ; GET DATE/TIME FROM RTC SUBROUTINE
- ;
- èGETDRI: OUT CLKADD,A ; Output rtc address
- IN A,CLKDAT ; Input rtc data
- RET
-
- ;
- ; CONVERT BCD TO BIN
- ;
-
- BCDBIN: LD H,A ; Save BCD in H
- AND 0F0H ; Mask upper nibble
- RRCA ; Rotate
- LD L,A ; L = upper nibble * 8
- RRCA ; Rotate twice
- RRCA ; A = upper nibble * 2
- ADD A,L
- LD L,A ; L = upper nibble * 0AH
- LD A,H ; Get BCD back
- AND 0FH ; Mask upper nibble
- ADD A,L ; Add to binary upper nibble
- RET
-
-
- END