;*************** BIOS DATA AREA ******************************
;
DIRBF EQU 0B800H;128bytes
;
CSV00 EQU 0B880H;8bytes
ALV00 EQU 0B888H;3bytes
;
; DISK PARAMETER BASE
;
DPBASE:
;
;drive No.0 (a drive)
DEFW 0 ;XLATE
DEFW 0 ;scratch1
DEFW 0 ;scratch2
DEFW 0 ;scratch3
DEFW DIRBF ;address of dirbf.
DEFW DPTOP ;address of disk parameter block.
DEFW CSV00 ;address of check vector.
DEFW ALV00 ;address of allocation vector (bit map).
;
;
DPTOP:DEFW 16 ;sectors per track from bios.
DEFB 2 ;block shift.sector in a block 128*2^n
DEFB 3 ;block mask.sector no. in a block - 1
DEFB 0 ;extent mask.
DEFW 23 ;disk size (number of blocks-1).
DEFW 31 ;directory size.(max file name no.-1)
DEFW 0C0H ;storage for first bytes of bit map (dir space used).
DEFW 8 ;check sum vector size
DEFW 0 ;offset. first usable track number.
;
;**************************************************************
;*
;* B I O S J U M P T A B L E
;*
;**************************************************************
;
BOOT: JP BOOTJ
WBOOT: JP WBOOTJ
CONST: JP CONSTJ
CONIN: JP CONINJ
CONOUT: JP CONOUTJ
LIST: JP LISTJ
PUNCH: JP PUNCHJ
READER: JP READERJ
HOME: JP HOMEJ
SELDSK: JP SELDSKJ
SETTRK: JP SETTRKJ
SETSEC: JP SETSECJ
SETDMA: JP SETDMAJ
READ: JP READJ
WRITE: JP WRITEJ
PRSTAT: JP PRSTATJ
SECTRN: JP SECTRNJ
;
;BIOS ROUTINE
;
;zb3routine
;
ADISP EQU 1015H
ZREENT EQU 1033H
SOUT EQU 10ABH
SIN EQU 10AEH
;
TRKADRS EQU 0BB00H
SCTADRS EQU 0BB02H
DMAADRS EQU 0BB04H
DRVNO EQU 0BB06H
DISKTOP EQU 8800H
;
SETENTRY:LD HL,REENT
LD A,0C3H
LD (HL),A
INC HL
LD DE,SETEN2
LD (HL),E
INC HL
LD (HL),D
SETEN2:LD HL,IOBYTE
XOR A
LD (HL),A
INC HL
LD (HL),A
INC HL
LD A,0C3H
LD (HL),A
INC HL
LD DE,FBASE
LD (HL),E
INC HL
LD (HL),D
JP CBASE
;
BOOTJ:XOR A
LD (IOBYTE),A
JP CBASE
;
WBOOTJ: LD A,(IOBYTE)
LD C,A
JP CBASE
;
;CONSOLE STATUS
;
CONSTJ:LD A,07
CALL SOUT
CALL SIN
CP 20H
RET NZ
XOR A
RET
;
;CONSOLE INPUT
;
CONINJ: LD A,5;1chr IN,nodp
CALL SOUT
CALL SIN
RET
;
;CONSOLE OUT
;
CONOUTJ:LD A,C
CP 0AH;12.1.8
JP NC,ADISP ;11.12.29
XOR A
RET
;
;PRINTER OUT
;
LISTJ: RET
;
;PUNCHER OUT
;
PUNCHJ: RET
;
;READER IN
;
READERJ: RET;JP 0
;
;SEEK HOME POSITION
;
HOMEJ: LD HL,DISKTOP
LD (TRKADRS),HL
LD (SCTADRS),HL
XOR A
RET
;
;SELECT DRIVE PARAMETER SET
;
SELDSKJ:LD HL,DPBASE
LD A,C
LD (DRVNO),A
RET
;
;SET TRKADRS
;
SETTRKJ:LD HL,DISKTOP
LD DE,800H
INC C
STTRK1: DEC C
JP Z,STTRK9
ADD HL,DE
JP STTRK1
STTRK9:LD (TRKADRS),HL
XOR A
RET
;
;SET SCTADRS
;
SETSECJ:LD HL,(TRKADRS)
LD DE,80H
INC C
STSCT1: DEC C
JP Z,STSCT9
ADD HL,DE
JP STSCT1
STSCT9:LD (SCTADRS),HL
XOR A
RET
;
;SET DMAADRS
;
SETDMAJ:LD H,B
LD L,C
LD (DMAADRS),HL
XOR A
RET
;
;READ SECTOR
;
READJ:LD HL,(DMAADRS)
EX DE,HL
LD HL,(SCTADRS)
READJ1: LD C,80H
READJ2:LD A,(HL)
LD (DE),A
INC HL
INC DE
DEC C
JP NZ,READJ2
XOR A
RET
;
;WRITE SECTOR
;
WRITEJ: LD HL,(SCTADRS)
EX DE,HL
LD HL,(DMAADRS)
JP READJ1
;
;PRINTER STATUS
;
PRSTATJ: RET
;
;sector translator
;
SECTRNJ:LD L,C
LD H,B
RET;
;
;*
;****************** E N D O F C P / M *****************
;*
END;
|