Mike_Z
Veteran Member
Well....again I'm looking over my CBIOS code, comparing it to the CBIOS in the DRI manual. I think that I have found a question I had some time ago, but since it didn't make a different at the time I let it go. But now it may make a difference.
The DRI CBIOS code has two spots that store DRIVE NUMBER. At the beginning, in BOOT, CDISK is zeroed and stored at 0004h. Then again in GOCPM, just prior to jumping to CCP, CDISK is loaded in Reg C. Yet in SELDSK, the drive number is placed into DISKNO at 4CEFh. Why is there two places for drive number? Should these is synchronized? My CBIOS routines use the DISKNO and 4CEFh and not the CDISK at 0004h. I would think that CPM would always use the 0004h, because it would not move if CPM was moved by the user, but why is DISKNO at 4CEFh used at all? This address would be different if the user used MOVCPM. Mike
Here are the CDISK references
Then the DISKNO reference
The DRI CBIOS code has two spots that store DRIVE NUMBER. At the beginning, in BOOT, CDISK is zeroed and stored at 0004h. Then again in GOCPM, just prior to jumping to CCP, CDISK is loaded in Reg C. Yet in SELDSK, the drive number is placed into DISKNO at 4CEFh. Why is there two places for drive number? Should these is synchronized? My CBIOS routines use the DISKNO and 4CEFh and not the CDISK at 0004h. I would think that CPM would always use the 0004h, because it would not move if CPM was moved by the user, but why is DISKNO at 4CEFh used at all? This address would be different if the user used MOVCPM. Mike
Here are the CDISK references
Code:
Boot: XRAA
STA IOBYTE
STA CDISK ;Select disk zero
JMP GOCPM
GOCPM: XXX ;Set some intial stuff
EI
LDA CDISK
MOVCA
JMP CCP
Then the DISKNO reference
Code:
SELDSK: LXIH 0000
MOVAC
STA DISKNO
CPI 1 ;Here is the limit on drive numbers
RNC
;Calc DPH Address
LDA DISKNO