; Patches SETD22.COM for Plu*Perfect DateStamper, written ; February 11, 1988 by Bruce Morgen ; Patch and overlay file for SETD20. To use, modify EURO and ; OVERWR bytes as desired. If your system has a clock, you may ; code a routine to get the date at getdate. If you do so, you ; should change the byte at DATEREQ to 0. Otherwise, leave it ; at 0FFh. ; Assemble to SETDDS.HEX with ZAS, Z80ASM, Z80MR (rename this file ; to SETDDS.AZM for Z80MR), etc. Load with Ron Fowler's MLOAD: ; MLOAD SETD.COM,SETDDS ORG 100H DS 3 ; Leave here (space for jmp to start of ; SETD itself) EUROMODE: DB 0 ; Change to 0FFh for default euro mode ; [don't change for this overlay unless ; you reverse the (MONTH) & (DAY) loads ; on lines 45 & 47! - b/m] OVERWRMODE: DB 0 ; Change to 0FFh for default overwr mode DATE: DW 0 ; This is where the system date should go. DATEREQ:DB 0 ; If you code a routine below to access the ; System date, or use the CPM/3 function ; Below, you must change this to 0. GETDATE:;RET ; And delete this RET! ; ADDING CLOCK SUPPORT: ; ; Support for a system clock may be added here. If your system has ; a clock, simply add the routine to access it. You have about 127 ; bytes in which to do so. The format of the date is an integer ; number of days since January 1, 1978. This number must be placed ; in DATE, above. CALL GETTIME LD HL,ASCII-1 LD A,(MONTH) CALL STORE ; Store month in memory variable LD A,(DAY) CALL STORE ; Store day in memory variable LD A,(YEAR) CALL STORE LD HL,ASCII ; Point HL at "ASCII:" JP 893H ; Let SETD's code convert to DRI ; DRI format and store in "DATE:" ; Store ASCII in memory variables STORE: LD B,A ; Stash BCD in B LOOP: RRCA ; Exchange nybbles RRCA RRCA RRCA CALL MASKER DEC HL ; Adj. ptr. LD A,B ; Get other nybble ; fall through MASKER: AND 0FH ; Mask ADD A,'0' ; ASCII INC HL ; Bump pointer LD (HL),A ; Store INC HL ; Skip "/" RET GETTIME: LD E,'D' LD C,12 CALL 005H CP 22H JR NZ,NODS LD A,H CP 'D' JR NZ,NODS PUSH DE POP IX LD HL,TIMSTR JP (IX) NODS: LD DE,NODSMSG LD C,9 CALL 005H RST 0 ASCII: DS 2 DB '/' DS 2 DB '/' DS 2 DB 0 ; SETD routine needs terminator TIMSTR: YEAR: DS 1 MONTH: DS 1 DAY: DS 1 DS 3 ORG TIMSTR NODSMSG: DB 7,'DateStamper Required!$' ; This routine must end before GETDATE+7Fh END