;  SLAVE SUPORT PROCESS FOR CP/NET
;
;  1982.8.9.	BASE
;
TITLE	SLAVE SUPORT PROCESS FOR CP/NET
;
;  EQUATIONS OF DOS FUNCTIONS
;
CGTUSR	EQU	32		;GET/SET USER CODE
CLOGIN	EQU	64		;LOGIN
CSNDMS	EQU	66		;SEND MESSAGE
CRCVMS	EQU	67		;RECEIVE MESSAGE
CMAX	EQU	74		;CP/NET FUNCTION MAX
COPENQ	EQU	135		;OPEN QUEUE
CREADQ	EQU	137		;READ QUEUE
CWRITQ	EQU	139		;WRITE QUEUE
CDELAY	EQU	141		;DELAY
CCREAT	EQU	144		;CREATE PROCESS
CSYSDT	EQU	154		;GET SYSTEM DATA PAGE
CGTPDA	EQU	156		;GET CURRENT PROCESS DESCRIPTOR POINT
;
LNTFCB	EQU	39		;FILE CONTROL BLOCK LENGTH FOR CP/NET
;
;  BIAS OF PARAMETER AREA
;
BRTNUM	EQU	7		;FUNCTION ROUTINE NUMBER
BPDPNT	EQU	17		;PROCESS DESCRIPTOR POINTER
BQBUF	EQU	19		;QUEUE BUFFER POINTER
BFCB	EQU	21		;FCB AREA TOP
BSPLBF	EQU	476		;SPOOLER BUFFER
BQSPL	EQU	494		;UQCB FOR SPOOLER
BQIN	EQU	663		;NETWORK QUEUE IN UQCB TOP
BQOUT	EQU	675		;NETWORK QUEUE OUT UQCB TOP
BLNG	EQU	687		;PARAMETER BLOCK LENGTH
;
;  BDOS ENTRY POINTER
;
BDOSAD:
	DW	0		;SET BY OS
;
;  MAIN PROCESS DESCRIPTOR
;
	DW	0		;LINK TO NEXT PROCESS DESCRIPTOR
	DB	0		;STATUS
	DB	100		;PRIORITY
	DW	MAINST+38	;STACK POINTER VALUE
	DB	'Slave0SP'	;PROCESS NAME
	DB	0		;CONSOLE
	DB	0FFH		;MEMORY SEGMENT IS RESIDENT
	DW	0
	DW	0
	DW	0
	DB	0
	DW	0
	DB	0
	DW	0
	DW	0
	DW	0		;HL'
	DW	0		;DE'
	DW	0		;BC'
	DW	0		;AF'
	DW	0		;IY
	DW	0		;IX
	DW	0		;HL
	DW	0		;DE
	DW	0		;BC
	DW	0		;AF
	DW	0
;
;
;  COMMENT & USER ID
;
	DB	'COPTRIGHT (C) 1980, DIGITAL RESEARCH '
;
	DB	0,0,0,0,0,0
;
;  FILE CONTROL BLOCK FOR SPOOLING
;
SPLFCB:
	DB	1,'SLVxSPL0','TXT'
	DB	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
;
;  DATA FOR USER QUEUE CONTROL BLOCK
;
QCNTQU:
	DB	'NtwrkQIx'
;
UQSPOL:
	DW	0		;LINK TO QUEUE
	DW	0		;LINK TO BUFFER
	DB	'SPOOL   '
;
UQMXLT:
	DW	0		;LINK TO QUEUE
	DW	0		;LINK TO BUFFER
	DB	'MXList  '
;
UQMLBX:
	DW	0		;LINK TO QUEUE
	DW	Y19C4		;LINK TO BUFFER
	DB	'MailBoxQ'
;
;  BIT MASK DATA INDEX
;
IXBTMS:
	DW	0FFFEH		;BIT 0
	DW	0FFFDH		;    1
	DW	0FFFBH		;    2
	DW	0FFF7H		;    3
	DW	0FFEFH		;    4
	DW	0FFDFH		;    5
	DW	0FFBFH		;    6
	DW	0FF7FH		;    7
	DW	0FEFFH		;    8
	DW	0FDFFH		;    9
	DW	0FBFFH		;   10
	DW	0F7FFH		;   11
	DW	0EFFFH		;   12
	DW	0DFFFH		;   13
	DW	0BFFFH		;   14
	DW	07FFFH		;   15
;
;  CP/NET FUNCTION ROUTINE NUMBER INDEX
;
IXFNRT:
	DB	000H
	DB	000H
	DB	000H
	DB	001H
	DB	002H
	DB	003H
	DB	000H
	DB	000H
	DB	000H
	DB	000H
	DB	000H
	DB	004H
	DB	000H
	DB	000H
	DB	005H
	DB	006H
	DB	007H
	DB	008H
	DB	008H
	DB	009H
	DB	00AH
	DB	00BH
	DB	006H
	DB	009H
	DB	000H
	DB	000H
	DB	000H
	DB	000H
	DB	000H
	DB	000H
	DB	009H
	DB	000H
	DB	005H
	DB	00CH
	DB	00DH
	DB	00EH
	DB	00FH
	DB	010H
	DB	005H
	DB	010H
	DB	00DH
	DB	000H
	DB	000H
	DB	000H
	DB	000H
	DB	000H
	DB	000H
	DB	000H
	DB	000H
	DB	000H
	DB	000H
	DB	000H
	DB	000H
	DB	000H
	DB	000H
	DB	000H
	DB	000H
	DB	000H
	DB	000H
	DB	000H
	DB	000H
	DB	000H
	DB	000H
	DB	000H
	DB	011H
	DB	012H
	DB	013H
	DB	014H
	DB	000H
	DB	000H
	DB	000H
	DB	000H
	DB	000H
	DB	000H
	DB	000H
;
;
;  DATA FOR SPOOL START
;
T011C:
	DB	'.TEX[D]',0
;
;
;
A0124:
	DCX	SP
	LXI	H,D0001
	DAD	SP
	MOV	D,E
	PUSH	D
	INX	SP
	PUSH	B
	MOV	E,M
	INX	H
	MOV	D,M
	INX	H
	MOV	C,M
	MOV	M,E
	INX	H
	MOV	B,M
	MOV	M,D
	PUSH	B
	LXI	H,T0005
	DAD	SP
	MVI	M,0FFH
A013D:
	LXI	H,T0005
	DAD	SP
	MOV	A,M
	INR	A
	MOV	M,A
	DCX	H
	CMP	M
	JZ	A018C
	LXI	H,T0005
	DAD	SP
T014D:
	MOV	L,M
	MVI	H,000H
	LXI	D,T0027
	CALL	A167C
	PUSH	H
	PUSH	H
	LXI	H,T0006
	DAD	SP
	POP	D
	CALL	A1647
	POP	D
	PUSH	H
	LXI	H,D0001
	DAD	D
	PUSH	H
	LXI	H,T0006
	DAD	SP
	POP	D
	CALL	A1647
	DCX	D
	DCX	D
	DCX	D
	CALL	A16A9
	ORA	L
	SUI	001H
	SBB	A
	POP	H
	ANA	M
	RAR
	JNC	A0189
	LXI	H,T0005
	DAD	SP
	MOV	A,M
	POP	H
	POP	H
	POP	H
	POP	H
	RET
;
A0189:
	JMP	A013D
;
A018C:
	LXI	H,T0005
	DAD	SP
	MOV	A,M
	POP	H
	POP	H
	POP	H
	POP	H
	RET
;
;  CHECK SLAVE ID	ON STACK  SLAVE ID 1B
;  INPUT			  COUNTER  1B
;   C:SLAVE ID			  BIT DATA 2B
;  OUTPUT
;   A:-1 NOT FOUND  OTHER VECTOR NUMBER
;
CHKSID:
	DCX	SP
	PUSH	H
	MOV	B,C		;SAVE SLAVE ID
	PUSH	B
	INX	SP		;RESERVE 4 BYTE WORK
	LXI	H,1
	DAD	SP		;GET WORK POINT FOR COUNTER
	MVI	M,-1		;INITIALIZE COUNTER
	MVI	A,1
	INX	H
	MOV	M,A		;INITIALIZE BIT DATA
	INX	H
	MVI	M,0
CHKSIL:				;ONE BIT CHECK LOOP
	MVI	A,-1
	RAR
	JNC	CHKSIE		;ALWAYS FAILS   NOT USED
	LXI	H,1
	DAD	SP		;GET COUNTER POINT
	MOV	A,M
	INR	A		;COUNT UP
	MOV	M,A
	LHLD	Y19C0		;CONFIGRATION TABLE TOP
	INX	H
	INX	H
	CMP	M		;COMPARE WITH MAX SLAVE COUNT
	JNZ	CHKSIS		;NOT TO END
	MVI	A,-1		;NOT FOUND END
	POP	H
	POP	H
	RET
;
CHKSIS:				;CHECK ONE DATA
	LXI	B,4
	LHLD	Y19C0
	DAD	B		;GET SLAVE ID TABLE TOP
	PUSH	H
	LXI	H,4
	DAD	SP		;GET BIT DATA POINT
	POP	D
	CALL	A1652		;CHECK LOGIN VECTOR
	MVI	A,0
	CALL	A169D		;CHECK ZERO
	ORA	L
	JZ	CHKSIN		;NOT LOGIN SLAVE
	LXI	H,1
	DAD	SP
	MOV	C,M		;GET NUMBER OF VECTOR
	MVI	B,0
	LXI	H,6
	DAD	B		;GET BIAS TO SLAVE PROCESSOR ID BUFFER
	XCHG
	LHLD	Y19C0
	DAD	D		;GET SLAVE PROCESSOR ID BUFFER
	PUSH	H
	LXI	H,2
	DAD	SP
	MOV	A,M		;GET ID CODE
	POP	H
	CMP	M
	JNZ	CHKSIN		;NOT MATCH CHECK NEXT
	LXI	H,1		;MATCH CODE
	DAD	SP
	MOV	A,M		;GET VECTOR NUMBER
	POP	H
	POP	H
	RET
;
CHKSIN:
	LXI	H,2
	DAD	SP
	XCHG
	LXI	H,2
	DAD	SP
	CALL	A1638		;*2 FOR BIT SHIFT
	XCHG
	DCX	H
	MOV	M,E
	INX	H
	MOV	M,D		;SAVE NEW BIT DATA TO WORK
	JMP	CHKSIL		;TO NEXT BIT CHECK
;
CHKSIE:				;LOOP END ROUTINE		NOT USED
	POP	H
	POP	H
	RET
;
;  CHECK HEADER DATA		ON STACK  DATA BUFFER POINT 2B
;  INPUT
;  BC:DATA BUFFER TOP
;  OUTPUT
;  HL:BC
;  BC:RESULT
;   A:RESULT 0 OK  -1 ERROR
;
CHKHDR:
	PUSH	B		;SAVE DATA BUFFER POINT ON STACK
	LXI	D,3		;BIAS TO FUNCTION CODE
	LXI	H,
	DAD	SP		;GET DATA BUFFER POINTER POINT
	CALL	A1647		;GET FUNCTION CODE DATA POINT
	MVI	A,CMAX
	CMP	M
	JNC	$+9		;NOT FUNCTION CODE OVER
	LXI	B,-1		;OVER OF FUNCTION CODE
	POP	H
	MOV	A,C
	RET
;
	LXI	H,0
	DAD	SP
	MOV	C,M
	INX	H
	MOV	B,M		;GET DATA BUFFER POINT
	INX	B
	LHLD	Y19C0
	INX	H
	LDAX	B		;GET MASTER ID
	CMP	M		;COMPARE WITH MASTER ID IN CONFIGRATION TABLE
	JZ	$+9		;OK
	LXI	B,-1		;MISS MATCH OF MASTER ID
	POP	H
	MOV	A,C
	RET
;
	LXI	D,3		;BIAS TO FUNCTION CODE
	LXI	H,0
	DAD	SP
	CALL	A1647		;GET FUNCTION CODE POINT
	MOV	A,M
	CPI	CLOGIN
	JNZ	$+7			;NORMAL CODE
	MVI	A,0			;LOGIN CODE  SO NO CHECK OF SLAVE ID
	POP	H
	RET
;
	LXI	H,0			;NORMAL CODE SO CHECK SLAVE ID
	DAD	SP
	MOV	C,M
	INX	H
	MOV	B,M
	INX	B
	INX	B
	LDAX	B			;GET SLAVE ID CODE
	MOV	C,A
	CALL	CHKSID			;CHECK SLAVE ID CODE
	CPI	-1
	JNZ	$+9			;MATCH SLAVE ID
	LXI	B,-1			;NOT FOUND OF SLAVE ID
	POP	H
	MOV	A,C
	RET
;
	LXI	D,3
	LXI	H,0
	DAD	SP
	CALL	A1647
	MOV	A,M		;GET FUNCTION CODE
	SUI	CSNDMS		;CHECK SEND MESSAGE COMMAND
	SUI	1
	SBB	A
	PUSH	PSW
	MOV	A,M
	SUI	CRCVMS		;CHECK RECEIVE MESSAGE COMMAND
	SUI	1
	SBB	A
	POP	B
	MOV	C,B
	ORA	C
	RAR
	JNC	$+9		;NOT MAIL COMMAND
	LDA	Y19C3		;GET MAIL BOX MODE  -1 ON
	CMA
	POP	H
	RET
;
	MVI	A,0		;SUCCESS END
	POP	H
	RET
;
;  EACH PROCESS COMMON ROUTINE   REENTRANT
;  INPUT
;   C:CHANEL NUMBER
;
CSTART:
	LXI	H,-BLNG+1
	DAD	SP		;STACK POINTER TO UPPER AREA OF DATA AREA
	SPHL
	MOV	B,C
	PUSH	B		;SET CHANEL NUMBER
	INX	SP
	LXI	D,0
	MVI	C,CGTPDA
	CALL	BDOS		;GET PROCESS DESCRIPTOR ADDRESS
	XCHG
	LXI	H,BPDPNT
	DAD	SP
	MOV	M,E
	INX	H
	MOV	M,D		;SET PROCESS DESCRIPTOR POINT
	LXI	H,BQBUF
	DAD	SP		;GET QUEUE BUFFER POINT
	XCHG
	LXI	H,BQIN+2
	DAD	SP
	MOV	M,E
	INX	H
	MOV	M,D		;SET BUFFER POINT TO INPUT UQCB
	MVI	L,7		;COPY LENGTH
	PUSH	H
	LXI	H,BQIN+4+2
	DAD	SP		;GET NAME POINT FOR UQCB
	XCHG
	LXI	B,QCNTQU	;NAME DATA POINTER
	POP	H
	LDAX	B
	STAX	D		;COPY NAME
	INX	B
	INX	D
	DCR	L
	JNZ	$-5
	LXI	H,0
	DAD	SP
	MOV	A,M		;GET CHANEL
	CPI	10
	JNC	CMSTQI		;OVER A
	MVI	A,'0'		;0 TO 9
	LXI	H,0
	DAD	SP
	ADD	M		;MAKE QUEUE NAME CODE
	LXI	H,BQIN+11
	DAD	SP
	MOV	M,A		;SET TO NAME DATA
	JMP	CMSTIW
;
CMSTQI:				;OVER A
	MVI	A,'A'
	LXI	H,0
	DAD	SP
	ADD	M		;MAKE QUEUE NAME CODE
	SUI	10
	LXI	H,BQIN+11
	DAD	SP
	MOV	M,A		;SET TO NAME DATA
CMSTIW:
	LXI	H,BQIN
	DAD	SP		;GET UQCB POINT
	XCHG
	MVI	C,COPENQ
	CALL	BDOS		;OPEN QUEUE
	CPI	0
	JZ	CMSTIO		;OK
	LXI	D,1		;CAN'T OPEN
	MVI	C,CDELAY
	CALL	BDOS		;DELAY FOR MAKE QUEUE 
	JMP	CMSTIW		;RETRY
;
CMSTIO:
	LXI	H,BQBUF
	DAD	SP
	XCHG
	LXI	H,BQOUT+2
	DAD	SP
	MOV	M,E
	INX	H
	MOV	M,D		;SET BUFFER POINTER IN UQCB FOR OUT
	MVI	L,6		;COUNT OF NAME COPY
	PUSH	H
	LXI	H,BQOUT+4+2
	DAD	SP
	XCHG
	LXI	B,QCNTQU	;DATA POINT
	POP	H
	LDAX	B
	STAX	D		;COPY NAME
	INX	B
	INX	D
	DCR	L
	JNZ	$-5
	LXI	H,BQOUT+10
	DAD	SP
	MVI	M,'O'		;"NtwrkQOx"
	LXI	H,0
	DAD	SP
	MOV	A,M		;GET CHANEL
	CPI	10
	JNC	CMSTQO		;OVER A
	MVI	A,'0'		;0 TO 9
	LXI	H,0
	DAD	SP
	ADD	M		;MAKE QUEUE NUMBER CODE
	LXI	H,BQOUT+11
	DAD	SP
	MOV	M,A		;SET NUMBER
	JMP	CMSTOW
;
CMSTQO:				;OVER A
	MVI	A,'A'
	LXI	H,0
	DAD	SP
	ADD	M		;MAKE QUEUE NUMBER CODE
	SUI	10
	LXI	H,BQOUT+11
	DAD	SP
	MOV	M,A		;SET NUMBER
CMSTOW:
	LXI	H,BQOUT
	DAD	SP
	XCHG
	MVI	C,COPEN
	CALL	BDOS		;OPEN QUEUE
	CPI	0
	JZ	CMSTOO		;OK
	LXI	D,1		;CAN'T OPEN
	MVI	C,CDELAY
	CALL	BDOS		;DELAY FOR MAKE QUEUE
	JMP	CMSTOW
;
CMSTOO:
	LXI	H,1
	DAD	SP
	MVI	M,0		;CLEAR FCB INITIALIZE COUNT
CMSTFL:
	MVI	A,7		;COUNT OF RESERVED FCB AREA
	LXI	H,1
	DAD	SP
	CMP	M		;CHECK END
	JC	CMSTFE		;ALL OVER
	LXI	H,1
	DAD	SP
	MOV	L,M		;GET COUNT
	MVI	H,0
	LXI	D,LNTFCB	;RESERVED FCB LENGTH
 	CALL	A167C		;GET BIAS
	XCHG
	LXI	H,BFCB		;BIAS TO FCB AREA TOP
	DAD	SP
	DAD	D		;GET FCB DATA POINT
	MVI	M,0		;CLEAR FLAG
	LXI	H,1
	DAD	SP
	MOV	A,M
	INR	A		;COUNT UP
	MOV	M,A
	JNZ	CMSTFL		;TO NEXT FCB
CMSTFE:				;ALL FCB OVER
	LXI	H,4
	DAD	SP
	MVI	M,0		;CLEAR
	LXI	H,10
	DAD	SP
	MVI	M,0		;CLEAR
	LDA	Y19C2		;GET SPOOL MODE
	RAR
	JNC	CMLOOP		;NO SPOOL
	LHLD	UQSPOL		;GET SPOOL QUEUE POINTER
	XCHG
	LXI	H,BQSPL		;BIAS OF UQCB FOR SPOOL
	DAD	SP
	MOV	M,E
	INX	H
	MOV	M,D		;SET LINK TO SPOOLER QUEUE
	LXI	H,BSPLBF	;BIAS OF SPOOLER BUFFER
	DAD	SP
	XCHG
	LXI	H,BQSPL+2
	DAD	SP
	MOV	M,E
	INX	H
	MOV	M,D		;SET POINTER TO SPOOLER QUEUE
;
;
CMLOOP:				;LOOP OF ONE MESSAGE EXCHANGE
	MVI	A,-1
	RAR
	JNC	CMLPRT		;ALWAYS FAIL	NOT USED
	LXI	H,BQIN
	DAD	SP
	XCHG
	MVI	C,CREADQ
	CALL	BDOS		;GET DATA FROM NETWORKIF
	LXI	B,-1
	LXI	H,5
	DAD	SP
	MOV	M,C		;INITIALIZE DATA
	INX	H
	MVI	M,0
	LXI	D,3
	LXI	H,BPDPNT
	DAD	SP
	CALL	A1647		;GET POINTER OF FUNCTION CODE
	MOV	C,M		;GET FUNCTION CODE OF MESSAGE
	MVI	B,0
	LXI	H,IXFNRT	;ROUTINE INDEX
	DAD	B
	MOV	A,M		;GET ROUTINE NUMBER
	LXI	H,BRTNUM
	DAD	SP
	MOV	M,A		;SET ROUTINE NUMBER
	LXI	H,BPDPNT
	DAD	SP
	MOV	C,M
	INX	H
	MOV	B,M		;GET DATA BUFFER POINT
	CALL	CHKHDR		;CHECK HEADER DATA PARAMETER
	RAR
	JNC	CMLPRD		;OK
	LXI	H,6		;ERROR
	DAD	SP
	MVI	M,-1
	JMP	CMLPEN
;
CMLPRD:
	LXI	H,BRTNUM
	DAD	SP
	MOV	C,M		;GET ROUTINE NUMBER
	MVI	B,000H
	LXI	H,IXMAIN	;ROUTINE INDEX
	DAD	B
	DAD	B
	MOV	E,M
	INX	H
	MOV	D,M		;GET TARGET ROUTINE
	XCHG
	PCHL			;TO EACH ROUTINE
;
;  ROUTINES OF EACH FUNCTION
;
;
A042C:
	JMP	CMLPEN
;
A042F:
	LXI	D,T0005
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	MOV	E,M
	MVI	D,000H
	LXI	H,T0900
	DAD	D
	XCHG
	MVI	C,000H
	CALL	A162D
	LXI	H,T0006
	DAD	SP
	MOV	M,A
	JMP	CMLPEN
;
A044E:
	LXI	D,T0006
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	LXI	B,T0005
	DCX	D
	PUSH	H
	CALL	A163B
	MOV	E,M
	MVI	D,000H
	LXI	H,T0C00
	DAD	D
	XTHL
	MOV	C,M
	POP	D
	CALL	A162D
	LXI	H,D0001
	DAD	SP
	MOV	M,A
	JMP	CMLPEN
;
A0475:
	LXI	H,T000A
	DAD	SP
	MOV	A,M
	CMA
	RAR
	J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08BH
	CALL	BDOS
	LXI	D,D0001
	MVI	C,027H
	CALL	BDOS
A0622:
	JMP	A062D
;
A0625:
	LXI	D,UQMXLT
	MVI	C,08BH
	CALL	BDOS
A062D:
	JMP	A0690
;
A0630:
	LDA	Y19C2
	RAR
	JNC	A0684
	LXI	H,T01F2
	DAD	SP
	MOV	C,M
	MVI	B,000H
	LXI	H,T01F3
	DAD	SP
	DAD	B
	PUSH	H
	LXI	H,T0005
	DAD	SP
	MOV	A,M
	POP	H
	MOV	M,A
	LXI	H,T01F2
	DAD	SP
	MOV	A,M
	INR	A
	MOV	M,A
	CPI	080H
	JNZ	A0681
	LXI	H,T01F2
	DAD	SP
	MVI	M,000H
	LXI	H,T01F3
	DAD	SP
	XCHG
	MVI	C,01AH
	CALL	BDOS
	LXI	H,T0273
	DAD	SP
	XCHG
	MVI	C,015H
	CALL	BDOS
	CPI	0FFH
	JNZ	A0681
	LXI	H,019C2H
	MVI	M,000H
	LXI	H,T000A
	DAD	SP
	MVI	M,000H
A0681:
	JMP	A0690
;
A0684:
	LXI	H,T0003
	DAD	SP
	MOV	E,M
	MVI	D,000H
	MVI	C,005H
	CALL	BDOS
A0690:
	LXI	H,D0001
	DAD	SP
	MOV	A,M
	INR	A
	MOV	M,A
	JNZ	A0552
A069A:
	JMP	CMLPEN
;
A069D:
	LXI	D,T0005
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	MOV	E,M
	MVI	D,000H
	LXI	H,T0600
	DAD	D
	XCHG
	MVI	C,000H
	CALL	A162D
	LXI	H,T0006
	DAD	SP
	MOV	M,A
	JMP	CMLPEN
;
A06BC:
	LXI	D,T0003
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	LXI	B,T0005
	DCX	D
	PUSH	H
	CALL	A163B
	MOV	E,M
	INX	H
	MOV	D,M
	POP	H
	MOV	C,M
	CALL	BDOS
	LXI	H,D0001
	DAD	SP
	MOV	M,A
	LXI	D,T0003
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	MOV	A,M
	CPI	020H
	JNZ	A0718
	LXI	D,T0005
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	MOV	A,M
	CPI	0FFH
	JNZ	A0708
	LXI	H,D0001
	DAD	SP
	MOV	A,M
	LXI	H,T0006
	DAD	SP
	MOV	M,A
	JMP	A0718
;
A0708:
	LXI	D,T0005
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	MOV	A,M
	LXI	H,T0004
	DAD	SP
	MOV	M,A
A0718:
	JMP	CMLPEN
;
A071B:
	LXI	D,T0005
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	MOV	C,M
	INX	H
	MOV	B,M
	PUSH	B
	INX	D
	MOV	B,D
	MOV	C,E
	MVI	E,008H
	CALL	A0124
	LXI	H,T0002
	DAD	SP
	MOV	M,A
	LXI	H,T0002
	DAD	SP
	MOV	A,M
	SUI	008H
	SUI	001H
	SBB	A
	CMA
	DCX	H
	MOV	M,A
	MOV	A,M
	CMA
	RAR
	JNC	A078D
	LXI	H,T0002
	DAD	SP
	MVI	M,000H
A074F:
	LXI	H,D0001
	DAD	SP
	MOV	A,M
	CMA
	INX	H
	PUSH	PSW
	MOV	A,M
	SUI	008H
	ADI	0FFH
	SBB	A
	POP	B
	MOV	C,B
	ANA	C
	RAR
	JNC	A078D
	LXI	H,T0002
	DAD	SP
	MOV	L,M
	MVI	H,000H
	LXI	D,T0027
	CALL	A167C
	XCHG
	LXI	H,T0015
	DAD	SP
	DAD	D
	MOV	A,M
	CMA
	LXI	H,D0001
	DAD	SP
	MOV	M,A
	CMA
	RAR
	JNC	A078A
	LXI	H,T0002
	DAD	SP
	MOV	A,M
	INR	A
	MOV	M,A
A078A:
	JMP	A074F
;
A078D:
	LXI	H,D0001
	DAD	SP
	MOV	A,M
	CMA
	LXI	H,T0006
	DAD	SP
	MOV	M,A
	CMA
	RAR
	JNC	A0831
	LXI	H,T0002
	DAD	SP
	MOV	L,M
	MVI	H,000H
	LXI	D,T0027
	CALL	A167C
	XCHG
	LXI	H,T0015
	DAD	SP
	DAD	D
	XCHG
	LXI	H,T014D
	DAD	SP
	MOV	M,E
	INX	H
	MOV	M,D
	DCX	H
	MOV	C,M
	INX	H
	MOV	B,M
	MOV	H,B
	MOV	L,C
	LXI	B,0FFFFH
	MOV	M,C
	LXI	D,T0005
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	PUSH	H
	LXI	H,T014F
	DAD	SP
	MOV	C,M
	INX	H
	MOV	B,M
	INX	B
	POP	H
	PUSH	B
	MOV	C,M
	INX	H
	MOV	B,M
	POP	H
	MOV	M,C
	INX	H
	MOV	M,B
	MVI	L,00DH
	LXI	D,T0007
	PUSH	H
	LXI	H,T0015
	DAD	SP
	CALL	A1647
	LXI	D,T0003
	PUSH	H
	LXI	H,T0151
	DAD	SP
	CALL	A1647
	XCHG
	POP	B
	POP	H
A07F9:
	LDAX	B
	STAX	D
	INX	B
	INX	D
	DCR	L
	JNZ	A07F9
	LXI	D,T0003
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	LXI	D,T0003
	PUSH	H
	LXI	H,T014F
	DAD	SP
	CALL	A1647
	XTHL
	MOV	C,M
	POP	D
	CALL	BDOS
	LXI	H,T0006
	DAD	SP
	MOV	M,A
	CPI	0FFH
	JNZ	A0831
	LXI	H,T014D
	DAD	SP
	MOV	C,M
	INX	H
	MOV	B,M
	MOV	H,B
	MOV	L,C
	MVI	M,000H
A0831:
	JMP	CMLPEN
;
A0834:
	LXI	D,T0005
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	MOV	C,M
	INX	H
	MOV	B,M
	PUSH	B
	INX	D
	MOV	B,D
	MOV	C,E
	MVI	E,008H
	CALL	A0124
	LXI	H,T0002
	DAD	SP
	MOV	M,A
	CPI	008H
	JZ	A0887
	LXI	H,T0002
	DAD	SP
	MOV	L,M
	MVI	H,000H
	LXI	D,T0027
	CALL	A167C
	XCHG
	LXI	H,T0015
	DAD	SP
	DAD	D
	XCHG
	LXI	H,T014D
	DAD	SP
	MOV	M,E
	INX	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	060H
	MOV	C,A
	MVI	B,000H
	LXI	H,T0151
	DAD	SP
	DAD	B
	PUSH	H
	LXI	H,T0008
	DAD	SP
	MOV	A,M
	POP	H
	SUB	M
	ADI	0FFH
	SBB	A
	POP	B
	MOV	C,B
	ANA	C
	RAR
	JNC	A095F
	LXI	D,A0000
	MVI	C,012H
	CALL	BDOS
	LXI	H,T0006
	DAD	SP
	MOV	M,A
	JMP	A0924
;
A095F:
	LXI	D,T0005
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	PUSH	H
	LXI	H,T0008
	DAD	SP
	MOV	A,M
	POP	H
	MOV	M,A
	CPI	0FFH
	JZ	A09D7
	LXI	H,T0005
	DAD	SP
	MVI	M,000H
	MVI	L,020H
	MVI	A,003H
	PUSH	H
	LXI	H,T0008
	DAD	SP
	ANA	M
	MOV	L,A
	MVI	H,000H
	LXI	D,T0020
	CALL	A167C
	XCHG
	LXI	H,T0151
	DAD	SP
	DAD	D
	LXI	D,T0006
	PUSH	H
	LXI	H,T0017
	DAD	SP
	CALL	A1647
	XCHG
	POP	B
	POP	H
A09A3:
	LDAX	B
	STAX	D
	INX	B
	INX	D
	DCR	L
	JNZ	A09A3
	LXI	D,T0004
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	MVI	M,020H
	LXI	H,T0005
	LXI	D,T0017
	PUSH	H
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	PUSH	H
	LXI	H,T0010
	DAD	SP
	XCHG
	POP	B
	POP	H
A09CD:
	LDAX	B
	STAX	D
	INX	B
	INX	D
	DCX	H
	MOV	A,H
	ORA	L
	JNZ	A09CD
A09D7:
	JMP	CMLPEN
;
A09DA:
	LXI	D,T0003
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	LXI	B,T0005
	DCX	D
	PUSH	H
	CALL	A163B
	XTHL
	MOV	C,M
	POP	D
	CALL	BDOS
	LXI	H,T0006
	DAD	SP
	MOV	M,A
	JMP	CMLPEN
;
A09FA:
	LXI	H,T0005
	DAD	SP
	MVI	M,000H
	LXI	D,T0004
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	MVI	M,082H
	LXI	D,T0005
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	MOV	C,M
	INX	H
	MOV	B,M
	PUSH	B
	INX	D
	MOV	B,D
	MOV	C,E
	MVI	E,008H
	CALL	A0124
	LXI	H,T0002
	DAD	SP
	MOV	M,A
	CPI	008H
	JZ	A0AD8
	LXI	H,T0002
	DAD	SP
	MOV	L,M
	MVI	H,000H
	LXI	D,T0027
	CALL	A167C
	XCHG
	LXI	H,T0015
	DAD	SP
	DAD	D
	XCHG
	LXI	H,T014D
	DAD	SP
	MOV	M,E
	INX	H
	MOV	M,D
	LXI	D,T0007
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	LXI	D,T000F
	PUSH	H
	LXI	H,T014F
	DAD	SP
	CALL	A1647
	POP	B
	LDAX	B
	MOV	M,A
	LXI	D,T0008
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	LXI	D,T0023
	PUSH	H
	LXI	H,T014F
	DAD	SP
	CALL	A1647
	POP	B
	LDAX	B
	MOV	M,A
	LXI	D,T0007
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	XCHG
	MVI	C,01AH
	CALL	BDOS
	LXI	D,T0003
	LXI	H,T014D
	DAD	SP
	CALL	A1647
	XCHG
	MVI	C,014H
	CALL	BDOS
	LXI	D,T0087
	LXI	H,T0013
	DAD	SP
	PUSH	PSW
	CALL	A1647
	POP	B
	MOV	C,B
	MOV	M,C
	LXI	D,T000F
	LXI	H,T014D
	DAD	SP
	CALL	A1647
	LXI	D,T0005
	PUSH	H
	LXI	H,T0015
	DAD	SP
	CALL	A1647
	POP	B
	LDAX	B
	MOV	M,A
	LXI	D,T0023
	LXI	H,T014D
	DAD	SP
	CALL	A1647
	LXI	D,T0006
	PUSH	H
	LXI	H,T0015
	DAD	SP
	CALL	A1647
	POP	B
	LDAX	B
	MOV	M,A
	JMP	A0AE4
;
A0AD8:
	LXI	D,T0087
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	MVI	M,0FFH
A0AE4:
	JMP	CMLPEN
;
A0AE7:
	LXI	H,T0005
	DAD	SP
	MVI	M,000H
	LXI	D,T0004
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	MVI	M,002H
	LXI	D,T0005
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	MOV	C,M
	INX	H
	MOV	B,M
	PUSH	B
	INX	D
	MOV	B,D
	MOV	C,E
	MVI	E,008H
	CALL	A0124
	LXI	H,T0002
	DAD	SP
	MOV	M,A
	CPI	008H
	JZ	A0BC5
	LXI	H,T0002
	DAD	SP
	MOV	L,M
	MVI	H,000H
	LXI	D,T0027
	CALL	A167C
	XCHG
	LXI	H,T0015
	DAD	SP
	DAD	D
	XCHG
	LXI	H,T014D
	DAD	SP
	MOV	M,E
	INX	H
	MOV	M,D
	LXI	D,T0007
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	LXI	D,T000F
	PUSH	H
	LXI	H,T014F
	DAD	SP
	CALL	A1647
	POP	B
	LDAX	B
	MOV	M,A
	LXI	D,T0008
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	LXI	D,T0023
	PUSH	H
	LXI	H,T014F
	DAD	SP
	CALL	A1647
	POP	B
	LDAX	B
	MOV	M,A
	LXI	D,T0009
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	XCHG
	MVI	C,01AH
	CALL	BDOS
	LXI	D,T0003
	LXI	H,T014D
	DAD	SP
	CALL	A1647
	XCHG
	MVI	C,015H
	CALL	BDOS
	LXI	D,T0007
	LXI	H,T0013
	DAD	SP
	PUSH	PSW
	CALL	A1647
	POP	B
	MOV	C,B
	MOV	M,C
	LXI	D,T000F
	LXI	H,T014D
	DAD	SP
	CALL	A1647
	LXI	D,T0005
	PUSH	H
	LXI	H,T0015
	DAD	SP
	CALL	A1647
	POP	B
	LDAX	B
	MOV	M,A
	LXI	D,T0023
	LXI	H,T014D
	DAD	SP
	CALL	A1647
	LXI	D,T0006
	PUSH	H
	LXI	H,T0015
	DAD	SP
	CALL	A1647
	POP	B
	LDAX	B
	MOV	M,A
	JMP	A0BD1
;
A0BC5:
	LXI	D,T0007
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	MVI	M,0FFH
A0BD1:
	JMP	CMLPEN
;
A0BD4:
	LXI	H,T0005
	DAD	SP
	MVI	M,000H
	LXI	D,T0004
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	MVI	M,082H
	LXI	D,T0005
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	MOV	C,M
	INX	H
	MOV	B,M
	PUSH	B
	INX	D
	MOV	B,D
	MOV	C,E
	MVI	E,008H
	CALL	A0124
	LXI	H,T0002
	DAD	SP
T0C00:
	MOV	M,A
	CPI	008H
	JZ	A0CA5
	LXI	H,T0002
	DAD	SP
	MOV	L,M
	MVI	H,000H
	LXI	D,T0027
	CALL	A167C
	XCHG
	LXI	H,T0015
	DAD	SP
	DAD	D
	XCHG
	LXI	H,T014D
	DAD	SP
	MOV	M,E
	INX	H
	MOV	M,D
	MVI	L,003H
	LXI	D,T0007
	PUSH	H
	LXI	H,T0015
	DAD	SP
	CALL	A1647
	LXI	D,T0024
	PUSH	H
	LXI	H,T0151
	DAD	SP
	CALL	A1647
	XCHG
	POP	B
	POP	H
A0C3C:
	LDAX	B
	STAX	D
	INX	B
	INX	D
	DCR	L
	JNZ	A0C3C
	LXI	D,T0007
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	XCHG
	MVI	C,01AH
	CALL	BDOS
	LXI	D,T0003
	LXI	H,T014D
	DAD	SP
	CALL	A1647
	XCHG
	MVI	C,021H
	CALL	BDOS
	LXI	D,T0087
	LXI	H,T0013
	DAD	SP
	PUSH	PSW
	CALL	A1647
	POP	B
	MOV	C,B
	MOV	M,C
	LXI	D,T000F
	LXI	H,T014D
	DAD	SP
	CALL	A1647
	LXI	D,T0005
	PUSH	H
	LXI	H,T0015
	DAD	SP
	CALL	A1647
	POP	B
	LDAX	B
	MOV	M,A
	LXI	D,T0023
	LXI	H,T014D
	DAD	SP
	CALL	A1647
	LXI	D,T0006
	PUSH	H
	LXI	H,T0015
	DAD	SP
	CALL	A1647
	POP	B
	LDAX	B
	MOV	M,A
	JMP	A0CB1
;
A0CA5:
	LXI	D,T0087
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	MVI	M,0FFH
A0CB1:
	JMP	CMLPEN
;
A0CB4:
	LXI	H,T0005
	DAD	SP
	MVI	M,000H
	LXI	D,T0004
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	MVI	M,002H
	LXI	D,T0005
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	MOV	C,M
	INX	H
	MOV	B,M
	PUSH	B
	INX	D
	MOV	B,D
	MOV	C,E
	MVI	E,008H
	CALL	A0124
	LXI	H,T0002
	DAD	SP
	MOV	M,A
	CPI	008H
	JZ	A0D90
	LXI	H,T0002
	DAD	SP
	MOV	L,M
	MVI	H,000H
	LXI	D,T0027
	CALL	A167C
	XCHG
	LXI	H,T0015
	DAD	SP
	DAD	D
	XCHG
	LXI	H,T014D
	DAD	SP
	MOV	M,E
	INX	H
	MOV	M,D
	MVI	L,003H
	LXI	D,T0007
	PUSH	H
	LXI	H,T0015
	DAD	SP
	CALL	A1647
	LXI	D,T0024
	PUSH	H
	LXI	H,T0151
	DAD	SP
	CALL	A1647
	XCHG
	POP	B
	POP	H
A0D1C:
	LDAX	B
	STAX	D
	INX	B
	INX	D
	DCR	L
	JNZ	A0D1C
	LXI	D,T000A
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	XCHG
	MVI	C,01AH
	CALL	BDOS
	LXI	D,T0003
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	LXI	D,T0003
	PUSH	H
	LXI	H,T014F
	DAD	SP
	CALL	A1647
	XTHL
	MOV	C,M
	POP	D
	CALL	BDOS
	LXI	D,T0007
	LXI	H,T0013
	DAD	SP
	PUSH	PSW
	CALL	A1647
	POP	B
	MOV	C,B
	MOV	M,C
	LXI	D,T000F
	LXI	H,T014D
	DAD	SP
	CALL	A1647
	LXI	D,T0005
	PUSH	H
	LXI	H,T0015
	DAD	SP
	CALL	A1647
	POP	B
	LDAX	B
	MOV	M,A
	LXI	D,T0023
	LXI	H,T014D
	DAD	SP
	CALL	A1647
	LXI	D,T0006
	PUSH	H
	LXI	H,T0015
	DAD	SP
	CALL	A1647
	POP	B
	LDAX	B
	MOV	M,A
	JMP	A0D9C
;
A0D90:
	LXI	D,T0007
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	MVI	M,0FFH
A0D9C:
	JMP	CMLPEN
;
A0D9F:
	LXI	H,T0005
	DAD	SP
	MVI	M,000H
	LXI	D,T0004
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	MVI	M,005H
	LXI	D,T0005
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	MOV	C,M
	INX	H
	MOV	B,M
	PUSH	B
	INX	D
	MOV	B,D
	MOV	C,E
	MVI	E,008H
	CALL	A0124
	LXI	H,T0002
	DAD	SP
	MOV	M,A
	CPI	008H
	JZ	A0E60
	LXI	H,T0002
	DAD	SP
	MOV	L,M
	MVI	H,000H
	LXI	D,T0027
	CALL	A167C
	XCHG
	LXI	H,T0015
	DAD	SP
	DAD	D
	XCHG
	LXI	H,T014D
	DAD	SP
	MOV	M,E
	INX	H
	MOV	M,D
	LXI	D,T0003
	LXI	H,T014D
	DAD	SP
	CALL	A1647
	XCHG
	MVI	C,023H
	CALL	BDOS
	LXI	D,T000A
	LXI	H,T0013
	DAD	SP
	PUSH	PSW
	CALL	A1647
	POP	B
	MOV	C,B
	MOV	M,C
	LXI	D,T000F
	LXI	H,T014D
	DAD	SP
	CALL	A1647
	LXI	D,T0005
	PUSH	H
	LXI	H,T0015
	DAD	SP
	CALL	A1647
	POP	B
	LDAX	B
	MOV	M,A
	LXI	D,T0023
	LXI	H,T014D
	DAD	SP
	CALL	A1647
	LXI	D,T0006
	PUSH	H
	LXI	H,T0015
	DAD	SP
	CALL	A1647
	POP	B
	LDAX	B
	MOV	M,A
	MVI	L,003H
	LXI	D,T0024
	PUSH	H
	LXI	H,T014F
	DAD	SP
	CALL	A1647
	LXI	D,T0007
	PUSH	H
	LXI	H,T0017
	DAD	SP
	CALL	A1647
	XCHG
	POP	B
	POP	H
A0E55:
	LDAX	B
	STAX	D
	INX	B
	INX	D
	DCR	L
	JNZ	A0E55
	JMP	A0E6C
;
A0E60:
	LXI	D,T000A
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	MVI	M,0FFH
A0E6C:
	JMP	CMLPEN
;
A0E6F:
	LXI	H,T0005
	DAD	SP
	MVI	M,000H
	LXI	D,T0004
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	MVI	M,003H
	LXI	D,T0005
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	MOV	C,M
	INX	H
	MOV	B,M
	PUSH	B
	INX	D
	MOV	B,D
	MOV	C,E
	MVI	E,008H
	CALL	A0124
	LXI	H,T0002
	DAD	SP
	MOV	M,A
	CPI	008H
	JZ	A0F30
	LXI	H,T0002
	DAD	SP
	MOV	L,M
	MVI	H,000H
	LXI	D,T0027
	CALL	A167C
	XCHG
	LXI	H,T0015
	DAD	SP
	DAD	D
	XCHG
	LXI	H,T014D
	DAD	SP
	MOV	M,E
	INX	H
	MOV	M,D
	LXI	D,T0007
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	LXI	D,T000F
	PUSH	H
	LXI	H,T014F
	DAD	SP
	CALL	A1647
	POP	B
	LDAX	B
	MOV	M,A
	LXI	D,T0008
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	LXI	D,T0023
	PUSH	H
	LXI	H,T014F
	DAD	SP
	CALL	A1647
	POP	B
	LDAX	B
	MOV	M,A
	LXI	D,T0003
	LXI	H,T014D
	DAD	SP
	CALL	A1647
	XCHG
	MVI	C,024H
	CALL	BDOS
	LXI	D,T0008
	LXI	H,T0013
	DAD	SP
	PUSH	PSW
	CALL	A1647
	POP	B
	MOV	C,B
	MOV	M,C
	MVI	L,003H
	LXI	D,T0024
	PUSH	H
	LXI	H,T014F
	DAD	SP
	CALL	A1647
	LXI	D,T0005
	PUSH	H
	LXI	H,T0017
	DAD	SP
	CALL	A1647
	XCHG
	POP	B
	POP	H
A0F25:
	LDAX	B
	STAX	D
	INX	B
	INX	D
	DCR	L
	JNZ	A0F25
	JMP	A0F3C
;
A0F30:
	LXI	D,T0008
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	MVI	M,0FFH
A0F3C:
	JMP	CMLPEN
;
A0F3F:
	LXI	D,T0003
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	LXI	B,T0005
	DCX	D
	PUSH	H
	CALL	A163B
	MOV	E,M
	INX	H
	MOV	D,M
	POP	H
	MOV	C,M
	CALL	BDOS
	LXI	H,T0006
	DAD	SP
	MOV	M,A
	MVI	A,001H
	LXI	H,T0008
	DAD	SP
	MOV	M,A
	INX	H
	MVI	M,000H
	LXI	H,D0001
	DAD	SP
	MVI	M,000H
A0F6E:
	MVI	A,00FH
	LXI	H,D0001
	DAD	SP
	CMP	M
	JC	A100C
	LXI	D,T0005
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	XCHG
	LXI	H,T0008
	DAD	SP
	CALL	A1652
	MVI	A,000H
	CALL	A169D
	ORA	L
	JZ	A0FF1
	LXI	H,T0002
	DAD	SP
	MVI	M,000H
A0F99:
	MVI	A,007H
	LXI	H,T0002
	DAD	SP
	CMP	M
	JC	A0FF1
	LXI	H,T0002
	DAD	SP
	MOV	L,M
	MVI	H,000H
	LXI	D,T0027
	CALL	A167C
	XCHG
	LXI	H,T0015
	DAD	SP
	DAD	D
	XCHG
	LXI	H,T014D
	DAD	SP
	MOV	M,E
	INX	H
	MOV	M,D
	DCX	H
	MOV	C,M
	INX	H
	MOV	B,M
	LXI	D,T0003
	DCX	H
	CALL	A1647
	PUSH	H
	LXI	H,T0003
	DAD	SP
	MOV	A,M
	INR	A
	POP	H
	SUB	M
	SUI	001H
	SBB	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CA
	MVI	H,000H
	CALL	A167C
	LXI	B,D0001
	DAD	B
	XCHG
	LHLD	Y19C6
	DAD	D
	MOV	A,M
	INR	A
	LHLD	Y19C4
	MOV	L,M
	MVI	H,000H
	MOV	E,A
	MVI	D,000H
	CALL	A165D
	LXI	D,T0005
	PUSH	H
	LHLD	Y19CA
	MVI	H,000H
	CALL	A167C
	LXI	B,D0001
	DAD	B
	XCHG
	LHLD	Y19C6
	DAD	D
	POP	B
	MOV	M,C
A1409:
	LXI	D,UQMLBX
	MVI	C,08BH
	CALL	BDOS
	JMP	CMLPEN
;
A1414:
	JMP	CMLPEN
;
A1417:
	JMP	CMLPEN
;
A141A:
	JMP	CMLPEN
;
A141D:
	JMP	CMLPEN
;
; >> NO EXECUTION PATH TO HERE <<
;
;  MAIN INDEX OF FUNCTION ROUTINES
;
IXMAIN:
	DW	A042C
	DW	A042F
	DW	A044E
	DW	A0475
	DW	A069D
	DW	A06BC
	DW	A071B
	DW	A0834
	DW	A0890
	DW	A09DA
	DW	A09FA
	DW	A0AE7
	DW	A0BD4
	DW	A0CB4
	DW	A0D9F
	DW	A0E6F
	DW	A0F3F
	DW	A100F
	DW	A110E
	DW	A1189
	DW	A12FF
	DW	A1414
	DW	A1417
	DW	A141A
	DW	A141D
;
;  END PROCESS
;
;
CMLPEN:
	LXI	H,T0013
	DAD	SP
	MOV	C,M
	INX	H
	MOV	B,M
	LDAX	B
	INR	A
	DCX	H
	MOV	C,M
	INX	H
	MOV	B,M
	MOV	H,B
	MOV	L,C
	MOV	M,A
	LXI	H,T0013
	DAD	SP
	MOV	C,M
	INX	H
	MOV	B,M
	INX	B
	LDAX	B
	LXI	H,D0001
	DAD	SP
	MOV	M,A
	LXI	H,T0013
	DAD	SP
	MOV	C,M
	INX	H
	MOV	B,M
	INX	B
	INX	B
	DCX	H
	PUSH	B
	MOV	C,M
	INX	H
	MOV	B,M
	INX	B
	MOV	H,B
	MOV	L,C
	POP	D
	LDAX	D
	MOV	M,A
	LXI	H,T0013
	DAD	SP
	MOV	C,M
	INX	H
	MOV	B,M
	INX	B
	INX	B
	LXI	H,D0001
	DAD	SP
	MOV	A,M
	MOV	H,B
	MOV	L,C
	MOV	M,A
	LXI	H,T0005
	DAD	SP
	MOV	A,M
	RAR
	JNC	CMLPES
	LXI	D,T0004
	LXI	H,T0013
	DAD	SP
	CALL	A1647
	MVI	M,000H
	LXI	B,T0005
	DCX	D
	CALL	A163B
	PUSH	H
	LXI	H,T0008
	DAD	SP
	MOV	A,M
	POP	H
	MOV	M,A
CMLPES:
	LXI	H,T02A3
	DAD	SP
	XCHG
	MVI	C,08BH
	CALL	BDOS
	JMP	CMLOOP
;
CMLPRT:
	LXI	H,T02AF
	DAD	SP
	SPHL
	RET
;
;  INITIALIZER ROUTINE
;  START UP EACH CHANEL PROCESS
;
INSTAT:
	LXI	D,UQSPOL
	MVI	C,COPENQ
	CALL	BDOS		;OPEN SPOOL
	CPI	0
	JZ	INSTSP		;GET QUEUE LINK
	LXI	D,1
	MVI	C,CDELAY
	CALL	BDOS		;WAIT FOR PRIORITY RESOLUTION
	LXI	D,UQSPOL
	MVI	C,COPENQ
	CALL	BDOS		;TRY AGAIN
	CMA
	STA	Y19C2		;SET SPOOLER MODE
	CMA
	RAR
	JNC	$+11		;OK OPENED
	LXI	D,UQMXLT	;NO SPOOLER SO GET LIST QUEUE
	MVI	C,COPEN
	CALL	BDOS
	JMP	INSTSL
;
INSTSP:
	LXI	B,-1
	LXI	H,Y19C2
	MOV	M,C		;SET SPOOL MODE ON
INSTSL:
	LXI	D,0
	MVI	C,CSYSDT
	CALL	BDOS		;GET SYSTEM DATA AREA
	LXI	D,9
	DAD	D
	SHLD	Y1A4E		;SAVE CONFIGRATION TABLE POINTER
INSTWN:				;WAIT FOR NETWORKIF INITIALIZATION
	LHLD	Y1A4E
	MVI	A,0
	CALL	A16B4		;CHECK EMPTY
	ORA	L
	JNZ	INSTWS		;GET DATA
	LXI	D,1
	MVI	C,CDELAY
	CALL	BDOS		;WAIT FOR INITIALIZATION
	JMP	INSTWN		;TRY AGAIN
;
INSTWS:
	LXI	D,UQMLBX
	MVI	C,COPENQ
	CALL	BDOS		;OPEN MAIL BOX QUEUE
	SUI	0
	SUI	1
	SBB	A
	STA	Y19C3		;SAVE MAIL BOX MODE
	RAR
	JNC	INSTML		;NO QUEUE
	LXI	D,UQMLBX
	MVI	C,CREADQ
	CALL	BDOS		;READ DATA
	LXI	D,UQMLBX
	MVI	C,CWRITQ
	CALL	BDOS		;WRITE DATA
	LHLD	Y19C4		;MAIL BOX DATA
	INX	H
	INX	H
	SHLD	Y19C6		;SAVE MAIL BOX BUFFER POINT
INSTML:
	LHLD	Y1A4E
	MOV	E,M
	INX	H
	MOV	D,M		;GET CONFIGRATION TABLE POINT
	XCHG
	SHLD	Y19C0		;SAVE CONFIGRATION TABLE POINT
	LHLD	Y1A4E
	MOV	C,M
	INX	H
	MOV	B,M
	INX	B
	INX	B
	MOV	H,B
	MOV	L,C
	SHLD	Y1A4E		;TO SLAVE SUPPORT COUNTER POINT
	LHLD	Y1A4E
	MOV	L,M
	MOV	A,L
	STA	Y1A53		;SAVE MAX SUPPORT COUNT
	LXI	D,28		;LENGTH OF CONFIGRATION TABLE-2
	LHLD	Y1A4E
	DAD	D
	SHLD	Y1A4E		;SAVE SLAVE 1 DATA BUFFER POINT
	LXI	H,Y1A52
	MVI	M,0		;CLEAR COUNT
INSTPR:				;SLAVE SUPORT SYSTEM SET UP LOOP
	LDA	Y1A52
	INR	A		;COUNT UP
	STA	Y1A52
	LXI	H,Y1A53
	CMP	M
	JZ	INSTPE		;ALL OVER
	MVI	L,52		;COPY DATA LENGTH
	PUSH	H
	LHLD	Y1A4E		;GET CURRENT BUFFER TOP
	XCHG
	LXI	B,PDSLSP	;BASE PROCESS DESCRIPTOR
	POP	H
	LDAX	B
	STAX	D		;COPY DATA
	INX	B
	INX	D
	DCR	L
	JNZ	$-5
	LHLD	Y1A4E
	MVI	A,0
	MOV	M,A
	INX	H
	MVI	M,0		;CLEAR LINK
	LDA	Y1A52
	CPI	10
	JNC	INSTPS		;OVER A
	LDA	Y1A52		;0 TO 9
	ADI	'0'
	LXI	B,11		;BIAS TO NAME
	LHLD	Y1A4E
	DAD	B
	MOV	M,A		;SET NUMBER
	JMP	INSTPN
;
INSTPS:				;OVER A
	LDA	Y1A52
	ADI	'A'
	SUI	10
	LXI	B,11
	LHLD	Y1A4E
	DAD	B
	MOV	M,A		;SET NUMBER
INSTPN:
	LXI	D,52		;PROCESS DESCRIPTOR LENGTH
	LHLD	Y1A4E
	DAD	D
	LXI	D,768		;STACK LENGTH
	DAD	D
	DCX	H
	DCX	H
	SHLD	Y1A50		;SAVE ENTRY STACK
	LXI	B,4
	PUSH	H
	LHLD	Y1A4E
	DAD	B
	POP	B
	MOV	M,C
	INX	H
	MOV	M,B		;SET ENTRY STACK
	LHLD	Y1A50
	LXI	B,CSTART	;COMMON ROUTINE ENTRY POINT
	MOV	M,C
	INX	H
	MOV	M,B		;SET ENTRY POINT
	LXI	B,46
	LHLD	Y1A4E
	DAD	B		;GET C REG DATA POINT
	LDA	Y1A52
	MOV	M,A		;SET CHANEL NUMBER
	LHLD	Y1A4E
	XCHG
	MVI	C,CCREAT
	CALL	BDOS		;CREATE PROCESS
	LXI	D,52		;PROCESS DESCRIPTOR LENGTH
	LHLD	Y1A4E
	DAD	D
	LXI	D,768		;STACK LENGTH
	DAD	D
	SHLD	Y1A4E		;SET NEXT DATA POINT
	JMP	INSTPR		;TO NEXT CHANEL
;
INSTPE:
	LXI	H,Y19C0		;STACK TO COMMON ROUTINE ENTRY STACK
	SPHL
	MVI	C,0		;CHANEL ZERO PROCESS
	CALL	CSTART		;TO COMMON ROUTINE
	RET
;
;  TO BDOS
;
;
BDOS:
	LHLD	BDOSAD
	PCHL
;
A162D:
	LHLD	D0001
	INX	H
	INX	H
	MOV	H,M
	MOV	L,D
	MOV	D,E
	PCHL
;
; >> NO EXECUTION PATH TO HERE <<
	MOV	L,C
	MOV	H,B
A1638:
	MOV	C,M
	INX	H
	MOV	B,M
A163B:
	LDAX	D
	ADD	C
	MOV	L,A
	INX	D
	LDAX	D
	ADC	B
	MOV	H,A
	RET
;
; >> NO EXECUTION PATH TO HERE <<
	XCHG
	MOV	E,A
	MVI	D,000H
A1647:
	XCHG
A1648:
	LDAX	D
	ADD	L
	MOV	L,A
	INX	D
	LDAX	D
	ADC	H
	MOV	H,A
	RET
;
; >> NO EXECUTION PATH TO HERE <<
	MOV	L,C
	MOV	H,B
A1652:
	MOV	C,M
	INX	H
	MOV	B,M
	LDAX	D
	ANA	C
	MOV	L,A
	INX	D
	LDAX	D
	ANA	B
	MOV	H,A
	RET
;
A165D:
	MOV	B,H
	MOV	C,L
	LXI	H,A0000
	MVI	A,010H
A1664:
	PUSH	PSW
	DAD	H
	XCHG
	SUB	A
	DAD	H
	XCHG
	ADC	L
	SUB	C
	MOV	L,A
	MOV	A,H
	SBB	B
	MOV	H,A
	INX	D
	JNC	A1676
	DAD	B
	DCX	D
A1676:
	POP	PSW
	DCR	A
	JNZ	A1664
	RET
;
A167C:
	MOV	B,H
	MOV	C,L
	LXI	H,A0000
	MVI	A,010H
A1683:
	DAD	H
	XCHG
	DAD	H
	XCHG
	JNC	A168B
	DAD	B
A168B:
	DCR	A
	JNZ	A1683
	RET
;
; >> NO EXECUTION PATH TO HERE <<
	MOV	L,C
	MOV	H,B
A1692:
	MOV	C,M
	INX	H
	MOV	B,M
	LDAX	D
	ORA	C
	MOV	L,A
	INX	D
	LDAX	D
	ORA	B
	MOV	H,A
	RET
;
A169D:
	MOV	E,A
	MVI	D,000H
	MOV	A,E
	SUB	L
	MOV	L,A
	MOV	A,D
	SBB	H
	MOV	H,A
	RET
;
; >> NO EXECUTION PATH TO HERE <<
	MOV	L,C
	MOV	H,B
A16A9:
	MOV	C,M
	INX	H
	MOV	B,M
	LDAX	D
	SUB	C
	MOV	L,A
	INX	D
	LDAX	D
	SBB	B
	MOV	H,A
	RET
;
A16B4:
	MOV	E,A
	MVI	D,000H
	MOV	A,E
	SUB	M
	MOV	E,A
	MOV	A,D
	INX	H
	SBB	M
	MOV	D,A
	XCHG
	RET
;
;  MAIN PROCESS (SLV0SP) STACK
;
MAINST:
	DW	0C7C7H,0C7C7H,0C7C7H,0C7C7H
	DW	0C7C7H,0C7C7H,0C7C7H,0C7C7H
	DW	0C7C7H,0C7C7H,0C7C7H,0C7C7H
	DW	0C7C7H,0C7C7H,0C7C7H,0C7C7H
	DW	0C7C7H,0C7C7H,0C7C7H
A16E6:
	DW	INSTAT
;
	DS	728		;STACK & WORK FOR SLV0SP
;
;  WORKING
;
Y19C0:	DS	2		;CONFIGRATION TABLE POINTER
Y19C2:	DS	1		;SPOOL MODE 0 NO
Y19C3:	DS	1		;MAIL MODE -1 ON
Y19C4:	DS	2
Y19C6:	DS	2		;MAIL BOX BUFFER POINTER
;
Y19C8:	DS	2
Y19CA:	DS	1
Y19CB:	DS	2
Y19CD:	DS	1
;
	DS	128
;
;
Y1A4E:	DS	2		;INITIALIZE WORK DATA BUFFER
Y1A50:	DS	2		;WORK FOR STACK POINTER
Y1A52:	DS	1		;SLAVE PROCESS SET UP COUNTER
Y1A53:	DS	1		;MAXIMUM SUPORT COUNT
;
;
;
	END
	END
