; ; panovl.mac ; ; user-written overlay for pancake ; ; written ron murray 17/11/88 ; modified to use bye5 clock inserts rjm 13/1/90 ; ; this version dated 21/2/90 rjm ; false equ 0 true equ not false no equ false yes equ true bdos equ 5 ; this overlay defines equates and strings for pancake. edit as you wish. ; you will also need to supply the name of your bye5 clock insert at the ; appropriate point. ; org 0109h ; Start after initial jp, and then some ; Your _must_ place your ENV address here as BYE loads Pancake.com and as ; a result the env pointer does not get set. ; Place your Z3ENV address here.. dw 0f580h ; Your ENV address dw 0 ; Do NOT alter this one ; Jump table: do not change jp pantime ; get time/date ;------------------------------------------------------------------------------ ; Place your local STD area code number here ; Edit this to reflect your local STD number. stdnum: db '09' ; Your local STD code. Up to eight numbers allowed ;---------------------------------------------------------------------- ; DO NOT ALTER THIS! db '-' ; DO NOT alter this one. It is ALWAYS last! ; ;------------------------------------------------------------------------------ ; ; Insert the filename of your bye5 clock insert here. don't forget to make ; sure that the file is on the correct drive/user area before you assemble ; this file! Also note that the insert must be in z80 code before use: ; convert with xiz or whatever if necessary. ; include clock.lib ; ;------------------------------------------------------------------------------ ; ; end of user-specified equates. do not change anything below this point! ; ;------------------------------------------------------------------------------ ; ; time routine ; ; Destroys af and hl, retains the rest returns (in hl) address of a table ; containing the current time as follows: ; ; 0 year e.g. 1988 ; 2 month 1 - 12 ; 4 day 1 - 31 ; 6 hour 0 - 23 ; 8 minute 0 - 59 ; 10 second 0 - 59 ; Each is a 2-byte binary value. pantime:push af ; save regs push bc push de push ix ; in case insert uses ix, iy push iy call time ; call the bye5 clock insert ld a,(rtcbuf+4) ; convert years call bcdbin ld de,1900 ; add century add hl,de ld (timetab),hl ; store ld a,(rtcbuf+5) ; convert month call bcdbin ld (timetab+2),hl ld a,(rtcbuf+6) ; day call bcdbin ld (timetab+4),hl ld a,(rtcbuf) ; hour call bcdbin ld (timetab+6),hl ld a,(rtcbuf+1) ; minute call bcdbin ld (timetab+8),hl ld a,(rtcbuf+2) ; second call bcdbin ld (timetab+10),hl pop iy ; restore regs pop ix pop de pop bc pop af ld hl,timetab ; point to table ret ; and quit ; Convert bcd value in a to 2-byte binary value in hl. modified from ; routine in bye5 (with apologies). bcdbin: ld h,a ; save a and 0fh ; mask off hi nybble ld l,a ; save low nybble ld a,h ; get original back and 0f0h ; mask lsb rrca ; x2 ld h,a rrca ; x4 rrca ; x8 add a,h ; x10 add a,l ; low nibble ld l,a ; put in hl ld h,0 ; msb = 0 ret ; Binbcd will convert a 0-99 binary number to 0-99 bcd number. ; Call with (a)=binary number 0-99. (a)=0-99 bcd on exit binbcd: or a ; bcd 0 = binary 0, ret z ; so return. push bc ld b,a ; conversion counter. xor a ; clear 'a'. binlop: inc a ; add one. daa ; binary to bcd. djnz binlop ; all converted? pop bc ret ; Time table: pointed to by hl on return from time routine. all are two-byte ; binary values. timetab: year: ds 2 month: ds 2 day: ds 2 hour: ds 2 minute: ds 2 second: ds 2 ; dummy bye5 time buffers: rtcbuf: ds 7 cchour: ds 1 ; not used but necessary to keep ccmin: ds 1 ; the bye overlay happy. if ($ ge 0300h) jp error overlay too large!!! endif end