Mercurial > hg > index.cgi
annotate src/defs.s @ 85:663d8e77b579
Implmement BCD floating point and update number parsing and printing
Implements a BCD floating point system with 10 decimal digits of precistion
and an exponent range of -63 to +63. Also include parsing integer and
floating point values and printing them out.
author | William Astle <lost@l-w.ca> |
---|---|
date | Sun, 15 Oct 2023 22:15:36 -0600 |
parents | bb50ac9fdf37 |
children | 6db72a92ff7a |
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 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
15 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
16 ; Data structure used for calculations. Calculations are handled via structurs called value accumulators. A value |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
17 ; 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
|
18 ; 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
|
19 ; |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
20 ; 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
|
21 ; |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
22 ; A value accumulator has the following structure for floating point: |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
23 ; Offset Length Contents |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
24 ; 0 1 fp exponent |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
25 ; 1 4 fp mantissa |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
26 ; 5 1 fp sign |
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 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
31 ; 0 1 *unsued* |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
32 ; 1 4 integer value (two's complement) |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
33 ; 5 1 *unused* |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
34 ; 6 1 value type |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
35 ; |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
36 ; 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
|
37 ; Offset Length Contents |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
38 ; 0 2 string length |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
39 ; 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
|
40 ; 4 2 string data pointer |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
41 ; 6 1 value type |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
42 ; |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
43 ; Value type constants |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
44 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
|
45 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
|
46 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
|
47 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
|
48 ; 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
|
49 ; |
663d8e77b579
Implmement BCD floating point and update number parsing and printing
William Astle <lost@l-w.ca>
parents:
80
diff
changeset
|
50 ; 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
|
51 ; 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
|
52 ; unpacked. |
663d8e77b579
Implmement BCD floating point and update number parsing and printing
William Astle <lost@l-w.ca>
parents:
80
diff
changeset
|
53 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
|
54 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
|
55 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
|
56 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
|
57 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
|
58 ; String data definition |
bb50ac9fdf37
Checkpoint with very basic integer and floating point arithmetic, untested
William Astle <lost@l-w.ca>
parents:
77
diff
changeset
|
59 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
|
60 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
|
61 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
|
62 ; 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
|
63 ; 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
|
64 val.value equ 0 ; offset of the value stored in the accumulator |
85
663d8e77b579
Implmement BCD floating point and update number parsing and printing
William Astle <lost@l-w.ca>
parents:
80
diff
changeset
|
65 val.fpsexp equ val.value ; floating point exponent |
663d8e77b579
Implmement BCD floating point and update number parsing and printing
William Astle <lost@l-w.ca>
parents:
80
diff
changeset
|
66 val.fpssig equ val.fpsexp+1 ; floating point significand |
663d8e77b579
Implmement BCD floating point and update number parsing and printing
William Astle <lost@l-w.ca>
parents:
80
diff
changeset
|
67 val.fpssign equ val.fpssig+5 ; floating point sign |
80
bb50ac9fdf37
Checkpoint with very basic integer and floating point arithmetic, untested
William Astle <lost@l-w.ca>
parents:
77
diff
changeset
|
68 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
|
69 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
|
70 val.strptr equ val.value+str.ptr ; string data pointer (low word) |
85
663d8e77b579
Implmement BCD floating point and update number parsing and printing
William Astle <lost@l-w.ca>
parents:
80
diff
changeset
|
71 val.type equ val.value+val.fpssign+1 ; use the largest of the data types here |
80
bb50ac9fdf37
Checkpoint with very basic integer and floating point arithmetic, untested
William Astle <lost@l-w.ca>
parents:
77
diff
changeset
|
72 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
|
73 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
74 ifdef COCO3 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
75 ; GIME INIT0 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
76 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
|
77 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
|
78 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
|
79 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
|
80 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
|
81 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
|
82 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
|
83 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
|
84 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
|
85 ; GIME INIT1 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
86 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
|
87 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
|
88 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
|
89 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
|
90 ; GIME interrupt enable/status bits |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
91 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
|
92 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
|
93 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
|
94 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
|
95 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
|
96 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
|
97 ; GIME VMODE |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
98 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
|
99 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
|
100 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
|
101 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
|
102 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
|
103 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
|
104 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
|
105 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
|
106 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
|
107 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
|
108 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
|
109 ; GIME VRES |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
110 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
|
111 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
|
112 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
|
113 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
|
114 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
|
115 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
|
116 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
|
117 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
|
118 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
|
119 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
|
120 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
|
121 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
|
122 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
|
123 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
|
124 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
|
125 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
|
126 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
|
127 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
|
128 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
|
129 endc |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
130 ifdef COCO3 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
131 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
132 ; 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
|
133 org 0xfe00 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
134 rmb 0xed ; unused |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
135 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
|
136 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
|
137 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
|
138 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
|
139 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
|
140 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
|
141 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
|
142 endc |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
143 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
144 ; 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
|
145 org 0xff00 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
146 PIA0 equ * ; Keyboard PIA |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
147 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
|
148 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
|
149 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
|
150 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
|
151 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
|
152 PIA1 equ * ; DA/misc stuff |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
153 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
|
154 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
|
155 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
|
156 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
|
157 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
|
158 rmb 16 ; SCS/Disk controller |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
159 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
|
160 rmb 32 ; miscelaneous hardware |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
161 ifdef COCO3 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
162 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
|
163 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
|
164 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
|
165 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
|
166 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
|
167 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
|
168 rmb 2 ; *reserved* |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
169 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
|
170 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
|
171 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
|
172 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
|
173 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
|
174 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
|
175 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
|
176 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
|
177 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
|
178 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
|
179 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
|
180 else |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
181 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
|
182 endc |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
183 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
|
184 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
|
185 SAM.V0SET rmb 1 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
186 SAM.V1CLR rmb 1 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
187 SAM.V1SET rmb 1 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
188 SAM.V2CLR rmb 1 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
189 SAM.V2SET rmb 1 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
190 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
|
191 SAM.F0SET rmb 1 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
192 SAM.F1CLR rmb 1 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
193 SAM.F1SET rmb 1 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
194 SAM.F2CLR rmb 1 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
195 SAM.F2SET rmb 1 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
196 SAM.F3CLR rmb 1 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
197 SAM.F3SET rmb 1 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
198 SAM.F4CLR rmb 1 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
199 SAM.F4SET rmb 1 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
200 SAM.F5CLR rmb 1 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
201 SAM.F5SET rmb 1 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
202 SAM.F6CLR rmb 1 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
203 SAM.F6SET rmb 1 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
204 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
|
205 SAM.P1SET rmb 1 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
206 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
|
207 SAM.R0SET rmb 1 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
208 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
|
209 SAM.R1SET rmb 1 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
210 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
|
211 SAM.M0SET rmb 1 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
212 SAM.M1CLR rmb 1 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
213 SAM.M1SET rmb 1 |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
214 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
|
215 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
|
216 rmb 18 ; *MPU reserved* |
2d52cd154ed1
Split some code into separate files for easier management
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
217 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
|
218 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
|
219 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
|
220 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
|
221 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
|
222 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
|
223 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
|
224 *pragmapop list |