5.6 Jump Block Interception - by AMSDOS
When AMSDOS is initialised it copies the relevant cassette jumpblock entries into its own data area. When DISC is selected the cassette jumpblock entries are overwritten by AMSDOS entries, when TAPE is selected the original cassette entries are restored.
Initially the disc routines are selected.
5.7 Jump Block Re-Interception - by the User
In order to intercept the jumpblock entries the following procedure should be observed: copy the three bytes from the required jumpblock entry into your own data area - do not make any assumption as to what these three bytes are. Replace the jumpblock entry with your own JMP, RST or whatever. When you receive control restore the jumpblock entry, and CALL it. When you receive control once again save the jumpblock entry and replace it with your own. This procedure will work no matter what the jumpblock entry contains.
Note: when intercepting AMSDOS routines the above procedure must be followed. Merely executing a copy of the jumpblock entry will not work; it must be restored toits original place in the jumpblock
5.8 Return Parameters
So far as it is possible the AMSDOS routines all have the same interface as their cassette counterparts, although in some cases tile interpretation of tile return parameters is different. Errors which are detected by both the cassette and disc routines are returned carry false, zero false. Errors which are only detected by the disc routines are returned carry false, zero true. This latter case corresponds to the cassette routine BREAK condition. In both cases register A contains an error number.
When a routine fails (carry false) it returns a six bit error number in the A register. Bit 7 is set it the error has already been reported to the user. The error numbers are as follows:
#0E | the file is not open as expected. |
#0F | hard end of file. |
#1A | soft end of file. |
#20 | bad command, usually caused by an incorrect filename. |
#21 | file already exists. |
#22 | file doesn't exist. |
#23 | directory is full |
#24 | disc is full. |
#25 | disc has been changed with files open on it. |
#26 | file is |
AMSTRAD Disc Drive & Interface | Chapter 5.6 |