2 ; Copyright (C) 2010 Sprite_tm
4 ; This program is free software: you can redistribute it and/or modify
5 ; it under the terms of the GNU General Public License as published by
6 ; the Free Software Foundation, either version 3 of the License, or
7 ; (at your option) any later version.
9 ; This program is distributed in the hope that it will be useful,
10 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ; GNU General Public License for more details.
14 ; You should have received a copy of the GNU General Public License
15 ; along with this program. If not, see <http://www.gnu.org/licenses/>.
17 msize: equ 62 ;size of available RAM in k
19 bias: equ (msize-20) * 1024
20 ccp: equ $3400+bias ;base of cpm ccp
21 bdos: equ ccp+$806 ;base of bdos
22 bios: equ ccp+$1600 ;base of bios
23 cdisk: equ $0004 ;current disk number (0 ... 15)
24 iobyte: equ $0003 ;intel iobyte
25 buff: equ $0080 ;default buffer address
26 retry: equ 3 ;max retries on disk i/o before error
37 nsects: equ ($-ccp)/128 ;warm start sector count
61 db msize - (msize/10)*10 + '0' ;modulo doesn't work?
83 ld d,1 ;sektor (0 based)
109 cp 26 ;if sector >= 26 then change tracks
171 ld hl,0 ;error return code
174 in a,(15) ;querry, if disk exists
185 add hl,de ;return disk parameter header address
192 ld bc,0 ; same as seek to track 0
220 or c ;merge write type in c
226 ;translate sector bc using table at de, res into hl
250 ;Disk Parameter Header
252 dpe0: dw 0 ;XLT: No sector translation table
253 dw 0 ;000: Scratchpad
254 dw 0 ;000: Scratchpad
255 dw 0 ;000: Scratchpad
256 dw dirbuf ;DIRBUF: Address of a dirbuff scratchpad
257 dw dpb ;DPB: Address of a disk parameter block
258 dw chk0 ;CSV: Address of scratchpad area for changed disks
259 dw all0 ;ALV: Address of an allocation info sratchpad
260 dpe1: dw 0 ;XLT: No sector translation table
261 dw 0 ;000: Scratchpad
262 dw 0 ;000: Scratchpad
263 dw 0 ;000: Scratchpad
264 dw dirbuf ;DIRBUF: Address of a dirbuff scratchpad
265 dw dpb ;DPB: Address of a disk parameter block
266 dw chk1 ;CSV: Address of scratchpad area for changed disks
267 dw all1 ;ALV: Address of an allocation info sratchpad
268 dpe2: dw 0 ;XLT: No sector translation table
269 dw 0 ;000: Scratchpad
270 dw 0 ;000: Scratchpad
271 dw 0 ;000: Scratchpad
272 dw dirbuf ;DIRBUF: Address of a dirbuff scratchpad
273 dw dpb ;DPB: Address of a disk parameter block
274 dw chk2 ;CSV: Address of scratchpad area for changed disks
275 dw all2 ;ALV: Address of an allocation info sratchpad
276 dpe3: dw 0 ;XLT: No sector translation table
277 dw 0 ;000: Scratchpad
278 dw 0 ;000: Scratchpad
279 dw 0 ;000: Scratchpad
280 dw dirbuf ;DIRBUF: Address of a dirbuff scratchpad
281 dw dpb ;DPB: Address of a disk parameter block
282 dw chk3 ;CSV: Address of scratchpad area for changed disks
283 dw all3 ;ALV: Address of an allocation info sratchpad
286 dw 26 ;SPT: sectors per track
287 db 3 ;BSH: data allocation block shift factor
288 db 7 ;BLM: Data Allocation Mask
290 dw 242 ;DSM: Disk storage capacity
291 dw 63 ;DRM, no of directory entries
294 dw 16 ;CKS, size of dir check vector
295 dw 2 ;OFF, no of reserved tracks