Back to firmware
Appendix A shows the disassembled part of the timeout routine. Appendix B shows an assembler source for the timeout routine.
Amstrad, June 1986Page 1 of 5

CP/M DEVICE TIMEOUTS

The BIOS within CP/M Plus attempts to prevent the System "locking up" completely when a non-existent device is referenced by means of a timeout. So, for example, if [CTRL] P were typed accidentally when there was no printer available, after approximately 10 seconds the BIOS will recognise that there is no printer responding and will produce a status message along the lines of :

LPT not ready - Retry, Ignore or Cancel ?

This allows you to either switch a printer on-line then Retry, or rectify the error by pushing C for cancel (which then directs all printer output to a null device).

Unfortunately, some printers take such a long time form feeding (or sheet feeding) that the BIOS times out before the operation has been finished so that R must be hit repeatedly. The length of this timeout may be extended by modifying the '.EMS' CP/M system file. This can be done using the programming utility SID.COM, that is to be found on the "Programming Utilities" side of the system discs.

CP/M Plus has been implemented on both the CPC 6128 and the PCW 8256. Consequently, there are different instructions for modifying the system file depending on which machine you have. As well as setting the timeout to a longer period it can also be made infinite.

Continued


Amstrad, June 1986Page 2 of 5

THE FOLLOWING IS FOR 6128 ONLY

1) To set timeout to approximately 15 seconds

In order to increase the timeout period to approximately 15 seconds, the following procedure should be followed :

Start CP/M Plus from the side 1 system disc. Once this has loaded, switch across to the programming Utilities on side 2. Then type :

SID

Once the program has loaded, remove this disc and re-insert side 1 (the side from which CP/M was originally loaded). Now type :

RC10CPM3.EMS

This reads in the CP/M system file so that you can modify it. Only two bytes need be changed and that is accomplished with the following :

S2673

The screen will show :

2673 10

Type in :

FF

The screen will now show :

2674 A4

Type in :

FF
. {a full stop ends input}

Once these changes have been made the new version may be written back to disc using the following command :

WC10CPM3.EMS,0100,64FF

This modification has no other side-effect.

Continued ....


Amstrad, June 1986Page 3 of 5

2) To set the timeout to an infinite period

SID is loaded and the system file read in as described above. The actual modifications to be made are, however, a little more convoluted. First type :

S2580

The machine will respond with :

2580 90

Type the following :

E7
3F
.

Now type :

S23E7
78
FE
01
C2
90
3D
F6
FF
C9
.

And finally write the code out using :

WC10CPM3.EMS,0100,64FF

In the above, two bytes have been highlighted. These can be changed to a number of possible values depending on which devices the timeout is to be set infinite for.

FE 01(as above)setinfinitetimeout for PRINTER
 normaltimeout for SERIAL PORT
FE 02setnormaltimeout for PRINTER
 infinitetimeout for SERIAL PORT
E6 00setinfinitetimeout for PRINTER
 infinitetimeout for SERIAL PORT

WARNING: IF THIS PATCH IS USED THEN A PRINTER/SERIAL DEVICE MUST BE FITTED WHEN CP/M IS USED OR IT WILL LOCK_UP.

Continued ....


Amstrad, June 1986Page 4 of 5

THE FOLLOWING IS FOR 8256 ONLY

1) To set timeout to approximately 15 seconds

In order to increase the timeout period to approximately 15 seconds, the following procedure should be followed :

Start CP/M Plus from the side 2 System disc. Once this has loaded, switch across to the programming utilities on side 3. Then type :

SID

Once the program has loaded, remove this disc and re-insert side 2 (the side from which CP/M was originally loaded). Now type :

RJ14CPM3.EMS

This reads in the CP/M system file so that you can modify it. Only two bytes need be changed and that is accomplished with the following :

S6F73

The screen will show :

6F73 10

Type in :

FF

The screen will now show :

6F74 A4

Type in :

FF
. {a full stop ends input}

Once these changes have been made the new version may be written back to disc using the following command :

WJ14CPM3.EMS,0100,A0FF

This nodification has no other side-effect.

Continued ....


Amstrad, June 1986Page 5 of 5

2) To set the timeout to an infinite period

SID is loaded and the system file read in as described above. The actual modifications to be made are, however, a little more convoluted. First type :

S6E80

The machine will respond with :

6E80 90

Type the following :

A5
BD
.

Now type :

S6BA5
78
FE
01
C2
90
BA
F6
FF
C9
.

And finally write the code out using :

WJ14CPM3.EMS,0100,A0FF

In the above, two bytes have been highlighted. These can be changed to a number of possible values depending on which devices the timeout is to be set infinite for.

FE 01(as above)setinfinitetimeout for LPT
 normaltimeout for SIO & CEN
FE 02setinfinitetimeout for SIO
 normaltimeout for LPT & CEN
FE 03setinfinitetimeout for CEN
 normaltimeout for LPT & SIO
E6 00setinfinitetimeout for LPT
 infinitetimeout for SIO
 infinitetimeout for CEN

WARNING: IF THIS PATCH IS USED THEN A PRINTER/SERIAL DEVICE MUST BE FITTED WHEN CP/M IS USED OR IT WILL LOCK_UP.

The End


APPENDIX A

Disassembled part of the .EMS file:

Timeout delay routine in CP/M file .EMS

; File : j14gcpm3.ems

  6F72            LD      HL,A410         ; Set delay
  6F75    LAB0:   CALL    BAD8            ; Test device ready
  6F78            JR      NZ,0A=LAB1      ; Ok, well done
  6F7A            DEC     HL              ; Count down delay
  6F7B            LD      A,H
  6F7C            OR      L
  6F7D            JR      NZ,F6=LAB0      ; Test done
  6F7F            CALL    39C3            ; Process error if time out
  6F82            SBC     A,L
  6F83            CALL    9D62
  6F86    LAB1:   JP      A0F0            ; Proceed

APPENDIX B

Assembler routine for extending the timeouts:

BIOS timeout fix	MACRO-80 3.44	09-Dec-81	PAGE	1

					title	BIOS timeout fix

				.comment :

				The follwing patch is made to set the timeout
				to a longer period.With this patch the timeout
				message appears after approximately 20 seconds.

				Written by	Werner Cirsovius
						Hohe Weide 44
						D-2000 Hamburg 20
						Germany

				Many thanks to AMSTRAD who sent me the
				principle paper about CP/M device timeouts
				:

FFFF				timval	equ	-1
BAD8				exbios	equ	0bad8h	; External BIOS call

				; The next addresses are those addresses which
				; must be changed after calling SID and the
				; *.EMS file

6F72				timout	equ	06f72h	; 1st patch address
6BA5				patch	equ	06ba5h  ; 2nd patch address

				; The next value is the difference to real
				; addresses after BIOS is installed

5200				differ	equ	05200h

					.z80	

					org	timout

6F72'	CD BDA5				call	patch+differ	; Call new routine

					org	patch

6BA5	21 FFFF				ld	hl,timval	; Load timeout

6BA8'	CD BAD8			loop:	call	exbios		; Test device ready
6BAB'	20 09				jr	nz,fix		; Ok, exit to main
6BAD'	2B				dec	hl		; Else countdown
6BAE'	7C				ld	a,h
6BAF	B5				or	l
6BB0'	20 F6				jr	nnz,loop	; All count down ?
6BB2'	21 FFFF				ld	hl,timval	; Yes, return to
6BB5'	C9				ret			; count down again

6BB6'	E3			fix:	ex	(sp),hl		; Fix caller's PC
6BB7'	23				inc	hl		; To skip calling
6BB8'	23				inc	hl		; 'EXBIOS'
6BB9'	23				inc	hl		; At main level
6BBA'	E3				ex	(sp),hl
6BBB'	C9				ret	

					end