annotate src/defs.s @ 121:5d5472b11ccd

Initital skeleton of separation of separate parsing scheme This is the first commit in a long series related to separating the parsing of the input code from the execution of the code. It should allow for more efficient, and probably simpler, execution while giving quicker feedback when someone types in syntactically invalid code.
author William Astle <lost@l-w.ca>
date Sun, 31 Dec 2023 17:44:39 -0700
parents 6db72a92ff7a
children 917b4893bb3d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
73
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
1 *pragmapush list
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
2 *pragma list
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
3 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
4 ; Various constants
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
5 console_curdel equ 10 ; delay between cursor blink cycles
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
6 keyb_bufflen equ 64 ; keyboard ring buffer length
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
7 keyb_repdeli equ 40 ; ticks before initial repeat (2/3 s)
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
8 keyb_repdelr equ 6 ; 10 repeats per second
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
9 keyb_caps equ 0x80 ; capslock enabled
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
10 keyb_alt equ 0x04 ; alt pressed
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
11 keyb_ctrl equ 0x02 ; ctrl pressed
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
12 keyb_shift equ 0x01 ; shift pressed
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
13 linebuffsize equ 0x100 ; the line input buffer (256 bytes)
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
14 stringstacknum equ 20 ; number of entries on the anonymous string descriptor stack
121
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents: 100
diff changeset
15 stackheadroom equ 50 ; required headroom for the stack on OM checks
73
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
16 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
100
6db72a92ff7a Make value accumulator descriptions consistent and make usage consistent
William Astle <lost@l-w.ca>
parents: 85
diff changeset
17 ; Data structure used for calculations. Calculations are handled via structures called value accumulators. A value
73
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
18 ; accumulator consists of a data type flag (at the end of the structure) and a data area whose layout varies based
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
19 ; on the actual data type. The layouts for each value type are described below.
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
20 ;
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
21 ; A value type that is NULL (not set to anything) has type 0 (valtype_none) and the rest should be zero.
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
22 ;
100
6db72a92ff7a Make value accumulator descriptions consistent and make usage consistent
William Astle <lost@l-w.ca>
parents: 85
diff changeset
23 ; A value accumulator has the following structure for floating point, which holds a packed floating point value:
73
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
24 ; Offset Length Contents
100
6db72a92ff7a Make value accumulator descriptions consistent and make usage consistent
William Astle <lost@l-w.ca>
parents: 85
diff changeset
25 ; 0 1 fp exponent and sign
6db72a92ff7a Make value accumulator descriptions consistent and make usage consistent
William Astle <lost@l-w.ca>
parents: 85
diff changeset
26 ; 1 5 fp mantissa
73
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
27 ; 6 1 value type
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
28 ;
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
29 ; A value accumulator has the following structure for integers:
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
30 ; Offset Length Contents
100
6db72a92ff7a Make value accumulator descriptions consistent and make usage consistent
William Astle <lost@l-w.ca>
parents: 85
diff changeset
31 ; 0 4 integer value (two's complement)
6db72a92ff7a Make value accumulator descriptions consistent and make usage consistent
William Astle <lost@l-w.ca>
parents: 85
diff changeset
32 ; 4 2 *unused*
73
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
33 ; 6 1 value type
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
34 ;
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
35 ; A value accumulator has the following structure for a string:
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
36 ; Offset Length Contents
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
37 ; 0 2 string length
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
38 ; 2 2 *reserved for string data pointer expansion, must be zero*
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
39 ; 4 2 string data pointer
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
40 ; 6 1 value type
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
41 ;
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
42 ; Value type constants
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
43 valtype_none equ 0 ; unknown value type
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
44 valtype_int equ 1 ; integer (32 bit) value (signed)
85
663d8e77b579 Implmement BCD floating point and update number parsing and printing
William Astle <lost@l-w.ca>
parents: 80
diff changeset
45 valtype_float equ 2 ; BCD float type (48 bit) value
73
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
46 valtype_string equ 3 ; string type (16 bit length, 16(32) bit data pointer
80
bb50ac9fdf37 Checkpoint with very basic integer and floating point arithmetic, untested
William Astle <lost@l-w.ca>
parents: 77
diff changeset
47 ; Floating point accumulator structure definitions
85
663d8e77b579 Implmement BCD floating point and update number parsing and printing
William Astle <lost@l-w.ca>
parents: 80
diff changeset
48 ;
663d8e77b579 Implmement BCD floating point and update number parsing and printing
William Astle <lost@l-w.ca>
parents: 80
diff changeset
49 ; Note: the extra precision bytes are needed for general calculations and need to be at least the same
663d8e77b579 Implmement BCD floating point and update number parsing and printing
William Astle <lost@l-w.ca>
parents: 80
diff changeset
50 ; size as the significand itself; the exponent will be stored with the bias. The accumulators are
663d8e77b579 Implmement BCD floating point and update number parsing and printing
William Astle <lost@l-w.ca>
parents: 80
diff changeset
51 ; unpacked.
663d8e77b579 Implmement BCD floating point and update number parsing and printing
William Astle <lost@l-w.ca>
parents: 80
diff changeset
52 fpa.exp equ 0 ; exponent - use largest size needed for any precision
663d8e77b579 Implmement BCD floating point and update number parsing and printing
William Astle <lost@l-w.ca>
parents: 80
diff changeset
53 fpa.sig equ fpa.exp+1 ; significand - use largest size needed for any precision
663d8e77b579 Implmement BCD floating point and update number parsing and printing
William Astle <lost@l-w.ca>
parents: 80
diff changeset
54 fpa.extra equ fpa.sig+5 ; extras; largest size needed for any precision, must follow significand
663d8e77b579 Implmement BCD floating point and update number parsing and printing
William Astle <lost@l-w.ca>
parents: 80
diff changeset
55 fpa.sign equ fpa.extra+5 ; sign flag
663d8e77b579 Implmement BCD floating point and update number parsing and printing
William Astle <lost@l-w.ca>
parents: 80
diff changeset
56 fpa.size equ fpa.sign+1 ; use the largest floating point accumulator size
80
bb50ac9fdf37 Checkpoint with very basic integer and floating point arithmetic, untested
William Astle <lost@l-w.ca>
parents: 77
diff changeset
57 ; String data definition
bb50ac9fdf37 Checkpoint with very basic integer and floating point arithmetic, untested
William Astle <lost@l-w.ca>
parents: 77
diff changeset
58 str.len equ 0 ; string length (2 bytes)
bb50ac9fdf37 Checkpoint with very basic integer and floating point arithmetic, untested
William Astle <lost@l-w.ca>
parents: 77
diff changeset
59 str.ptr equ str.len+2 ; string data pointer (3 bytes)
bb50ac9fdf37 Checkpoint with very basic integer and floating point arithmetic, untested
William Astle <lost@l-w.ca>
parents: 77
diff changeset
60 str.size equ str.ptr+3
bb50ac9fdf37 Checkpoint with very basic integer and floating point arithmetic, untested
William Astle <lost@l-w.ca>
parents: 77
diff changeset
61 ; Value accumulator structure definitions; note that the actual value data must be first and any
bb50ac9fdf37 Checkpoint with very basic integer and floating point arithmetic, untested
William Astle <lost@l-w.ca>
parents: 77
diff changeset
62 ; incidental meta data must follow
bb50ac9fdf37 Checkpoint with very basic integer and floating point arithmetic, untested
William Astle <lost@l-w.ca>
parents: 77
diff changeset
63 val.value equ 0 ; offset of the value stored in the accumulator
100
6db72a92ff7a Make value accumulator descriptions consistent and make usage consistent
William Astle <lost@l-w.ca>
parents: 85
diff changeset
64 val.fpsexp equ val.value ; floating point exponent (and sign)
85
663d8e77b579 Implmement BCD floating point and update number parsing and printing
William Astle <lost@l-w.ca>
parents: 80
diff changeset
65 val.fpssig equ val.fpsexp+1 ; floating point significand
80
bb50ac9fdf37 Checkpoint with very basic integer and floating point arithmetic, untested
William Astle <lost@l-w.ca>
parents: 77
diff changeset
66 val.int equ val.value ; integer offset
bb50ac9fdf37 Checkpoint with very basic integer and floating point arithmetic, untested
William Astle <lost@l-w.ca>
parents: 77
diff changeset
67 val.strlen equ val.value+str.len ; string length offset
bb50ac9fdf37 Checkpoint with very basic integer and floating point arithmetic, untested
William Astle <lost@l-w.ca>
parents: 77
diff changeset
68 val.strptr equ val.value+str.ptr ; string data pointer (low word)
100
6db72a92ff7a Make value accumulator descriptions consistent and make usage consistent
William Astle <lost@l-w.ca>
parents: 85
diff changeset
69 val.type equ 6 ; use the largest of the data type sizes here
80
bb50ac9fdf37 Checkpoint with very basic integer and floating point arithmetic, untested
William Astle <lost@l-w.ca>
parents: 77
diff changeset
70 val.size equ val.type+1 ; size of a value accumulator
73
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
71 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
72 ifdef COCO3
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
73 ; GIME INIT0
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
74 GIME_COCO equ 0x80 ; Set for coco2 compatible mode (video display)
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
75 GIME_MMUEN equ 0x40 ; Set to enable MMU
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
76 GIME_IEN equ 0x20 ; GIME IRQ enable
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
77 GIME_FEN equ 0x10 ; GIME FIRQ enable
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
78 GIME_FExx equ 0x08 ; Enable constant RAM at 0xFExx (comes from block 0x3f)
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
79 GIME_SCS equ 0x04 ; Set to enable standard SCS (switches 0xFF5x)
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
80 GIME_ROME16 equ 0x00 ; 16K internal, 16K external ROM mode
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
81 GIME_ROME32 equ 0x03 ; 32K external ROM
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
82 GIME_ROMI32 equ 0x02 ; 32K internal ROM
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
83 ; GIME INIT1
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
84 GIME_TMRFAT equ 0x20 ; TIMER ticks approx every 279.365 ns
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
85 GIME_TMRSLOW equ 0x00 ; TIMER ticks approx every 63.695 µs
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
86 GIME_TASK0 equ 0x00 ; MMU task 0
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
87 GIME_TASK1 equ 0x01 ; MMU task 1
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
88 ; GIME interrupt enable/status bits
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
89 GIME_ITIMER equ 0x20 ; TIMER interrupt (timer reaches 0)
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
90 GIME_IHBORD equ 0x10 ; HSYNC interrupt (falling edge)
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
91 GIME_IVBORD equ 0x08 ; VSYNC interrupt (falling edge)
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
92 GIME_ISERIAL equ 0x04 ; Falling edge of signal on pin 4 of serial port
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
93 GIME_IKEYBOARD equ 0x02 ; Interrupt if a 0 bit appears on bits 6-0 of PIA0.DA
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
94 GIME_ICART equ 0x01 ; Interrupt on falling edge of pin 8 of cartridge port
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
95 ; GIME VMODE
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
96 GIME_BP equ 0x80 ; enable bit plane mode
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
97 GIME_BPI equ 0x20 ; colour burst phase inversion (composite output only)
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
98 GIME_MONO equ 0x10 ; disable colour burst (composite output only)
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
99 GIME_H50 equ 0x08 ; set to 50Hz operation
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
100 GIME_LPR1 equ 0x00 ; one line per row
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
101 GIME_LPR2 equ 0x02 ; two lines per row (also works on graphics)
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
102 GIME_LPR8 equ 0x03 ; 8 lines per row
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
103 GIME_LPR9 equ 0x04 ; 9 lines per row
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
104 GIME_LPR10 equ 0x05 ; 10 lines per row
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
105 GIME_LPR11 equ 0x06 ; 11 lines per row
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
106 GIME_LPRINF equ 0x07 ; "infinite" lines per row
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
107 ; GIME VRES
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
108 GIME_LPF192 equ 0x00 ; 192 lines on screen
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
109 GIME_LPF200 equ 0x40 ; 200 lines on screen (actually 199 due to hardware bug)
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
110 GIME_LPF225 equ 0x60 ; 225 lines on screen
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
111 GIME_BPR16 equ 0x00 ; 16 bytes per row
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
112 GIME_BPR20 equ 0x04 ; 20 bytes per row
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
113 GIME_BPR32 equ 0x08 ; 32 bytes per row
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
114 GIME_BPR40 equ 0x0c ; 40 bytes per row
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
115 GIME_BPR64 equ 0x10 ; 64 bytes per row
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
116 GIME_BPR80 equ 0x14 ; 80 bytes per row
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
117 GIME_BPR128 equ 0x18 ; 128 bytes per row
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
118 GIME_BPR160 equ 0x1c ; 160 bytes per row
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
119 GIME_TXT32 equ 0x00 ; 32 characters per row
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
120 GIME_TXT40 equ 0x04 ; 40 characters per row
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
121 GIME_TXT64 equ 0x10 ; 64 characters per row
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
122 GIME_TXT80 equ 0x14 ; 80 characters per row
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
123 GIME_BPP1 equ 0x00 ; 1 bit per pixel
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
124 GIME_BPP2 equ 0x01 ; 2 bits per pixel
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
125 GIME_BPP4 equ 0x02 ; 4 bits per pixel
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
126 GIME_TXTATTR equ 0x01 ; text attributes enabled
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
127 endc
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
128 ifdef COCO3
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
129 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
130 ; Stuff on the fixed memory page
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
131 org 0xfe00
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
132 rmb 0xed ; unused
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
133 INT.FLAG rmb 1 ; validity flag
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
134 INT.SWI3 rmb 3 ; SWI3 bounce vector
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
135 INT.SWI2 rmb 3 ; SWI2 bounce vector
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
136 INT.FIRQ rmb 3 ; FIRQ bounce vector
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
137 INT.IRQ rmb 3 ; IRQ bounce vector
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
138 INT.SWI rmb 3 ; SWI bounce vector
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
139 INT.NMI rmb 3 ; NMI bounce vector
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
140 endc
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
141 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
142 ; Hardware definitions for the I/O page
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
143 org 0xff00
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
144 PIA0 equ * ; Keyboard PIA
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
145 PIA0.DA rmb 1 ; PIA0 data/direction A
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
146 PIA0.CA rmb 1 ; PIA0 control A
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
147 PIA0.DB rmb 1 ; PIA0 data/direction B
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
148 PIA0.CB rmb 1 ; PIA0 control B
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
149 rmb 28 ; mirror images of PIA0
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
150 PIA1 equ * ; DA/misc stuff
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
151 PIA1.DA rmb 1 ; PIA1 data/direction A
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
152 PIA1.CA rmb 1 ; PIA1 control A
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
153 PIA1.DB rmb 1 ; PIA1 data/direction B
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
154 PIA1.CB rmb 1 ; PIA1 control B
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
155 rmb 28 ; mirror images of PIA1
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
156 rmb 16 ; SCS/Disk controller
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
157 rmb 16 ; second half of SCS area
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
158 rmb 32 ; miscelaneous hardware
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
159 ifdef COCO3
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
160 rmb 16 ; *reserved* (unused but the GIME drives them)
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
161 GIME.INIT0 rmb 1 ; basic GIME system config
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
162 GIME.INIT1 rmb 1 ; MMU task and timer rate
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
163 GIME.IRQ rmb 1 ; GIME IRQ enable/status register
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
164 GIME.FIRQ rmb 1 ; GIME FIRQ enable/status register
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
165 GIME.TIMER rmb 2 ; GIME programmable timer
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
166 rmb 2 ; *reserved*
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
167 GIME.VMODE rmb 1 ; GIME video mode setting
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
168 GIME.VRES rmb 1 ; GIME video resolution setting
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
169 rmb 1 ; *reserved* (used for MMU expansion on some memory boards)
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
170 GIME.BORDER rmb 1 ; GIME border colour
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
171 GIME.VSCROLL rmb 1 ; vertical scroll offset register/VDG screen mode variation
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
172 GIME.VOFFSET rmb 2 ; address of video memory (8 byte increments)
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
173 GIME.HOFFSET rmb 1 ; horizontal scroll offset
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
174 GIME.MMU equ * ; MMU registers (two tasks)
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
175 GIME.MMU0 rmb 8 ; MMU task 0
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
176 GIME.MMU1 rmb 8 ; MMU task 1
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
177 GIME.PALETTE rmb 16 ; Palette registers
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
178 else
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
179 rmb 64 ; unused on Coco 1/2 (GIME on Coco 3)
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
180 endc
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
181 SAMREG equ * ; the SAM configuration register
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
182 SAM.V0CLR rmb 1 ; SAM video mode bits
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
183 SAM.V0SET rmb 1
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
184 SAM.V1CLR rmb 1
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
185 SAM.V1SET rmb 1
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
186 SAM.V2CLR rmb 1
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
187 SAM.V2SET rmb 1
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
188 SAM.F0CLR rmb 1 ; SAM screen address bits
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
189 SAM.F0SET rmb 1
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
190 SAM.F1CLR rmb 1
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
191 SAM.F1SET rmb 1
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
192 SAM.F2CLR rmb 1
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
193 SAM.F2SET rmb 1
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
194 SAM.F3CLR rmb 1
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
195 SAM.F3SET rmb 1
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
196 SAM.F4CLR rmb 1
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
197 SAM.F4SET rmb 1
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
198 SAM.F5CLR rmb 1
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
199 SAM.F5SET rmb 1
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
200 SAM.F6CLR rmb 1
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
201 SAM.F6SET rmb 1
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
202 SAM.P1CLR rmb 1 ; SAM "page 1" selection (or extra memory type flag)
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
203 SAM.P1SET rmb 1
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
204 SAM.R0CLR rmb 1 ; SAM R0 bit (address dependent speedup, not used on Coco3)
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
205 SAM.R0SET rmb 1
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
206 SAM.R1CLR rmb 1 ; SAM R1 bit (full speedup/coco 3 speedup)
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
207 SAM.R1SET rmb 1
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
208 SAM.M0CLR rmb 1 ; SAM M0/M1 bits (memory type, not used on Coco3)
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
209 SAM.M0SET rmb 1
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
210 SAM.M1CLR rmb 1
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
211 SAM.M1SET rmb 1
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
212 SAM.TYCLR rmb 1 ; force ROM mode (map type 0)
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
213 SAM.TYSET rmb 1 ; set RAM mode (map type 1)
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
214 rmb 18 ; *MPU reserved*
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
215 CPU.SWI3 rmb 2 ; CPU SWI3 vector
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
216 CPU.SWI2 rmb 2 ; CPU SWI2 vector
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
217 CPU.FIRQ rmb 2 ; CPU FIRQ vector
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
218 CPU.IRQ rmb 2 ; CPU IRQ vector
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
219 CPU.SWI rmb 2 ; CPU SWI vector
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
220 CPU.NMI rmb 2 ; CPU NMI vector
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
221 CPU.RESET rmb 2 ; CPU RESET/startup vector
2d52cd154ed1 Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff changeset
222 *pragmapop list