File:  [Infocom source] / coco / zequates.src
Revision 1.1.1.3 (vendor branch): download - view: text, annotated - select for diffs
Fri Mar 20 10:20:13 2020 UTC (20 months, 2 weeks ago) by root
Branches: infocom, MAIN
CVS tags: VERSION_D, HEAD
coco interpeter version D

	PAGE
	;SBTTL "--- MEMORY ORGANIZATION ---"

TRUE	EQU	$FF
FALSE	EQU	0

DSTART	EQU	0		; START OF DIRECT-PAGE RAM

MSTACK	EQU	MSTART+$FE	; TOP OF MACHINE STACK (254 BYTES)
IOBUFF	EQU	MSTART+$100	; 256-BYTE DISK I/O BUFFER
ZSTACK	EQU	MSTART+$200	; Z-STACK (255 WORDS)
ZSTAKL	EQU	255		; LENGTH OF Z-STACK IN WORDS
TOPSTA	EQU	(2*ZSTAKL)+ZSTACK	; TOP OF Z-STACK
PTABLE	EQU	MSTART+$400	; PAGING TABLE ($140 BYTES/$A0 WORDS)
LRUMAP	EQU	MSTART+$550	; TIMESTAMP MAP ($A0 BYTES)
LOCALS  EQU     MSTART+$600     ; LOCAL VARIABLE STORAGE (32 BYTES)
BUFFER  EQU     MSTART+$620     ; I/O LINE BUFFER (32 BYTES)
BUFSAV  EQU     MSTART+$640     ; I/O AUX BUFFER (32 BYTES)
ZIP	EQU	MSTART+$700	; START OF EXECUTABLE CODE
ZCODE	EQU	ZIP+$1800	; START OF Z-CODE (ASSUME 6K ZIP)

	; Z-CODE HEADER OFFSETS

ZVERS	EQU	0		; VERSION BYTE
ZMODE	EQU	1		; MODE SELECT BYTE
ZID	EQU	2		; GAME ID WORD
ZENDLD	EQU	4		; START OF NON-PRELOADED Z-CODE
ZBEGIN	EQU	6		; EXECUTION ADDRESS
ZVOCAB	EQU	8		; START OF VOCABULARY TABLE
ZOBJEC	EQU	10		; START OF OBJECT TABLE
ZGLOBA	EQU	12		; START OF GLOBAL VARIABLE TABLE
ZPURBT	EQU	14		; START OF "PURE" Z-CODE
ZSCRIP	EQU	16		; FLAG WORD
ZSERIA	EQU	18		; 3-WORD ASCII SERIAL NUMBER
ZFWORD	EQU	24		; START OF FWORDS TABLE
ZLENTH	EQU	26		; LENGTH OF Z-PROGRAM IN WORDS
ZCHKSM	EQU	28		; Z-CODE CHECKSUM WORD

	PAGE
	;SBTTL "--- ZIP D-PAGE VARIABLES ---"

OPCODE	EQU	DSTART		; CURRENT OPCODE
ARGCNT	EQU	OPCODE+1	; # ARGUMENTS
ARG1	EQU	OPCODE+2	; ARGUMENT #1 (WORD)
ARG2	EQU	OPCODE+4	; ARGUMENT #2 (WORD)
ARG3	EQU	OPCODE+6	; ARGUMENT #3 (WORD)
ARG4	EQU	OPCODE+8	; ARGUMENT #4 (WORD)

LRU	EQU	OPCODE+10	; (BYTE) LEAST RECENTLY USED PAGE INDEX
ZPURE	EQU	LRU+1		; (BYTE) 1ST VIRTUAL PAGE OF PURE Z-CODE
PMAX	EQU	LRU+2		; (BYTE) MAXIMUM # SWAPPING PAGES
ZPAGE	EQU	LRU+3		; (BYTE) CURRENT SWAPPING PAGE
PAGE0	EQU	LRU+4		; (BYTE) 1ST ABS PAGE OF SWAPPING SPACE
TABTOP	EQU	LRU+5		; (WORD) ADDRESS OF LAST P-TABLE ENTRY
STAMP	EQU	LRU+7		; (BYTE) CURRENT TIMESTAMP (BM 11/24/84)
SWAP	EQU	LRU+8		; (BYTE) EARLIEST BUFFER (BM 11/24/84)

ZPCH	EQU	LRU+9		; HIGHEST-ORDER BIT OF PC
ZPCM	EQU	ZPCH+1		; MIDDLE 8 BITS OF PC
ZPCL	EQU	ZPCH+2		; LOWER 8 BITS OF PC
ZPCPNT	EQU	ZPCH+3		; POINTER TO ACTUAL PC PAGE (WORD)
ZPCFLG	EQU	ZPCH+5		; FLAG: "TRUE" IF ZPCPNT VALID

MPCH	EQU	ZPCH+7		; HIGHEST-ORDER BIT OF MEM POINTER
MPCM	EQU	MPCH+1		; MIDDLE 8 BITS OF MEM POINTER
MPCL	EQU	MPCH+2		; LOW-ORDER 8 BITS OF MEMORY POINTER
MPCPNT	EQU	MPCH+3		; ACTUAL POINTER TO MEMORY (WORD)
MPCFLG	EQU	MPCH+5		; FLAG: "TRUE" IF MPCPNT VALID

GLOBAL	EQU	MPCH+7		; GLOBAL VARIABLE POINTER (WORD)
VOCAB	EQU	GLOBAL+2	; VOCAB TABLE POINTER (WORD)
FWORDS	EQU	GLOBAL+4	; FWORDS TABLE POINTER (WORD)

OZSTAK	EQU	GLOBAL+6	; ZSP SAVE REGISTER (FOR ZCALL)

CSTEMP	EQU	OZSTAK+2	; SET IF TEMP CHARSET IN EFFECT
CSPERM	EQU	CSTEMP+1	; CURRENT PERM CHARSET
STBYTF	EQU	CSTEMP+2	; 0=1ST, 1=2ND, 2=3RD, 0=LAST

ZSTWRD	EQU	CSTEMP+3	; WORD STORAGE (WORD)
ZSTBUI	EQU	ZSTWRD+2	; Z-STRING INPUT BUFFER (6 BYTES)
ZSTBUO	EQU	ZSTWRD+8	; Z-STRING OUTPUT BUFFER (6 BYTES)
RTABP	EQU	ZSTWRD+14	; RESULT TABLE POINTER
STABP	EQU	ZSTWRD+15	; SOURCE TABLE POINTER
PZSTFO	EQU	ZSTWRD+16	; FWORD TABLE BLOCK OFFSET

VAL	EQU	ZSTWRD+17	; VALUE RETURN REGISTER (WORD)
TEMP	EQU	VAL+2		; TEMPORARY REGISTER (WORD)
TEMP2	EQU	VAL+4		; ANOTHER TEMPORARY REGISTER (WORD)
MASK	EQU	VAL+6		; BIT-MASK REGISTER (WORD)
SQUOT	EQU	VAL+8		; SIGN OF QUOTIENT
SREM	EQU	VAL+9		; SIGN OF REMAINDER
MTEMP	EQU	VAL+10		; MATH TEMP REGISTER (WORD)

DRIVE	EQU	VAL+12		; DRIVE NUMBER
DBUFF	EQU	DRIVE+1		; DISK I/O BUFFER POINTER (WORD)
DBLOCK	EQU	DRIVE+3		; Z-BLOCK # (WORD)
TRACK	EQU	DRIVE+5		; TRACK/SECTOR ADDRESS (WORD)

TIMEFL	EQU	DRIVE+7		; "TRUE" IF TIME MODE

CHRPNT	EQU	TIMEFL+1	; I/O BUFFER INDEX
CPSAV	EQU	CHRPNT+1	; SAVE REGISTER FOR [CHRPNT]
BINDEX	EQU	CHRPNT+2	; BUFFER DISPLAY INDEX
LINCNT	EQU	CHRPNT+3	; # LINES DISPLAYED SINCE LAST USL
IOCHAR	EQU	CHRPNT+4	; CURRENT I/O CHARACTER
GDRIVE	EQU	CHRPNT+5	; GAME-SAVE DEFAULT DRIVE #
GPOSIT	EQU	CHRPNT+6	; GAME-SAVE DEFAULT POSITION
RAND1	EQU	CHRPNT+7	; RANDOM NUMBER REGISTER
RAND2	EQU	CHRPNT+8	; DITTO
CYCLE	EQU	CHRPNT+9	; TIMER FOR CURSOR BLINK (WORD)
BLINK	EQU	CHRPNT+11	; MASK FOR CURSOR BLINK
CFLAG	EQU	CHRPNT+12	; CURSOR ENABLE FLAG
SCRIPT	EQU	CHRPNT+13	; SCRIPTING ENABLE FLAG
IHOLD	EQU	CHRPNT+14	; INTERRUPT HOLD
TPOSIT	EQU	CHRPNT+15	; TEMP GAME POSITION
TDRIVE	EQU	CHRPNT+16	; TEMP GAME DRIVE

ZPGTOP	EQU	CHRPNT+15	; END OF DIRECT-PAGE VARIABLES

	;END


unix.superglobalmegacorp.com