Mercurial > hg > index.cgi
comparison defs.s @ 0:605ff82c4618
Initial check in with cleaned up sources
This is the initial check in the source code in a state where it builds byte
accurate copies of all the various ROM versions included.
author | William Astle <lost@l-w.ca> |
---|---|
date | Sat, 08 Dec 2018 19:57:01 -0700 |
parents | |
children | 704b2c9dc19e |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:605ff82c4618 |
---|---|
1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
2 ; First, some useful macro definitions to avoid most instances with FCB standing for actual code. | |
3 skip1 macro noexpand | |
4 fcb 0x21 ; opcode of BRN which causes next code byte to be skipped | |
5 endm | |
6 skip2 macro noexpand | |
7 fcb 0x8c ; opcode of CMPX immediate which will skip two bytes (but clobbers flags) | |
8 endm | |
9 skip2keepc macro noexpand | |
10 fcb 0x7d ; opcode of TST extended which will skip two bytes like above but preserves C | |
11 endm | |
12 skip1lda macro noexpand | |
13 fcb 0x86 ; opcode of LDA immediate; used to load A with nonzero and skip a CLRA, usually | |
14 endm | |
15 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
16 ; Now various constants used in the ROMs. | |
17 STKBUF equ 58 ; extra room kept between the stack and variables during memory checks | |
18 DEBDEL equ 0x45e ; delay constant for debouncing the keyboard (10ms at standard clock speed) | |
19 LBUFMX equ 250 ; size of the line input buffer | |
20 MAXLIN equ 0xfa ; the maximum MS byte of a line number | |
21 DOSBUF equ 0x2600 ; address where DOS command loads track 24 | |
22 DIRLEN equ 32 ; size of a directory entry on disk | |
23 SECLEN equ 256 ; length of a disk sector | |
24 SECMAX equ 18 ; number of sectors per track | |
25 TRKLEN equ SECMAX*SECLEN ; number of bytes on a track | |
26 TRKMAX equ 35 ; number of tracks per disk | |
27 FATLEN equ 6+(TRKMAX-1)*2 ; size of memory copy of a file allocation table | |
28 GRANMX equ (TRKMAX-1)*2 ; number of granules per disk | |
29 FCBLEN equ SECLEN+25 ; size of a file control block | |
30 INPFIL equ 0x10 ; input file type | |
31 OUTFIL equ 0x20 ; output file type | |
32 RANFIL equ 0x40 ; random file type | |
33 ROWMAX equ 24 ; the number of rows on the hi-res text screen | |
34 HRESSCRN equ 0x2000 ; where the hi-res text screen starts in logical memory | |
35 HRESBUFF equ 0xc000 ; where the HGET/HPUT buffers are in logical memory | |
36 TMPSTACK equ 0xdfff ; temporary stack location when in secondary memory map | |
37 CURCHAR equ SPACE ; hi-res text screen cursor character | |
38 ; HGET/HPUT buffer header structure | |
39 HB.ADDR equ 0 ; address of next buffer (2 bytes) | |
40 HB.NUM equ 2 ; number of this buffer (1 byte) | |
41 HB.SIZE equ 3 ; number of bytes in this buffer (2 bytes) | |
42 HB.LEN equ 5 ; number of bytes in a buffer header | |
43 ; Video register definitions | |
44 ; INIT0 | |
45 COCO equ 0x80 ; 1 = Coco2 compatible mode | |
46 MMUEN equ 0x40 ; 1 = MMU enabled | |
47 IEN equ 0x20 ; 1 = IRQ enabled | |
48 FEN equ 0x10 ; 1 = FIRQ enabled | |
49 MC3 equ 0x08 ; 1 = FExx constant page enabled | |
50 MC2 equ 0x04 ; 1 = Standard SCS operation | |
51 MC1 equ 0x02 ; ROM map control bit 1 | |
52 MC0 equ 0x01 ; ROM map control bit 0 | |
53 ; Interrupt enable/status bits | |
54 TMR equ 0x20 ; TIMER | |
55 HBORD equ 0x10 ; horizontal border | |
56 VBORD equ 0x08 ; vertical border | |
57 EI2 equ 0x04 ; serial data | |
58 EI1 equ 0x02 ; keyboard | |
59 EI0 equ 0x01 ; cartridge port | |
60 ; Memory block definitions | |
61 BLOCK6.0 equ 0x30 ; hi-res graphics screen | |
62 BLOCK6.1 equ 0x31 ; hi-res graphics screen | |
63 BLOCK6.2 equ 0x32 ; hi-res graphics screen | |
64 BLOCK6.3 equ 0x33 ; hi-res graphics screen | |
65 BLOCK6.4 equ 0x34 ; HGET/HPUT buffers | |
66 BLOCK6.5 equ 0x35 ; stack space for hi-res graphics operations | |
67 BLOCK6.6 equ 0x36 ; hi-res text screen | |
68 BLOCK6.7 equ 0x37 ; unused by Basic | |
69 BLOCK7.0 equ 0x38 ; standard 64K memory map | |
70 BLOCK7.1 equ 0x39 ; standard 64K memory map | |
71 BLOCK7.2 equ 0x3a ; standard 64K memory map | |
72 BLOCK7.3 equ 0x3b ; standard 64K memory map | |
73 BLOCK7.4 equ 0x3c ; standard 64K memory map | |
74 BLOCK7.5 equ 0x3d ; standard 64K memory map | |
75 BLOCK7.6 equ 0x3e ; standard 64K memory map | |
76 BLOCK7.7 equ 0x3f ; standard 64K memory map (constant page comes from this block) | |
77 ; Disk Basic FAT data format. The memory image contains a six byte header followed by the cached copy | |
78 ; of the FAT from the disk. The cached copy may be modified compared to the copy on disk. This is indicated | |
79 ; by a nonzero of the "FAT1" byte. | |
80 FAT0 equ 0 ; active file counter for this image | |
81 FAT1 equ 1 ; data changed flag - nonzero means write is needed | |
82 FATCON equ 6 ; offset to start of FAT data | |
83 ; Directory entry format. Entries are 32 bytes long but only the first 16 are used. | |
84 DIRNAM equ 0 ; file name (8 characters) | |
85 DIREXT equ 8 ; extention (3 characters) | |
86 DIRTYP equ 11 ; file type number | |
87 DIRASC equ 12 ; ASCII flag | |
88 DIRGRN equ 13 ; first granule number for the file | |
89 DIRLST equ 14 ; number of bytes used in last sector (two bytes are needed) | |
90 ; File control block format. | |
91 FCBTYP equ 0 ; file type: 0x40=RANDOM, 0x20=WRITE, 0x10=READ | |
92 FCBDRV equ 1 ; drive number | |
93 FCBFGR equ 2 ; first granule in the file | |
94 FCBCGR equ 3 ; current granule being used | |
95 FCBSEC equ 4 ; current sector within granule | |
96 FCBCPT equ 5 ; input file - next char to be read; output: sector full flag (sequential) | |
97 FCBPOS equ 6 ; current print position (0 for random files) | |
98 FCBREC equ 7 ; current record number (random files) | |
99 FCBRLN equ 9 ; random file record length | |
100 FCBBUF equ 11 ; pointer to the start of this files buffer | |
101 FCBSOF equ 13 ; sector offset to current position in the record | |
102 FCBFLG equ 15 ; GET/PUT flag | |
103 FCBCFL equ 16 ; cache flag: nonzero is cache full (sequential) | |
104 FCBCDT equ 17 ; cache byte (sequential) | |
105 FCBDIR equ 18 ; directory entry number | |
106 FCBLST equ 19 ; number of bytes in last sector of the file | |
107 FCBGET equ 21 ; GET record counter (how many pulled from record) | |
108 FCBPUT equ 23 ; PUT record counter (where to put next byte in record) | |
109 FCBDFL equ 23 ; input file: data left flag (nonzero is no data) | |
110 FCBLFT equ 24 ; number of characters left in input file buffer | |
111 FCBCON equ 25 ; offset to data buffer | |
112 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
113 ; This is the memory map and variable definitions for the entire system (all levels of Basic) | |
114 ; NOTE: unnamed variables (Vxx) are generally scratch variables used for various purpose. As such, no further description is | |
115 ; provided for those. | |
116 org 0 | |
117 setdp 0 | |
118 ENDFLG rmb 1 ; STOP/END flag: bit 7 set means STOP, bit 7 clear means END | |
119 CHARAC rmb 1 ; terminator character for searches | |
120 ENDCHR rmb 1 ; terminator character for searches | |
121 TMPLOC rmb 1 ; scratch variable | |
122 IFCTR rmb 1 ; number of "IF" statements encountered while scanning a line | |
123 DIMFLG rmb 1 ; nonzero means dimensioning, zero means evaluating (when parsing array) | |
124 VALTYP rmb 1 ; the type of the current value when evaluating expressions | |
125 GARBFL rmb 1 ; flag for whether garbage collection has been done yet when allocating strings | |
126 ARYDIS rmb 1 ; nonzero means don't parse arrays when parsing variables | |
127 INPFLG rmb 1 ; are we running INPUT or READ - nonzero for INPUT | |
128 RELFLG rmb 1 ; which relational operators are currently in play | |
129 TEMPPT rmb 2 ; pinter to the top of the string stack | |
130 LASTPT rmb 2 ; pointer to the last entry on the string stack | |
131 TEMPTR rmb 2 ; scratch pointer | |
132 TMPTR1 rmb 2 ; scratch pointer | |
133 FPA2 rmb 4 ; floating point accumulator, mantissa only | |
134 BOTSTK rmb 2 ; bottom of stack during last check; also a scratch variable | |
135 TXTTAB rmb 2 ; pointer to the beginning of the program | |
136 VARTAB rmb 2 ; pointer to the beginning of the scalar variable table (end of program) | |
137 ARYTAB rmb 2 ; pointer to the beginning of the array table (end of scalars) | |
138 ARYEND rmb 2 ; pointer to the end of the array table (start of free memory) | |
139 FRETOP rmb 2 ; top of free memory (start of string space) | |
140 STRTAB rmb 2 ; start of allocates string space | |
141 FRESPC rmb 2 ; pointer to newly allocated string space | |
142 MEMSIZ rmb 2 ; top of memory (and string space) allowed for the interpreter to size | |
143 OLDTXT rmb 2 ; save line number during STOP | |
144 BINVAL rmb 2 ; binary value of line number during parsing | |
145 OLDPTR rmb 2 ; saving input pointer during STOP | |
146 TINPTR rmb 2 ; temporary input pointer storage | |
147 DATTXT rmb 2 ; line number where we're looking for DATA | |
148 DATPTR rmb 2 ; input pointer where we're looking for DATA | |
149 DATTMP rmb 2 ; scratch pointer for INPUT and READ | |
150 VARNAM rmb 2 ; storage for variable name during parsing | |
151 VARPTR rmb 2 ; pointer to variable descriptor | |
152 VARDES rmb 2 ; pointer to variable descriptor | |
153 RELPTR rmb 2 ; pointer to relational operator processing routine | |
154 TRELFL rmb 1 ; temporary relational operator flags | |
155 V40 rmb 1 | |
156 V41 rmb 1 | |
157 V42 rmb 1 | |
158 V43 rmb 1 | |
159 V44 rmb 1 | |
160 V45 rmb 1 | |
161 V46 rmb 1 | |
162 V47 rmb 1 | |
163 V48 rmb 2 | |
164 V4A rmb 1 | |
165 V4B rmb 2 | |
166 V4D rmb 2 | |
167 FP0EXP rmb 1 ; floating point accumulator #0 exponent | |
168 FPA0 rmb 4 ; floating point accumulator #0 mantissa | |
169 FP0SGN rmb 1 ; floating point accumulator #0 sign | |
170 COEFCT rmb 1 ; polynomial expansion coefficient counter | |
171 STRDES rmb 5 ; temporary string descriptor | |
172 FPCARY rmb 1 ; floating point carry byte | |
173 FP1EXP rmb 1 ; floating point accumulator #1 exponent | |
174 FPA1 rmb 4 ; floating point accumulator #1 mantissa | |
175 FP1SGN rmb 1 ; floating point accumulator #1 sign | |
176 RESSGN rmb 1 ; pre-calculated result sign | |
177 FPSBYT rmb 1 ; floating point extra precision underflow byte | |
178 COEFPT rmb 2 ; polynomial expansion coefficient pointer | |
179 LSTTXT rmb 2 ; current line pointer during LIST | |
180 CURLIN rmb 2 ; line number of currently executing statement (0xffff for direct) | |
181 DEVCFW rmb 1 ; width of tab field for current device | |
182 DEVLCF rmb 1 ; column of last tab field for current device | |
183 DEVPOS rmb 1 ; current output column for current device | |
184 DEVWID rmb 1 ; number of characters per line for current device | |
185 PRTDEV rmb 1 ; print device flag: 0xff for non-display device (tape) | |
186 DEVNUM rmb 1 ; current I/O device/file number (signed) | |
187 CINBFL rmb 1 ; EOF flag for console in (0xff for EOF) | |
188 RSTFLG rmb 1 ; warm start enable flag: 0x55 for enabled | |
189 RSTVEC rmb 2 ; pointer to warm start routine (must start with NOP) | |
190 TOPRAM rmb 2 ; the actual top of memory | |
191 rmb 2 ; *unused* | |
192 FILSTA rmb 1 ; status of tape file (0=closed, 1=input, 2=output) | |
193 CINCTR rmb 1 ; number of characters in buffer | |
194 CINPTR rmb 2 ; pointer to current buffer location | |
195 BLKTYP rmb 1 ; cassette block type | |
196 BLKLEN rmb 1 ; length of cassette block | |
197 CBUFAD rmb 2 ; pointer to data buffer for cassette I/O | |
198 CCKSUM rmb 1 ; cassette checksum | |
199 CSRERR rmb 1 ; cassette error flag/charactercount | |
200 CPULWD rmb 1 ; pulse width counter | |
201 CPERTM rmb 1 ; bit counter | |
202 CBTPHA rmb 1 ; sync phase flag | |
203 CLSTSN rmb 1 ; last sine table entry | |
204 GRBLOK rmb 1 ; graphic block value for SET/RESET/POINT | |
205 IKEYIM rmb 1 ; cached key read during BREAK check | |
206 CURPOS rmb 2 ; screen cursor position | |
207 ZERO rmb 2 ; always kept as 0 | |
208 SNDTON rmb 1 ; tone value for SOUND | |
209 SNDDUR rmb 2 ; duration value for SOUND | |
210 CMPMID rmb 1 ; 1200/2400 Hz partition (why is this a variable?) | |
211 CMP0 rmb 1 ; upper limit of 1200 Hz period (why is this a variable?) | |
212 CMP1 rmb 1 ; upper limit of 2400 Hz period (why is this a variable?) | |
213 SYNCLN rmb 2 ; number of 0x55s for a cassette leader (why is this a variable?) | |
214 BLKCNT rmb 1 ; cursor blink delay counter | |
215 LPTBTD rmb 2 ; serial baud rate delay count | |
216 LPTLND rmb 2 ; delay for waiting for carriage return | |
217 LPTCFW rmb 1 ; tab field width for printer | |
218 LPTLCF rmb 1 ; last tab field position for printer | |
219 LPTWID rmb 1 ; width of printer line | |
220 LPTPOS rmb 1 ; current character position for printer | |
221 EXECJP rmb 2 ; default jump address for EXEC | |
222 GETNCH rmb 6 ; fetch next character for interpretation (INC CHARAD+1\BNE GETCCH\INC CHARAD) | |
223 GETCCH rmb 1 ; re-fetch the current character for interpretation (opcode of LDA extended) | |
224 CHARAD rmb 2 ; current input pointer | |
225 rmb 3 ; (JMP BROMHK) | |
226 VAB rmb 1 | |
227 VAC rmb 1 | |
228 VAD rmb 1 | |
229 VAE rmb 1 | |
230 TRCFLG rmb 1 ; is TRACE enabled? nonzero is on | |
231 USRADR rmb 2 ; address of the start of USR vectors | |
232 FORCOL rmb 1 ; bitmap foreground colour | |
233 BAKCOL rmb 1 ; bitmap background colour | |
234 WCOLOR rmb 1 ; bitmap working colour | |
235 ALLCOL rmb 1 ; byte with all pixels set to WCOLOR | |
236 PMODE rmb 1 ; which PMODE is active | |
237 ENDGRP rmb 2 ; end of current bitmap graphics page | |
238 HORBYT rmb 1 ; number of bytes per bitmap row | |
239 BEGGRP rmb 2 ; start of current bitmap graphics page | |
240 GRPRAM rmb 1 ; MSB of start of bitmap graphics | |
241 HORBEG rmb 2 ; horizontal starting coordinate | |
242 VERBEG rmb 2 ; vertical starting coordinate | |
243 CSSVAL rmb 1 ; SCREEN's colour set value | |
244 SETFLG rmb 1 ; doing PSET or PRESET? (nonzero = PSET) | |
245 HOREND rmb 2 ; horizontal ending coordinate | |
246 VEREND rmb 2 ; vertical ending coordinate | |
247 HORDEF rmb 2 ; default horizontal coordinate | |
248 VERDEF rmb 2 ; default vertical coordinate | |
249 VCB rmb 2 | |
250 VCD rmb 2 | |
251 VCF rmb 2 | |
252 VD1 rmb 2 | |
253 VD3 rmb 1 | |
254 VD4 rmb 1 | |
255 VD5 rmb 1 | |
256 VD6 rmb 1 | |
257 VD7 rmb 1 | |
258 VD8 rmb 1 | |
259 VD9 rmb 1 | |
260 VDA rmb 1 | |
261 CHGFLG rmb 1 ; flag indicating if graphic data changed | |
262 TMPSTK rmb 2 ; temporary stack pointer during PAINT | |
263 OCTAVE rmb 1 ; PLAY octave | |
264 VOLHI rmb 1 ; PLAY high volume value | |
265 VOLLOW rmb 1 ; PLAY low volumnevalue | |
266 NOTELN rmb 1 ; PLAY notelength | |
267 TEMPO rmb 1 ; PLAY tempo | |
268 PLYTMR rmb 2 ; PLAY timer | |
269 DOTVAL rmb 1 ; PLAY dotted note timer scale factor | |
270 HRMODE equ * ; Coco3 graphics mode | |
271 DLBAUD rmb 1 ; DLOAD BAUD constant | |
272 HRWIDTH equ * ; Coco3 text mode | |
273 TIMOUT rmb 1 ; DLOAD timeout constant | |
274 ANGLE rmb 1 ; DRAW angle | |
275 SCALE rmb 1 ; DRAW scale | |
276 DCOPC rmb 1 ; DSKCON operation code | |
277 DCDRV rmb 1 ; DSKCON drive number | |
278 DCTRK rmb 1 ; DSKCON track number | |
279 DSEC rmb 1 ; DSKCON sector number | |
280 DCBPT rmb 2 ; DSKCON buffer pointer | |
281 DCSTA rmb 1 ; DSKCON status | |
282 FCBTMP rmb 2 ; temp file control block pointer | |
283 rmb 13 ; *unused* | |
284 SW3VEC rmb 3 ; SWI3 vector | |
285 SW2VEC rmb 3 ; SWI2 vector | |
286 SWIVEC rmb 3 ; SWI vector | |
287 NMIVEC rmb 3 ; NMI vector | |
288 IRQVEC rmb 3 ; IRQ vector | |
289 FRQVEC rmb 3 ; FIRQ vector | |
290 TIMVAL equ * ; Extended Basic TIMER value (2 bytes only) | |
291 USRJMP rmb 3 ; jump address for USR function | |
292 RVSEED rmb 5 ; floating point random number seed | |
293 CASFLG rmb 1 ; capslock state for keyboard | |
294 DEBVAL rmb 2 ; keyboar debounce delay (why is this a variable?) | |
295 EXPJMP rmb 3 ; exponentiation handler | |
296 COMVEC rmb 10 ; Color Basic's command table | |
297 rmb 10 ; Extended Basic's command table | |
298 rmb 10 ; Disk Basic's command table | |
299 USR0 rmb 20 ; ECB USR jump addresses (extra user command table and unused for Disk Basic) | |
300 KEYBUF rmb 8 ; keyboard state table | |
301 POTVAL rmb 4 ; joystick axis values (left vert, left horiz, right vert, right horiz) | |
302 RVEC0 rmb 3 ; RAM hook: OPEN | |
303 RVEC1 rmb 3 ; RAM hook: device number check | |
304 RVEC2 rmb 3 ; RAM hook: set print parameters | |
305 RVEC3 rmb 3 ; RAM hook: console out | |
306 RVEC4 rmb 3 ; RAM hook: console in | |
307 RVEC5 rmb 3 ; RAM hook: input device number check | |
308 RVEC6 rmb 3 ; RAM hook: output device number check | |
309 RVEC7 rmb 3 ; RAM hook: close all files | |
310 RVEC8 rmb 3 ; RAM hook: close current file | |
311 RVEC9 rmb 3 ; RAM hook: PRINT | |
312 RVEC10 rmb 3 ; RAM hook: INPUT | |
313 RVEC11 rmb 3 ; RAM hook: BREAK check | |
314 RVEC12 rmb 3 ; RAM hook: line input | |
315 RVEC13 rmb 3 ; RAM hook: terminating line input | |
316 RVEC14 rmb 3 ; RAM hook: EOF | |
317 RVEC15 rmb 3 ; RAM hook: expression evaluation | |
318 RVEC16 rmb 3 ; RAM hook: ERROR handler (on error goto) | |
319 RVEC17 rmb 3 ; RAM hook: ERROR handler (regular handling) | |
320 RVEC18 rmb 3 ; RAM hook: RUN | |
321 RVEC19 rmb 3 ; RAM hook: parse number | |
322 RVEC20 rmb 3 ; RAM hook: main interpretation loop | |
323 RVEC21 rmb 3 ; RAM hook: SET/RESET/POINT | |
324 RVEC22 rmb 3 ; RAM hook: CLS/ECB secondary/RENUM token/GET/PUT | |
325 RVEC23 rmb 3 ; RAM hook: crunch line | |
326 RVEC24 rmb 3 ; RAM hook: uncrunch line | |
327 STRSTK rmb 8*5 ; string stack | |
328 CFNBUF rmb 9 ; cassette file name buffer | |
329 CASBUF rmb 256 ; cassette I/O buffer | |
330 LINHDR rmb 2 ; header for line input (holds line number when editing program) | |
331 LINBUF rmb LBUFMX+1 ; line input buffer | |
332 STRBUF rmb 41 ; temporary string buffer | |
333 VIDRAM rmb 0x200 ; VDG text screen | |
334 DBUF0 rmb SECLEN ; Main disk I/O buffer | |
335 DBUF1 rmb SECLEN ; Secondary disk I/O buffer (used for VERIFY) | |
336 FATBL0 rmb FATLEN ; File allocation table cache for drive 0 | |
337 FATBL1 rmb FATLEN ; File allocation table cache for drive 1 | |
338 FATBL2 rmb FATLEN ; File allocation table cache for drive 2 | |
339 FATBL3 rmb FATLEN ; File allocation table cache for drive 3 | |
340 FCBV1 rmb 16*2 ; FCB pointers | |
341 RNBFAD rmb 2 ; start of free random file buffer area | |
342 FCBADR rmb 2 ; start of file control blocks | |
343 DNAMBF rmb 8 ; disk file name buffer | |
344 DEXTBF rmb 3 ; disk file name extension buffer | |
345 DFLTYP rmb 1 ; disk file type (0=Basic, 1=Data, 2=M/L) | |
346 DASCFL rmb 1 ; disk file ASCII flag (0=binary, 0xff=ASCII) | |
347 DRUNFL rmb 1 ; RUN flag (bit 1 set then RUN, bit 0 set then close files) | |
348 DEFDRV rmb 1 ; default drive number | |
349 FCBACT rmb 1 ; number of active file control blocks | |
350 DRESFL rmb 1 ; reset flag - will cause all FCBs to be shut down | |
351 DLODFL rmb 1 ; load flag - cause a "NEW" on error | |
352 DMRGFL rmb 1 ; merge flag: nonzero means we're merging | |
353 DUSRVC rmb 20 ; Disk Basic USR addresses | |
354 V973 rmb 1 | |
355 V974 rmb 2 | |
356 V976 rmb 1 | |
357 V977 rmb 1 | |
358 V978 rmb 2 | |
359 WFATVL rmb 2 ; number of granules allocated to trigger a FAT cache write | |
360 DFFLEN rmb 2 ; direct access file recrod length | |
361 DR0TRK rmb 4 ; current track number for each drive | |
362 NMIFLG rmb 1 ; nonzero means NMI vectoring is enabled | |
363 DNMIVC rmb 2 ; address to vector to in NMI | |
364 RDYTMR rmb 1 ; number of ticks before turning off drive motors | |
365 DRGRAM rmb 1 ; cached value of write-only disk control register | |
366 DVERFL rmb 1 ; nonzero means write verifies on | |
367 ATTCTR rmb 1 ; read/write attempt counter | |
368 DFLBUF equ * ; start of random file area, FCBs, etc. | |
369 | |
370 | |
371 org 0x8000 | |
372 EXBAS rmb 0x2000 ; Extended Basic ROM area | |
373 BASIC rmb 0x2000 ; Color Basic ROM area | |
374 ROMPAK equ * ; external ROM address | |
375 DOSBAS rmb 0x2000 ; Disk Basic ROM area | |
376 rmb 0x1e00 ; Super Extended Basic ROM area | |
377 ; These are the variables used by SECB on the "constant FExx page" which is unaffected by the MMU | |
378 ; when the FExx bit in INIT0 is set. | |
379 H.CRSLOC rmb 2 ; current cursor location pointer (hi-res) | |
380 H.CURSX rmb 1 ; current X coordinate of the cursor (hi-res) | |
381 H.CURSY rmb 1 ; current Y coordinate of the cursor (hi-res) | |
382 H.COLUMN rmb 1 ; the number of columns on the screen (hi-res) | |
383 H.ROW rmb 1 ; the number of rows on the screen (hi-res) | |
384 H.DISPEN rmb 2 ; pointer to the end of the screen (hi-res) | |
385 H.CRSATT rmb 1 ; current cursor attributes (hi-res) | |
386 rmb 1 ; *unused* | |
387 H.FCOLOR rmb 1 ; foreground colour (hi-res) | |
388 H.BCOLOR rmb 1 ; background colour (hi-res) | |
389 H.ONBRK rmb 2 ; ON BRK GOTO line number | |
390 H.ONERR rmb 2 ; ON ERR GOTO line number | |
391 H.ERROR rmb 1 ; most recent error number encountered (-1 for no error) | |
392 H.ONERRS rmb 2 ; line number where ON ERR GOTO was encountered | |
393 H.ERLINE rmb 2 ; line number where error actually occurred | |
394 H.ONBRKS rmb 2 ; line number where ON BRK GOTO was encountered | |
395 H.ERRBRK rmb 1 ; flag for whether we're processing an error or a break event | |
396 H.PCOUNT rmb 1 ; number of characters in the HPRINT buffer | |
397 H.PBUF rmb 80 ; HPRINT line buffer (max 80 characters per line) | |
398 rmb 132 ; *unused* | |
399 ; This is the set of primary interrupt vectors on the Coco3. These are here so that systems other | |
400 ; than Basic do not have to rely on low memory remaining constant. Under Basic, these simply bounce | |
401 ; to the traditional vectors starting at 0x100. | |
402 INT.FLAG rmb 1 ; interrupt vector validity flag: 0x55 for valid | |
403 INT.JUMP equ * | |
404 INT.SWI3 rmb 3 ; SWI3 bounce vector | |
405 INT.SWI2 rmb 3 ; SWI2 bounce vector | |
406 INT.FIRQ rmb 3 ; FIRQ bounce vector | |
407 INT.IRQ rmb 3 ; IRQ bounce vector | |
408 INT.SWI rmb 3 ; SWI bounce vector | |
409 INT.NMI rmb 3 ; NMI bounce vector | |
410 ; This is that start of the I/O page. Everything above here is hardware defined. | |
411 PIA0 rmb 4 ; PIA0 (keyboard/joystick) | |
412 rmb 28 ; PIA0 images (due to sloppy-ass decode) | |
413 DA equ * ; DAC address | |
414 PIA1 rmb 4 ; PIA1 (misc hardware) | |
415 rmb 28 ; PIA1 images (due to sloppy-ass decode) | |
416 DSKREG rmb 1 ; Disk control register | |
417 rmb 7 ; images of DSKREG due to (sloppy-ass decode) | |
418 FDCREG rmb 1 ; FDC command/status register | |
419 rmb 1 ; FDC track register | |
420 rmb 1 ; FDC sector register | |
421 rmb 1 ; FDC data register | |
422 rmb 4 ; mirror of FDCREG | |
423 rmb 16 ; unused SCS area | |
424 rmb 32 ; misc hardware area | |
425 rmb 16 ; *coco3 reserved* | |
426 INIT0 rmb 1 ; GIME initialization register 0 | |
427 INIT1 rmb 1 ; GIME initialization register 1 | |
428 IRQENR rmb 1 ; GIME IRQ enable/status register | |
429 FIRQENR rmb 1 ; GIME FIRQ enable/status register | |
430 V.TIMER rmb 2 ; GIME timer setting | |
431 rmb 2 ; *reserved* | |
432 VIDEOMOD rmb 1 ; GIME video mode register | |
433 VIDEORES rmb 1 ; GIME video resolution register | |
434 V.BORDER rmb 1 ; GIME border colour register | |
435 rmb 1 ; *reserved* | |
436 V.SCROLL rmb 1 ; GIME vertical scroll register | |
437 V.OFFSET rmb 2 ; GIME vertical offset (screen address) register | |
438 H.OFFSET rmb 1 ; GIME horizontal offset register | |
439 MMUREG rmb 16 ; GIME MMU registers (two tasks of 8) | |
440 PALETREG rmb 16 ; GIME palette registers | |
441 SAMREG equ * ; the SAM registers | |
442 V0CLR rmb 1 ; SAM video mode bits | |
443 V0SET rmb 1 | |
444 V1CLR rmb 1 | |
445 V1SET rmb 1 | |
446 V2CLR rmb 1 | |
447 V2SET rmb 1 | |
448 F0CLR rmb 1 ; SAM screen address bits | |
449 F0SET rmb 1 | |
450 F1CLR rmb 1 | |
451 F1SET rmb 1 | |
452 F2CLR rmb 1 | |
453 F2SET rmb 1 | |
454 F3CLR rmb 1 | |
455 F3SET rmb 1 | |
456 F4CLR rmb 1 | |
457 F4SET rmb 1 | |
458 F5CLR rmb 1 | |
459 F5SET rmb 1 | |
460 F6CLR rmb 1 | |
461 F6SET rmb 1 | |
462 rmb 2 ; *reserved* | |
463 R0CLR rmb 1 ; SAM R0 bit (address dependent speedup) | |
464 R0SET rmb 1 | |
465 R1CLR rmb 1 ; SAM R1 bit (full speedup/coco3 speedup) | |
466 R1SET rmb 1 | |
467 rmb 4 ; *reserved* | |
468 TYCLR rmb 1 ; force ROM mode | |
469 TYSET rmb 1 ; set RAM mode | |
470 rmb 18 ; *MPU reserved* | |
471 SWI3 rmb 2 ; MPU SWI3 vector | |
472 SWI2 rmb 2 ; MPU SWI2 vector | |
473 FIRQ rmb 2 ; MPU FIRQ vector | |
474 IRQ rmb 2 ; MPU IRQ vector | |
475 SWI rmb 2 ; MPU SWI vector | |
476 NMI rmb 2 ; MPU NMI vector | |
477 RESETV rmb 2 ; MPU reset vector |