CP/M 3 RSX calls

This is a partial listing of functions provided by various CP/M 3 RSXs. The general format of a call is:

	LD	C,3Ch
	LD	DE,RSXPB
	CALL	5
...
RSXPPB:	DEFB	subfun		;subfunction
	DEFB	nppars		;number of parameters
	DEFW	param1		;16-bit parameters
	DEFW	param2
	...

Subfunctions 0-7Fh can be used by user programs; Subfunctions 80h-0FFh are reserved for CP/M. If an RSX call is made and the RSX is not present, the BDOS returns BA=HL=00FFh.


Function 3C/00 - Initialise LIOS [LIOS.RSX]

Entered with subfun=0. No parameter checking.

This is used by Digital Research Logo to initialise the RSX containing device-dependent code.


Function 3C/01 - Terminate RSX [ANSIRSX.RSX]

ANSIRSX provides ANSI terminal emulation on Amstrad PCW computers.

Entered with subfun=1, nppars=1, param1=address of copy of RSX name ( DEFB 'ANSIRSX' )

Terminates the currently running RSX.

See also function 3C/7F, function 3C/7E.


Function 3C/04 - Return BYE active status [BYE5.RSX]

Entered with subfun=4. No parameter checking.

Returns 0 if BYE is active, 0FFh otherwise.


Function 3C/07 - Return BYE control block address [BYE5.RSX]

Entered with subfun=7. No parameter checking.

Returns HL=address of MXUSR byte in BYE.

MXUSR:	DB	MAXUSR		; Runtime maximum user area available
MXDRV:	DB	MAXDRV		; Runtime maximum drive available
TOVAL:	DB	TOVALUE		; Number of mins. to wait before timeout
NULLS:	DB	0		; Number of nulls after 
ULCSW:	DB	0		; Upper case only switch (32=upper case)
LFEEDS:	DB	0		; Line feed mask (0=don't mask)
WRTLOC:	DB	0		; Location RBBS pokes so BYE won't hang
HARDON:	DB	0FFH		; If 0, hardlog is deactivated
MDMOFF:	DB	0		; If 0FFH, do not output to modem
COVECT:	DW	0		; Console output vector for XMODEM
	DB	'BYE'		; Tells XMODEM that BYE is being used
BELLON:	DB	0FFH		; If 0FFH ok to send bell (Chat) to con-
				; sole, 00H=belloff.  This only affects
				; Your initial default choice
LCPTR:	JMP	LCDATA		; First byte is user access restrictions
				; and flags while user is logged on,
				; used for his total time-on after
				; logoff.  LCDATA is address of buffer
				; For NO25TH data, NO25BF in length
MXTIME:	JMP	RTCBUF		; First byte holds maximum time allowed
				; Next 2 bytes point to the real time
				; clock buffer
BEEPFL:	DB	0		; Flag to enable/disable inactivity beep
				; so we don't affect Zmodem transfers
				; 0 = beeps enabled, 0FFH = beeps off

Function 3C/0B - Delete RSXs below BYE [BYE5.RSX]

Entered with subfun=0Bh. No parameter checking.

Deletes any RSXs loaded below BYE.RSX.


Function 3C/37 - Initialise [HISTRSX.RSX]

Entered with subfun=37h. No parameter checking.

HISTRSX.RSX is a command history RSX for CP/M 3. This function initialises it, or deletes it if it is already initialised. Returns A=0 if the call was obeyed.


Function 3C/38 - Clear command history [HISTRSX.RSX]

Entered with subfun=38h. No parameter checking.

This function empties the HISTRSX history buffer. It returns A=0 for success.


Function 3C/41 - Print directory name [LBR.RSX]

Entered with subfun=41h. No parameter checking.

This is used by the LBRDISK program. When it is called, if a library is mounted as a directory, its name is printed preceded by a backslash; for example:

    A\LIBRARY>
or
    12:42 B3:UTILS\LIBRARY>
under a typical Z-system command processor.

Function 3C/42 - Return address of named directory RSX [DIR.RSX]

Entered with subfun=42h. No parameter checking.

Used by CCP+ named directory system. Returns the address in HL.


Function 3C/65 - Initialise BYE [BYE5.RSX]

Entered with RSXPB:

RSXPB:	DB	65h	;Subfunction
	DB	2	;2 parameters
	DW	BYE$
	DW	ARG
;
BYE$:	DB	'BYE     '
ARG:	DB	0,0
Initialises the BYE RSX. On return, if ARG+1 is nonzero then there is an error (it must be set to 0 on entry).

Function 3C/66 - Terminate BYE [BYE5.RSX]

Entered with RSXPB:

RSXPB:  DB      66h     ;Subfunction
        DB      2       ;2 parameters
        DW      BYE$    
        DW      ARG
;
BYE$:   DB      'BYE     '
ARG:    DB      0,0
Terminates the BYE RSX, thus logging the current caller out.

Function 3C/70 - Redefine character [UDG.RSX]

Entered with RSXPB as below.

The UDG.RSX functions are intended to provide a moderately portable user-defined graphic system. They come in two sets; 3C/70 and 3C/72 are designed to be identical on all systems, while 3C/71,3C/73,3C/74 and 3C/75 are for use in the construction of UDG editors and similar programs on particular computers. The RSXPB is formed:

RSXPB:	DEFB	70h,2	;2 parameters
	DEFW	UDG$	;Parameter 1 points to RSX name
	DEFW	DBLOCK	;Parameter 2 points to data block

UDG$:	DEFB	'UDG     '
DBLOCK:	DEFB	ascii	;Character number, 0-255
	DEFB	bitmap	;8 bytes; most significant bit corresponds to the
			;left of the character; first byte to the top.
If the computer on which UDG.RSX is running does not have 8x8 characters, the bitmap should be scaled to fit. This function returns A=0 for success.

Function 3C/71 - Get character bitmap [UDG.RSX]

Entered with RSXPB:

RSXPB:	DEFB	71h,2	;2 parameters
        DEFW    UDG$    ;Parameter 1 points to RSX name
        DEFW    DBLOCK  ;Parameter 2 points to data block

UDG$:   DEFB    'UDG     '
DBLOCK: DEFB    ascii   ;Character number, 0-255
        DEFS    ?	;As much space as is necessary

This function should return the bitmap for a character in its native form. The size of the character is implementation-dependent; no scaling should be done. This function returns A=0 for success.

In the Amstrad CP/M implementation, the bitmap is 8 bytes.


Function 3C/72 - Display bitmap [UDG.RSX]

Entered with RSXPB:

RSXPB:	DEFB    72h,2	;2 parameters
        DEFW    UDG$    ;Parameter 1 points to RSX name
        DEFW    DBLOCK  ;Parameter 2 points to data block

UDG$:   DEFB    'UDG     '
DBLOCK: DEFS    8	;Bitmap to display

This function should display an 8-byte bitmap (as in function 3C/70) without comitting it to the character set. This can be done by direct screen access or by redefinition of characters 'on-the-fly'. If the screen does not have 8x8 characters, scaling should be used. This function returns A=0 for success.


Function 3C/73 - Redefine literal [UDG.RSX]

Entered with RSXPB:

RSXPB:	DEFB    73h,2	;2 parameters
        DEFW    UDG$    ;Parameter 1 points to RSX name
        DEFW    DBLOCK  ;Parameter 2 points to data block

UDG$:   DEFB    'UDG     '
DBLOCK: DEFB	ascii	;Character to redefine
	DEFS    ?       ;New bitmap
This function is the exact converse of 3C/71. It redefines a character, with the bitmap being supplied in the native format. This function returns A=0 for success.

In the Amstrad CP/M implementation, the native format is 8 bytes long.


Function 3C/74 - Display literal bitmap [UDG.RSX]

Entered with RSXPB:

RSXPB:  DEFB    74h,2   ;2 parameters
        DEFW    UDG$    ;Parameter 1 points to RSX name
        DEFW    DBLOCK  ;Parameter 2 points to data block

UDG$:   DEFB    'UDG     '
DBLOCK: DEFS    ?	 ;Bitmap to display

This function should display a version-dependent bitmap without comitting it to the character set. This can be done by direct screen access or by redefinition of characters 'on-the-fly'. This call returns A=0 for success.

In the Amstrad CP/M implementation, the native format is 8 bytes long.


Function 3C/75 - Select font [UDG.RSX]

Entered with RSXPB:

RSXPB:  DEFB    75h,2   ;2 parameters
        DEFW    UDG$    ;Parameter 1 points to RSX name
        DEFW    fontid  ;Parameter 2 = font number

UDG$:   DEFB    'UDG     '

On computers with multiple fonts, this is used to choose which font should be affected by the other operations. Font 0 should be the font used by a 24x80 screen. This function returns A=0 for success, or 0FEh if the number is out of range. Functions 3C/70 and 3C/72 should only be used when Font 0 is selected.

In the Amstrad implementation, the CPC and PCW only allow Font 0. On the Spectrum +3, Font 0 is the 5-bit wide character set and Font 1 is the 8-bit wide character set. Functions 3C/70 and 3C/72 scale their input bitmaps to 5x8, while the other functions do not scale.


Function 3C/76 - Return RSX status

Entered with subfun=76h, nppars=1, param1=pointer to RSX name. Returns HL=status. In the case of PIPEMGR.RSX, this call returns a bitmapped value in H:

Bit 0: stdin  is redirected
Bit 1: stdout is redirected
Bit 2: stderr is redirected
Bit 3: redirected input is coming from a pipe
Bit 4: redirected output is going to a pipe

Function 3C/79 - Initialise the RSX

Entered with subfun=79h, nppars=1, param1=pointer to RSX name. Returns HL=0 if successful, other values if error. In the case of PIPEMGR.RSX, this call scans the command line at 0080h for redirection operations.


Function 3C/7A - output byte to standard error [PIPEMGR.RSX]

Entered with subfun=7Ah, nppars=1, param1=byte

PIPEMGR.RSX is an extension allowing piping and redirection of I/O from CP/M 3 programs.


Function 3C/7B - installation check for an RSX

Entered with subfun=7Bh, nppars=1, param1=address of RSX name. Returns HL=BCD RSX version (0100h => 1.0) or 00FFh if the RSX is not present.


Function 3C/7C - Read byte from standard input [PIPEMGR.RSX]

Entered with subfun=7Ch. No parameter checking. Returns byte in A, EOF code in H.

PIPEMGR.RSX is an extension allowing piping and redirection of I/O from CP/M 3 programs. The EOF code in H is 0 for end of file, or 1 if the byte in A is valid.


Function 3C/7D - output byte to standard output [PIPEMGR.RSX]

Entered with subfun=7Dh, nppars=1, param1=byte

PIPEMGR.RSX is an extension allowing piping and redirection of I/O from CP/M 3 programs.


Function 3C/7E - Terminate lowest copy of RSX [various]

Entered with subfun=7Eh, nppars=1, param1=address of a copy of the RSX name.

This function and the next one are used by some of my programs when loading long-term RSXs. They avoid RSX duplication using the following system:

See also function 3C/01, function 3C/7F.


Function 3C/7F - Terminate all copies of RSX [various]

Entered with subfun=7Fh, nppars=1, param1=address of a copy of the RSX name.

See also function 3C/01, function 3C/7E.

Function 3C/7F - Set mode for PEEK RSX [PEEKBDOS.RSX]

Entered with subfun=7Fh, nppars=2, param1=address of a copy of the RSX name, param2=mode.

PEEKBDOS.RSX monitors BDOS calls and prints a listing of calls and their parameters to the screen, printer or auxiliary device. The actual RSX ignores the subfun value; its companion COM file sends the value 7Fh.


Function 3C/80 - Return pointer to BIOS traps [GET.RSX]

Entered with subfun=80h. Returns address in HL. No parameter checking.


Function 3C/81 - Immediately stop a SUBMIT [GET.RSX]

Entered with subfun=81h. No parameter checking.


Function 3C/82 - Return pointer to input file FCB [GET.RSX]

Entered with subfun=82h. Returns address in HL. No parameter checking.

The FCB is for the file containing input data; with SUBMIT, this will be the SYSIN??.$$$ file. The file may be terminated with a 0FFh byte.

FCB-4:   Echo flag, 0=off, 1=on
FCB-3:   Display control characters 0=Y 1=N
FCB-2:   Used by GET ([SYSTEM]?).
FCB-1:   User number of input file.
FCB+0:   FCB for input file (no random access permitted)
FCB+21h: Record pointer, 0-80h (position within current record).
FCB+22h: Last character processed.
FCB+23h: Program input flag.
FCB+24h: 128-byte current record.

Function 3C/A0 - Immediately stop a SAVE [SAVE.RSX]

Entered with subfun=0A0h. No parameter checking.

Any resident SAVE RSX will be deactivated.


Non-standard RSX calls

Some RSXs do not use call 3Ch. Instead, they subvert an unused BDOS function number. Here are those I know of:


BDOS function 73 - Redefine character [REDEFINE.RSX]

Entered with C=49h, DE=parameter address.

The parameter is formed:

	DEFB	character_number
	DEFB	bitmap		;8 bytes

This is used in a PCW-specific program, REDEFINE.RSX. The calls from UDG.RSX should be used in preference to this call.


BDOS function 90 - Control GETERL extension [GETERL.RSX]

Entered with C=5Ah, DE=parameter.

GETERL.RSX is an extension written by me to allow the program return code to be passed from one program to another (the conventional CP/M 3 CCP resets it to zero). The parameter is either:

DE=0
Return the error code sent by the previous program using BDOS function 108 in HL.
DE=0100h
Reminder messages at warm boot (GETERL active) are disabled.
DE=0101h
Reminder messages at warm boot (GETERL active) are enabled.
DE=0FFFFh
Remove the GETERL extension.

Return to BDOS call listing

Return to archive listing