Block 0 RAM

Advanced programmers may find the following table useful as it shows the contents of important block zero RAM locations used by BASIC or the Cassette Operating System. Locations marked as miscellaneous working space tend to have multiple uses. For example, B0 to DB are used by COS for different purposes at different times, and 16 to 59 are usually but not always used as 4-byte integer arithmetic registers.

Note that many of these explanations are not formally supported by Acorn, so they may change in future ROMs. If this happens, we at Timedata would be interested to hear about it.

Page 0 RAM

Address  
00 Error number
01-02 Current Line number (binary)
03 Pointer to character being investigated in statement being interpreted.
04 Temp. for X
05-06 Address of start of statement being interpreted
07 Print Column counter
08-0C Random number seed
0D 0E Top (binary)
10 11 Address of BASIC error handler, normally C9E7,
12 Text space pointer; normally 82 or 89
16- 59 Misc. BASIC working space
5A 5B X ordinate for point plot routine
5C 5D Y ordinate for point plot routine
5E Data for point plot routine. 1=set, 2=invert, else clear
5F 60 Point plot routine workspace
61 6F Misc. BASIC working space
70 7F FP. BASIC working space
80 AF Free
B0 DB Misc. COS working space
DC Tape read/write checksum
DD Fload flag; bit 7 = 1 to ignore block numbers
DE DF VDU RAM address of start of line containing the cursor
DE should be 00, 20, 40 ... E0, DF should be 80 or 81
E0 Cursor position in VDU line; 00 to 3F (or is that 1F?)
E1 0=cursor off, 1 = cursor on
E2 E5 Misc. Workspace
E6 Number of lines remaining (1-16) if VDU in page mode,
bit 7 = 1 if not in page mode.
E7 Bits 5,6,= 1 for shift lock, else 0
E8 E9 Misc. Workspace
EA 'Nomon' if not zero
EB FD Misc. Workspace for COS
FE Character not sent to printer (normally 0A = Line Feed)

Page 1 RAM

100 13F Input line buffer
140 17F String processing area
180 1FF Stack

Page 2 and 3 RAM

200 201 Ptr. to NMI routine; not set by COS or BASIC
202 203 Ptr. to BRK routine; normally C9D8
204 205 Ptr. to IRQ routine; normally A000 (Utility ROM)
206 207 Ptr. to Command Line Interpreter, normally F8EF
208 209 Ptr. to Write Char. routine, normally FE52
20A 20B Ptr. to Read Char. routine, normally FE94
20C 20D Ptr. to Load File routine, normally FE6E
20E 20E Ptr. to Save File routine, normally FAE5
210 211 Ptr. to RDRVEC routine, normally
212 213 Ptr. to STRVEC routine, normally
214 215 Ptr. to GetTapeByte routine, normally
216 217 Ptr. to PutTapeByte routine, normally
218 219 Ptr. to PrintTapeMessage routine, normally
21A 21B Ptr. to Shut file routine, normally
21C 23F Free
240 2EA Misc. Workspace for BASIC
2EB 320 Pointers to arrays: 2EB,306 = AA; 2EC,307 = BB etc.
321 Integer Variable
322 33C Low byte of variables A-Z
33E 357 2nd byte of variables A-Z
359 371 3rd byte of variables A-Z
373 38C High byte of variables A-Z
38D 3C0 Labels; 38D, 38E is RAM address of label a,
38F, 340 is RAM address of label b, etc.
3C1 3FD Misc. Workspace for BASIC
3FE 3FF Ptr. to point plot routine F6E2 for mode 0,
F73B for mode 1,
F754 for mode 2,
F76D for mode 3,
F7AA for mode 4,