; "8080 FIG-FORTH FOR THE KAYPRO II" 	LIST	DBG 
; FROM FIG-FORTH RELEASE 1.1 
; THIS PUBLIC DOMAIN SOFTWARE IS PROVIDED THROUGH THE COURTESY OF THE
; FORTH INTEREST GROUP, P.O. BOX 1105, SAN CARLOS CA 94070.
; FURTHER DISTRIBUTION MUST INCLUDE THIS NOTICE.
;
; ALL OTHER CODE IS THE FAULT OF :
;
;	Bob Bumala
;	955 N. California
;	Palo Alto, California 94303
;
;		* and *
;
;	Kevin Appert
;	( address $+123SO )
;
;
FIGREL	EQU	1	; FIG RELEASE #
FIGREV	EQU	1	; FIG REV LEV
USRVER	EQU	6	; USER VERSION NUMBER
;
; USERVER 1 - FIRST OK 
; USERVER 2 - FIXED SOME BUGS
; USERVER 3 - 
; USERVER 4 - ADDED TWO DISK CAPABILITY
; USERVER 5 - ADDED VECTORED EXICUTION OF EMIT AND KEY
; USERVER 6 - REMOVED OPEN AND CLOSE
;
;
;		CP/M 
;
OPENF	EQU	000FH	; OPEN FILE
CLOSF	EQU	0010H	; CLOSE FILE
MAKEF	EQU	0016H	; MAKE FILE
RESDSK	EQU	000CH	; RESET DISK SYSTEM
NIOS	EQU	0005H	; FDOS
;
;		ASCII SPECIAL CHARACTORS
;
ABL	EQU	20H	; SPACE
ACR	EQU	0DH	; CARRIAGE RETURN
ADOT	EQU	02EH	; PERIOD
BELL	EQU	07H	; (^G)
BSIN	EQU	07FH	; BACKSPACE (RUBOUT)
BSOUT	EQU	08H	; BACKSPACE (^H)
DLE	EQU	10H	; (^P)
LF	EQU	0AH	; LINE FEED
FF	EQU	0CH	; FORM FEED (^L)
;
;		MEMORY ALLOCATION
;
NSCR	EQU	8	; NUMBER OF 1024 DB SCREENS AVAILABLE
KBBUF 	EQU	1024 	; DATA BYTES PER DISK BUFFER
US	EQU	40H	; USER VARIABLE SPACE
RTS	EQU	0A0H	; RETURN STACK AND TERM BUFF SPACE
;
EM	EQU	0B000H	; TOP OF MEMORY +1
CO	EQU	KBBUF+4	; DISK BUFFER + 2 HEADER + 2 TAIL
NBUF	EQU	NSCR*400H/KBBUF ; NUMBER OF BUFFERS 
BUF1	EQU	EM-CO*NBUF	; ADDR FIRST DISK BUFFER
INITRO	EQU	BUF1-US		; (RO)
INITSO	EQU	INITRO-RTS	; (SO)
	 
;
;
	ORG	100H
ORIG	NOP
	JMP	CLD	; COLD START
	NOP
	JMP 	WRM	; WARM START
	DB	FIGREL
	DB	FIGREV
	DB 	USRVER
	DB	0EH	; IMPLEMENTATION ATTRIBUTES
	DW	TASK-7 	; TOPMOST DW IN FORTH VOCABULARY
	DW	BSIN	
	DW	INITRO
;
;--------------FOLLOWING USED BY COLD---------------------
; (MUST BE IN SAME ORDER AS USER VARIABLES)
	DW	INITSO
	DW	INITRO
	DW	INITSO
	DW	20H	; INIT WIDTH
	DW	01H	; INIT WARNING
	DW 	INITDP	; INIT FENCE
	DW	INITDP	; INIT DP
	DW	FORTH+6 ; INIT VOC-LINK
	DW	PEMIT	; EMIT VECTOR
	DW	PKEY	; KEY VECTOR
;
;--------------END OF DATA USED BY COLD--------------------
;
	DW	5H,0B320H	;	PROCESSOR IN RAD-36,32 BIT
;
;--------------FORTH REGISTERS ----------------------------
;
UP	DW	INITRO	; USER AREA POINTER
RPP	DW	INITRO 	; RETURN STACK POINTER
;
;
	 
;
;-------------DEBUG SUPPORT--------------------------------
;
BIP	DW	0	; BREAKPOINT ON IP VALUE
;
TNEXT	LXI	H,BIP
	MOV	A,M
	CMP 	C
	JNZ	TNEXT1
	INX	H
	MOV	A,M
	CMP	B
	JNZ	TNEXT1
BREAK	NOP
	NOP
	NOP
TNEXT1	LDAX	B
	INX	B
	MOV	L,A
	JMP	NEXT+3
;
;----------THE EVERPOPULAR --NEXT-- THE FORTH ADDRESS INTERPRETER
;          ( POST INCREMENTING VERSION )
;
DPUSH	PUSH	D
HPUSH	PUSH	H
NEXT	LDAX	B
	INX	B
	MOV	L,A
	LDAX	B
	INX	B
	MOV	H,A
NEXT1	MOV	E,M	;  WAS NEXT1: IN FIG LISTING
	INX	H
	MOV	D,M
	XCHG
	PCHL
;
	 
;
;
;******************************************************************************
;******************************************************************************
;***			THE FORTH DICTIONARY				*******
;******************************************************************************
;******************************************************************************
;
;
DP0:	DB	83H	;LIT
	DB 	'LI'
	DB	'T'+80H
	DW	0	; LFA = 0 IS END OF DICTIONARY
LIT 	DW	$+2
	LDAX	B
	INX	B
	MOV	L,A
	LDAX	B
	INX	B
	MOV	H,A
	JMP	HPUSH
;
	DB	87H	;EXECUTE
	DB	'EXECUT'
	DB	'E'+80H
	DW	LIT-6
EXEC	DW	$+2
	POP	H
	JMP	NEXT1
;
	DB	86H	;BRANCH
	DB	'BRANC'
	DB	'H'+80H
	DW	EXEC-0AH
BRAN	DW	$+2	
BRAN1	MOV	H,B
	MOV	L,C
	MOV	E,M
	INX	H
	MOV	D,M
	DCX	H
	DAD	D
	MOV	C,L
	MOV	B,H
	JMP	NEXT
;
	DB	87H	;0BRANCH
	DB	'0BRANC'
	DB	'H'+80H
	DW	BRAN-9
ZBRAN	DW	$+2
	POP	H
	MOV	A,L
	ORA	H
	JZ	BRAN1
	INX	B
	INX	B
	JMP NEXT
;
	DB	86H	;LOOP
	DB	'(LOOP'
	DB	')'+80H
	DW	ZBRAN-0AH
XLOOP	DW	$+2
	LXI	D,1
XLOO1	LHLD	RPP
	MOV	A,M
	ADD	E
	MOV	M,A
	MOV	E,A
	INX	H
	MOV	A,M
	ADC	D
	MOV	M,A
	INX	H
	INR	D
	DCR	D
	MOV	D,A
	JM	XLOO2
	MOV	A,E
	SUB	M
	MOV	A,D
	INX	H
	SBB	M
	JMP	XLOO3
XLOO2	MOV	A,M
	SUB	E
	INX	H
	MOV	A,M
	SBB	D
;
XLOO3	JM	BRAN1
	INX	H
	SHLD	RPP
	INX	B
	INX	B
	JMP	NEXT
;
	DB	87H	;(+LOOP)
	DB	'(+LOOP'
	DB	')'+80H
	DW	XLOOP-9
XPLOO	DW	$+2
	POP	D
	JMP	XLOO1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B	84H	;	USER
	DB	'USE'
	DB	'R'+80H
	DW	VARB-0BH
USER	DW	DOCOL
	DW	CONS
	DW	PSCOD
DOUSE	INX	D
	XCHG	
	MOV	E,M
	MVI	D,0
	LHLD	UP
	DAD	D
	JMP	HPUSH
;
	DB	81H	;	0 ( THE NUMBER ZERO)
	DB	'0'+80H
	DW	USER-7
ZERO	DW	DOCON
	DW	0
;
	DB	81H	;	1
	DB	'1'+80H
	DW	ZERO-4
ONE	DW	DOCON
	DW	1
;
	DB	81H	;	2
	DB	'2'+80H
	DW	ONE-4
TWO	DW	DOCON
	DW	2
;
	DB	81H	;	3
	DB	'3'+80H
	DW	TWO-4
THREE	DW	DOCON
	DW	3
;
	DB	82H	;	BL
	DB	'B'
	DB	'L'+80H
	DW	THREE-4
BL	DW	DOCON
	DW	20H
;
	DB	83H	;	C/L
	DB	'C/'
	DB	'L'+80H	
	DW	BL-5
CSLL	DW	DOCON
	DW	64
;
	DB	85H	;	FIRST
	DB	'FIRS'
	DB	'T'+80H
	DW	CSLL-6
FIRST	DW	DOCON
	DW	BUF1
;
	DB	85H	;	LIMIT
	DB	'LIMI'
	DB	'T'+80H
	DW	FIRST-8
LIMIT	DW	DOCON
	DW	EM
;
	DB	85H	;	B/BUF
	DB	'B/BU'
	DB	'F'+80H
	DW	LIMIT-8
BBUF	DW	DOCON
	DW	KBBUF
;
	DB	85H
	DB	'B/SC'
	DB	'R'+80H
	DW	BBUF-8
BSCR	DW	DOCON
	DW	400H/KBBUF
;
	DB	87H	;	+ORIGIN
	DB	'+ORIGI'
	DB	'N'+80H
	DW	BSCR-8
PORIG	DW	DOCOL
	DW	LIT
	DW	ORIG
	DW	PLUS
	DW	SEMIS
;
;-------------------------USER VARIABLES--------------------------------------
;
	DB	82H	;	S0
	DB	'S'
	DB	'0'+80H
	DW	PORIG-0AH
SZERO	DW	DOUSE
	DW	6
;
	DB	82H	;	R0
	DB	'R'
	DB	'0'+80H
	DW	SZERO-5
RZERO	DW	DOUSE
	DW	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OUSE
	DB	26H
;
	DB	83H	;	DPL
	DB	'DP'
	DB	'L'+80H
	DW	BASEE-7
DPL	DW	DOUSE	
	DB	28H
;
	DB	83H	;FLD
	DB	'FL'
	DB	'D'+80H
	DW	DPL-6
FLD	DW	DOUSE
	DB	2AH
;
	DB	83H	;	CSP
	DB	'CS'
	DB	'P'+80H
	DW	FLD-6
CSPP	DW	DOUSE
	DB	2CH
;
	DB	82H	;	R#
	DB	'R'
	DB	'#'+80H
	DW	CSPP-6
RNUM	DW	DOUSE
	DB	2EH
;
	DB	83H	;	HLD
	DB	'HL'
	DB	'D'+80H
	DW	RNUM-5
HLD	DW	DOUSE
	DW	30H
;
	DB	85H	;	TEMIT
	DB	'TEMI'
	DB	'T'+80H
	DW	HLD-6
TEMIT	DW	DOUSE
	DB	32H
;
	DB	84H
	DB	'TKE'
	DB	'Y'+80H
	DW	TEMIT-8
TKEY	DW	DOUSE
	DB	34H
;
;
;-------------------------END OF USER VARIABLES--------------------------------
;
	DB	82H	;	1+
	DB	'1'
	DB	'+'+80H
	DW	TKEY-7 
ONEP	DW	DOCOL
	DW	ONE
	DW	PLUS
	DW	SEMIS
;
	DB	82H	;	2+
	DB	'2'
	DB	'+'+80H
	DW	ONEP-5
TWOP	DW	DOCOL
	DW	TWO
	DW	PLUS
	DW	SEMIS
;
	DB	84H	;	HERE
         DB	'HER'
	DB	'E'+80H
	DW	TWOP-5
HERE	DW	DOCOL
	DW	DP
	DW	AT
	DW	SEMIS
;
	DB	85H	;	ALLOT
	DB	'ALLO'
	DB 	'T'+80H
	DW	HERE-7
ALLOT	DW	DOCOL
	DW	DP
	DW	PSTOR
	DW	SEMIS
;
	DB	81H	;	,
	DB	','+80H
	DW	ALLOT-8
COMMA	DW	DOCOL
	DW	HERE
	DW	STORE
	DW	TWO
	DW	ALLOT
	DW	SEMIS
;
	DB	82H	;	C,
	DB	'C'
	DB	','+80H
	DW	COMMA-4
CCOM	DW	DOCOL
	DW	HERE
	DW	CSTOR
	DW	ON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