★ CODING ★ DDI-1 Firmware: The Complete CPC 464 DISC Operating System ROM Specification ★ |
DDI-1 Firmware: Chapter 2 - CP/M 2.2 and the BIOS (3/3) |
Chapter 2 - CP/M 2.2 and the BIOS 2.15 Extended Disc Parameter Blocks In order to facilitate reading and writing ‘foreign' discs of differing formats, all the parameters concerning a drive are kept in RAM in an extended CP/M disc parameter block (XPB). The knowledgeable user may patch an XPB. There are two XPBs, one per drive. XPB structure:
To find the XPB for a particular drive:
When calling SELDSK if bit 0 of E = 0 and byte 24 of the XPB = #00 then the BIOS will attempt to determine the format of the disc and patch the XPB accordingly. The XPBs for the different formats are initialized as follows: System Format
Data Only Format
IBM Format
2.16 The Restart Instructions and Locations The BIOS uses the restart instructions and their locations as follows:
An application program may use RST6 without any further ado. An application program may not use RST7 or its location since this is used for interrupts - unless, that is, the program wishes to intercept interrupts. If an application program wishes to use the restart instructions 1..5 and/or their locations for its own purposes then it must intercept all entries into the BIOS and restore the restart locations. Initially copy the required restart location(s) into RAM. On entry to a BIOS routine, and again on exit, swap the restart location(s) with the RAM version. If an application program does not call the BIOS directly then only the BDOS entry at #0005 need be intercepted. The restart location(s) must also be restored if any firmware or extended BIOS jumpblock routines are called. The DDT program supplied has been modified to use RST6 instead of the usual RST7. 2.17 Using the Alternate Register Set and the ENTER FIRMWARE Routine The firmware uses BC' and carry' for its own purposes and corrupts the other alternate registers and IY. If an application program wishes to use these registers then the BIOS will automatically save the users alternate and IY registers on entry into the BIOS and restore them on exit. While inside the BIOS these registers are set as required by the firmware. If the application programs call firmware or extended BIOS routines then they must be called via the ENTER FIRMWARE routine which performs the necessary register saving. The routine SET REG SAVE sets or clears the register saving option. If register saving is enabled then an application program:
If register saving is disabled then an application program:
It is strongly recommended that the BIOS is run with the alternate register saving enabled and that application programs follow the procedure outlined above. If an application program does disable the register saving it should re-enable it on exit. Otherwise certain standard application programs may not work. SET REG SAVE must not be called via ENTER FIRMWARE. See the firmware documentation for more details on the use of the alternate registers. Note: the SETUP utility describes register saving enabled as ‘slow' and disabled as ‘fast'; these terms are misleading. The difference in speed is negligible.
|