Instruction manual
fa96 c0 defm 192 ;alloc 0
fa97 00 defm 0 ;alloc 1
fa98 00 00 defw 0 ;check size
fa9a 02 00 defw 2 ;track offset
fa9c ;
fa9c ; end of fixed tables
fa9c ;
fa9c ; individual subroutines to perform each function
fa9c boot: ;simplest case is to just perform parameter initialization
fa9c af XOR a ;zero in the accum
fa9d 32 03 00 LD (iobyte),A ;clear the iobyte
faa0 32 04 00 LD (cdisk),A ;select disk zero
faa3 c3 ef fa JP gocpm ;initialize and go to cp/m
faa6 ;
faa6 wboot: ;simplest case is to read the disk until all sectors loaded
faa6 31 80 00 LD sp, 80h ;use space below buffer for stack
faa9 0e 00 LD c, 0 ;select disk 0
faab cd 4d fb call seldsk
faae cd 47 fb call home ;go to track 00
fab1 ;
fab1 06 2c LD b, nsects ;b counts * of sectors to load
fab3 0e 00 LD c, 0 ;c has the current track number
fab5 16 02 LD d, 2 ;d has the next sector to read
fab7 ; note that we begin by reading track 0, sector 2 since sector 1
fab7 ; contains the cold start loader, which is skipped in a warm start
fab7 21 00 e4 LD HL, ccp ;base of cp/m (initial load point)
faba load1: ;load one more sector
faba c5 PUSH BC ;save sector count, current track
fabb d5 PUSH DE ;save next sector to read
fabc e5 PUSH HL ;save dma address
fabd 4a LD c, d ;get sector address to register C
fabe cd 6b fb call setsec ;set sector address from register C
fac1 c1 pop BC ;recall dma address to b, C
fac2 c5 PUSH BC ;replace on stack for later recall
fac3 cd 77 fb call setdma ;set dma address from b, C
fac6 ;
fac6 ; drive set to 0, track set, sector set, dma address set
fac6 cd 7d fb call read
fac9 fe 00 CP 00h ;any errors?
facb c2 a6 fa JP NZ,wboot ;retry the entire boot if an error occurs
65










