;****************************************************************************
;
;	M5b Z-80 Banked Monitor External Interface Definitions
;
;****************************************************************************
;
;	This file supplies the software interface definitions for the Vers.
; 1.22+ M5b Z-80 Banked Monitor ROMs. The definitions include the entry
; points at the beginning of the ROM as well as the function arguments. The
; function argument definitions are explained in the ZBM-122.DOC file.
;
;****************************************************************************
;
; Revision History:
;
; 1.00	11-26-90   grh
;	First cut.
;
; 1.01	1-13-91   GRH
;	Change clock function definitions for set clock.
;	Change character i/o function definitions to add AUX & AUX2 devices &
;	 single, separate device driver and system function calls.
;
;****************************************************************************
;
;   ENTRY ADDRESSES
;
MR_BASE	EQU	0F800H		;BASE ADDRESS OF ROM
;
;   MONITOR FUNCTIONS
;
MR_COLD	EQU	MR_BASE + 0	;COLD RESET OF SYSTEM
MR_FUN	EQU	MR_BASE + 6	;EXECUTE FUNCTION IN A (SEE FOLLOWING FOR #S)
;
;   SYSTEM CONSOLE FUNCTIONS
;
MR_CIS	EQU	MR_BASE + 18	;RETURN SYSTEM CONSOLE INPUT STATUS
MR_CI	EQU	MR_BASE + 3	;RETURN NEXT SYSTEM CONSOLE CHAR IN A
MR_COS	EQU	MR_BASE + 12	;RETURN SYSTEM CONSOLE OUTPUT STATUS IN A
MR_CO	EQU	MR_BASE + 9	;SEND CHAR IN C TO SYSTEM CONSOLE
MR_PUTS	EQU	MR_BASE + 51	;DISPLAY BIT-7 TERMINATED CHAR STRING (HL) ON
;				 SYSTEM CONSOLE
;
;   SYSTEM LIST DEVICE (PRINTER) FUNCTIONS
;
MR_LOS	EQU	MR_BASE + 39	;RETURN SYSTEM LIST DEVICE OUTPUT STATUS
MR_LO	EQU	MR_BASE + 15	;SEND CHAR IN C TO SYSTEM LIST DEVICE
;
;   BANKED MEMORY MANAGEMENT
;
MR_GMEM	EQU	MR_BASE + 21	;RETURN BANKED MEMORY (E:HL) CONTENTS IN A
MR_PMEM	EQU	MR_BASE + 24	;STORE DATA IN C TO BANKED MEMORY (E:HL)
MR_BSEL	EQU	MR_BASE + 27	;SELECT MEMORY BANK IN C
MR_SBNK	EQU	MR_BASE + 30	;SET SRC (B) & DEST (C) BANKS FOR BLOCK MOVE
MR_BMOV	EQU	MR_BASE + 33	;MOVE DATA (BC= CNT) FROM SRC (HL) TO
;				 DEST (DE) BANKS
MR_EXEC	EQU	MR_BASE + 36	;EXECUTE PROGRAM (E:HL) IN ANOTHER BANK
;
;   DEBUGGER SUPPORT
;
MR_BRK	EQU	MR_BASE + 42	;DEBUGGER BREAKPOINT ENTRY
MR_GOTO	EQU	MR_BASE + 45	;DEBUGGER INTERNAL PROCESS
MR_REST	EQU	MR_BASE + 48	;RESTART ERROR
;
;
;****************************************************************************
;
;	MONITOR FUNCTION DEFINITIONS
; NOTE:
;   ALL OTHER FUNCTION #S WILL RETURN -1 IN A (UNDEFINED FUNCTION ERROR)
;
;****************************************************************************
;
MF_VERS	EQU	0	;RETURN MONITOR VERSION IN HL IN HUNDREDTHS (X.XX)
MF_GMEM	EQU	1	;RETURN BANKED MEMORY (E:HL) DATA IN A
MF_PMEM	EQU	2	;STORE BANKED MEMORY (E:HL) DATA IN C
MF_EXEC	EQU	3	;EXECUTE PROCEDURE IN ANOTHER BANK (E:HL)
MF_SBNK	EQU	4	;SELECT SRC (B) & DEST (C) BANKS FOR BLOCK MOVE
MF_BMOV	EQU	5	;MOVE N (BC) BYTES FROM SRC (HL) TO DEST (DE) BANKS
MF_SELP	EQU	6	;SELECT NEW SS100 BUS PROCESSOR
MF_GBNK	EQU	7	;RETURN CURRENT BANK # IN A
MF_BSEL	EQU	9	;SELECT BANK IN C
;
MF_DVER	EQU	16	;RETURN DEBUGGER VERSION IN HL IN HUNDREDTHS (X.XX)
MF_XDEB	EQU	17	;EXECUTE THE DEBUGGER (DOES NOT RETURN)
MF_PHXN	EQU	19	;DISPLAY HEX NIBBLE IN C<3..0> ON SYSTEM CONSOLE
MF_PHXB	EQU	20	;DISPLAY HEX BYTE IN C ON SYSTEM CONSOLE
MF_PHXW	EQU	21	;DISPLAY HEX WORD IN HL ON SYSTEM CONSOLE
MF_PHXA	EQU	22	;DISPLAY HEX ADDRESS IN E:HL ON SYSTEM CONSOLE
MF_PUTS	EQU	23	;DIPLAY BIT-7 TERMINATED TEXT (HL) ON SYSTEM CONSOLE
;
MF_CVER	EQU	32	;RETURN CHAR I/O VERSION IN HL IN HUNDREDTHS (X.XX)
MF_XDFUN EQU	33	;EXECUTE CHAR DEVICE DRIVER FUNCTION
MF_SDEV	EQU	35	;SET STANDARD DEVICE
MF_AIS	EQU	36	;RETURN STANDARD AUX DEVICE INPUT STATUS
MF_AI	EQU	37	;RETURN STANDARD AUX DEVICE INPUT CHAR
MF_AOS	EQU	38	;RETURN STANDARD AUX DEVICE OUTPUT STATUS
MF_AO	EQU	39	;SEND CHAR TO STANDARD AUX DEVICE
MF_CIS	EQU	40	;RETURN SYSTEM CONSOLE INPUT STATUS IN A
MF_CI	EQU	41	;RETURN NEXT SYSTEM CONSOLE CHAR IN A
MF_COS	EQU	42	;RETURN SYSTEM CONSOLE OUTPUT STATUS IN A
MF_CO	EQU	43	;SEND CHAR IN C TO SYSTEM CONSOLE
MF_LOS	EQU	44	;RETURN SYSTEM LIST DEVICE OUTPUT STATUS IN A
MF_LO	EQU	45	;SEND CHAR IN C TO SYSTEM LIST DEVICE
MF_A2IS	EQU	46	;RETURN STANDARD AUX2 DEVICE INPUT STATUS
MF_A2I	EQU	47	;RETURN STANDARD AUX2 DEVICE INPUT CHAR
MF_A2OS	EQU	48	;RETURN STANDARD AUX2 DEVICE OUTPUT STATUS
MF_A2O	EQU	49	;SEND CHAR TO STANDARD AUX2 DEVICE
;
MF_KVER	EQU	64	;RETURN DISK DRIVER VERSION IN HL IN HUNDREDTHS (X.XX)
MF_BOOT	EQU	65	;BOOT FROM DISK IN BC
MF_TIOB	EQU	66	;TEST IOPB (E:HL) FOR ERROR & DISPLAY IOPB DATA IF TRUE
MF_DIOB	EQU	67	;DISPLAY IOPB (E:HL) DATA ON SYSTEM CONSOLE
MF_XIOB	EQU	68	;EXECUTE IOPB (E:HL)
;
MF_VVER	EQU	80	;RETURN MISC. DRIVER VERSION IN HL IN HUNDREDTHS (X.XX)
MF_SCAL	EQU	81	;SET CLOCK CALENDAR
MF_STIM	EQU	82	;SET CLOCK TIME
MF_GCAL	EQU	83	;RETURN CLOCK CALENDAR
MF_GTIM	EQU	84	;RETURN CLOCK TIME
MF_GREG	EQU	85	;RETURN CLOCK REGISTER DATA
MF_CSYN	EQU	86	;WAIT FOR CLOCK SYNC/TEST BOARD PRESENCE
MF_STPC	EQU	88	;STOP CLOCK
MF_STC	EQU	89	;START CLOCK

