	ORG	1900H
;******* INITIALIZATION ******
        DI
	MVI	A,40H
	STA	SYSRG2
	STA	CONFIG
	EI
	LXI	D,DLPRINT
	LXI	H,L0B13
	MVI	B,44
MOVT:	MVI	A,0C3H
	STAX	D
	INX	D
	MOV	A,L 
	STAX	D
	INX	D
	MOV	A,H
	STAX	D
	INX	D
	DCR	B
	JNZ	MOVT
	MVI	B,4 
	MVI	C,2
MOVR:	MVI     A,0C9H
	STAX	D
	INX	D
	XRA	A
	STAX 	D
	INX	D
	STAX	D
	INX	D
	DCR	B
	JNZ	MOVR
	MVI	B,1
	STAX	D
	INX	D
	DCR	C
	JNZ	MOVR 
	LXI	H,PROGR
	MVI	B,15
MOVPR:	MOV	A,M  
	STAX	D
	INX	H
	INX	D
	DCR	B
	JNZ	MOVPR
	LXI	H,L3848
	MVI	A,0C3H
	STAX	D
	INX	D
	MOV	A,L
	STAX	D
	INX	D
	MOV	A,H
	STAX	D
	INX	D
PROGR:	DB	0D6H,0,6FH,7CH,0DEH,0,67H,78H
	DB	0DEH,0,47H,3EH,0,0DEH,0
	XRA	A
	LXI  	H,3B6H
MOVZ:	STAX	D
	INX	D
 	DCX	H
	CMP	H
	JNZ	MOVZ
	CMP	L
	JNZ	MOVZ
	LXI	D,L3D2B
	LXI	H,LDPROG
	MVI	B,21H
DPROG:	MOV	A,M
	STAX	D
	INX	H
	INX	D
	DCR	B
	JNZ	DPROG
	LXI	D,L45F0
	LXI	H,LDTABL	;TABLE FOR RND()
	MVI	B,33H
DTABL	MOV	A,M
	STAX	D
	INX	H
	INX	D
	DCR	B
	JNZ	DTABL
;     	LXI	H,0F705H
;	SHLD	CURS
	MVI	A,1 
	STA	NULL
	STA	XS
	STA	YS
	MVI	A,40H
	STA	DISPLAY
	MVI	A,2AH 
	STA	L0728
	LXI	H,0FFFFH
	SHLD	CURLIN
	MVI	A,2CH
	STA	BUFMIN
	MVI	A,0EH
	STA	N404A
	MVI	A,0FFH
	STA	CON
	STA	N404B
	STA	NCREG
	MVI	A,0A3H
	STA	N403D
	LXI	H,8100H
	SHLD	ASP+2
	LXI	H,0FDAH
	SHLD	PI2
	LXI	H,8349H
	SHLD	PI2+2
	LXI	H,8280H
	SHLD	KK1+2
	LXI	H,ADREND+213
	SPHL
;	SHLD	STKTOP
;	SHLD	SAVSTK
	LXI	H,TEMPST
	SHLD	TEMPPT	
	LXI	H,0F5FFH
	SHLD	MEMSIZ
	LXI	D,0FF9DH
	DAD	D
	DCX	H
	SHLD	STKTOP
	SHLD	SAVSTK
	LXI	H,ADREND
	LXI	B,300H
	DAD	B
	SHLD	TXTTAB
	CALL	LCLS1
	CALL	LPCLS
	LXI	H,ADRL
	CALL	L227C
	CALL	L0D17
	LHLD	TXTTAB
	DCX	H
	MVI	M,00
	CALL	LDISK
	JMP	L0BA2
ADRL:	DB	0E2H,0C5H,0CAH,0D3H,0C9H,0CBH,20H,20H,0EBH
	DB	0EFH,0F2H,0F7H,0E5H,0F4H,20H,20H,0D7H,2EH
	DB	31H,0DH,0AH ;,0EEH,0C9H,0C9H,0D3H,0DEH,0C5
	DB	0EDH,0CFH,0D3H
	DB	0CBH,0D7H,0C1H,20H,20H,31H,39H,38H,36H
	DB	0DH,0AH,0
	DB	'NIISMH'

; **********   MATHEMATICS  PART   **********
L366B:		
	LXI	H,L43EF	
L366E:		
	CALL	L3944	
	JMP	SPADD	
 
L3674:		
	CALL	L3944	
SPSUB:		;-SP  
	CALL	L3901
SPADD:		;+SP  
	MOV	A,B
	ORA	A
	RZ
	LDA	L0A5B	;EXP OF NUMBER
	ORA	A
	JZ	L3936	
	SUB	B
	JNC	L3694	
	CMA
	INR	A
	XCHG
	CALL	L3926	
	XCHG
	CALL	L3936	
	POP	B
	POP	D
L3694:		
	CPI	19H
	RNC
	PUSH	PSW
	CALL	L3963	
	MOV	H,A
	POP	PSW
	CALL	L3741	
	ORA	H
	LXI	H,FAC
	JP	L36BA	
	CALL	L3721	
	JNC	L3700	
	INX	H
	INR	M
	JZ	L371C	
	MVI	L,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RET
 
L3741:		
	MVI	B,0
L3743:		
	SUI	8
	JC	L3750	
	MOV	B,E
	MOV	E,D
	MOV	D,C
	MVI	C,0
	JMP	L3743	
 
L3750:		
	ADI	9
	MOV	L,A
L3753:		
	XRA	A
	DCR	L
	RZ
	MOV	A,C
L3757:	
	RAR
	MOV	C,A
	MOV	A,D
	RAR
	MOV	D,A
	MOV	A,E
	RAR
	MOV	E,A
	MOV	A,B
	RAR
	MOV	B,A
	JMP	L3753	
 
L3765:		;1.0 SP
	DB	0,0,0,81H
 
L3769:		;TABLE FOR LOG
	DB	3
	DB	0AAH,56H,19H,80H
	DB	0F1H,22H,76H,80H
	DB	45H,0AAH,38H,82H
 
LLOG:		;L3776 
	CALL	L38D2	
	ORA	A
	JPE	L14DA	;ILLEGAL FUNCTION CALL
	LXI	H,L0A5B	;EXP OF NUMBER
	MOV	A,M
	LXI	B,8035H
	LXI	D,04F3H
	SUB	B
	PUSH	PSW
	MOV	M,B
	PUSH	D
	PUSH	B
	CALL	SPADD	
	POP	B
	POP	D
	INR	B
	CALL	SPDIV	
	LXI	H,L3765	
	CALL	L3674	
	LXI	H,L3769	
	CALL	L4557	
	LXI	B,8080H
	LXI	D,0000		;BC/DE=-0.5
	CALL	SPADD	
	POP	PSW
	CALL	L3FB8	
L37AE:		
	LXI	B,8031H
	LXI	D,7218H
SPMUL:		;*SP  
	CALL	L38D2	
	RZ
	MVI	L,0
	CALL	L3890	
	MOV	A,C
	STA	L0A81+5
	XCHG
	SHLD	L0A81+6
	LXI	B,0000	
	MOV	D,B
	MOV	E,B
	LXI	H,L36CB	
	PUSH	H
	LXI	H,L37D6	
	PUSH	H
	PUSH	H
	LXI	H,FAC
L37D6:		
	MOV	A,M
	INX	H
	ORA	A
	JZ	L3801	
	PUSH	H
	MVI	L,8
L37E0:	
	RAR
	MOV	H,A
	MOV	A,C
	JNC	L37EE	
	PUSH	H
L37E7:	LHLD	L0A81+6
	DAD	D
	XCHG
	POP	H
L37EC:	LDA	L0A81+5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M
	MOV	B,A
	MVI	L,0
L3890:		
	MOV	A,B
	ORA	A
	JZ	L38B4	
	MOV	A,L
	LXI	H,L0A5B	;EXP OF NUMBER
	XRA	M
	ADD	B
	MOV	B,A
	RAR
	XRA	B
	MOV	A,B
	JP	L38B3	
	ADI	80H
	MOV	M,A
	JZ	L37FF	
	CALL	L3963	
	MOV	M,A
L38AC:		
	DCX	H
	RET
 
L38AE:		
	CALL	L38D2	
	CMA
	POP	H
L38B3:	
	ORA	A
L38B4:	
	POP	H
	JP	L36E0	
	JMP	L371C	
 
L38BB:		
	CALL	L3941	
	MOV	A,B
	ORA	A
	RZ
	ADI	2
	JC	L371C	
	MOV	B,A
	CALL	SPADD	
	LXI	H,L0A5B	;EXP OF NUMBER
	INR	M
	RNZ
	JMP	L371C	
 
L38D2:		
	LDA	L0A5B	;EXP OF NUMBER
	ORA	A
	RZ
	LDA	L0A5A	
L38DA:	CPI	2FH
L38DC:		
	RAL
L38DD:	
	SBB	A
	RNZ
	INR	A
	RET
 
L38E1:		
	MVI	B,88H
	LXI	D,0000	
L38E6:		
	LXI	H,L0A5B	;EXP OF NUMBER
	MOV	C,A
	MOV	M,B
	MVI	B,0
	INX	H
	MVI	M,80H
	RAL
	JMP	L36C8	
 
LABS:		;L38F4
	CALL	L3913	
	RP
L38F8:	
	RST	4
	JM	L3C38	
	JZ	L3A88	
L3901:		
	LXI	H,L0A5A	
	MOV	A,M
	XRI	80H
	MOV	M,A
	RET
 
LSGN:		;L3909
	CALL	L3913	
L390C:		
	MOV	L,A
	RAL
	SBB	A
	MOV	H,A
	JMP	L3A25	
 
L3913:		
	RST	4
	JZ	L3A88	
	JP	L38D2	
L391C:	LHLD	FAC
L391F:		
	MOV	A,H
	ORA	L
	RZ
	MOV	A,H
	JMP	L38DC	
 
L3926:		
	XCHG
	LHLD	FAC
	XTHL
	PUSH	H
	LHLD	L0A5A	
	XTHL
	PUSH	H
	XCHG
	RET
 
L3933:		
	CALL	L3944	
L3936:		
	XCHG
	S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ORA	M
	CALL	L400A	
	JMP	L227B	
 
L3FED:		
	XRA	A
L3FEE:		
	CALL	L4070	
	ANI	8
	JZ	L3FF8	
	MVI	M,'+'	;2BH
L3FF8:		
	XCHG
	CALL	L3913	
	XCHG
	JP	L400A	
	MVI	M,'-'	;2DH
	PUSH	B
	PUSH	H
	CALL	L38F8	
	POP	H
	POP	B
	ORA	H
L400A:		
	INX	H
	MVI	M,'0'	;30H
	LDA	TEMP3	
	MOV	D,A
	RAL
	LDA	VALTYP
	JC	L40DC	
	JZ	L40D4	
	CPI	4
	JNC	L4079	
	LXI	B,0000	
	CALL	L439C	
L4026:		
	LXI	H,L0A67	
	MOV	B,M
	MVI	C,' '	;20H
	LDA	TEMP3	
	MOV	E,A
	ANI	' '	;20H
	JZ	L403D	
	MOV	A,B
	CMP	C
	MVI	C,'*'	;2AH
	JNZ	L403D	
	MOV	B,C
L403D:		
	MOV	M,C
	RST	2
	JZ	L405D	
	CPI	'E'	;45H
	JZ	L405D	
	CPI	'D'	;44H
	JZ	L405D	
	CPI	'0'	;30H
	JZ	L403D	
	CPI	','	;2CH
	JZ	L403D	
	CPI	'.'	;2EH
	JNZ	L4060	
L405D:		
	DCX	H
	MVI	M,'0'	;30H
L4060:		
	MOV	A,E
	ANI	10H
	JZ	L4069	
	DCX	H
	MVI	M,'$'	;24H
L4069:		
	MOV	A,E
	ANI	4
	RNZ
	DCX	H
	MOV	M,B
	RET
 
L4070:		
	STA	TEMP3	
	LXI	H,L0A67	
	MVI	M,' '	;20H
	RET
 
L4079:		
	CPI	5
	PUSH	H
	SBI	0
	RAL
	MOV	D,A
	INR	D
	CALL	L4252	
	LXI	B,0300H
	ADD	D
	JM	L4094	
	INR	D
	CMP	D
	JNC	L4094	
	INR	A
	MOV	B,A
	MVI	A,2
L4094:		
	SUI	2
	POP	H
	PUSH	PSW
	CALL	L42F1	
	MVI	M,'0'	;30H
	CZ	L394B	
	CALL	L4305	
L40A3:		
	DCX	H
	MOV	A,M
	CPI	'0'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OV	C,A
	SUB	E
	PUSH	PSW
	PUSH	B
L4220:		
	CM	L3F3D	
	JM	L4220	
	POP	B
	POP	PSW
	PUSH	B
	PUSH	PSW
	JM	L422E	
	XRA	A
L422E:		
	CMA
	INR	A
	ADD	B
	INR	A
	ADD	D
	MOV	B,A
	MVI	C,0
	CALL	L4305	
	POP	PSW
	CP	L42CE	
	POP	B
	POP	PSW
	CZ	L38AC	
	POP	PSW
	JC	L4249	
	ADD	E
	SUB	B
	SUB	D
L4249:		
	PUSH	B
	CALL	L40B3	
	XCHG
	POP	D
	JMP	L4101	
L4252:		
	PUSH	D
	XRA	A
	PUSH	PSW
	RST	4
	JPO	L4276	
L425B:		
	LDA	L0A5B	
	CPI	91H
	JNC	L4276	
	LXI	D,L43D3	
	LXI	H,L0A5E	
	CALL	L3956	
	CALL	DPMUL	
	POP	PSW
	SUI	0AH
	PUSH	PSW
	JMP	L425B	
 
L4276:		
	CALL	L42A8	
L4279:		
	RST	4
	JPE	L428B	
	LXI	B,9143H
	LXI	D,4FF9H
	CALL	SPEXP	
	JMP	L4291	
 
L428B:		
	LXI	D,L43DB	
	CALL	L39D0	
L4291:		
	JP	L42A4	
	POP	PSW
	CALL	L3F2E	
	PUSH	PSW
	JMP	L4279	
 
L429C:		
	POP	PSW
	CALL	L3F3D	
	PUSH	PSW
	CALL	L42A8	
L42A4:		
	POP	PSW
	ORA	A
	POP	D
	RET
 
L42A8:		
	RST	4
	JPE	L42BA	
	LXI	B,9474H
	LXI	D,23F8H
	CALL	SPEXP	
	JMP	L42C0	
 
L42BA:		
	LXI	D,L43E3	
	CALL	L39D0	
L42C0:		
	POP	H
	JP	L429C	
	PCHL
L42C5:	
	ORA	A
L42C6:	
	RZ
	DCR	A
	MVI	M,'0'	;30H
	INX	H
	JMP	L42C6	
L42CE:		
	JNZ	L42D5	
L42D1:		
	RZ
	CALL	L42F1	
L42D5:		
	MVI	M,'0'	;30H
	INX	H
	DCR	A
	JMP	L42D1	
L42DC:		
	MOV	A,E
	ADD	D
	INR	A
	MOV	B,A
	INR	A
L42E1:		
	SUI	3
	JNC	L42E1	
	ADI	5
	MOV	C,A
L42E9:		
	LDA	TEMP3	
	ANI	40H
	RNZ
	MOV	C,A
	RET
 
L42F1:		
	DCR	B
	JNZ	L42FD	
L42F5:		
	MVI	M,'.'	;2EH
	SHLD	TEMP2	
	INX	H
	MOV	C,B
	RET
 
L42FD:		
	DCR	C
	RNZ
	MVI	M,','	;2CH
	INX	H
	MVI	C,3
	RET
 
L4305:		
	PUSH	D
	RST	4
	JPO	L4354	
	PUSH	B
	PUSH	H
	CALL	L3981	
	LXI	H,L43EB	
	CALL	L397B	
	CALL	DPADD	
	XRA	A
	CALL	L3B15	
L431E:		
	POP	H
	POP	B
	LXI	D,L43FB	
	MVI	A,0AH
L4325:		
	CALL	L42F1	
	PUSH	B
	PUSH	PSW
	PUSH	H
	PUSH	D
	MVI	B,'/'	;2FH
L432E:		
	INR	B
	POP	H
	PUSH	H
	MVI	A,9EH
	CALL	L3D39	
	JNC	L432E	
	POP	H
	MVI	A,8EH
	CALL	L3D39	
	XCHG
	POP	H
	MOV	M,B
	INX	H
	POP	PSW
	POP	B
	DCR	A
	JNZ	L4325	
	PUSH	B
	PUSH	H
	LXI	H,L0A54	
	CALL	L3933	
	JMP	L4360	
 
L4354:		
	PUSH	B
	PUSH	H
	CALL	L366B	
	INR	A
	CALL	L3A8D	
	CALL	L3936	
L4360:		
	POP	H
	POP	B
	XRA	A
	LXI	D,L4441	
L4366:		
	CMC
	CALL	L42F1	
	PUSH	B
	PUSH	PSW
	PUSH	H
	PUSH	D
	CALL	L3941	
	POP	H
	MVI	B,'/'	;2FH
L4374:		
	INR	B
	MOV	A,E
	SUB	M
	MOV	E,A
	INX	H
	MOV	A,D
	SBB	M
	MOV	D,A
	INX	H
	MOV	A,C
	SBB	M
	MOV	C,A
	DCX	H
	DCX	H
	JNC	L4374	
	CALL	L3721	
	INX	H
	CALL	L3936	
	XCHG
	POP	H
	MOV	M,B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N,HEX, OCT TO DECIMAL
	MVI	B,01	;BIN$
	JMP	L445D

L4456:	MVI	B,03H
	JMP	L445D

L445B:	MVI	B,04H
L445D:	PUSH	B
	CALL	L2845
	LXI	D,L0A67+4
	XRA	A
	STAX	D
	POP	B
	MOV	C,A
L4468:	PUSH	B
	DCX	D
L446A:	ANA	A
	MOV	A,H
	RAR
	MOV	H,A
	MOV	A,L
	RAR
	MOV	L,A
	MOV	A,C
	RAR
	MOV	C,A
	DCR	B
	JNZ	L446A
	POP	B
	PUSH	B
L447A:	RLC
	DCR	B
	JNZ	L447A
	ADI	30H
	CPI	3AH
	JC	L4488
	ADI	07H
L4488:	STAX	D
	POP	B
	MOV	A,L
	ORA	H
	JNZ	L4468
	XCHG
	RET
;*
 
L449D:		
	LXI	H,L3901	
	XTHL
	PCHL
LSQR:		;L44A2
	CALL	L3926	
	LXI	H,L43EF	
	CALL	L3933	
	JMP	L44B1	
 
L44AE:		
	CALL	LCSNG
L44B1:		
	POP	B
	POP	D
	CALL	L38D2	
	MOV	A,B
	JZ	LEXP	
	JP	L44C1	
	ORA	A
	JZ	L0B15+1	;DIVISION BY ZERO
L44C1:		
	ORA	A
	JZ	L36E1	
	PUSH	D
	PUSH	B
	MOV	A,C
	ORI	7FH
	CALL	L3941	
	JP	L44DE	
	PUSH	D
	PUSH	B
	CALL	L3AD8	
	POP	B
	POP	D
	PUSH	PSW
	CALL	SPEXP	
	POP	H
	MOV	A,H
	RAR
L44DE:	
	POP	H
	SHLD	L0A5A	
	POP	H
	SHLD	FAC
	CC	L449D	
	CZ	L3901	
	PUSH	D
	PUSH	B
	CALL	LLOG	
	POP	B
	POP	D
	CALL	SPMUL	
LEXP:		;L44F6		
	CALL	L3926	
	LXI	B,8138H
	LXI	D,0AA3BH
	CALL	SPMUL	
	LDA	L0A5B	
	CPI	88H
	JNC	L38AE	
	CALL	L3AD8	
	ADI	80H
	ADI	2
	JC	L38AE	
	PUSH	PSW
	LXI	H,L3765	
	CALL	L366E	
	CALL	L37AE	
	POP	PSW
	POP	B
	POP	D
	PUSH	PSW
	CALL	SPSUB	
	CALL	L3901	
	LXI	H,L4536	
	CALL	L4566	
	LXI	D,0000	
	POP	B
	MOV	C,D
	JMP	SPMUL	;*SP
 
L4536:		;TABLE
	DB	8
	DB	40H,2EH,94H,74H
	DB	70H,4FH,2EH,77H
	DB	6EH,02H,88H,7AH
	DB	0E6H,0A0H,2AH,7CH
	DB	50H,0AAH,0AAH,7EH
	DB	0FFH,0FFH,7FH,7FH
	DB	0,0,80H,81H
	DB	0,0,0,81H
	    
L4557:		
	CALL	L3926	
	LXI	D,L3BD5	
	PUSH	D
	PUSH	H
	CALL	L3941	
	CALL	SPMUL	
	POP	H
L4566:		
	CALL	L3926	
	MOV	A,M
	INX	H
	CALL	L3933	
L456E:	MVI	B,0F1H
	POP	B
	POP	D
	DCR	A
	RZ
	PUSH	D
	PUSH	B
	PUSH	PSW
	PUSH	H
	CALL	SPMUL	
	POP	H
	CALL	L3944	
	PUSH	H
	CALL	SPADD	
	POP	H
	JMP	L456E+1
	
LRND:		;L4587
	CALL	L38D2	
	LXI	H,L45F2	
	JM	L45E8	
	LXI	H,L4613	
	CALL	L3933	
	LXI	H,L45F2	
	RZ
	ADD	M
	ANI	7
	MVI	B,0
	MOV	M,A
	INX	H
	ADD	A
	ADD	A
	MOV	C,A
	DAD	B
	CALL	L3944	
	CALL	SPMUL	;*SP
	LDA	L45F1	
	INR	A
	ANI	3
	MVI	B,0
	CPI	1
	ADC	B
	STA	L45F1	
	LXI	H,L4613	
	ADD	A
	ADD	A
	MOV	C,A
	DAD	B
	CALL	L366E	
L45C3:		
	CALL	L3941	
	MOV	A,E
	MOV	E,C
	XRI	4FH
	MOV	C,A
	MVI	M,80H
	DCX	H
	MOV	B,M
	MVI	M,80H
	LXI	H,L45F0	
	INR	M
	MOV	A,M
	SUI	0ABH
	JNZ	L45DF	
	MOV	M,A
	INR	C
	DCR	D
	INR	E
L45DF:		
	CALL	L36CB	
	LXI	H,L4613	
	JMP	L394D	
 
L45E8:		
	MOV	M,A
	DCX	H
	MOV	M,A
	DCX	H
	MOV	M,A
	JMP	L45C3	
;L45F0:		;TABLE
LDTABL:	DB 	0
;L45F1:		
	DB 	0
;L45F2:	
	DB 	0
	DB 	35H,4AH,0CAH,99H
	DB	39H,1CH,76H,98H
	DB	22H,95H,0B3H,98H
	DB	0AH,0DDH,47H,98H
	DB	53H,0D1H,99H,99H
	DB	0AH,1AH,9FH,98H
	DB	65H,0BCH,0CDH,98H
	DB	0D6H,77H,3EH,98H
;L4613:		
	DB	52H,0C7H,4FH,80H
	DB	68H,0B1H,46H,68H
	DB	99H,0E9H,92H,69H
	DB	10H,0D1H,75H,68H

LCOS:		;L4623 
	LXI	H,L466D	;LOAD 1.5
	CALL	L366E	
LSIN:		;L4629 
	CALL	L3926	
	LXI	B,8349H
	LXI	D,0FDBH
	CALL	L3936	
	POP	B
	POP	D
	CALL	SPDIV	
	CALL	L3926	
	CALL	L3AD8	
	POP	B
	POP	D
	CALL	SPSUB	
	LXI	H,L4671 ;LOAD 0.25
	CALL	L3674	
	CALL	L38D2	
	STC
	JP	L4659	
	CALL	L366B	
	CALL	L38D2	
	ORA	A
L4659:		
	PUSH	PSW
	CP	L3901	
	LXI	H,L4671	;LOAD 0.25
	CALL	L366E	
	POP	PSW
	CNC	L3901	
	LXI	H,L4675	
	JMP	L4557	
 
L466D:		;TABLE
	DB	0DBH,0FH,49H,81H	;1.5
L4671:		
	DB	0,0,0,7FH	;0.25
 
L4675:		;TABLE FOR SIN
	DB	5
	DB	0BAH,0D7H,1EH,86H
	DB	64H,26H,99H,87H
	DB	58H,34H,23H,87H
	DB	0E0H,5DH,0A5H,86H
	DB	0DAH,0FH,49H,83H
 
LTAN:		;L468A
	CALL	L3926	
	CALL	LSIN	
	POP	B
	POP	H
	CALL	L3926	
	XCHG
	CALL	L3936	
	CALL	LCOS	
	JMP	L380F	;/SP
 
LATN:		;L469F
	CALL	L38D2	
	CM	L449D	
	CM	L3901	
	LDA	L0A5B	
	CPI	81H
	JC	L46BC	
	LXI	B,8100H
	MOV	D,C
	MOV	E,C
	CALL	SPDIV	
	LXI	H,L3674	
	PUSH	H
L46BC:		
	LXI	H,L46C6	
	CALL	L4557	
	LXI	H,L466D	;LOAD 1.5
	RET
 
L46C6:		;TABLE FOR ATN
	DB	9
	DB	4AH,0D7H,3BH,78H
	DB	02,6EH,84H,7BH
	DB	0FEH,0C1H,2FH,7CH
	DB	74H,31H,9AH,7DH
	DB	84H,3DH,5AH,7DH
	DB	0C8H,7FH,91H,7EH
	DB	0E4H,0BBH,4CH,7EH
	DB	6CH,0AAH,0AAH,7FH
	DB	0,0,0,81H
     
 ; **********  TABLE  PART  **********
;L0100:	JMP	L4701	
	DW	LCINT
	DW	L3A25
 
L0107:		;ADDRESS TABLE OF COMMAND AND OPERATION
	DW	LEND        ;L138D  81H
	DW	LFOR        ;L11C0  82H
	DW	LNEXT       ;L19F9  83H
	DW	LDATA       ;L15CF  84H
	DW	LINPUT      ;L18E9  85H
	DW	LDIM        ;L1E2C  86H
	DW	LREAD       ;L191C  87H
	DW	LLET	    ;L15F5  88H
	DW	LGOTO       ;L157D  89H
	DW	LRUN	    ;L154F  8AH
	DW	LIF         ;L1721  8BH
        DW	LRESTORE    ;L1355  8CH
	DW	LGOSUB      ;L1565  8DH
	DW	LRETURN	    ;L15B4  8EH
	DW	LDATA+2     ;L15CF+2  REM  8FH
	DW	LSTOP       ;L1388  90H
	DW	LPRINT      ;L176A  91H
	DW	LCLEAR      ;L1522  92H
	DW	LLIST       ;L269A  93H
	DW	LNEW        ;L0D2D  94H
	DW	LON         ;L1656  95H
	DW	DNULL       ;L13F7  96H
	DW	LCOM        ;COM    97H -
	DW	LDEF        ;L20BE  98H
	DW	DPOKE       ;L2833  99H
 	DW	LCONT       ;L13E4  9AH
	DW	LCSAVE      ;CSAVE  9BH
	DW	LCLOAD      ;CLOAD  9CH
	DW	LMOTOR      ;MOTOR  9DH 
	DW	DLPRINT     ;L1762  9EH
	DW	DLLIST      ;L2695  9FH
	DW	LKEY	    ;KEY    A0H
	DW	DWIDTH      ;L264B  A1H
	DW	LDATA+2     ;L15CF+2  ELSE A2H
	DW	LTRON       ;L1409  A3H
	DW	LTRON+1     ;L1409+1  TROFF A4H
	DW	LSWAP       ;L140F  A5H
	DW      DERASE      ;L144D  A6H
	DW	LEDIT       ;L2A2C  A7H
	DW	LERROR	    ;L16E0  A8H
	DW	LRESUME     ;L16A3  A9H
	DW	LDELETE     ;L27F2  AAH
	DW	LAUTO       ;L16EB  ABH
	DW	LRENUM      ;L2C1A  ACH
	DW	LDEFSTR     ;L1483  ADH
	DW	LDEFINT+1   ;L1485+1 AEH
	DW	LDEFSNG+1   ;L1488+1 AFH
	DW	LDEFDBL+1   ;L148B+1 B0H
	DW	LLINE       ;L1892  B1H
	DW	DBSAVE      ;BSAVE  B2H
	DW	DBLOAD	    ;BLOAD  B3H
	DW	LWHILE      ;WHILE  B4H
	DW	LWEND	    ;WEND   B5H
	DW	DCALL	    ;CALL   B6H
	DW	LWRITE	    ;WRITE  B7H
	DW	0000	    ;PLAY   B8H
	DW	LSOUND	    ;SOUND  B9H
	DW	0000	    ;OPTION BAH
	DW	DRANDOM	    ;RANDOMIZE BBH
	DW	LBEEP	    ;BEEP   BCH
	DW	DSYSTEM     ;L3151  BDH
	DW	LMAX	    ;MAX    BEH
	DW	DOPEN       ;L3069  BFH
	DW	DFIELD      ;L3512  C0H
	DW	DGET        ;L2E4E+1  GET C1H
	DW	DPUT        ;L2E4E  C2H
	DW	DCLOSE      ;L34DA  C3H
	DW	DLOAD       ;L33CF+1 C4H
	DW	DMERGE      ;L3467  C5H
	DW	DFILES      ;L31C4  C6H
	DW	DNAME       ;L3014  C7H
	DW	DKILL       ;L3171  C8H
	DW	DLSET       ;L3555+1  LSET C9H
	DW	DRSET       ;L3555  CAH
	DW	DSAVE       ;L34A4  CBH
	DW	0000        ;       CCH
	DW	DLFIL	    ;LFILES CDH
	DW	LCLS        ;CLS    CEH
	DW	LPCLS	    ;PCLS   CFH
	DW	LCOLOR	    ;COLOR  D0H
	DW	LCIRCLE	    ;CIRCLE D1H
	DW	DDRAW	    ;DRAW   D2H
	DW	LPAINT 	    ;PAINT  D3H
	DW	LPSET       ;PSET   D4H
	DW	LPRESET	    ;PRESET D5H
	DW	LLOCATE	    ;LOCATE D6H
	DW	LSCREEN	    ;SCREEN D7H
	DW	LSPRITE	    ;SPRITE D8H
	DW	LLUT        ;LUT    D9H
	DW	LRELOC      ;RELOC  DAH
	DW	LBASE	    ;BASE   DBH
    
L019F:          ;ADDRESS TABLE OF FUNCTIONS
	DW	LLEFT       ;L2467  01H
	DW	LRIGHT      ;L2498  02H
	DW	LMID        ;L24A2  03H
	DW	LSGN        ;L3909  04H
	DW	LINT        ;L3ACB  05H
	DW	LABS        ;L38F4  06H
	DW	LSQR        ;L44A2  07H
	DW	LRND        ;L4587  08H
	DW	LSIN        ;L4629  09H 
	DW	LLOG        ;L3776  0AH
	DW	LEXP        ;L44F6  0BH
	DW	LCOS        ;L4623  0CH
	DW	LTAN        ;L468A  0DH
	DW	LATN        ;L469F  0EH
	DW	LFRE        ;L203C  0FH
	DW	LBIN        ;L21FA0 10H
	DW	LPOS        ;L2066  11H
	DW	LLEN        ;L23F3  12H
	DW	LSTR        ;L2206  13H
	DW	LVAL        ;L24C3  14H
	DW	LASC        ;L23FF  15H
	DW	LCHR        ;L240F  16H
	DW	DPEEK       ;L282C  17H
	DW	LSPACE      ;L244A  18H
	DW	LOCT        ;L21FA  19H
	DW	LHEX        ;L2200  1AH
	DW	DLPOS       ;L2060  1BH
	DW	LCINT       ;L3A07  1CH
	DW	LCSNG       ;L3A3B  1DH
	DW	LCDBL       ;L3A69  1EH
	DW	LFIX        ;L3AB8  1FH
	DW	0000        ;20H
	DW	0000	    ;21H
	DW	0000	    ;22H
	DW	0000        ;23H
	DW	0000 	    ;24H
	DW	0000 	    ;25H
	DW	0000	    ;26H
	DW	0000  	    ;27H
	DW	0000	    ;28H
	DW	0000	    ;29H
	DW	0000 	    ;2AH
	DW	DCVI        ;L32BC  2BH
	DW	DCVS        ;L32BE+1 2CH
	DW	DCVD        ;L32C1+1 2DH
	DW	0000	    ;2EH
	DW	DEOF        ;L2D5F  2FH
	DW	DLOC        ;L2DF6  30H
	DW	DLOF        ;L2E06  31H
	DW	DMKI        ;L32A3  32H
	DW	DMKS        ;L32A5+1 33H
	DW	DMKD        ;L32A8+1 34H
 
L0207:          ;ALPHABETIC TABLE
	DW	LA          ;L023B
	DW	LB	    ;L024C
	DW	LC	    ;L024D
	DW	LD	    ;L0278
	DW	LE1	    ;L02A1
	DW	LF	    ;L02C6
	DW	LG	    ;L02DC
	DW	LH	    ;L02EE
	DW	LI	    ;L02F3
	DW	LJ	    ;L0309
	DW	LK	    ;L030A
	DW	LL	    ;L030F
	DW	LM	    ;L0343
	DW	LN	    ;L035C
	DW	LO	    ;L036F
	DW	LP	    ;L037F
	DW	LQ	    ;L0393
	DW	LR	    ;L0394
	DW	LS	    ;L03C9
	DW	LT1	    ;L03FE
	DW	LU	    ;L0415
	DW	LV	    ;L0415
	DW	LW	    ;L0428
	DW	LX	    ;L0432
	DW	LY	    ;L0436
	DW	LZ	    ;L0437
 
L023B:          ;TABLE OF TOKENIZES
LA:
	DB	'N','D'+80H,0F7H
	DB	'B','S'+80H,06H
	DB	'T','N'+80H,0EH
	DB	'S','C'+80H,15H
	DB	'UT','O'+80H,0ABH
	DB	0
LB:
	DB	'IN','$'+80H,10H
	DB	'EE','P'+80H,0BCH
	DB	0
LC:
	DB	'LOS','E'+80H,0C3H
	DB	'ON','T'+80H,9AH
	DB	'LEA','R'+80H,92H
	DB	'IN','T'+80H,1CH
	DB	'SN','G'+80H,1DH
	DB	'DB','L'+80H,1EH
	DB	'V','I'+80H,2BH
	DB	'V','S'+80H,2CH
	DB	'V','D'+80H,2DH
	DB	'O','S'+80H,0CH
	DB	'HR','$'+80H,16H
	DB	'SRLI','N'+80H,0EBH
	DB	'L','S'+80H,0CEH
	DB	'O','M'+80H,97H
	DB	'SAV','E'+80H,9BH
	DB	'LOA','D'+80H,9CH
	DB	'OLO','R'+80H,0D0H
	DB	'IRCL','E'+80H,0D1H
	DB	0
LD:
 	DB	'AT','A'+80H,84H
	DB	'I','M'+80H,86H
	DB	'EFST','R'+80H,0ADH
	DB	'EFIN','T'+80H,0AEH
	DB	'EFSN','G'+80H,0AFH
	DB	'EFDB','L'+80H,0B0H
	DB	'E','F'+80H,98H
	DB	'ELET','E'+80H,0AAH
	DB	'RA','W'+80H,0D2H
	DB	0
LE1:
	DB	'N','D'+80H,81H
	DB	'LS','E'+80H,0A2H
	DB	'RAS','E'+80H,0A6H
	DB	'DI','T'+80H,0A7H
	DB	'RRO','R'+80H,0A8H
	DB	'R','L'+80H,0E4H
	DB	'R','R'+80H,0E5H
	DB	'X','P'+80H,0BH
	DB	'O','F'+80H,2FH
	DB	'Q','V'+80H,0FAH
	DB	0
LF:
	DB	'O','R'+80H,82H
	DB	'IEL','D'+80H,0C0H
	DB	'ILE','S'+80H,0C6H
	DB	'N'+80H,0E1H
	DB	'R','E'+80H,0FH
	DB	'I','X'+80H,1FH
	DB	0
LG:
	DB	'OT','O'+80H,89H
	DB	'OSU','B'+80H,8DH
	DB	'E','T'+80H,0C1H
	DB	0
LH:
	DB	'EX','$'+80H,1AH
	DB	0
LI:
	DB	'NPU','T'+80H,85H
	DB	'F'+80H,8BH
	DB	'NST','R'+80H,0E8H
	DB	'N','T'+80H,05H
	DB	'M','P'+80H,0FBH
	DB	'NKEY','$'+80H,0EDH
	DB	0
LJ:
	DB	0
LK:
	DB	'IL','L'+80H,0C8H
	DB	0
LL:
	DB	'OCAT','E'+80H,0D6H
	DB	'E','T'+80H,88H
	DB	'IN','E'+80H,0B1H
	DB	'OA','D'+80H,0C4H
	DB	'SE','T'+80H,0C9H
	DB	'PRIN','T'+80H,9EH
	DB	'LIS','T'+80H,9FH
	DB	'PO','S'+80H,1BH
	DB	'IS','T'+80H,93H
	DB	'O','G'+80H,0AH
	DB	'O','C'+80H,30H
	DB	'O','F'+80H,31H
	DB	'E','N'+80H,12H
	DB	'EFT','$'+80H,01H
	DB	'FILE','S'+80H,0CDH
	DB	'U','T'+80H,0D9H
	DB	0
LM:
	DB	'ERG','E'+80H,0C5H
	DB	'O','D'+80H,0FCH
	DB	'KI','$'+80H,32H
	DB	'KS','$'+80H,33H
	DB	'KD','$'+80H,34H
	DB	'ID','$'+80H,03H
	DB	'A','X'+80H,0BEH
	DB	'OTO','R'+80H,9DH
	DB	0
LN:
	DB	'EX','T'+80H,83H
	DB	'UL','L'+80H,96H
	DB	'AM','E'+80H,0C7H
	DB	'E','W'+80H,94H
	DB	'O','T'+80H,0E3H
	DB	0
LO:
	DB	'N'+80H,95H
	DB	'PE','N'+80H,0BFH
	DB	'R'+80H,0F8H
	DB	'F','F'+80H,0ECH
	DB	'CT','$'+80H,19H
	DB	0
LP:
	DB	'U','T'+80H,0C2H
	DB	'OK','E'+80H,99H
	DB	'RIN','T'+80H,91H
	DB	'O','S'+80H,11H
	DB	'EE','K'+80H,17H
	DB	'AIN','T'+80H,0D3H
	DB	'OIN','T'+80H,0EEH
	DB	'RESE','T'+80H,0D5H
	DB	'SE','T'+80H,0D4H
	DB	'CL','S'+80H,0CFH
	DB	0
LQ:
	DB	0
LR:
	DB	'EA','D'+80H,87H
	DB	'U','N'+80H,8AH
	DB	'ESTOR','E'+80H,8CH
	DB	'ETUR','N'+80H,8EH
	DB	'E','M'+80H,8FH
	DB	'ESUM','E'+80H,0A9H
	DB	'SE','T'+80H,0CAH
	DB	'IGHT','$'+80H,02H
	DB	'N','D'+80H,08H
	DB	'ENU','M'+80H,0ACH
	DB	'ELO','C'+80H,0DAH
	DB	0
LS:
	DB	'TO','P'+80H,90H
	DB	'WA','P'+80H,0A5H
	DB	'AV','E'+80H,0CBH
	DB	'PC','('+80H,0E2H
	DB	'TE','P'+80H,0DFH
	DB	'G','N'+80H,04H
	DB	'Q','R'+80H,07H
	DB	'TR','$'+80H,13H
	DB	'TRING','$'+80H,0E6H
	DB	'PACE','$'+80H,18H
	DB	'I','N'+80H,09H
	DB	'YSTE','M'+80H,0BDH
	DB	'CREE','N'+80H,0D7H
	DB	0
LT1:
	DB	'RO','N'+80H,0A3H
	DB	'ROF','F'+80H,0A4H
	DB	'AB','('+80H,0DEH
	DB	'O'+80H,0DCH
	DB	'HE','N'+80H,0DDH
	DB	'A','N'+80H,0DH
	DB	0
LU:
	DB	'SIN','G'+80H,0E7H
	DB	'S','R'+80H,0E0H
	DB	0
LV:
 	DB	'A','L'+80H,14H
	DB	'ARPT','R'+80H,0EAH
	DB	0
LW:
	DB	'IDT','H'+80H,0A1H
	DB	0
LX:
	DB	'O','R'+80H,0F9H
	DB	0
LY:
	DB	0
LZ:
	DB	0
   
L0438:		;TABLE OF RECODED OPERATION SIGN
	DB	0ABH,0F2H    ;+
	DB	0ADH,0F3H    ;-
	DB	0AAH,0F4H    ;*
	DB	0AFH,0F5H    ;/
	DB	0DEH,0F6H    ;^
	DB	0DCH,0FDH    ;\
	DB	0A7H,0E9H    ;'
	DB	0BEH,0EFH    ;>
	DB	0BDH,0F0H    ;=
	DB	0BCH,0F1H    ;<
              
L044D:		;TABLE OF OPERATION PRIORITET
	DB	79H ;+
	DB	79H ;-
	DB	7CH ;*
	DB	7CH ;/
	DB	7FH ;^
	DB	50H ;AND
	DB	46H ;OR
	DB	3CH ;XOR
	DB	32H ;IMP
	DB	28H ;EQV
	DB	7AH ;MOD
	DB	7BH ;\
 
L0459:		;TABLE OF CONVERTION
	DW	LCDBL    ;L3A69
	DW	0
	DW	LCINT    ;L3A07
	DW	L3A84    ;DATA TYPE
	DW	LCSNG    ;L3A3D
     
L0463:		;ARITHMETIC OF DP
	DW	DPADD    ;+
	DW	DPSUB    ;-
	DW	DPMUL	 ;*
	DW	DPDIV    ;/
	DW	DPEXP    ;^
       
L046D:		;ARITHMETIC OF SP
	DW	SPADD    ;+
	DW	SPSUB	 ;-
	DW	SPMUL    ;*
	DW	SPDIV    ;/
	DW	SPEXP    ;^
     
L0477:		;ARITHMETIC OF INT
	DW	INADD    ;+
	DW	INSUB	 ;-
	DW	INMUL	 ;*
	DW	INDIV    ;/
	DW	INEXP    ;^
   
L0481:		;MESSAGE OF ERRORS
	DB	0
; 1. NEXT without FOR
	DB	'NEXT ',0E2H,0E5H,0FAH,' FOR',0
; 2. Syntax error
	DB	0EFH,0FBH,0E9H,0E2H,0EBH,0E1H,20H,0F3H,0E9H,0EEH
	DB	0F4H,0E1H,0EBH,0F3H,0E9H,0F3H,0E1H,0
; 3. RETURN without GOSUB
	DB	'RETURN ',0E2H,0E5H,0FAH,' GOSUB',0
; 4. Out of DATA
	DB	0F7H,0EEH,0E5H,' DATA',0
; 5. Illegal function call 
	DB	0EEH,0E5H,0F7H,0E5H,0F2H,0E5H,0EEH,20H,0F7H,0F9H,0FAH,0EFH
	DB	0F7H,20H,0E6H,0F5H,0EEH,0EBH,0E3H,0E9H,0E9H,0
; 6. Overflow
	DB	0F0H,0E5H,0F2H,0E5H,0F0H,0EFH,0ECH,0EEH,0E5H,0EEH,0E9H,0E5H,0
; 7. Out of memory
	DB	0EEH,0E5H,0F4H,20H,0F0H,0E1H,0EDH,0F1H,0F4H,0E9H,0
; 8. Undefined line number 
	DB	0EEH,0E5H,0EFH,0F0H,0F2H,0E5H,0E4H,0E5H,0ECH,0E5H
	DB	0EEH,0EEH,0F9H,0EAH,20H,0EEH,0EFH,0EDH,0E5H,0F2H,20H
	DB	0F3H,0F4H,0F2H,0EFH,0EBH,0E9H,0
; 9. Subscript out of range
	DB	0E9H,0EEH,0E4H,0E5H,0EBH,0F3H,20H,0F7H,0EEH,0E5H,20H
	DB	0E4H,0E9H,0E1H,0F0H,0E1H,0FAH,0EFH,0EEH,0E1H,0
; 10. Redimensioned array
	DB	0F0H,0E5H,0F2H,0E5H,0EFH,0F0H,0F2H
	DB	0E5H,0E4H,0E5H,0ECH,0E5H,0EEH,0E9H,0E5H
	DB	20H,0EDH,0E1H,0F3H,0F3H,0E9H,0F7H,0E1H,0
; 11. Division by zero
	DB	0E4H,0E5H,0ECH,0E5H,0EEH,0E9H,0E5H,20H,0EEH,0E1H,20H,30H,0
; 12. Illegal direct
	DB	0EFH,0FBH,0E9H,0E2H,0EFH,0FEH,0EEH,0E1H,0F1H,20H,0E4H
	DB	0E9H,0F2H,0E5H,0EBH,0F4H,0E9H,0F7H,0E1H,0
; 13. Type mismatch
	DB	0EFH,0FBH,0E9H,0E2H,0EFH,0FEH,0EEH,0F9H,0EAH,20H,0F4H
	DB	0E9H,0F0H,0
; 14. Out of string space
	DB	0EEH,0E5H,0F4H,20H,0F0H,0E1H,0EDH,0F1H,0F4H,0E9H,20H
	DB	0E4H,0ECH,0F1H,20H,0F3H,0F4H,0F2H,0EFH,0EBH,0
; 15. String too long
	DB	0E4H,0ECH,0E9H,0EEH,0EEH,0E1H,0F1H,20H,0F3H,0F4H,0F2H
	DB	0EFH,0EBH,0E1H,0
; 16. String formula too complex
	DB	0EFH,0FEH,0E5H,0EEH,0F8H,20H,0F3H,0ECH,0EFH,0F6H,0EEH,0E1H,0F1H
	DB	20H,0F3H,0F4H,0F2H,0EFH,0EBH,0E1H,0
; 17. Can't continue
	DB	0EFH,0FBH,0E9H,0E2H,0EBH,0E1H,' CONT',0
; 18. Undefined user function
	DB	0EEH,0E5H,0F4H,20H,0E6H,0F5H,0EEH,0EBH,0E3H,0E9H,0E9H
	DB	20H,0F0H,0EFH,0ECH,0F8H,0FAH,0EFH,0F7H,0E1H,0F4H,0E5H
	DB	0ECH,0F1H,0
; 19. No RESUME
	DB	0EEH,0E5H,0F4H,' RESUME',0
; 20. RESUME without error
	DB	'RESUME ',0E2H,0E5H,0FAH,20H,0EFH,0FBH,0E9H,0E2H,0EBH,0E9H,0
; 21. Unprintable error
	DB	0EEH,0E5H,0EFH,0F0H,0F2H,0E5H,0E4H,0E5H,0ECH,0E5H,0EEH
	DB	0EEH,0E1H,0F1H,20H,0EFH,0FBH,0E9H,0E2H,0EBH,0E1H,0
; 22. Missing operand
	DB	0EEH,0E5H,0F4H,20H,0EFH,0F0H,0E5H,0F2H,0E1H,0EEH,0E4H,0E1H,0
; 23. Line buffer overflow
	DB	0E2H,0F5H,0E6H,0E5H,0F2H,20H,0F3H,0F4H,0F2H,0EFH,0EBH
	DB	0E9H,20H,0F0H,0EFH,0ECH,0EEH,0F9H,0EAH,0
; 50. FIELD overflow
	DB	0F0H,0E5H,0F2H,0E5H,0F0H,0EFH,0ECH,0EEH,0E5H,0EEH,0E9H,0E5H,' FIELD',0
; 51. Internal error
	DB	0F7H,0EEH,0F5H,0F4H,0F2H,0E5H,0EEH,0EEH,0F1H,0F1H,20H
	DB	0EFH,0FBH,0E9H,0E2H,0EBH,0E1H,0
; 52. Bad file number
	DB	0EEH,0E5H,0F7H,0E5H,0F2H,0E5H,0EEH,20H,0EEH,0EFH,0EDH
	DB	0E5H,0F2H,20H,0E6H,0E1H,0EAH,0ECH,0E1H,0
; 53. File not found
	DB	0E6H,0E1H,0EAH,0ECH,20H,0EEH,0E5H,20H
	DB	0EEH,0E1H,0EAH,0E4H,0E5H,0EEH,0
; 54. Bad file mode
	DB	0EEH,0E5H,0F7H,0E5H,0F2H,0E5H,0EEH,20H,0F2H
	DB	0E5H,0F6H,0E9H,0EDH,20H,0E6H,0E1H,0EAH,0ECH,0E1H,0
; 55. File already open
	DB	0E6H,0E1H,0EAH,0ECH,20H,0F5H,0F6H,0E5H,20H,0EFH,0F4H
	DB	0EBH,0F2H,0F9H,0F4H,0
; 56. ?
	DB	3FH,0
; 57. Disk I/O error
	DB	0EFH,0FBH,0E9H,0E2H,0EBH,0E1H,20H,0F7H,0F7H,0EFH,0E4H,0E1H
	DB	2FH,0F7H,0F9H,0F7H,0EFH,0E4H,0E1H
	DB	20H,0E4H,0E9H,0F3H,0EBH,0E1H,0
; 58. File already exists
	DB	0E6H,0E1H,0EAH,0ECH,20H,0F5H,0F6H,0E5H,20H,0F3H,0F5H
	DB	0FDH,0E5H,0F3H,0F4H,0F7H,0F5H,0E5H,0F4H,0
; 59. ?
	DB	3FH,0
; 60. ?
	DB	3FH,0
; 61. Disk full
	DB	0E4H,0E9H,0F3H,0EBH,20H,0F0H,0EFH,0ECH,0EEH,0F9H,0EAH,0
; 62. Input past end
	DB	0F7H,0F7H,0EFH,0E4H,20H,0F0H,0EFH,0F3H,0ECH,0E5H,' END',0
; 63. Bad record number
	DB	0EEH,0E5H,0F7H,0E5H,0F2H,0E5H,0EEH,20H,0EEH,0EFH,0EDH,0E5H
	DB	0F2H,20H,0FAH,0E1H,0F0H,0E9H,0F3H,0E9H,0
; 64. Bad file mode
	DB	0EEH,0E5H,0F7H,0E5H,0F2H,0EEH,0EFH,20H,0E9H,0EDH,0F1H,20H
	DB	0E6H,0E1H,0EAH,0ECH,0E1H,0
; 65. ?
	DB	3FH,0
; 66. Direct statement in file
	DB	0F0H,0F2H,0F1H,0EDH,0EFH,0EAH,20H,0EFH,0F0H,0E5H,0F2H,0E1H
	DB	0F4H,0EFH,0F2H,20H,0F7H,20H,0E6H,0E1H,0EAH,0ECH,0E5H,0
; 67. Too many files
	DB 	0EDH,0EEH,0EFH,0E7H,0EFH,20H,0E6H,0E1H,0EAH,0ECH,0EFH,0F7H,0
  
;L070E:		
;	DW	L14DA	
;	DW	L14DA
;	DW	L14DA	
;	DW	L14DA
;	DW	L14DA	
;	DW	L14DA
;	DW	L14DA	
;	DW	L14DA
;	DW	L14DA	
;	DW	L14DA
L0A89:	
	DB	' ',0F7H,' ',0
L0A8D:
	DB	0
L0A8E:
	DB	'Ok',0DH,0AH,0
L0A93:
	DB	0F3H,0F4H,0EFH,0F0H,0



;**********  BASIC  PART  ********** 
L0A99:
	LXI	H,0004H
	DAD	SP
L0A9D:		
	MOV	A,M
	INX	H
	CPI	82H
	RNZ
	MOV	C,M
	INX	H
	MOV	B,M
	INX	H
	PUSH	H
	MOV	L,C
	MOV	H,B
	MOV	A,D
	ORA	E
	XCHG
	J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SH	B
	PUSH	D
	MOV	C,A
	PUSH	H
L1109:	CALL	DLPT	
	POP	H
	POP	D
	POP	B
	POP	PSW
	RET
L1111:		
	XRA	A
	STA	PRTFLG
	LDA	LPTPOS
	ORA	A
	RZ
L111A:		
	MVI	A,0DH
	CALL	L1104	
	MVI	A,0AH
	CALL	L1104	
	XRA	A
	STA	LPTPOS
	RET
 
L1129:		
	LDA	L072A	
	ORA	A
	JNZ	L22B1	
	POP	PSW
	PUSH	B
	PUSH	PSW
	CPI	9
	JNZ	L1148	
L1138:		
	MVI	A,' '	
	RST	5
	LDA	TTYPOS
	ANI	7
	JNZ	L1138	
	POP	PSW
	POP	B
	RET
 
L1148:		
	CPI	' '	
	JC	L115C	
	LDA	DISPLAY
	MOV	B,A
	LDA	TTYPOS
	CMP	B
	CZ	L17E8	
	INR	A
        STA	TTYPOS
L115C:		
	POP	PSW
	POP	B
LCONOUT:PUSH	PSW
	PUSH	B
	PUSH	D
	MOV	C,A
	PUSH	H
L1167:	CALL	04CH	
	POP	H
	POP	D
	POP	B
	POP	PSW
	RET
 
L116F:		
	PUSH	H
	LHLD	PTRFIL
	MOV	A,H
	ORA	L
	JZ	L11A0	
	CALL	D2F7A	;L2F7A	
	JNC	L37FF	
	PUSH	B
	PUSH	D
	PUSH	H
	CALL	D3458	;L3458	
	POP	H
	POP	D
	POP	B
	LDA	L0731	
	ORA	A
	LXI	H,L1246	
	XTHL
	JNZ	L0D41	
	XTHL
	PUSH	B
	PUSH	D
	LXI	H,L0A8E	
	CALL	L227C	
	POP	D
	POP	B
	XRA	A
	POP	H
	RET
 
L11A0:		
        POP     H
L11A1:		
	PUSH	B
	PUSH	D
	PUSH	H
	SUB	A
	STA	L0721
L11A4:	CALL	049H	
	POP	H
	POP	D
	POP	B
;	ANI	7FH
	CPI	0FH
	RNZ
	LDA	L072A	
	ORA	A
	CZ	L13C8	
	CMA
	STA	L072A	
	ORA	A
	JZ	L13C8	
	XRA	A
	RET
 
LFOR:		;L11C0
	MVI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	RST	5
	POP	D
L128A:		
	XCHG
L128B:		
	RST	2
	LXI	D,L1246	
	PUSH	D
L1292:		
	RZ
L1293:		
	SUI	81H
	JC	LLET	
	CPI	5BH	
	JNC	L257F	
	RLC
	MOV	C,A
	MVI	B,0
	XCHG
	LXI	H,L0107	
	DAD	B
	MOV	C,M
	INX	H
	MOV	B,M
	PUSH	B
	XCHG
L12AB:		;RST2
	INX	H
L12AC:		
	MOV	A,M
	CPI	':'	
	RNC
	CPI	' '	
	JZ	L12AB	;NEXT SYMBOL
	JNC	L131E	
	CPI	0BH
	JC	L1314	
	CPI	1EH
	JNZ	L12C7	
	LDA	CONSAV
	ORA	A
	RET
 
L12C7:		
	CPI	10H
	JNZ	L12D2	
L12CC:		
	LHLD	CONTXT
	JMP	L12AC	
 
L12D2:		
	PUSH	PSW
	INX	H
	STA	CONSAV
	SUI	1CH
	JNC	L12F9	
	SUI	0F5H
	JNC	L12E8	
	CPI	0FEH
	JNZ	L12F8	
	MOV	A,M
	INX	H
L12E8:		
	PUSH	H
	MOV	L,A
	MVI	H,0
	SHLD	CONLO	
	MVI	A,2
	STA	CONTYP
	POP	H
	JMP	L130B	
 
L12F8:		
	XRA	A
L12F9:		
	INR	A
	RLC
	STA	CONTYP
	PUSH	D
	PUSH	B
	LXI	D,CONLO	
	XCHG
	MOV	B,A
	CALL	L395A	
	XCHG
	POP	B
	POP	D
L130B:		
	SHLD	CONTXT
	POP	PSW
	LXI	H,L1324	
	ORA	A
	RET
 
L1314:		
	CPI	0BH
	JNC	L131E	
	CPI	9
	JNC	L12AB	;NEXT SYMBOL
L131E:		
	CPI	'0'	
	CMC
	INR	A
	DCR	A
	RET
 
L1324:		
	MVI	E,10H
L1326:		
	LDA	CONSAV
	CPI	0FH
	JNC	L1346	
	CPI	0DH
	JC	L1346	
	LHLD	CONLO	
	JNZ	L1340	
	INX	H
	INX	H
	INX	H
	MOV	E,M
	INX	H
	MOV	D,M
	XCHG
L1340:		
	CALL	L3C43	
	JMP	L12CC	
 
L1346:		
	LXI	H,CONLO	
	LDA	CONTYP
	STA	VALTYP
	CALL	L397B	
	JMP	L12CC	
 
LRESTORE:       ;L1355
	XCHG
	LHLD	TXTTAB
	JZ	L136A	
	XCHG
	CALL	L14EA	
	PUSH	H
	CALL	L0CF7	
	MOV	H,B
	MOV	L,C
	POP	D
	JNC	L15AF	
L136A:		
	DCX	H
L136B:		
	SHLD	DATPTR
	XCHG
	RET
 
L1370:		
	PUSH	B
	PUSH	D
	PUSH	H
L1373:  CALL	046H 	
	POP	H
	POP	D
	POP	B
	ORA	A
	RZ
L137B:		
	CALL	L116F	
	STA	L0721
	CPI	13H
	CZ	L116F	
	CPI	3
	CZ	L13CA	
LSTOP:          ;L1388
	RNZ
L1389:		
	INR	A
	JMP	L1393	
 
LEND:           ;L138D
	RNZ
	PUSH	PSW
	CZ	D3508	
	POP	PSW
L1393:		
	SHLD	SAVTXT
	LXI	H,TEMPST
	SHLD	TEMPPT
L139C:	LXI	H,0FFF6H
	POP	B
L13A0:		
	LHLD	CURLIN
	PUSH	H
	PUSH	PSW
	MOV	A,L
	ANA	H
	INR	A
	JZ	L13B4	
	SHLD	OLDLIN
	LHLD	SAVTXT
	SHLD	OLDTXT
L13B4:		
	XRA	A
	STA	L072A	
	CALL	L1111	
	CALL	L17DB	
	POP	PSW
	LXI	H,L0A93	
	JNZ	L0B96	
	JMP	L0BA0+1
 
L13C8:		
	MVI	A,0FH
L13CA:		
	PUSH	PSW
	SUI	3
	JNZ	L13D6	
	STA	PRTFLG
	STA	L072A	
L13D6:		
	MVI	A,5EH
	RST	5
	POP	PSW
	ADI	40H
	RST	5
	JMP	L17E8	
 
LCONT:		;L13E4
	LHLD	OLDTXT
	MOV	A,H
	ORA	L
	MVI	E,11H   ;CAN'T CONTINUE
	JZ	L0B24	
	XCHG
	LHLD	OLDLIN
	SHLD	CURLIN
	XCHG
	RET
 
;LNULL:		;L13F7
;	CALL	L2686	
;	RNZ
;	LDA	DISPLAY
;	MOV	B,A
;	MOV	A,E
;	INR	A
;	CMP	B
;	JNC	L14DA	;ILLEGAL FUNCTION CALL
;	STA	NULL
;	RET
	
LTRON:		;L1409 
	MVI	A,0AFH
	STA	TRCFLG
	RET
 
LSWAP:		;L140F
	CALL	L1E30+1
	PUSH	D
	PUSH	H
	LXI	H,SWAP
	CALL	L3956	
	LHLD	ARYTAB
	XTHL
L141E:	
	RST	4
	PUSH	PSW
	RST	1
	DB	2CH	;','
	CALL	L1E30+1
	POP	B
	RST	4
	CMP	B
	JNZ	L3A88	
	XTHL
	XCHG
	PUSH	H
	LHLD	ARYTAB
	RST	3
	JNZ	L14DA	;ILLEGAL FUNCTION CALL
	POP	D
	POP	H
	XTHL
	PUSH	D
	CALL	L3956	
	POP	H
	LXI	D,SWAP
	CALL	L3956	
	POP	H
	RET
 
;LERASE:		;L144D
;	MVI	A,1
;	STA	SUBFLG
;	CALL	L1E30+1
;	PUSH	H
;	STA	SUBFLG
;	MOV	H,B
;	MOV	L,C
;	DCX	B
;	DCX	B
;	DCX	B
;	DCX	B
;	DCX	B
;	DAD	D
;	XCHG
;	LHLD	STREND
;L1465:		
;	RST	3
;	LDAX	D
;	STAX	B
;	INX	D
;	INX	B
;	JNZ	L1465	
;	DCX	B
;	MOV	H,B
;	MOV	L,C
;	SHLD	STREND
;	POP	H
;	MOV	A,M
;	CPI	','	
;	RNZ
;	RST	2
;	JMP	LERASE
 
L1480:		
	POP	PSW
	POP	H
	RET
 
LDEFSTR:	;L1483
	MVI	E,3
LDEFINT:	;L1485
	LXI	B,021EH
LDEFSNG:	;L1488
	LXI	B,041EH
LDEFDBL:	;L148B
	LXI	B,081EH
L148E:		
	CALL	L14CB	
	LXI	B,L0B13	;SYNTAX ERROR
	PUSH	B
	RC
	SUI	41H
	MOV	C,A
	MOV	B,A
	RST	2
	CPI	0F3H	;-
	JNZ	L14AF	
	RST	2
	CALL	L14CB	
	RC
	SUI	41H
	MOV	B,A
	RST	2
L14AF:		
	MOV	A,B
	SUB	C
	RC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	L1650	
	LHLD	FAC
	PUSH	H
	INX	H
	MOV	E,M
	INX	H
	MOV	D,M
	LHLD	TXTTAB
	RST	3
	JNC	L1643+1
	LHLD	STKTOP
	RST	3
	POP	D
	JNC	L164C	
	LHLD	VARTAB
	RST	3
	JNC	L164C	
L1643:	MVI	A,0D1H
	CALL	L23E3	
	XCHG
	CALL	L2213	
L164C:		
	CALL	L23E3	
	XTHL
L1650:		
	CALL	L3956	
	POP	D
	POP	H
	RET
 
LON:		;L1656
	CPI	0A8H	;ERROR
	JNZ	L1685	
	RST	2
	RST	1
	DB	89H	;GOTO
	CALL	L14EA	
	MOV	A,D
	ORA	E
	JZ	L1673	
	CALL	L0CF5	
	MOV	D,B
	MOV	E,C
	POP	H
	JNC	L15AF	
L1673:		
	XCHG
	SHLD	ONELIN
	XCHG
	RC
	LDA	ONEFLG
	ORA	A
	RZ
	LDA	ERRFLG
	MOV	E,A
	JMP	L0B2D	
 
L1685:		
	CALL	L2686	;GET NUMBER
	MOV	A,M
	MOV	B,A
	CPI	8DH	;GOSUB
	JZ	L1694	
	RST	1
	DB	89H	;GOTO
	DCX	H
L1694:		
	MOV	C,E
L1695:		
	DCR	C
	MOV	A,B
	JZ	L1293	
	CALL	L14EB	
	CPI	','	
	RNZ
	JMP	L1695	
 
LRESUME: 	;L16A3
	LXI	D,ONEFLG
	LDAX	D
	ORA	A
	JZ	L0B21+1	;RESUME WITHOUT ERROR
	INR	A
	STA	ERRFLG
	STAX	D
	MOV	A,M
	CPI	83H	;NEXT
	JZ	L16C3	
	CALL	L14EA	
	RNZ
	MOV	A,D
	ORA	E
	JNZ	L1580	
	INR	A
	JMP	L16C7	
 
L16C3:		
	RST	2
	RNZ
L16C7:		
	LHLD	ERRTXT
	XCHG
	LHLD	ERRLIN
	SHLD	CURLIN
	XCHG
	RNZ
	MOV	A,M
	ORA	A
	JNZ	L16DC	
	INX	H
	INX	H
	INX	H
	INX	H
L16DC:		
	INX	H
	JMP	LDATA
 
LERROR:		;L16E0
	CALL	L2686	;GET NUMBER
	RNZ
	ORA	A
	JZ	L14DA	;ILLEGAL FUNCTION CALL
	JMP	L0B24	;ERROR SUBROUTINE
 
LAUTO:		;L16EB
	LXI	D,000AH
	PUSH	D
	JZ	L170D	
	CALL	L14DF	
	XCHG
	XTHL
	JZ	L170E	
	XCHG
	RST	1
	DB	2CH	;','
	XCHG
	LHLD	AUTINC
	XCHG
	JZ	L170D	
	CALL	L14EA	
	JNZ	L0B13	;SYNTAX ERROR
L170D:		
	XCHG
L170E:	
	MOV	A,H
	ORA	L
	JZ	L14DA	;ILLEGAL FUNCTION CALL
	SHLD	AUTINC
	STA	AUTFLG
	POP	H
	SHLD	AUTLIN
	POP	B
	JMP	L0BBD	
 
LIF:		;L1721
	CALL	ARIFM	
	MOV	A,M
	CPI	','	
	CZ	L12AB	;NEXT SYMBOL
	CPI	89H	;GOTO
	JZ	L1734	
	RST	1
	DB	0DDH	;THEN
	DCX	H
L1734:		
	PUSH	H
	CALL	L3913	
	POP	H
	JZ	L174C	
L173C:		
	RST	2
	CPI	0EH
	JZ	LGOTO	
	CPI	0DH
	JZ	LGOTO	
	JMP	L1292	
 
L174C:		
	MVI	D,1
L174E:		
	CALL	LDATA
	ORA	A
	RZ
	RST	2
	CPI	0A2H	;ELSE
	JNZ	L174E	
	DCR	D
	JNZ	L174E	
	JMP	L173C	
 
;LLPRINT:	;L1762
;	MVI	A,1
;	STA	PRTFLG
;	JMP	L176F	
 
LPRINT:		;L176A
	MVI	C,2
	CPI	23H
	JZ 	D325F
;	CALL	L325C	;#
L176F:		
	DCX	H
	RST	2
	CZ	L17E8	
L1776:		
	JZ	L1886	
	CPI	0E7H	;USING
	JZ	L2861	
	CPI	0DEH	;TAB(
	JZ	L1842	
	CPI	0E2H	;SPC(
	JZ	L1842	
	PUSH	H
	CPI	','	
	JZ	L180F	
	CPI	';'	
	JZ	L187F	
	POP	B
	CALL	ARIFM	
	PUSH	H
	RST	4
	JZ	L17D4	
	CALL	L3FED	
	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A	LPTPOS
	JMP	L186F	
 
L186C:		
	LDA	TTYPOS
L186F:		
	CMA
	ADD	E
	JNC	L187F	
L1874:		
	INR	A
	MOV	B,A
	MVI	A,' '	
L1878:		
	RST	5
	DCR	B
	JNZ	L1878	
L187F:		;';'
	POP	H
	RST	2
	JMP	L1776	
 
L1886:		
	XRA	A
	STA     PRTFLG
	PUSH	H
	MOV	H,A
	MOV	L,A
	SHLD	PTRFIL
	POP	H
	RET
 
LLINE:		;L1892
	CPI	85H	;INPUT
	JNZ	NLINE
	RST	1
	DB 	85H	;INPUT
	CPI	'#'	
	JZ	D32E9	
	CALL	L18F2	
	CALL	L1E30+1
	CALL	L3A84	
	PUSH	D
	PUSH	H
	CALL	L0FEA	
	POP	D
	POP	B
	JC	L139C+1
	PUSH	B
	PUSH	D
	MVI	B,0
	CALL	L2238	
	POP	H
	XRA	A
	JMP	L1612	
 
L18BA:		
	DB	3FH,0F0H,0EFH,0F7H,0F4H,0EFH,0F2H,0E9H,0F4H,0E5H,20H
	DB	0F7H,0F7H,0EFH,0E4H,0DH,0AH,0
 
L18CD:		 
	LDA	FLGINP
	ORA	A
	JNZ	L0B0D	
	POP	B
	LXI	H,L18BA	
	CALL	L227C	
	LHLD	SAVTXT
	RET
 
;L18DF:		
;	CALL	L325A	
;	PUSH	H
;	LXI	H,BUFMIN
;	JMP	L1917	
 
LINPUT:		;L18E9
	CPI	'#'	
	JZ	D18DF	
	LXI	B,L1907	
	PUSH	B
L18F2:		
	CPI	'"'	
	MVI	A,0
	STA	L072A	
	RNZ
	CALL	L2236	
	RST	1
	DB 	3BH	;';'
	PUSH	H
	CALL	L227F	
	POP	H
	RET
 
L1907:		
	PUSH	H
	CALL	L0D99	
	POP	B
	JC	L139C+1
	INX	H
	MOV	A,M
	ORA	A
	DCX	H
	PUSH	B
	JZ	L15CD+1
L1917:		
	MVI	M,','	
	JMP	L1920+1
 
LREAD:		;L191C
	PUSH	H
	LHLD	DATPTR
L1920:	ORI	0AFH
	STA	FL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ET

LFRE:		;L203C
	LHLD	STREND
	XCHG
	LXI	H,0000	
	DAD	SP
	RST	4
	JNZ	L2057	
	CALL	L23C5	
	CALL	L22BF	
	LHLD	STKTOP
	XCHG
	LHLD	FRETOP
L2057:		
	MOV	A,L
	SUB	E
	MOV	L,A
	MOV	A,H
	SBB	D
	MOV	H,A
	JMP	L3C43	
 
;*
LCSRL:
	RST	2
	CALL	CURSOR
	PUSH	H
	INR	A
	CALL	L2069
	POP	H	
	RET
;LLPOS:		;L2060
;	LDA	LPTPOS
;	JMP	L2069	
 
LPOS:		;L2066
	LDA	TTYPOS
	INR	A
L2069:		
	MOV	L,A
	XRA	A
L206B:		
	MOV	H,A
	JMP	L3A25	
 
;L206F:		;USR
;	CALL	L208E	
;	PUSH	D
;	CALL	L1CA0	
;	XTHL
;	MOV	C,M
;	INX	H
;	MOV	B,M
;	LXI	H,L37FF	
;	PUSH	H
;	PUSH	B
;	LDA	VALTYP
;	PUSH	PSW
;	CPI	3
;	CZ	L23C5	
;	POP	PSW
;	XCHG
;	LXI	H,FAC
;	RET
 
;L208E:		
;	RST	2
;	LXI	B,0000	
;	CPI	1BH
;	JNC	L20A6	
;	CPI	11H
;	JC	L20A6	
;	RST	2
;	LDA	CONLO	
;	RAL
;	MOV	C,A
;L20A6:	
;	XCHG
;	LXI	H,L070E	
;	DAD	B
;	XCHG
;	RET
 
;L20AD:		
;	CALL	L208E	
;	PUSH	D
;	RST	1
;	DB	0F0H	;'='
;	CALL	L2667	
;	XTHL
;	MOV	M,E
;	INX	H
;	MOV	M,D
;	POP	H
;	RET
 
LDEF:		;L20BE
	CPI	0E0H	;USR
	JZ	D20AD	
	CALL	L21EC	
	CALL	L21DE	
	XCHG
	MOV	M,E
	INX	H
	MOV	M,D
	XCHG
	MOV	A,M
	CPI	'('	;28H
	JNZ	LDATA	
	RST	2
L20D7:		
	CALL	L1E30+1
	MOV	A,M
	CPI	')'	;29H
	JZ	LDATA
	RST	1
	DB	2CH	;','
	JMP	L20D7	
 
L20E7:		
	CALL	L21EC	
	LDA	VALTYP
	ORA	A
	PUSH	PSW
	SHLD	TEMP2	
	XCHG
	MOV	A,M
	INX	H
	MOV	H,M
	MOV	L,A
	ORA	H
	JZ	L0B1E+1	;UNDEFINED USER FUNCTION
	MOV	A,M
	CPI	'('	;28H
	JNZ	L215F+1
	RST	2
	SHLD	TEMP3
	JMP	L210E
 
L210A:		
	RST	1
	DB	2CH	;','
L210E:		
	MVI	C,4
	CALL	L0ACD	
	MVI	A,80H
	STA	SUBFLG
	CALL	L1E30+1
	XCHG
	STC
	JMP	L1AEE	
 
L2120:		
	JNC	L3A88	
	PUSH	D
	XCHG
	CALL	L225A+1
	POP	D
	XRA	A
L212A:	
	PUSH	H
	PUSH	PSW
	XCHG
	MOV	A,M
	CPI	')'	;29H
	JNZ	L210A	
	LHLD	TEMP2	
	RST	1
	DB	'('	;28H
	PUSH	H
	LHLD	TEMP3	
L213E:		
	CALL	L1E30+1
	XTHL
	CALL	L1609	
	MOV	A,M
	CPI	')'	;29H
	JZ	L2157	
	RST	1
	DB	2CH	;','
	XTHL
	RST	1
	DB	2CH	;','
	JMP	L213E	
 
L2157:		
	RST	2
	XTHL
	RST	1
	DB	29H	;')'
L215F:	MVI	A,0D5H
	RST	1
	DB	0F0H	;'='
	CALL	ARIFM	
	DCX	H
	RST	2
	JNZ	L0B13	;SYNTAX ERROR
	RST	4
	JZ	L21B6	
L2175:		
	POP	D
L2176:		
	POP	PSW
	JZ	L21CE	
	JNC	L219A	
	POP	H
	POP	B
	MOV	M,B
	DCX	H
	MOV	M,C
	JM	L2176	
	DCX	H
	POP	B
	MOV	M,B
	DCX	H
	MOV	M,C
	JPO	L2176	
	DCX	H
	POP	B
	MOV	M,B
	DCX	H
	MOV	M,C
	DCX	H
	POP	B
	MOV	M,B
	DCX	H
	MOV	M,C
	JMP	L2176	
 
L219A:		
	PUSH	D
	PUSH	PSW
	RST	4
	LXI	D,DSCTMP
	CZ	L225A+1
	POP	PSW
L21A6:	CPI	0E5H
	ANI	7
	LXI	H,L0459	
	MOV	C,A
	MVI	B,0
	DAD	B
	CALL	L1D71	
	POP	H
	RET
 
L21B6:		
	LHLD	TEMPPT
	XCHG
	LHLD	FAC
	RST	3
	JC	L21C9	
	CALL	L2213	
	JMP	L2175	
 
L21C9:		
	POP	D
	LXI	H,DSCTMP
	PUSH	H
L21CE:		
	CALL	L23E3	
	MOV	A,M
	SHLD	TEMPPT
	POP	H
	MOV	M,A
	INX	H
	MOV	M,C
	INX	H
	MOV	M,B
	JMP	L2176	
 
L21DE:		
	PUSH	H
	LHLD	CURLIN
	INX	H
	MOV	A,H
	ORA	L
	POP	H
	RNZ
	MVI	E,0CH	;ILLEGAL DIRECT
	JMP	L0B24	
L21EC:		
	RST	1
	DB	0E1H	;FN
	MVI	A,80H
	STA	SUBFLG
	ORA	M
	MOV	B,A
	JMP	L1E36	

;*
LBIN:	
	CALL	L4451
	JMP	L2209
  
LOCT:		;L21FA
	CALL	L4456	
	JMP	L2209	
 
LHEX:		;L2200
	CALL	L445B
	JMP	L2209	
;*
  
LSTR:		;L2206
	CALL	L3FED	
L2209:		
	CALL	L2235	
	CALL	L23C5	
	LXI	B,L241B	
	PUSH	B
L2213:		
	MOV	A,M
	INX	H
	PUSH	H
	CALL	L2295	
	POP	H
	MOV	C,M
	INX	H
	MOV	B,M
	CALL	L222A	
	PUSH	H
	MOV	L,A
	CALL	L23B8	
	POP	D
	RET
 
L2227:		
	CALL	L2295	
L222A:		
	LXI	H,DSCTMP
	PUSH	H
	MOV	M,A
	INX	H
	MOV	M,E
	INX	H
	MOV	M,D
	POP	H
	RET
 
L2235:		
	DCX	H
L2236:		
	MVI	B,'"'	;22H
L2238:		
	MOV	D,B
L2239:		
	PUSH	H
	MVI	C,0FFH
L223C:		
	INX	H
	MOV	A,M
	INR	C
	ORA	A
	JZ	L224B	
	CMP	D
	JZ	L224B	
	CMP	B
	JNZ	L223C	
L224B:		
	CPI	'"'	;22H
	CZ	L12AB	;NEXT SYMBOL
	XTHL
	INX	H
	XCHG
	MOV	A,C
	CALL	L222A	
L2257:		
	LXI	D,DSCTMP
L225A:	MVI	A,0D5H
	LHLD	TEMPPT
	SHLD	FAC
	MVI	A,3
	STA	VALTYP
	CALL	L3956	
	LXI	D,FRETOP
	RST	3
	SHLD	TEMPPT
	POP	H
	MOV	A,M
	RNZ
	MVI	E,10H	;STRING FORMULA TOO COMPLEX
	JMP	L0B24	
 
L227B:		
	INX	H
L227C:		
	CALL	L2235	
L227F:		
	CALL	L23C5	
	CALL	L3946	
	INR	D
L2286:		
	DCR	D
	RZ
	LDAX	B
	RST	5
	CPI	0DH
	CZ	L17F2	
	INX	B
	JMP	L2286	
 
L2295:		
	ORA	A
L2296:	MVI	C,0F1H
	PUSH	PSW
	LHLD	STKTOP
	XCHG
	LHLD	FRETOP
	CMA
	MOV	C,A
	MVI	B,0FFH
	DAD	B
	INX	H
	RST	3
	JC	L22B3	
	SHLD	FRETOP
	INX	H
	XCHG
L22B1:	
	POP	PSW
	RET
 
L22B3:		
	POP	PSW
	MVI	E,0EH	;OUT OF STRING SPACE
	JZ	L0B24	
	CMP	A
	PUSH	PSW
	LXI	B,L2296+1
	PUSH	B
L22BF:		
	LHLD	MEMSIZ
L22C2:		
	SHLD	FRETOP
	LXI	H,0000	
	PUSH	H
	LHLD	STKTOP
	PUSH	H
	LXI	H,TEMPST
L22D0:		
	XCHG
	LHLD	TEMPPT
	XCHG
	RST	3
	LXI	B,L22D0	
	JNZ	L2330	
	LHLD	VARTAB
L22E1:		
	XCHG
	LHLD	ARYTAB
	XCHG
	RST	3
	JZ	L2301	
	MOV	A,M
	INX	H
	INX	H
	INX	H
	CPI	3
	JNZ	L22F9	
	CALL	L2331	
	XRA	A
L22F9:		
	MOV	E,A
	MVI	D,0
	DAD	D
	JMP	L22E1	
 
L2300:		
	POP	B
L2301:		
	XCHG
	LHLD	STREND
	XCHG
	RST	3
	JZ	L2355	
	MOV	A,M
	INX	H
	CALL	L3944	
	PUSH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X	D
	JMP	L23B9	
 
L23C2:		
	CALL	L3A84	
L23C5:		
	LHLD	FAC
L23C8:		
	XCHG
L23C9:	
	CALL	L23E3	
	XCHG
	RNZ
	PUSH	D
	MOV	D,B
	MOV	E,C
	DCX	D
	MOV	C,M
	LHLD	FRETOP
	RST	3
	JNZ	L23E1	
	MOV	B,A
	DAD	B
	SHLD	FRETOP
L23E1:		
	POP	H
	RET
 
L23E3:		
	LHLD	TEMPPT
	DCX	H
	MOV	B,M
	DCX	H
	MOV	C,M
	DCX	H
	RST	3
	RNZ
	SHLD	TEMPPT
	RET
 
LLEN:		;L23F3
	LXI	B,L2069	
	PUSH	B
L23F7:		
	CALL	L23C2	
	XRA	A
	MOV	D,A
	MOV	A,M
	ORA	A
	RET
 
LASC:		;L23FF
	LXI	B,L2069	
	PUSH	B
L2403:		
	CALL	L23F7	
	JZ	L14DA	;ILLEGAL FUNCTION CALL
	INX	H
	MOV	E,M
	INX	H
	MOV	D,M
	LDAX	D
	RET
 
LCHR:		;L240F
	MVI	A,1
	CALL	L2227	
	CALL	L2689	;GET NUMBER
L2417:	LHLD	DSCPTR
	MOV	M,E
L241B:		
	POP	B
	JMP	L2257	
 
L241F:		;STRING
	RST	2
	RST	1
	DB	'('	;28H
	CALL	L2686	;GET NUMBER
	PUSH	D
	RST	1
	DB	2CH	;','
	CALL	ARIFM	
	RST	1
	DB	29H	;')'
	XTHL
	PUSH	H
	RST	4
	JZ	L2443	
	CALL	L2689	
	JMP	L2446	
 
L2443:		
	CALL	L2403	
L2446:		
	POP	D
	CALL	L244F	
LSPACE:		;L244A
	CALL	L2689	
	MVI	A,' '	;20H
L244F:		
	PUSH	PSW
	MOV	A,E
	CALL	L2227	
	MOV	E,A
	POP	PSW
	INR	E
	DCR	E
	JZ	L241B	
	LHLD	DSCPTR
           
L245E:		
	MOV	M,A
	INX	H
	DCR	E
	JNZ	L245E	
	JMP	L241B	
 LLEFT:		;L2467
	CALL	L24DD	
	XRA	A
L246B:		
	XTHL
	MOV	C,A
L246D:	MVI	A,0E5H
L246F:		
	PUSH	H
	MOV	A,M
	CMP	B
	JC	L2476+1
	MOV	A,B
L2476:	LXI	D,000EH
	PUSH	B
	CALL	L2295	
	POP	B
	POP	H
	PUSH	H
	INX	H
	MOV	B,M
	INX	H
	MOV	H,M
	MOV	L,B
	MVI	B,0
	DAD	B
	MOV	B,H
	MOV	C,L
	CALL	L222A	
	MOV	L,A
	CALL	L23B8	
	POP	D
	CALL	L23C9	
	JMP	L2257	
 
LRIGHT:		;L2498
	CALL	L24DD	
	POP	D
	PUSH	D
	LDAX	D
	SUB	B
	JMP	L246B
 
LMID:		;L24A2
	XCHG
	MOV	A,M
	CALL	L24E2	
	INR	B
	DCR	B
	JZ	L14DA	;ILLEGAL FUNCTION CALL
	PUSH	B
	CALL	L260A	
	POP	PSW
	XTHL
	LXI	B,L246F	
	PUSH	B
	DCR	A
	CMP	M
	MVI	B,0
	RNC
	MOV	C,A
	MOV	A,M
	SUB	C
	CMP	E
	MOV	B,A
	RC
	MOV	B,E
	RET
 
LVAL:		;L24C3
	CALL	L23F7	
	JZ	L2069	
	MOV	E,A
	INX	H
	MOV	A,M
	INX	H
	MOV	H,M
	MOV	L,A
	PUSH	H
	DAD	D
	MOV	B,M
	MOV	M,D
	XTHL
	PUSH	B
	MOV	A,M
	CALL	L3E62	
	POP	B
	POP	H
	MOV	M,B
	RET
 
L24DD:		
	XCHG
	RST	1
	DB	29H	;')'
L24E2:		
	POP	B
	POP	D
	PUSH	B
	MOV	B,E
	RET
 
L24E7:		;INSTR
	RST	2
	CALL	L1A7C	
	RST	4
	MVI	A,1
	PUSH	PSW
	JZ	L2509	
	POP	PSW
	CALL	L2689	
	ORA	A
	JZ	L14DA	;ILLEGAL FUNCTION CALL
	PUSH	PSW
	RST	1
	DB	2CH	;','
	CALL	ARIFM	
	CALL	L3A84	
L2509:		
	RST	1
	DB	2CH	;','
	PUSH	H
	LHLD	FAC
	XTHL
	CALL	ARIFM	
	RST	1
	DB	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W
	MOV	A,M
	CALL	L260A	
	PUSH	D
	RST	1
	DB	0F0H	;'='
	CALL	ARIFM	
	PUSH	H
	CALL	L23C2	
	XCHG
	POP	H
	POP	B
	POP	PSW
	MOV	B,A
	XTHL
	PUSH	H
	LXI	H,L37FF	
	XTHL
	MOV	A,C
	ORA	A
	RZ
	MOV	A,M
	SUB	B
	JC	L14DA	;ILLEGAL FUNCTION CALL
	INR	A
	CMP	C
	JC	L25E7	
	MOV	A,C
L25E7:		
	MOV	C,B
	DCR	C
	MVI	B,0
	PUSH	D
	INX	H
	MOV	E,M
	INX	H
	MOV	H,M
	MOV	L,E
	DAD	B
	MOV	B,A
	POP	D
	XCHG
	MOV	C,M
	INX	H
	MOV	A,M
	INX	H
	MOV	H,M
	MOV	L,A
	XCHG
	MOV	A,C
	ORA	A
	RZ
L25FF:	
	LDAX	D
	MOV	M,A
	INX	D
	INX	H
	DCR	C
	RZ
	DCR	B
	JNZ	L25FF	
	RET
 
L260A:		
	MVI	E,0FFH
	CPI	')'	;29H
	JZ	L2618	
	RST	1
	DB	2CH	;','
	CALL	L2686	;GET NUMBER
L2618:		
	RST	1
	DB	29H	;')'
	RET
;***********************************
;LINP:		;L261D
;	CALL	L2689	
;	STA	L2623+1
;L2623:	IN	0
;	JMP	L2069	
 
;LOUT:		;L2628
;	CALL	L2673	
;L262B:	OUT	0
;	RET
 
;LWAIT:		;L262E
;	CALL	L2673	
;	PUSH	PSW
;	MVI	E,0
;	DCX	H
;	RST	2
;	JZ	L2642	
;	RST	1
;	DB	2CH	;','
;	CALL	L2686	
;L2642:		
;	POP	B
;L2643:		
;	IN	0
;	XRA	E
;	ANA	B
;	JZ	L2643	
;	RET
;**********************************
;LWIDTH:		;L264B
;	CALL	L2686	;GET NUMBER
;	CPI	0FH
;	JC	L14DA	
;	STA	DISPLAY
;L2656:		
;	SUI	0EH
;	JNC	L2656	
;	ADI	1CH
;	CMA
;	INR	A
;	ADD	E
;	STA	L0728	
;	RET
 
L2664:		
	RST	2
L2667:		
	CALL	ARIFM	
L266A:		
	PUSH	H
	CALL	LCINT	;L3A07
	XCHG
	POP	H
	MOV	A,D
	ORA	A
	RET
 
;L2673:		
;	CALL	L2686	
;	STA	L2643+1
;	STA	L262B+1
;	RST	1
;	DB	2CH	;','
;	JMP	L2686	
 
L2683:		
	RST	2
L2686:		
	CALL	ARIFM	
L2689:		
	CALL	L266A	
	JNZ	L14DA	;ILLEGAL FUNCTION CALL
	DCX	H
	RST	2
	MOV	A,E
	RET
 
;LLLIST:		;L2695
;	MVI	A,1
;	STA	PRTFLG
LLIST:		;L269A 
	POP	B
	CALL	L0CD7	
	PUSH	B
L269F:		
	LXI	H,0FFFFH
	SHLD	CURLIN
	POP	H
	POP	D
	MOV	C,M
	INX	H
	MOV	B,M
	INX	H
	MOV	A,B
	ORA	C
	JZ	L0BA2	
	PUSH	H
	LHLD	PTRFIL
	MOV	A,H
	ORA	L
	POP	H
	CZ	L1370	
	PUSH	B
	MOV	C,M
	INX	H
	MOV	B,M
	INX	H
	PUSH	B
	XTHL
	XCHG
	RST	3
	POP	B
	JC	L0BA0+1
	XTHL
	PUSH	H
	PUSH	B
	XCHG
	SHLD	DOT
	CALL	L3FDF	
	MVI	A,' '	;20H
	POP	H
	RST	5
	CALL	L26F2	
	LXI	H,BUF
	CALL	L26E8	
	CALL	L17E8	
	JMP	L269F	
 
L26E8:		
	MOV	A,M
	ORA	A
	RZ
	CALL	L2BFD	
	INX	H
	JMP	L26E8	
 
L26F2:		
	XRA	A
	STA	LRUS
	LXI	B,BUF
	MVI	D,0FFH
	JMP	L26FE
 
L26FA:		
	INX	B
	INX	H
	DCR	D
	RZ
L26FE:		
	MOV	A,M
	ORA	A
	STAX	B
	RZ
	CPI	0BH
	JC	L26FA	
	CPI	' '	;20H
	JC	L2763	
L270C:		
;*
	CPI	22H	;"
	JNZ	L270D
	LDA	LRUS
	XRI	01
	STA	LRUS
	JMP	L26FA
L270D:	LDA	LRUS
	ORA	A
	JNZ	L26FA
	M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
L27B1:		
	MOV	A,M
	CPI	' '	;20H
	CZ	L394B	
L27B7:		
	MOV	A,M
	INX	H
	ORA	A
	JZ	L27E3	
	STAX	B
	INX	B
	DCR	D
	RZ
	LDA	CONTYP
	CPI	4
	JC	L27B7	
	DCX	B
	LDAX	B
	INX	B
	JNZ	L27D4	
	CPI	'.'	;2EH
	JZ	L27DE	
L27D4:		
	CPI	'D'	;44H
	JZ	L27DE	
	CPI	'E'	;45H
	JNZ	L27B7	
L27DE:		
	MVI	E,0
	JMP	L27B7	
 
L27E3:		
	MOV	A,E
	ORA	A
	JZ	L27EC	
	STAX	B
	INX	B
	DCR	D
	RZ
L27EC:	
	LHLD	CONTXT
	JMP	L26FE	
 
LDELETE:	;L27F2
	CALL	L0CD7	
	PUSH	B
	CALL	L2D57	
	POP	B
	POP	D
	PUSH	B
	PUSH	B
	CALL	L0CF7	
	JNC	L280A
	MOV	D,H
	MOV	E,L
	XTHL
	PUSH	H
	RST	3
L280A:		
	JNC	L14DA	;ILLEGAL FUNCTION CALL
	LXI	H,L0A8E	
	CALL	L227C	
	POP	B
	LXI	H,L0C86	
	XTHL
L2818:	
	XCHG
	LHLD	VARTAB
L281C:		
	LDAX	D
	STAX	B
	INX	B
	INX	D
	RST	3
	JNZ	L281C	
	MOV	H,B
	MOV	L,C
	SHLD	VARTAB
	RET
 
;LPEEK:		;L282C
;	CALL	L2845	
;	MOV	A,M
;	JMP	L2069	
 
;LPOKE:		;L2833
;	CALL	ARIFM	
;	PUSH	H
;	CALL	L2845	
;	XTHL
;	RST	1
;	DB	2CH	;','
;	CALL	L2686	;GET NUMBER
;	POP	D
;	STAX	D
;	RET
 
L2845:		
	LXI	B,LCINT	;L3A07
	PUSH	B
	RST	4
	RM
	LDA	L0A5B	
	CPI	90H
	RNZ
	LDA	L0A5A	
	ORA	A
	RM
	LXI	B,9180H
	LXI	D,0000	
	JMP	SPADD	
 
L2861:		;USING
	CALL	L1A81	
	CALL	L3A84	
	RST	1
	DB	3BH	;';'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	H
	MOV	A,M
	CPI	22H
	JZ	L0B13	; ERROR
;	DCX	H
LCOM1:	INX	B
	MOV	A,M
	INX	H
	CPI	22H	;"
	JZ	LCOM2
	DCR	D
	JZ	L0B13	;SYNTAX ERROR
	STAX	B
	JMP	LCOM1
	
LCOM2:	MVI	A,0
	STAX	B
	INX	B
	STAX	B
	INX	B
	STAX	B
	MVI	A,01
	STA	6200H
	RET
LCSAVE:	PUSH	H  
	MVI	A,1	;ëïä úáðéóé äìéîîïçï íáòëåòá
	CALL	LTAPOON	;úáðéóø äìéîîïçï íáòëåòá
	MVI	B,0AH	;óþåôþéë âáêôï÷
	           
;-------------- úáðéóø 10 âáêô 0D3-----------------
     
	MVI	A,0D3H 
ZAP0D3:	CALL	LTAPOUT	;úáðéóø âáêôá îá ëáóóåôõ
	DCR	B
	JNZ	ZAP0D3
                
;------------- úáðéóø éíåîé ðòïçòáííù -------------
      
	MVI	B,06H
	MVI	A,0A3H	;÷íåóôï éíåîé-->6 âáêô 0á3
REP:	CALL	LTAPOUT	;úáðéóø âáêôá îá ëáóóåôõ
	DCR	B   
	JNZ	REP    
            
;------------- úáðéóø äáîîùè ----------------------
         
ZAPDAT:	MVI	A,0	;ëïä ëïòïôëïçï íáòëåòá
	CALL	LTAPOON	;úáðéóø ëïòïôëïçï íáòëåòá
	LHLD	VARTAB	;áäòåó ëïîãá âåêóéë-ðòïçòáííù
GROB:	SUB	A
	DCX	H
	ORA	M
	JNZ	GROB
	DCX	H
	ORA	M
	JNZ	GROB
	DCX	H
	ORA	M
	JNZ	GROB
	XCHG
	LHLD	TXTTAB	;áäòåó îáþáìá âåêóéë-ðòïçòáííù
REP1:	RST	3	
	JNC	ZAP70
	MOV	A,M
	CALL	LTAPOUT	;úáðéóø âáêôá îá ëáóóåôõ
	INX	H
	JMP	REP1
ZAP70:	MVI	B,0AH	;óþåôþéë 7-íé îõìåê
	MVI	A,0
REPR:	CALL	LTAPOUT	;úáðéóø âáêôá îá ëáóóåôõ
	DCR	B
	JNZ	REPR	
	CALL	005EH 	;ïóôáîï÷ úáðéóé
	POP	H
	RET
LTAPIN:	PUSH	H
	PUSH	D
	PUSH	B
	CALL	0052H	;æõîëãéñ þôåîéñ âáêôá
	JNC	MET111 
	JMP	LTAPIOF
LTAPOUT:PUSH	H
	PUSH	D
	PUSH	B
	PUSH	PSW
	CALL	005BH 	;æõîëãéñ úáðéóé âáêôá
	JMP	MET100
LTAPION:PUSH	H
	PUSH	D
	PUSH	B
	CALL	004FH 	;æõîëãéñ þôåîéñ íáòëåòá
	JNC	MET111
LTAPIOF:CALL	0055H 	;æõîëãéñ ïóôáîï÷á þôåîéñ
	STC		;õóôáîï÷ëá ðòéúîáëá C
	JMP	MET111
LTAPOOF:CALL	005EH 	;æõîëãéñ ïóôáîï÷á úáðéóé
	JMP	MET100
LSTMOTR:PUSH	H
	PUSH	D
	PUSH	B
	PUSH	PSW
	CALL	0061H 	;æõîëãéñ ÷ëì/÷ùëì íïôïòá
	JMP	MET100
LTAPOON:PUSH	H
	PUSH	D
	PUSH	B
	PUSH	PSW
	CALL	0058H 	;æõîëãéñ úáðéóé íáòëåòá
MET100:	POP	PSW
MET111:	POP	B
	POP	D
	POP	H
	RET

LCLOAD:
	MVI	B,0AH	;óþåôþéë
	CALL	LTAPION	;þôåîéå íáòëåòá
	JC	LMIST	;ïûéâëá þôåîéñ
SATUR1:	CALL	LTAPIN	;þôåîéå âáêôá
	JC	LMIST
	CPI	0D3H
	JNZ	LMIST
	DCR	B
	JNZ	SATUR1
	MVI	B,6
	LXI	H,L076C	;áäòåó éíåîé æáêìá
SATUR3:	CALL	LTAPIN 	;þôåîéå âáêôá
	JC	LMIST
	MOV	M,A
	INX	H
	DCR	B
	JNZ	SATUR3
	CALL	LTAPION	;þôåîéå íáòëåòá
	JC	LMIST
	LHLD	TXTTAB	;áäòåó îáþáìá âåêóéë-ðòïçòáííù
SATUR5:	MVI	B,0AH
SATUR6:	CALL	LTAPIN
	JC	LMIST
	MOV	M,A
	INX	H
	ORA	A
	JNZ	SATUR5
	DCR	B
	JNZ	SATUR6
	CALL	0055H 	;ïóôáîï÷ þôåîéñ
	CALL	L0CAA	;NASTROJKA PROGRAMMY
	INX	H
	SHLD	VARTAB
	LXI	H,MAXFIL
	MOV	A,M
	STA	L0732
	MVI	M,0
	CALL	L0D41	;THE PART OF NEW
	LDA	L0732
	STA	MAXFIL
	LDA	L0731
	ORA	A
	JZ	L0BA2
	JMP	L1246	;INTERPRETATOR
LMIST:	LXI	H,MISTAKE
	CALL	L227C
	CALL	0055H
	JMP	L0BA2
MISTAKE:DB	0EFH,0FBH,0E9H,0E2H,0EBH,0E1H,20H,20H
	DB	0FEH,0F4H,0E5H,0EEH,0E9H,0F1H,0,0
                                             
LMOTOR:	MOV	A,M
	CPI	095H	;ëïä ON
	JZ	MOTON
	CPI	0ECH	;ëïä OFF
	JZ	MOTOFF
	MVI	A,0FFH                   
	JMP	ROLL
MOTON:	INX	H
	MVI	A,1
	JMP	ROLL
MOTOFF:	INX	H
	MVI	A,0
ROLL:	CALL	LSTMOTR
  	RET
 
LBEEP: 	PUSH	H
	MVI	A,7	;÷ùäáþá ú÷õëá
	RST	5
	POP	H
	RET
 
;**********  GRAPHICS **********
LCOLOR:			; *** COLOR ***
	MOV	A,M	
	CPI	2CH
	CNZ	N340C  
	CALL	PARM
	CNZ	N3429
	RET

N3403:
	CALL	L2686	;GET NUMBER
	CPI	8
	JNC	L14DA	;ILLEGAL FUNCTION CALL
	RET

N340C:		;FOREGROUND
	CALL	N3403
	ADD	A
	MOV	C,A
	XCHG
	LXI	H,N404A
	MOV	A,M
	ANI	0F0H
	ORA	C
	MOV	M,A
	MVI	B,0F1H
N341C: 
 	LXI	H,N404B
	MOV	A,M
	ANA	B
	ORA	C
	MOV	M,A
	STA	NCREG
	XCHG
	MOV	A,M
	RET

N3429:		;BACKGROUND
	CALL	N3403
	ADD	A
	ADD	A
	ADD	A
	ADD	A
	MOV	C,A
	XCHG
	LXI	H,N404A
	MOV	A,M
	ANI	0FH
	ORA	C
	MOV	M,A
	XCHG
	MOV	A,M
	RET

N343D:
	CALL	L2686	;GET NUMBER
	CPI	4
	JNC	L14DA	;ILLEGAL  FUNCTION CALL
	RET

LSCREEN:		; *** SCREEN ***
	MOV	A,M	
	CPI	2CH
	CNZ	SCRE1
	CALL	PARM
	CNZ	SCRE2
	RET	

SCRE1:
	CALL	N343D
	MVI	B,0FCH
SCRE3:
	MOV	C,A
	LDA	VIREG
	ANA	B
	ORA	C
	STA	VIREG
	RET

SCRE2:
	CALL	N343D
	RRC
	RRC
	MVI	B,3FH
	JMP	SCRE3

LLUT:			; *** LUT ***
	RST	1	
	DB	28H
	CALL	L1E30+1	;part of DIM
	MOV	A,D
	ORA	E
	JZ	L14DA	;ILLEGAL FUNCTION CALL
	PUSH	H
	LHLD	ARYTAB
	RST	3
N349D:
	POP	H
	JNC	L14DA	;ILLEGAL FUNCTION CALL
	LDA	VALTYP
	CPI	2
	JNZ	L14DA	;ILLEGAL FUNCTION CALL
	PUSH	H
	LXI	H,VISTS
N34AD:	
	MOV	A,M
	RRC
	RRC
	JNC	N34AD
N34B2:
	MOV	A,M
	RRC
	RRC
	JC	N34B2
	MVI	A,0B4H
N34B9:
	DCR	A
	JNZ	N34B9
	LXI	H,LUT
	LXI	B,10H
N34C3:
	LDAX	D
	CPI	10H
	JNC	N349D
	ADD	A
	ADD	A
	ADD	A
	ADD	A
	ORA	B
	MOV	M,A
	INX	D
	LDAX	D
	ORA	A
	INX	D
	JNZ	N349D
	INR	B
	DCR	C
	JNZ	N34C3
	POP	H
	RST	1
	DB	29H	;)
	RET

N34DF:
	LDA	N404A
	ANI	70H
	RRC
	RRC
	RRC
N34E7:
	MOV	B,A
	LDA	N404B
	ANI	0F1H
	ORA	B
	STA	NCREG
	STA	NCREGP
	RET

LPCLS:		;N34F2: *** PCLS ***
	CALL	N34DF 	
	PUSH	H
	DI
	MVI	A,60H
	STA	CONFIG
	STA	SYSRG2
	LXI	H,0
	DAD	SP
	LXI	SP,0
	LXI	D,0FFFFH
	LXI	B,400H
N3508:
	PUSH	D
	PUSH	D
	PUSH	D
	PUSH	D
	PUSH	D
	PUSH	D
	PUSH	D
	PUSH	D
	DCR	C
	JNZ	N3508
	DCR	B
	JNZ	N3508
	SPHL
	MVI	A,40H 
	STA	CONFIG
	STA	0BF7FH
	EI
	LXI	H,100H
	SHLD	N404C
	LXI	H,80H
	SHLD	N404E
	POP	H
N352A:
	LDA	N404B
	STA	NCREG
	STA	NCREGP
;	DCX	H
N3531:
;	RST	2
;	JNZ	N3531
	RET

N3536:
	CALL	ARIFM
	CALL	L266A
	RET

N353D:
	RST	1
	DB	28H	;(
	CALL	N3536
	PUSH	D
	RST	1
	DB	2CH
	CALL	N3536
	POP	B
	RST	1
	DB	29H	;)
	RET

LRELOC:			; *** RELOC(X,Y) ***
	CALL	N353D	
	XCHG
	SHLD	N4052
	MOV	H,B
	MOV	L,C
	SHLD	N4050
	XCHG
	RET

N355A:	
	CPI	0DFH	;STEP
	PUSH	PSW
	JNZ	N3561
	RST	2
N3561:	
	CALL	N353D
	POP	PSW
	PUSH	H
	LHLD	N4050
	JNZ	N356F
	LHLD	N404C
N356F:	
	DAD	B
	SHLD	N404C
	MOV	B,H
	MOV	C,L
	LHLD	N4052
	JNZ	N357E
	LHLD	N404E
N357E:	
	DAD	D
	SHLD	N404E
	XCHG
	POP	H
	RET

N3585:	
	XRA	A
	RET

N3587:	
	MOV	A,D
	ORA	A
	JNZ	N3585
	MOV	A,B
	CPI	2
	JNC	N3585
	MOV	A,E
	RAR
	RAR
	ORI	0C0H	;BEGIN GRAF ZU
	MOV	D,A
	MOV	A,B
	RAR
	MOV	A,E
	RAR
	RAR
	RAR
	ANI	0E0H
	MOV	E,A
	MOV	A,C
	RAR
	RAR	
	RAR
	ANI	1FH
	ORA	E
	MOV	E,A
	MOV	A,C
	ANI	7
	MOV	C,A
	INR	C
	XRA	A
	STC
N35B0:
	RAR
	DCR	C
	JNZ	N35B0
	MOV	C,A
	ORA	A
	RET

N35B8:
	INX	H
N35B9:
	PUSH	D
	PUSH	B
	CALL	N3403
	POP	B
	POP	D
	ADD	A
	JMP	N34E7
LPRESET:		; *** PRESET [STEP] ***
	CALL	N34DF
LPSET:
	CALL	N355A	; *** PSET [STEP] ***
	CALL	N3587
	JZ	N352A
N35CD:
	MOV	A,M
	CPI	2CH	;,
	CZ	N35B8
	XCHG
	MVI     A,60H
	DI
	STA	SYSRG2
	MOV	M,C
	MVI	A,40H
	STA	0BF7FH
	EI
	XCHG
	JMP	N352A

N1:	
	DCX	D
	MOV	A,D
	ORA	A
	RET

N35F5:			; *** UP ***
	PUSH	H	
	LXI	H,0FFC0H
	DAD	D
	XCHG
	POP	H	
	MOV	A,D
	CPI	0BFH
	RET

N2:	
	INX	D
	MOV	A,D
	ORA	E
	RET

N3604:			; *** DOWN ***
	PUSH	H	
	LXI	H,40H
	DAD	D
	XCHG
	POP	H
	MOV	A,D
	ORA	A
	RET

N3:	
	DCX	B
	MOV	A,B
	DCR	A
	RET

N3612:			; *** LEFT ***
	MOV	A,C	
	ORA	A
	RLC
	MOV	C,A
	RNC
	MOV	A,E
	ANI	3FH
	DCX	D
	RET

N4:	
	INX	B
	MOV	A,B
	ORA	C
	RET

N3620:			; *** RIGHT ***
	MOV	A,C	
	ORA	A
	RRC
	MOV	C,A
	RNC
	INX	D
	MOV	A,E
	ANI	3FH
	RET
         
N3638:		;VIDEO
	MVI	A,60H
	DI
	STA	SYSRG2
	MOV	A,C
	STAX	D
	MVI	A,40H
	STA	0BF7FH
	EI
	RET

N3644:	
	PUSH	D
	PUSH	H
	LHLD	N411C
	MOV	B,H
	MOV	C,L
	LHLD	N411E
	XCHG
	POP	H
N3650:	
	XTHL
	CALL	N4124
	CALL	N4127
	JZ	N367D
	PUSH	D
	XCHG
	LHLD	N4120
	DAD	D
	JNC	N3668
	LHLD	N4122
	DAD	D
	STC
N3668:
	POP	D
	CC	N412A
 	JZ	N367D
	XTHL
	DCR	L
	JNZ	N3650
	DCR	H
	JNZ	N3650
	DCR	H
	XTHL
	JMP	N367E

N367D:
	XRA	A
N367E:
	PUSH	H
	MOV	H,B
	MOV	L,C
	SHLD	N411C
	XCHG
	SHLD	N411E
	POP	D
	POP	H
	RET

N368B:		;LINE GRAPHICS
	CPI	0F3H	;token '-' *** LINE ***
	CNZ	N355A
	XCHG
	LHLD	N404C
	PUSH	H
	LHLD	N404E
	PUSH	H
	XCHG
	RST	1
	DB	0F3H	;token '-'
	CALL	N355A
	PUSH	B
	PUSH	D
	CALL	N36BA
	CNZ	N35B9
	CALL	N36BA
	RST	1
	DB	42H	;BOXI
	JZ	A1
	RST	1
	DB	46H	;"BF"
	CALL	SETXY
	PUSH	H
	LHLD	NX0
	XCHG
	LHLD	NX1
	CALL	SRW
	JZ	A21	; X1=X2
A22:	
	LHLD	NY0
	XCHG
	LHLD	NY1
	CALL	SRW
	JC	A20
	JZ	A21	; Y1=Y2
	CALL	PP2
	LHLD	NY1
	PUSH	H
	LHLD	NY0
	PUSH	H
	SHLD	NY1
	CALL	SETX12
	CALL	A2
	POP	H
	INX	H
	SHLD	NY0
	POP	H
	SHLD	NY1
	JMP	A22
A21:
	CALL	PP2
	CALL	SETX12
	CALL	A2
	JMP	A8
A20:
	CALL	PP2
	LHLD	NY0
	PUSH	H
	LHLD	NY1
	PUSH	H
	SHLD	NY0
	CALL	SETX12
	CALL	A2
	POP	H
	INX	H
	SHLD	NY1
	POP	H
	SHLD	NY0
	JMP	A22
	
N36BA:
	DCX	H
	RST	2
	JZ	N36C4
	RST	1
	DB	2CH	;,
	CPI	2CH	;,
	RET

N36C4:
	XCHG		; *** SET X1,Y1,X2,Y2 ***
	LXI	H,N3638
N36C8:
	SHLD	N4125
	MVI	A,0C3H	;code of JMP
	STA	N4124
	POP	PSW
	POP	H
	SHLD	N4122
	POP	H
	SHLD	N4120
	POP	H
	SHLD	N411E
	POP	H
	SHLD	N411C
	XCHG
	RET

A5:	
	LDA	CON
	CPI	0FFH
	JZ	N352A
	JMP	A3

N36F7:	
	LXI	D,0	; *** NEGATE ***
	XCHG
N36FB:	
	MOV	A,L	; HL=HL-DE
	SUB	E
	MOV	L,A
	MOV	A,H
	SBB	D
	MOV	H,A
	RET

NLINE:		;START GRAPH. LINE
	MVI	A,0FFH
	STA	CON
	MOV	A,M
	CALL	N368B
A2:	
	MVI	A,0C3H	;code JMP
	STA	N4127
	STA	N412A
	PUSH	H
	MVI	B,80H
	LHLD	N411C
	MOV	A,H
	XRA	B
	MOV	H,A
	XCHG
	LHLD	N4120
	MOV	A,H
	XRA	B
	MOV	H,A
	CALL	N36FB
	LXI	D,N3620
 	JNC	N3731
	CALL	N36F7
	LXI	D,N3612
N3731:	
	SHLD	N4120
	XCHG
	SHLD	N412B
	LHLD	N411E
	MOV	A,H
	XRA	B
	MOV	H,A
	XCHG
	LHLD	N4122
	MOV	A,H
	XRA	B
	MOV	H,A
	CALL	N36FB
	LXI	D,N3604
	JNC	N3754
	CALL	N36F7
	LXI	D,N35F5
N3754:	
	XCHG
	SHLD	N4128
	LHLD	N4120
	RST	3
	JC	N3771
	PUSH	H
	PUSH	D
	LHLD	N4128
	XCHG
	LHLD	N412B
	SHLD	N4128
	XCHG
	SHLD	N412B	
	POP	H
	POP	D
N3771:	
	SHLD	N4120
	XCHG
	SHLD	N4122
	CALL	N36F7
	MOV	A,H
	STC
	RAR
	MOV	H,A
	MOV	A,L
	RAR
	MOV	L,A
	PUSH	H
	LHLD	N4122
	XCHG
	LHLD	N4120
	CALL	N36FB
	SHLD	N4122
	XCHG
	INR	L
	INR	H
	PUSH	H
N3794:	
	LHLD	N411C
	MOV	B,H
	MOV	C,L
	LHLD	N411E
	XCHG
	CALL	N3587
	JZ	N37B4
	XCHG
	SHLD	N411E
	MOV	A,C
	STA	N411C
	POP	H
	POP	D
	CALL	N3644
N37B0:	
	POP	H
	JMP	A5

N37B4:	
	LHLD	N412B
	DCX	H
	DCX	H
	DCX	H
	DCX	H
	SHLD	N412B
	LHLD	N4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
	CALL	SPDIV
	LXI	H,BY
	CALL	FACWHL
	POP	H
	RET

AS1:	
	CALL	RADASP	; RAD-->BC/DE
	CALL	SPMUL	;  *SP
	LXI	H,RAD
	CALL	FACWHL	;  FAC --> RAD
	LXI	H,AX
	CALL	FACWHL
	CALL	LCINT
	SHLD	RADIUS	;  RADIUS=R*A OR =R
	POP	H
	RET

W4121:			;  ---> FAC
	MVI	B,4	
	LXI	H,FAC
	CALL	MOVESP
	RET

PPKD:			; GET D=1/4+R+1/4*A^2
	LXI	D,ASP
	CALL	ASPWBD	; ASP --> BC/DE
	CALL	SPMUL	;  *SP
	LXI	H,ASP
	CALL	FACWHL	; (ASP*ASP)-->ASP
	LXI	B,7F00H	; 1/4--> BC/DE
	LXI	D,0
	CALL	SPMUL	 
	LXI	H,RAD
	CALL	HLWBD	;  RAD --> BC/DE
	CALL	SPADD	;  +SP
	LXI	B,7F00H
	LXI	D,0
	CALL	SPADD
	LXI	H,KD1
	CALL	FACWHL
	RET

PPKB:			; GET B
	LXI	D,RAD
	CALL	W4121
	LXI	H,RAD
	CALL	ADDI
	LXI	H,KB1
	CALL	FACWHL
	RET

PPKK3:			; GET K3=-2*A*A
	LXI	D,ASP
	CALL	ASPWBD	;  ASP --> BC/DE
	CALL	SPADD	;  +SP
	LDA	FAC+2
	XRI	80H
	STA	FAC+2
	LXI	H,KK3	          
	CALL	FACWHL	;  FAC -->KK3
	RET

NEGK:			; GET K1=-K1,K3=-K3,D=-D
	LXI	D,KK1
	CALL	NEGSP
	LXI	H,KK1
	CALL	FACWHL
	LXI	D,KD1
	CALL	NEGSP
	LXI	H,KD1
	CALL	FACWHL
	LXI	D,KK3
	CALL	NEGSP
	LXI	H,KK3
	CALL	FACWHL
	RET

NEGSP:		
	CALL	W4121
	LDA	FAC+2
	XRI	80H
	STA	FAC+2
	RET

MOVTYP:	
	MVI	A,4
	STA	VALTYP
	RET

SRAW:	
	MOV	A,L
	SUB	E
	RNZ
	MOV	A,H
	SBB	D
	RET

PARM:			; NEXT PARAMETR
	DCX	H
	RST	2
	JZ	PIC1
	RST	1
	DB	2CH	;,
	CPI	2CH	;,
PIC1:	
	RET		; Z ELSE ,,

VIDXY:			; PIXEL(X,Y) IS DISPLAYED
	LHLD	NXLPR
	MOV	B,H
	MOV	C,L
	LHLD	NYLPR
	XCHG
	CALL	NCXYB
	JZ	A6
	CALL	VIDEO
A6:	
	RET

RADASP:
	LXI	H,RAD
	CALL	HLWBD
	PUSH	D
	PUSH	B
	LXI	D,ASP
	CALL	W4121
	POP	B
	POP	D
	CALL	MOVTYP
	RET

MULT:
	CALL	HLWBD
	CALL	MOVTYP
	CALL	SPMUL
	CALL	LCINT
	RET

ADDI:
	CALL	HLWBD
	CALL	MOVTYP
	CALL	SPADD
	RET

SUBI:
	CALL	HLWBD
	CALL	MOVTYP
	CALL	SPSUB
	RET

ASPWBD:
	CALL	W4121
	CALL	FACWBD
	CALL	MOVTYP
	RET

LPOINT:			; *** PAINT ***	
	RST	2
	CALL	NCXYI	; GET (X,Y) TO BC,DE
	CALL	NCXYB	; CONVERT (X,Y) TO ADR(DE),BIT(C)
	PUSH	H	; HL=INPUT STREAM
	LXI	H,0FFFFH	; -1 ->HL
	JZ	NPOINE
	MVI	A,60H	; SWITCH ON VIDEO MEMORY
	DI
	STA	CONFIG
	STA	SYSRG2
	EI
	XCHG
	MVI	A,70H	; COLOR=0
NPOIN1:	ADI	10H
	STA	VCREG
	MOV	B,A
	MOV	A,M	; COMPARE COLOR OF 8 POINTS
	ANA	C
	MOV	A,B	
	JNZ	NPOIN1	; COLOR<>COLOR OF POINT
	ANI	70H
	RRC
	RRC
	RRC
	RRC
	MOV	L,A
	MVI	H,0
	MVI	A,40H	; NSYSRG2 SWITCH OFF VIDEO MEMORY
	DI
	STA	CONFIG
	STA	0BF7FH
	EI
NPOINE:	CALL	L3A25	;COLOR -> FLOAT POINT ACCUMULATOR
	POP	H	; HL=INPUT STREAM
	LDA	NCREGI
	STA	NCREG	; RESTORE COLOR REG AND RETURN
	RET
 ;******************************************
 ; PAINT [STEP](X,Y)[,COL][,BNDR]
 ; ******************************************
LPAINT:	CALL	NCXYI
	CALL	NCXYB
	JZ	NRSCOL	; return if point out of screen
NTPNT:	LDA	NCREGI
	STA	NCREGP
	DCX	H
	RST	2
	JZ	NTPNT1	; no ","  PAINT(X,Y),foregr,foregr
	RST	1
	DB	','
	CPI	','	; test for ","
	JZ	NTPNT3	;  ",,"   PAINT(X,Y),foregr,BNDR
	CALL	NSNCL1
	DCX	H
	RST	2
	JNZ	NTPNT3	; PAINT(X,Y),COL,BNDR
NPAINB:	MOV	A,B	; PAINT(X,Y),COL,COL
NSRCOL:	ADD	A	; SET READ COLOR
	ADD	A
	ADD	A
	MOV	B,A
	LDA	NCREGP
	ANI	8FH
	ORA	B
	ORI	80H
	STA	NCREG
	STA	NCREGP	; :1:BNDR:COL:X
	ANI	0EH
	RLC	
	RLC
	RLC
	ORI	80H
	STA	NCREGR	; :1:COL:000:0
	PUSH	H	; save input streams
	LXI	H,0	
	DAD	SP
	SHLD	STKPSAV
	LXI	H,STKP+202H
	SPHL		;SET NEW STACK
	XCHG
NT1PNT:	MVI	A,60H	; TEST FIRST POINT
	DI
	STA	CONFIG
	STA	NSYSRG
	EI
	MOV	A,M	; TEST COLOR OF POINT=BNDR
	ANA	C
	JNZ	NPAIN1	; POINT IS NO 
	JMP	NPAINSE	; RETURN IF POINT BNDR

NTPNT3:	RST	1
	DB	','	; MUST BE COMMA
	PUSH	D
	PUSH	B
	CALL	NGCOL	; BNDR-->READ COLOR
	POP	B
	POP	D
	ADD	A
	JMP	NSRCOL

NTPNT1:	LDA	NFBCL
	ANI	0EH	; foregr->read color
	JMP	NSRCOL

NPAIN1:	XRA	A
	STA	NSTPOI
	CALL	NSTACK	; get 1-st point to stack
	PUSH	H
	PUSH	B
NPAINS: LDA	NSTPOI
	DCR	A
	JM      NPAINSE	; if no point in stack
	STA	NSTPOI
	POP	B
	POP	H
NRBND:	MOV	A,M
	CMA
	ORA	A
	JNZ	NRBND2	; if find bondary in first byte 
NRBND1:	MOV	A,L
	ANI	ESCR
	CPI	ESCR
	JZ	NRBND4	; if end of screen line
	INX	H
	MOV	A,M
	CMA
	ORA	A
	JZ	NRBND1	;if no find bondary point
	MVI	C,0H
	STC
NRBND2:	MOV	B,A	;save mask
NRBND3:	MOV	A,C
	RAR 
	JC	NRBND1	; if no bondary in 1-st byte
	MOV	C,A
	ANA	B	;B:=color mask
	JZ	NRBND3
	RLC
	MOV	C,A
	JNC	NMLFT	 
	DCX	H	; take next byte
NRBND4:	MVI	C,1
NMLFT:	MVI	B,3
NMLSET:
	MOV	M,C	; SET POINT
	CALL	NUP
	JC	NMLDWN	;if point is in 0 line
	MOV	A,M
	ANA	C
	JZ	NMLBUP	;if up point is BND
	CALL	NCOL
	JZ	NMLBUP	;if up point is COL
	MOV	A,B
	ANI	1
	JZ	NMLDWN
 	CALL	NSTACK	; store to stack
	PUSH	H
	PUSH	B
	MOV	A,B
	ANI	0FEH
	JMP	NMLBU1
NMLBUP:	MOV	A,B
	ORI	1H
NMLBU1:	MOV	B,A
NMLDWN:	CALL	NDWN
	JC	NMLEND	;if down point is in 255 line
	MOV	A,M
	ANA	C
	JZ	NMLBDN	;if down point is no BND
	CALL	NCOL
	JZ	NMLBDN	
	MOV	A,B
	ANI	2
	JZ	NMLEND
	CALL	NSTACK	; STORE TO STACK
	PUSH	H
	PUSH	B
	MOV	A,B
	ANI	0FDH
	JMP	NMLBD1
NMLBDN:	MOV	A,B
	ORI	2
NMLBD1:	MOV	B,A	
NMLEND:	CALL	NCURR
	CALL	NNEXT	;take next left point
 	JZ	NPAINS	;if begin of line
	MOV	A,M	
	ANA	C
	JZ	NPAINS	;if point = bnd
	JMP	NMLSET	;REPEAT 
NPAINSE:LHLD	STKPSAV
	SPHL		;RESTORE STACK
NPAINE:	MVI	A,40H	;  switch video-memory
	DI
	STA	CONFIG
	STA	VSYSRG
	EI
	POP     H	;  restore input stream pointer
	JMP	NRSCOL	; restore color reg and return
;**************************************
NUP:	LXI	D,0FFC0H	;goto up line
	DAD	D
	MOV	A,H
	CPI	NBVID
	RET		;c=0 if (H) >=begin of video

NDWN:	
	LXI	D,0080H		;goto down
	DAD	D
	RET		;c=0 if (H) <=end of video

NCURR:	
	LXI	D,0FFC0H	;return to current line
	DAD	D
	RET

NCOL:	
	LDA	NCREGR
	STA	VCREG
	MOV	A,M
	ANA	C
	LDA	NCREGP
	STA	VCREG
	RET		;z=1 if point haz COL color

NSTACK:	
	LDA	NSTPOI	; get point to stack
	INR	A
	JZ	NPAINSE	;if såååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååå
	RET

NNEXT1:	
	DCX	H
	MOV	A,L
	ANI	ESCR
	CPI	ESCR	; z=1 if end of line
	RZ
	MVI	C,1H
	RET
; *******EQU*****
CONFIG	EQU	6000H
DLPRINT	EQU	6303H
DLLIST	EQU	6306H
DWIDTH	EQU	6309H
DERASE	EQU	630CH
DRANDOM	EQU	630FH
DSYSTEM	EQU	6312H
DOPEN	EQU	6315H
DFIELD	EQU	6318H
DGET	EQU	631BH
DPUT	EQU	631EH
DCLOSE	EQU	6321H
DLOAD	EQU	6324H
DMERGE	EQU	6327H
DFILES	EQU	632AH
DNAME	EQU	632DH
DKILL	EQU	6330H
DLSET	EQU	6333H
DRSET	EQU	6336H
DSAVE	EQU	6339H
DLFIL	EQU	633CH
DDRAW	EQU	633FH
DNULL	EQU	6342H
DPOKE	EQU	6345H
DPEEK	EQU	6348H
DLPOS	EQU	634BH
DCVI	EQU	634EH
DCVS	EQU	6351H
DCVD	EQU	6354H
DEOF	EQU	6357H
DLOC	EQU	635AH
DLOF	EQU	635DH
DMKI	EQU	6360H
DMKS	EQU	6363H
DMKD	EQU	6366H
D18DF	EQU	6369H
D32E9	EQU	636CH
D33CF	EQU	636FH
D360C	EQU	6372H
D206F	EQU	6375H
D20AD	EQU	6378H
DVARPTR	EQU	637BH
D325F 	EQU	637EH
D32D9	EQU	6381H
D2E14	EQU	6384H
D3508	EQU	6387H
D3458	EQU	638AH
D2F7A	EQU	638DH
LDISK	EQU	6390H
DLPT	EQU	6394H
L3839	EQU	6398H
L383D	EQU	639CH
L3841	EQU	63A0H
L3844	EQU	63A3H
LCSRY	EQU	63AAH
LCSRX	EQU	63ABH
LRUS	EQU	63ACH
CURS	EQU	0F705H	;4 FREE BAITA
L0721	EQU	63B1H
NULL	EQU	63B2H
ERRFLG	EQU	63B3H
LPTPOS	EQU	63B5H
PRTFLG	EQU	63B6H
DISPLAY	EQU	63B7H
L0728	EQU	63B8H
L0729	EQU	63B9H
L072A	EQU	63BAH
STKTOP	EQU	63BBH
CURLIN	EQU	63BDH
TXTTAB	EQU	63BFH
L0731	EQU	63C1H
L0732	EQU	63C2H
L0733	EQU	63C3H
PTRFIL	EQU	63C5H
L0737	EQU	63C7H
L0739	EQU	63C9H
MAXFIL	EQU	63E9H
L075A	EQU	63EAH
L075C	EQU	63ECH
L076C	EQU	64FCH
L076D	EQU	64FDH
L0775	EQU	6405H
L078C	EQU	641CH
KBUF	EQU	641DH
BUFMIN	EQU	655BH
BUF	EQU	655CH
ENDBUF	EQU	665EH
TTYPOS	EQU	665FH
DIMFLG	EQU	6660H
VALTYP	EQU	6661H
DORES	EQU	6662H
DONUM	EQU	6663H
CONTXT	EQU	6664H
CONSAV	EQU	6666H
CONTYP	EQU	6667H
CONLO	EQU	6668H
MEMSIZ	EQU	6670H
TEMPPT	EQU	6672H
TEMPST	EQU	6674H
DSCTMP	EQU	6692H
DSCPTR	EQU	6693H
FRETOP	EQU	6695H
TEMP3	EQU	6697H
DATLIN	EQU	6699H
SUBFLG	EQU	669BH
FLGINP	EQU	669CH
TEMP	EQU	669DH
PTRFLG	EQU	669FH
AUTFLG	EQU	66A0H
AUTLIN	EQU	66A1H
AUTINC	EQU	66A3H
SAVTXT	EQU	66A5H
SAVSTK	EQU	66A7H
ERRLIN	EQU	66A9H
DOT	EQU	66ABH
ERRTXT	EQU	66ADH
ONELIN	EQU	66AFH
ONEFLG	EQU	66B1H
TEMP2	EQU	66B2H
OLDLIN	EQU	66B4H
OLDTXT	EQU	66B6H
VARTAB	EQU	66B8H
ARYTAB	EQU	66BAH
STREND	EQU	66BCH
DATPTR	EQU	66BEH
DEFTBL	EQU	66C0H
SWAP	EQU	66DAH
TRCFLG	EQU	66E2H
L0A53	EQU	66E3H
L0A54	EQU	66E4H
L0A56	EQU	66E6H
L0A57	EQU	66E7H
FAC	EQU	66E8H
L0A5A	EQU	66EAH
L0A5B	EQU	66EBH
L0A5C	EQU	66ECH
L0A5D	EQU	66EDH
L0A5E	EQU	66EEH
L0A64	EQU	66F4H
L0A65	EQU	66F5H
L0A66	EQU	66F6H
L0A67	EQU	66F7H
L0A81	EQU	6711H
L0A87	EQU	6717H
L0A88	EQU	6718H
CON	EQU	6719H
N404A	EQU	671AH
N404B	EQU	671BH
N404C	EQU	671CH
N404E	EQU	671EH
N4050	EQU	6720H
N4052	EQU	6722H
N4054	EQU	6724H
N411C	EQU	6726H
N411E	EQU	6728H
N4120	EQU	672AH
N4122	EQU	672CH
N4124	EQU	672EH
N4125	EQU	672FH
N4127	EQU	6731H
N4128	EQU	6732H
N412A	EQU	6734H
N412B	EQU	6735H
N403D	EQU	6736H
RAD	EQU	6737H
ASP	EQU	673BH
KK1	EQU	673FH
KK3	EQU	6743H
KA1	EQU	6747H
KD1	EQU	674BH
KB1	EQU	674FH
XS	EQU	6753H
YS	EQU	6755H
NSTPOI	EQU	6757H
NCREGP	EQU	6758H
NCREGR	EQU	6759H
L3D2B	EQU	675AH
L3D34	EQU	6763H
L3D36	EQU	6765H
L3D39	EQU	6768H
L3D3C	EQU	676BH
L3D42	EQU	6771H
L3D43	EQU	6772H	
STKPSAV	EQU	677BH
AX	EQU	677DH
BY	EQU	6781H
HA	EQU	6785H
KO	EQU	6789H
NP	EQU	678DH
N	EQU	6791H
NH	EQU	6793H
NK	EQU	6795H
H1	EQU	6797H
K1	EQU	6798H
PH	EQU	6799H
PI2	EQU	679AH
L45F0	EQU	67A0H
L45F1	EQU	67A1H
L45F2	EQU	67A2H
L4613	EQU	67C3H

NX01	EQU	67D3H
NY01	EQU	67D5H
STKP	EQU	67D7H
ADREND	EQU	STKP+204H
; ******************************
NCREG	EQU	0FABFH
SYSRG2	EQU	0FA7FH
VISTS	EQU	0FB38H
VIREG	EQU	0FB3AH
LUT	EQU	0FAFBH
VCREG	EQU	0BFBFH
VSYSRG	EQU	0BF7FH
   
NCXYI	EQU	N355A
NXLPR	EQU	N404C
NYLPR	EQU	N404E
NXORGN	EQU	N4050
NYORGN	EQU	N4052
RADIUS	EQU	N4054
NX0	EQU	N411C
NY0	EQU	N411E
NX1	EQU	N4120
NY1	EQU	N4122
NCXYB	EQU	N3587
FACWHL	EQU	L394D
FACWBD	EQU	L3941
NSNCOL	EQU	N35B8
NEGHL	EQU	N36F7
NHLSDE	EQU	N36FB
VIDEO	EQU	N3638
HLWBD	EQU	L3944
MOVESP	EQU	L395A
 
ESCR	EQU	3FH	
NBVID	EQU	0C0H	
NRSCOL	EQU	N352A
NGCOL	EQU	N3403
NSYSRG	EQU	SYSRG2
NCREGI	EQU	N404B
NFBCL	EQU	N404A
NSNCL1	EQU	N35B9
;
ZRST1	EQU	L10BA
ZRST2	EQU	L12AB
ZRST3	EQU	L10B4
ZRST4	EQU	L1DC6
ZRST5	EQU	L10C5
;
	END
