Changes
CP/M 2.2
,/* Implementations */
CP/M 2.2 was the first CP/M avaiable for the Amstrad CPC. A minimum requirement to run CP/M was a disc drive therefore CP/M 2.2 came bundled with the Amstrad [[DDI-1]] discdrive with the BIOS in the AMSDOS ROM, making it possible to run CP/M 2.2 on the Amstrad CPC 464. Later when the Amstrad CPC 664 was released, CP/M 2.2 came together with this machine as the 664 had a built in discdrive. With the CPC6128 it was on one of the two system discs, with CPM+ on the other.
== Tips ==
CPM 2.2 doesn't allow a program to handle BDOS errors itself like CPM+ does therefore you need to take additional steps to avoid them if you wish your program to continue:
=== Deleting a file that doesn't exist ===
First check if a file exists before deleting it:
ld c,&11
ld de,fcb
call BDOS
cp 255
jr z,doesnt_exist
ld c,&13
ld de,fcb
call BDOS
doesnt_exist:
=== Disc change ===
If the disc is changed, e.g. another disc is inserted into drive A in a single disc system, then the disc will be marked as read-only. Any modification operations (e.g. delete or write) will fail and the program will be aborted with a BDOS read-only error.
To avoid this reset the disk system and re-select the current drive:
ld c,&19 ;; get current disk
call BDOS
push af
ld c,&0d ;; reset disk system
call BDOS
pop af
ld e,a
ld c,&0e ;; select disk restoring it to read/write state
call BDOS
== Implementations ==