A pseudo-variable which contains the address of the first byte that BBC BASIC (Z80) will not use.

HIMEM must not be changed within a subroutine, procedure, function, FOR...NEXT, REPEAT...UNTIL or GOSUB loop.


BBC BASIC (Z80) uses the calculator's memory to store your program and the variables that your program uses. When BBC BASIC is first loaded and run it checks to find the highest memory address it can use.

If you want to use a machine code subroutine or store some data for use by a CHAINed program, you can move HIMEM down. This protects the area above HIMEM from being overwritten by BBC BASIC (Z80). See the Assembler section and the keyword CHAIN for details.

If you want to change HIMEM, you should do so early in your program. Once it has been changed it will stay at its new value until set to another value. Thus, if you wish to load a machine code subroutine for use by several programs, you only have to change HIMEM and load the subroutine once.

HIMEM must not be raised above its initial value. Memory above HIMEM is used to store TI-OS user variables and moving HIMEM into this region will cause BBC BASIC to corrupt them.

If you wish to increase HIMEM to give more memory to BBC BASIC or decrease HIMEM to give memory to the TI-OS for the creation of new variables use the *HIMEM star command instead.



Associated Keywords