BBC BASIC MEMORY USE Compiled by Jon Ripley &0000-&007F Language Zero Page Workspace ======================================== &0000/1 LOMEM - start of variable heap &0002/3 VARTOP - top of variable heap &0004/5 STACKBOT - BASIC stack pointer &0006/7 HIMEM - top of BASIC stack &0008/9 ERL &000A Text pointer 1 offset index into the current statement &000B/C Text pointer 1 to the start of the current statement &000D-11 RND store &0012/3 TOP &0014 Print field width from @% &0015 b7=Hex/Decimal Print flag &0016/7 ON ERROR pointer &0018 PAGE high (low is always zero) &0019/A Text pointer 2 start of current expression &001B Text pointer 2 offset - index to the current expression &001C/D Pointer to next DATA item &001E COUNT &001F LISTO option Bit 0 - Space after line number 1 - Indent FORs 2 - Indent REPEATs &0020 Trace flag &00=off, <>&00=on &0021/2 TRACE maximum line number &0023 WIDTH &0024 Number of REPEATs, index into REPEAT stack &0025 Number of GOSUBs, index into GOSUB stack &0026 15 * number of FORs, index into FOR stack &0027 Variable type of current expression &0028 OPT value for assembler Bit 0 - Produce listing 1 - Give errors 2 - Relocate &0029-B Assembled code buffer, overlaps IntA so opcode parameter follows &002A-D Integer accumulator &002E Floating Point Accumulator #1 sign/point &002F Floating Point Accumulator #1 over/underflow &0030 Floating Point Accumulator #1 exponent &0031-4 Floating Point Accumulator #1 mantissa &0035 Floating Point Accumulator #1 rounding byte &0036 String Accumulator length (string accumulator is at &600) &0037/8 Renumber pointer &0037 String/number conversion format type from @% &0038 String/number conversion number of digits from @% &0039/A Renumber/Delete line number &0039 PROC/FN/variable name length &0039-40 Integer store for multiply and divide &003B Floating Point Accumulator #2 sign &003C Floating Point Accumulator #2 over/underflow byte &003D Floating Point Accumulator #2 exponent &003E-41 Floating Point Accumulator #2 mantissa &0042 Floating Point Accumulator #2 rounding byte &0043 Temporary store &0043-47 Floating point multiple and divide workspace &003F-47 Hex output digit build area &0048 Series counter &0048 String/number conversion decimal exponent (BASIC IV) &0049 String/number conversion flag (pre BASIC IV) &004A String/number conversion decimal exponent (pre BASIC IV) &004B/C Current variable pointer &004D/E Pointer for series evaluator &004F-6F Unused &004F/50 non-BBC: Error pointer (eg System, Atom) &0050/51 LOMEM on CPU where &00/1 are I/O ports (eg C64) &0070-8F Reserved for user within BASIC &0400-&07FF Language absolute workspace ======================================= &0400-&046B Integer variables ----------------------------- &0400-&0403 @% PRINT format &0404-&0407 A% Transfered to A on CALL/USR &0408-&040B B% &040C-&040F C% b0 transfered carry flag on CALL/USR &0410-&0413 D% &0414-&0417 E% &0418-&041B F% &041C-&041F G% &0420-&0423 H% &0424-&0427 I% &0428-&042B J% &042C-&042F K% &0430-&0433 L% &0434-&0437 M% &0438-&043B N% &043C-&043F O% Assembler address of object code (Not BASIC 1) &0440-&0443 P% Assembler program counter &0444-&0447 Q% &0448-&044B R% &044C-&044F S% &0450-&0453 T% &0454-&0457 U% &0458-&045B V% &045C-&045F W% &0460-&0463 X% Transfered to X register on CALL/USR &0464-&0467 Y% Transfered to Y register on CALL/USR &0468-&046B Z% &046C-&047F Floating point temporary storage -------------------------------------------- &046C-&0470 Floating point temp 1 &0471-&0475 Floating point temp 2 &0476-&047A Floating point temp 3 &047B-&047F Floating point temp 4 &0480-&04EC Variables linked list start addresses ------------------------------------------------- &0480-&0481 @ (unused) &04C0-&04C1 ` &0482-&0483 A &04C2-&04C3 a &0484-&0485 B &04C4-&04C5 b &0486-&0487 C &04C6-&04C7 c &0488-&0489 D &04C8-&04C9 d &048A-&048B E &04CA-&04CB e &048C-&048D F &04CC-&04CD f &048E-&048F G &04CE-&04CF g &0490-&0491 H &04D0-&04D1 h &0492-&0493 I &04D2-&04D3 i &0494-&0495 J &04D4-&04D5 j &0496-&0497 K &04D6-&04D7 k &0498-&0499 L &04D8-&04D9 l &049A-&049B M &04DA-&04DB m &049C-&049D N &04DC-&04DD n &049E-&049F O &04DE-&04DF o &04A0-&04A1 P &04E0-&04E1 p &04A2-&04A3 Q &04E2-&04E3 q &04A4-&04A5 R &04E4-&04E5 r &04A6-&04A7 S &04E6-&04E7 s &04A8-&04A9 T &04E8-&04E9 t &04AA-&04AB U &04EA-&04EB u &04AC-&04AD V &04EC-&04ED v &04AE-&04AF W &04EE-&04EF w &04B0-&04B1 X &04F0-&04F1 x &04B2-&04B3 Y &04F2-&04F3 y &04B4-&04B5 Z &04F4-&04F5 z &04B6-&04B7 [ (unused) &04F6-&04F7 PROCs &04B8-&04B9 \ (unused) &04F8-&04F9 FNs &04BA-&04BB ] (unused) &04BC-&04BD ^ (unused) &04FA-&04FF Unused &04BE-&04BF _ &0500-&05FF FOR, GOSUB and REPEAT stack --------------------------------------- &0500-&0595 FOR/NEXT loop parameters, up to 10 blocks of 15 bytes each &0596-&05A3 unused &05A4-&05B7 REPEAT/UNTIL loop start address low bytes (20 max) &05B8-&05CB REPEAT/UNTIL loop start address high bytes (20 max) &05CC-&05E5 GOSUB return address low bytes (26 max) &05E6-&05FF GOSUB return address high bytes (26 max) &05FF OSWORD subfunction for TIME$= &0600-&06FF BASIC string accumlator and CALL paramater block ------------------------------------------------------------ &0700-&07FF BASIC text input buffer ----------------------------------- Version History --------------- 18-Aug-2006 Updated with reference to "BASIC ROM User Guide", Mark Plumbley