Repository navigation
Expand file tree
/
Copy pathBasic68k3.0.inc
More file actions
150 lines (105 loc) · 4.63 KB
/
Copy pathBasic68k3.0.inc
File metadata and controls
150 lines (105 loc) · 4.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
* This lot is in RAM
OFFSET 0 * start of RAM
ram_strt ds.l $100 * allow 1K for the stack, this should be plenty
* for any BASIC program that doesn't do something
* silly, it could even be much less.
ram_base
LAB_WARM ds.w 1 * BASIC warm start entry point
Wrmjpv ds.l 1 * BASIC warm start jump vector
Usrjmp ds.w 1 * USR function JMP address
Usrjpv ds.l 1 * USR function JMP vector
* system dependant i/o vectors
* these are in RAM and are set at start-up
V_INPT ds.w 1 * non halting scan input device entry point
V_INPTv ds.l 1 * non halting scan input device jump vector
V_OUTP ds.w 1 * send byte to output device entry point
V_OUTPv ds.l 1 * send byte to output device jump vector
V_LOAD ds.w 1 * load BASIC program entry point
V_LOADv ds.l 1 * load BASIC program jump vector
V_SAVE ds.w 1 * save BASIC program entry point
V_SAVEv ds.l 1 * save BASIC program jump vector
V_CTLC ds.w 1 * save CTRL-C check entry point
V_CTLCv ds.l 1 * save CTRL-C check jump vector
Itemp ds.l 1 * temporary integer (for GOTO etc)
Smeml ds.l 1 * start of memory (start of program)
Sfncl ds.l 1 * start of functions (end of Program)
Svarl ds.l 1 * start of variables (end of functions)
Sstrl ds.l 1 * start of strings (end of variables)
Sarryl ds.l 1 * start of arrays (end of strings)
Earryl ds.l 1 * end of arrays (start of free mem)
Sstorl ds.l 1 * string storage (moving down)
Ememl ds.l 1 * end of memory (upper bound of RAM)
Sutill ds.l 1 * string utility ptr
Clinel ds.l 1 * current line (Basic line number)
Blinel ds.l 1 * break line (Basic line number)
Cpntrl ds.l 1 * continue pointer
Dlinel ds.l 1 * current DATA line
Dptrl ds.l 1 * DATA pointer
Rdptrl ds.l 1 * read pointer
Varname ds.l 1 * current var name
Cvaral ds.l 1 * current var address
Lvarpl ds.l 1 * variable pointer for LET and FOR/NEXT
des_sk_e ds.l 6 * descriptor stack end address
des_sk * descriptor stack start address
* use a4 for the descriptor pointer
ds.w 1
Ibuffs ds.l $40 * start of input buffer
Ibuffe
* end of input buffer
FAC1_m ds.l 1 * FAC1 mantissa1
FAC1_e ds.w 1 * FAC1 exponent
FAC1_s EQU FAC1_e+1 * FAC1 sign (b7)
ds.w 1
FAC2_m ds.l 1 * FAC2 mantissa1
FAC2_e ds.l 1 * FAC2 exponent
FAC2_s EQU FAC2_e+1 * FAC2 sign (b7)
FAC_sc EQU FAC2_e+2 * FAC sign comparison, Acc#1 vs #2
flag EQU FAC2_e+3 * flag byte for divide routine
PRNlword ds.l 1 * PRNG seed long word
ut1_pl ds.l 1 * utility pointer 1
Asptl ds.l 1 * array size/pointer
Astrtl ds.l 1 * array start pointer
numexp EQU Astrtl * string to float number exponent count
expcnt EQU Astrtl+1 * string to float exponent count
expneg EQU Astrtl+3 * string to float eval exponent -ve flag
func_l ds.l 1 * function pointer
* these two need to be a word aligned pair !
Defdim ds.w 1 * default DIM flag
cosout EQU Defdim * flag which CORDIC output (re-use byte)
Dtypef EQU Defdim+1 * data type flag, $80=string, $40=integer, $00=float
Binss ds.l 4 * number to bin string start (32 chrs)
Decss ds.l 1 * number to decimal string start (16 chrs)
ds.w 1 *
Usdss ds.w 1 * unsigned decimal string start (10 chrs)
Hexss ds.l 2 * number to hex string start (8 chrs)
BHsend ds.w 1 * bin/decimal/hex string end
prstk ds.b 1 * stacked function index
*Srchc ds.b 1 * search character
tpower ds.b 1 * remember CORDIC power
Asrch ds.b 1 * scan-between-quotes flag, alt search character
Dimcnt ds.b 1 * # of dimensions
Breakf ds.b 1 * break flag, $00=END else=break
Oquote ds.b 1 * open quote flag (Flag: DATA; LIST; memory)
Gclctd ds.b 1 * garbage collected flag
Sufnxf ds.b 1 * subscript/FNX flag, 1xxx xxx = FN(0xxx xxx)
Imode ds.b 1 * input mode flag, $00=INPUT, $98=READ
Cflag ds.b 1 * comparison evaluation flag
TabSiz ds.b 1 * TAB step size
comp_f ds.b 1 * compare function flag, bits 0,1 and 2 used
* bit 2 set if >
* bit 1 set if =
* bit 0 set if <
Nullct ds.b 1 * nulls output after each line
TPos ds.b 1 * BASIC terminal position byte
TWidth ds.b 1 * BASIC terminal width byte
Iclim ds.b 1 * input column limit
ccflag ds.b 1 * CTRL-C check flag
ccbyte ds.b 1 * CTRL-C last received byte
ccnull ds.b 1 * CTRL-C last received byte 'life' timer
* these variables for simulator load/save routines
file_byte ds.b 1 * load/save data byte
file_id ds.l 1 * load/save file ID
dc.w 0 * dummy even value and zero pad byte
prg_strt
ORG *
ram_top EQU $40000 * length in bytes of RAM