X-Git-Url: http://cloudbase.mooo.com/gitweb/avrcpm.git/blobdiff_plain/162601cae715d054f74f6882aacb07c1e7a26631..d8fa6a36ffba80be398c90641b3e7e7a79d56d43:/cpm/BIOS.MAC diff --git a/cpm/BIOS.MAC b/cpm/BIOS.MAC index 2b3842f..a260ec8 100644 --- a/cpm/BIOS.MAC +++ b/cpm/BIOS.MAC @@ -19,31 +19,39 @@ maclib CFGACPM.LIB +cr equ 0dh +lf equ 0ah + aseg org 100h .phase bios .z80 -nsects equ ($-ccp)/128 ;warm start sector count +nsects equ ($-ccp)/128 ;warm start sector count - jp boot + jp boot wboote: - jp wboot - jp const - jp conin - jp conout - jp list - jp punch - jp reader - jp home - jp seldsk - jp settrk - jp setsec - jp setdma - jp read - jp write - jp listst - jp sectran + jp wboot + jp const + jp conin + jp conout + jp list + jp punch + jp reader + jp home + jp seldsk + jp settrk + jp setsec + jp setdma + jp read + jp write + jp listst + jp sectran + jp 0 ;zsdos (?) + jp 0 ;zsdos (?) + jp 0 ;zsdos (?) + jp clock ;zsdos compatible clock set/get + .8080 maclib AVRCPM.LIB @@ -92,34 +100,34 @@ msgnodisk: db cr,lf,0 const: - in a,(0) + in a,(0) ret conin: - in a,(0) - cp 0ffh - jp nz,conin + in a,(0) + cp 0ffh + jp nz,conin - in a,(1) + in a,(1) ret conout: - ld a,c - out (1),a + ld a,c + out (1),a ret list: ret listst: - ld a,0 + ld a,0 ret punch: ret reader: - ld a,01Fh + ld a,01Fh ret prmsg: @@ -405,6 +413,55 @@ sectran: ld h,0 ret +;------------------------------------------------------------------------ +; ZSDOS clock drivers may use registers BC and D without restoring them, +; but must preserve the Z80's alternate and index registers. +; Other registers must be used exactly as follows: +; +; Enter: C = 00H to Read the Clock, 01H to Set the Clock +; DE = Address of a 6-byte field to Receive or from which +; to Set time in DateStamper format (BCD digits as: +; YY MM DD HH MM SS). 24-hour operation is assumed. +; +; Exit : A = 01H for a successful operation, +; 0FFH for a failure of any sort (Can't set, etc.) +; +; When Reading the Clock: +; E = Original contents of Entry value of DE plus 5 +; HL = Entry value of DE plus 5 (Seconds field) + +clock: + dec c + jr z,clk_set + inc c + ret nz + +clk_read: + ex de,hl + ld bc,5*256 + CLOCKPORT-1 +clkg_l: + inc c + ini + jr nz,clkg_l + ld e,(hl) + in a,(CLOCKPORT+5) + ld (hl),a + jr clk_e + +clk_set: + ld hl,5 + add hl,de + ld bc,6*256 + CLOCKPORT+6 +clks_l: + dec c + outd + jr nz,clks_l +clk_e: + ld a,1 + ret + +;------------------------------------------------------------------------ + bcb: dw drvtbl dw dirbuf dw enddat