1- ; ************************************************************************************************
2- ; ************************************************************************************************
3- ;
4- ; Name: 04data.inc
5- ; Purpose: Main Data
6- ; Created: 18th September 2022
7- ; Reviewed: 23rd November 2022
8- ; Author: Paul Robson (paul@robsons.org.uk)
9- ;
10- ; ************************************************************************************************
11- ; ************************************************************************************************
1+ ;;
2+ ; Main data declarations
3+ ;;
124
135; ************************************************************************************************
146;
2113codePtr: ; address of current line (allow for 32 bit)
2214 .fill 4
2315basicStack: ; BASIC stack address
24- .fill 2
16+ .fill 2
2517zTemp0: ; temporary words used in the interpreter.
2618 .fill 2
2719zTemp1:
@@ -32,9 +24,14 @@ zsTemp: ; allocated string temporary.
3224 .fill 2
3325zaTemp: ; allocated array temporary
3426 .fill 2
35-
27+
3628safePtr = codePtr ; minimise direct tinkering
37-
29+
30+ ; unused reserve; declared for visibility, adjust accordingly when adding new variables;
31+ ; overflows are diagnosed automatically, see `makebuild.py`
32+ _zeropageReserve:
33+ .fill 14
34+
3835 .send zeropage
3936
4037; ************************************************************************************************
@@ -79,6 +76,11 @@ NSExponent: ; Exponent , 0 = Mantissa is integer
7976fnStackLevel: ; saved stack level for function evaluation
8077 .fill 1
8178
79+ ; unused reserve; declared for visibility, adjust accordingly when adding new variables;
80+ ; overflows are diagnosed automatically, see `makebuild.py`
81+ _zeroprefReserve:
82+ .fill 79
83+
8284 .send zeropref
8385
8486
@@ -95,7 +97,7 @@ identStart: ; start of identifier in line buffer
9597identTypeStart: ; start of type information (#$ and ( in the line buffer)
9698 .fill 1
9799identTypeEnd: ; character after end of type information in the line buffer
98- .fill 1
100+ .fill 1
99101identHash: ; hash of identifier (including the type characters)
100102 .fill 1
101103identTypeByte: ; type descriptor in format used in identifier record
@@ -113,63 +115,63 @@ lowMemPtr: ; memory allocation after program.
113115arrayMemPtr: ; array/alloc storage pointer (slots 2-3, $4000-$7FFF)
114116 .fill 2
115117stringMemory: ; allocate concrete strings from here
116- .fill 2
117- stringInitialised: ; string
118- .fill 1
118+ .fill 2
119+ stringInitialised: ; string
120+ .fill 1
119121stringTempPointer: ; temporary string
120- .fill 2
122+ .fill 2
121123
122124breakCheck: ; break check counter/shift
123125 .fill 1
124-
126+
125127decimalPlaces: ; no of decimals.
126128 .fill 1
127129dbOffset: ; offset into decimal buffer.
128- .fill 1
130+ .fill 1
129131
130132lastParameter: ; final stack offset when all parameters handled.
131133 .fill 1
132-
134+
133135dataPointer: ; operates like code pointer for DATA statements
134136 .fill 5
135137inDataStatement: ; non zero when in data statement, e.g. pointing to data
136- .fill 1
138+ .fill 1
137139
138140tbOffset: ; offset into token buffer
139- .fill 1
141+ .fill 1
140142
141143AssemblerAddress: ; address being assembled at
142144 .fill 2
143145AssemblerControl: ; assembler control byte - bit 0 (errors ok), bit 1 (listing on)
144- .fill 1
146+ .fill 1
145147ParamStart: ; offset of parameter.
146- .fill 2
148+ .fill 2
147149IsGroup1: ; flag set if group.1
148- .fill 1
150+ .fill 1
149151BaseOpcode: ; base opcode
150- .fill 1
152+ .fill 1
151153ModeMask: ; modes allowed
152- .fill 1
154+ .fill 1
153155listIndent: ; list indent level.
154156 .fill 1
155157listElseFound: ; flag set when ELSE found on line (for indent fix)
156158 .fill 1
157159listEndToken: ; closing token for LIST proc/fn
158160 .fill 1
159161lcLastCharacter: ; last character output.
160- .fill 1
162+ .fill 1
161163isPrintFlag: ; zero if input, non-zero if print, bit 6 zero = character print
162- .fill 1
164+ .fill 1
163165currentListColour: ; current set colour when listing.
164166 .fill 1
165167;
166168; New tokenised line - these three *must* be contiguous as they are used as a single entity
167- ;
169+ ;
168170tokenOffset: ; used for tokenising - tokenised result goes here
169- .fill 1
171+ .fill 1
170172tokenLineNumber:
171- .fill 2
172- tokenBuffer:
173+ .fill 2
174+ tokenBuffer:
173175 .fill 253
174176
175177lineBuffer: ; used for input - ASCII line goes here
@@ -194,18 +196,3 @@ decimalBuffer: ; buffer for number -> string conversion.
194196
195197 .send storage
196198
197- ; ************************************************************************************************
198- ;
199- ; Changes and Updates
200- ;
201- ; ************************************************************************************************
202- ;
203- ; Date Notes
204- ; ==== =====
205- ; 1/12/2022 Changed the recorded values used in the reference byte size which were
206- ; incorrect, no code change.
207- ; 2/12/2022 Made line buffer long again, as long lines can be entered via cross
208- ; development which would crash the interpreter.
209- ;
210- ; ************************************************************************************************
211-
0 commit comments