; ; PCPICLK.ASM ; ; Z80 DateStamper clock driver for use with 6502 hardware ; driver. Uses same convention for all Apple clocks. ; ; 6/5/88 - sh. ; ; Due to the stupid behavior of M80/L80 in loading files with ; multiple origins (it insists on filling all addresses between them), ; I have released a modified file for use with ASM.COM or MAC.COM. ; ; Syntax: asm pcpiclk (or) mac pcpiclk ; ; ; *** NOTE *** CLKADD must be patched to the base address of ; your running DateStamper(tm) system. This is displayed during ; loading of the DS module. More information may be found in the ; DateStamper manual Appendix 'B'. ; ; CLKADD EQU 0E395H ;patch this for your installation! ; ; ; WR65WRD EQU 0FFE9H ;write word to 6502 RD65BYT EQU 0FFE0H ;read byte from 6502 RD65BLK EQU 0FFECH ;read block from 6502 ; ; .Z80 ; ORG 80H DW CLKLEN ;length of clock driver DW 0 ;static year if needed DB 'PCPI Clk DVR' ;name of clock driver ; ; ORG CLKADD ; CLOCK: LXI D,16*256 + (14*4+0C3h) ;command #16 to char. dev. #14 'other' CALL WR65WRD ; LXI D,5 CALL RD65BLK ;read first five bytes ;'hl' had the buffer address! MOV E,M ;grab previous seconds CALL RD65BYT ;now get new seconds MOV M,A ;and put in buffer RET ; ; CLKLEN EQU $ - CLOCK ; should be <= 42H! END