mirror of https://github.com/wwarthen/RomWBW.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
137 lines
2.9 KiB
137 lines
2.9 KiB
; cpmbios.lib 2/20/2012 dwg - get$off, get$drm, and get$spt need c=drvnum
|
|
; cpmbios.lib 12/26/2011 dwg -
|
|
|
|
; Copyright (C) 2011-2012 Douglas Goodall All Rights Reserved.
|
|
; For non-commercial use by N8VEM community
|
|
|
|
XLT$OFS equ 0 ; Translate Table
|
|
RV1$OFS equ XLT$OFS+WORDSIZE ; Reserved Field 1
|
|
RV2$OFS equ RV1$OFS+WORDSIZE ; Reserved Field 2
|
|
RV3$OFS equ RV2$OFS+WORDSIZE ; Reserved Field 3
|
|
DBF$OFS equ RV3$OFS+WORDSIZE ; Directory Buffer
|
|
DPB$OFS equ DBF$OFS+WORDSIZE ; Diskk Parameter Block Pointer
|
|
CSV$OFS equ DPB$OFS+WORDSIZE ; Checksum Vector
|
|
ALV$OFS equ CSV$OFS+WORDSIZE ; Allocation Vector
|
|
DPH$LEN equ ALV$OFS+WORDSIZE ; size of normal DPH
|
|
LU1$OFS equ ALV$OFS+WORDSIZE ; Logical Unit Signature Byte 1 'L'
|
|
LU2$OFS equ LU1$OFS+BYTESIZE ; Logical Unit Signature Byte 2 'U'
|
|
CUR$OFS equ LU2$OFS+BYTESIZE ; Current Logical Unit (default)
|
|
NLU$OFS equ CUR$OFS+WORDSIZE ; Number of LU's (capacity/9)
|
|
|
|
|
|
SPT$OFS equ 0 ; Sectors Per Track
|
|
BSH$OFS equ SPT$OFS+WORDSIZE ; Block Shift Factor
|
|
BLM$OFS equ BSH$OFS+BYTESIZE ; Data Allocation Block Mask
|
|
EXM$OFS equ BLM$OFS+BYTESIZE ; Extend Mask
|
|
DSM$OFS equ EXM$OFS+BYTESIZE ; Disk Size Max
|
|
DRM$OFS equ DSM$OFS+WORDSIZE ; Number of Directory Entries
|
|
AL0$OFS equ DRM$OFS+WORDSIZE ; Allocation bitmask for directories
|
|
AL1$OFS equ AL0$OFS+BYTESIZE ; Allocation bitmask for directories
|
|
CKS$OFS equ AL1$OFS+BYTESIZE ; Size of Directory Check Vector
|
|
OFF$OFS equ CKS$OFS+WORDSIZE ; Number of Reserved Tracks
|
|
DPB$LEN equ OFF$OFS+WORDSIZE ; Disk Parameter Block Length
|
|
|
|
; BIOS Memory Locations
|
|
BIBOOT equ 0E600h
|
|
BIWBOOT equ 0E603h
|
|
BICONST equ 0E606h
|
|
BICONIN equ 0E609h
|
|
BICONOUT equ 0E60Ch
|
|
BILIST equ 0E60Fh
|
|
BIPUNCH equ 0E612h
|
|
BIREADER equ 0E615h
|
|
BIHOME equ 0E618h
|
|
BISELDSK equ 0E61Bh
|
|
BISETTRK equ 0E61Eh
|
|
BISETSEC equ 0E621h
|
|
BISETDMA equ 0E624h
|
|
BIREAD equ 0E627h
|
|
BIWRITE equ 0E62Ah
|
|
BILISTST equ 0E62Dh
|
|
BISECTRN equ 0E630h
|
|
|
|
; These are rel zero drive number for talking to the BIOS
|
|
; BDOS typically uses rel one drive codes
|
|
|
|
BIDRVA equ 0
|
|
BIDRVB equ 1
|
|
BIDRVC equ 2
|
|
BIDRVD equ 3
|
|
BIDRVE equ 4
|
|
BIDRVF equ 5
|
|
BIDRVG equ 6
|
|
BIDRVH equ 7
|
|
|
|
; On entry: c=drive number
|
|
get$spt macro
|
|
push psw
|
|
push b
|
|
push d
|
|
call BISELDSK
|
|
lxi d,DPB$OFS
|
|
dad d
|
|
mov e,m
|
|
inx h
|
|
mov d,m
|
|
xchg
|
|
lxi d,SPT$OFS
|
|
dad d
|
|
mov e,m
|
|
inx h
|
|
mov d,m
|
|
xchg
|
|
pop d
|
|
pop b
|
|
pop psw
|
|
endm
|
|
|
|
; On entry: c=drive number
|
|
get$drm macro
|
|
push psw
|
|
push b
|
|
push d
|
|
call BISELDSK
|
|
lxi d,DPB$OFS
|
|
dad d
|
|
mov e,m
|
|
inx h
|
|
mov d,m
|
|
xchg
|
|
lxi d,DRM$OFS
|
|
dad d
|
|
mov e,m
|
|
inx h
|
|
mov d,m
|
|
xchg
|
|
pop d
|
|
pop b
|
|
pop psw
|
|
endm
|
|
|
|
; On entry, c=drive number
|
|
get$off macro
|
|
push psw
|
|
push b
|
|
push d
|
|
call BISELDSK
|
|
lxi d,DPB$OFS
|
|
dad d
|
|
mov e,m
|
|
inx h
|
|
mov d,m
|
|
xchg
|
|
lxi d,OFF$OFS
|
|
dad d
|
|
mov e,m
|
|
inx h
|
|
mov d,m
|
|
xchg
|
|
pop d
|
|
pop b
|
|
pop psw
|
|
endm
|
|
|
|
|
|
|
|
; eof - cpmbios.lib
|
|
|