forked from rileym65/Basic-02
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsbc.doc
More file actions
184 lines (165 loc) · 4.93 KB
/
Copy pathsbc.doc
File metadata and controls
184 lines (165 loc) · 4.93 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
ASM
CHDIR "dirname"
CLOSE #filenum
CLS
DATA number,number,...
DEALLOC addr
DELETE "filename"
DMA expr
DPOKE addr,value
END
FOR var=expr TO expr [STEP expr]
FREAD #filenum address,length
FWRITE #filenum address,length
GET #filenum var,...
GOSUB line
GOTO line
IDLE
IF expr THEN statement
INPUT ["prompt",]var[,var][,var][,...]
INTR line
IOFF
ION
[LET] var=expr
LOCATE y,x
MKDIR "dirname"
NEXT [var]
ON expr GOSUB line,line,...
ON expr GOTO line,line,...
OPEN "filename" FOR INPUT|OUTPUT|APPEND AS #filenum
OUT port,value
POKE addr,value
POS #filenum position
PRINT expr[,;]expr[,;]...
PUT #filenum var,...
Q expr
READ var,var,...
REM text
RENAME "filename" TO "filename"
RESTORE [line]
RETURN [line]
RMDIR "dirname"
Expressions:
+
-
*
/
%
&
|
^
=
<>
<
>
<=
>=
$hexnum
ABS(expr)
ALLOC(expr)
ACOS(expr)
ASIN(expr)
ATAN(expr)
CINT(expr)
COS(expr)
CSNG(expr)
DPEEK(addr)
EOF(filenum)
EXP(addr)
FLG(expr)
FRE(addr)
INP(port)
LN(expr)
PEEK(addr)
POS(filenum)
RND(range)
SGN(expr)
SIN(expr)
SQRT(expr)
TAN(expr)
System variables:
DATA_ - Address of DATA pointer
FREE_ - Address of free RAM
LFSR_ - MSW of 32-bit LFSR RND seed
LFSR__ - LSW of 32-bit LFSR RND seed
*ISTART
*IRETURN
Variables:
Variable names can be more than 1 character, but must start with a letter
and then must consist of either upper or lowercase letter or numbers or the
underscaore (_) character. Case is irrelevant.
Varaibles are stored either at the specified address, else the first byte
in RAM after the program (if program is compiled for RAM) else the first byte
of RAM.
Notes:
Multiple statements on a line are supported, statements must be separated
by the colon (:) character.
Line numbers must be greater than 0 and less than 65536 and must appear
in order.
All other numbers are 16-bit signed integers (unless -32 or -fp is used).
if term=none then PRINT and INPUT will not produce any code, nor will they
produce errors during compile.
if term=bios then terminal i/o expects the Elf/OS BIOS to be present at
its normal address.
if term=self then terminal i/o functions will be added to the output file
producing a fully self-contained program that has no external dependencies.
In general whitespace is ignored and can be used as desired for legibility.
A single line number must be contained on a single input line. Each input
line is currently limited to 2048 character.
Compiler Directives:
.1805 - Enable 1804/5/6 assembler mode
.32 - Enable 32-bit mode
.binary - Output file as binary
.fp - Enable floating-point mode
.elfos - Produce Elf/OS executable
.list - Show source list
.nolist - Turn off source list
.noruntime - Do not show runtime modules
.nosymbols - Do not show assembler symbols
.novars - Do not show variables
.runtime - Show runtime modules
.symbols - Show assembler symbols
.vars - Show variables
Switches:
-32 - compile in 32-bit mode
-fp - enable floating point
-a - produce assembly file
-A - display assembly
-b - output as binary
-c - show compiler output
-i - output as Intel hex
-l - show source list
-L - create .lst file
-r - output as RCS hex
-R - show runtime modules
-s - show assembler symbols
-v - show variables
-lf - set line endings to line-feed
-cr - set line endings to carriag-return
-lfcr - set line endings to line-feed/carriage-return
-crlf - set line endings to carriage-return/line-feed
-nq - normal Q for internal serial port
-rq - reverse Q for internal serial port
-ef? - Set EF line for internal serial port (?=1-4)
-ref? - Set reverse EF line for internal serial port (?=1-4)
-ram=start-end - set ram address range
-rom=start-end - set rom address range
-start=hex - Set start address
-exit=hex - Set address to jump to on exit
-vars=hex - Start of variable table
-stack=hex - set address for top of stack
-estack=hex - set address for top of expression stack
-heap=hex - set address for top of heap
-keybuf=hex - size of key buffer
-term=bios - use BIOS terminal i/o (default)
=self - use internal serial i/o
=none - no terminal
-elfos - produce an Elf/OS executable
-stg - produce STG compatible image (sets -exit=8003)
-melf - -ram=0000-7fff -rom=8000-ffff -nq -ef2
-pev - -ram=0000-7fff -rom=8000-ffff -nq -ef2
-pev2 - -ram=0000-7fff -rom=8000-ffff -rq -ref2
-elf2k - -ram=0000-7fff -rom=8000-ffff -nq -ef3
-mclo - -ram=0000-7fff -rom=8000-ffff -nq -ef3
-mchi - -ram=8000-ffff -rom=0000-7fff -nq -ef3
-mchip - -ram=8000-ffff -rom=0000-7fff -rq -ref3