by Richard Russell, June 2020
A 'fast' variable is stored as a token in the range &18 to &1F, followed by two bytes to be interpreted as a 16-bit number (little-endian). This number indexes a 4-byte 'slot' pre-allocated at the start of the heap; some variables use more than one slot. So to find the memory address of a fast variable multiply the 16-bit index by 4 and add it to LOMEM. Some slots are never used and are 'wasted', because their index would include a disallowed byte.
The tokens are:
The format of a fast FN/PROC is slightly different. It consists of the regular token for FN or PROC followed by &18 and the 16-bit index, so 4 bytes in all rather than 3 for the other fast variables.
Everything above applies equally to BBC BASIC for Windows and BBC BASIC for SDL 2.0. The difference is that the BB4W cruncher creates fast variables only when one or more REM!Fast directives are present in the program; the BBCSDL cruncher will use fast variables whenever it can, irrespective of the presence of a REM!Fast.