[Index] [Previous] [Next]

1.3 Error Codes & Globals

A table of two-character error codes for the 12 errors.

00FA 4EC6 ERROR_CODES "NF" NEXT without FOR.
00FC 53CE "SN" Syntax Error
00FE 52C7 "RG" RETURN without GOSUB.
0100 4FC4 "OD" Out of Data
0102 46C3 "FC" Illegal Function Call
0104 4FD6 "OV" Overflow.
0106 4FCD "OM" Out of memory.
0108 55D3 "US" Undefined Subroutine
010A 42D3 "BS" Bad Subscript
010C 44C4 "DD" Duplicate Definition
010E 2FB0 "\0" Division by zero.
0110 49C4 "ID" Invalid in Direct mode.

 


LINE_BUFFER

Buffer for a line of input or program, 73 bytes long.

The line buffer is prefixed with this comma. It's here because the INPUT handler defers to the READ handler, which expects items of data (which the line buffer is treated as) to be prefixed with commas. Quite a neat trick!
0112 2C   DB ','  
0113 0000 LINE_BUFFER DW 0000
.... .... .......
015A 0000 DW 0000

 

 


Globals

A bunch of variables BASIC needs to run.

A flag used by GetArrayVar to determine whether we are declaring an array with DIM, or whether we are accessing an element of an existing array as might be done by EvalTerm.
015B 00 DIM_OR_EVAL DB 00  
A flag used by Read to determine whether the INPUT or READ keyword invoked it.
015C 00 INPUT_OR_READ DB 00  
A temporary prog ptr, used by the NEXT handler and other places (fixme: identify).
015D 0000 PROG_PTR_TEMP DW 0000
A temporary prog ptr used by the Expression Evaluator
015F 0000   DW 0000
Holds the line number of the program line currently being executed
0161 0000 CURRENT_LINE DW 0000
Holds the highest possible memory word address, used for the top of the stack.
0163 1A0F STACK_TOP DW 0F1A
Pointer to the base of program storage.
0165 0000 PROGRAM_BASE DW 0000
Points to the start of storage available for programs. Always immediately follows program storage.
0167 0000 VAR_BASE DW 0000
Points to the start of array storage. This immediately follows the block allocated for normal variables pointed to by VAR_BASE.
0169 0000 VAR_ARRAY_BASE DW 0000
Points to top of variable and array variable storage.
016B 0000 VAR_TOP DW 0000
Points to the point within the program where DATA can be READ from.
016D 0000 DATA_PROG_PTR DW 0000
The (F)loating (Accum)ulator. See the Floating Point section for a full explanation.
016F 00000000 FACCUM DD 0
A temporary byte used by floating point to temporarily hold signs+exponents during calculations.
0173 00 FTEMP DB 00

 

FBUFFER

Small buffer (12 bytes) used by the math package functions FOut and Sqr.

0174 0000 FBUFFER DW 0000
.... .... .......
017F 0000 DW 0000

 

Status Strings

Some string constants, used when reporting errors and printing OK.

0181 204552524FD200 szError " ERROR\0"  
0188 209E00 szIn " IN \0"
018D 0DFBD0 szOK "\rOK\r\0"  

 


[Index] [Previous] [Next]