Acorn Computers BBC Micro Model B w/8271 — Acorn BBC Micro Model B w/8271 User Guide Manual PDF

265 LOMEM Purpose Different sections of the computer’s memory are used for different purposes. Normally BASIC makes an intelligent decision about where to store the numbers that the user calls X and Y etc. In fact it stores these variables immediately after the user’s program. You can change the place where it starts to store these variables by changing the value of LOMEM , but this must be done right at the beginning of the program. The variable LOMEM gives the address of the place in memory above which the computer stores all its variables (except for the resident integer variables @ % and A% to Z%.

LOMEM is normally set to be the same as TOP which is the address of the top of the user program. See the keyword HIMEM and the memory map in Appendix J for more details. Do not accidentally move LOMEM in the middle of a program – the interpreter will lose track of all the variables that you are using. Examples 100 LOMEM=TOP+&100 PRINT LOMEM PRINT ~LOMEM Note: The ~ tells the computer to print the value in hexadecimal. Description A pseudo-variable which sets the place in memory above which the BASIC interpreter stores dynamic variables – those that are created and destroyed as required. Space is always set aside for the resident variables @ % to Z%.

Normally LOMEM is set equal to TOP which contains the address of the end of the user program. Moving LOMEM in the middle of a program will cause loss of all variables. Syntax LOMEM = or = LOMEM Associated keywords HIMEM , TOP , PAGE