Format: DEFUS expr
Supported by: Telmac SBASIC v 24.3
COMX BASIC V1.00: DEFUS
Floating Point BASIC 2.2: DEFUS
Pecom 32 BASIC, Pecom 64 BASIC 1.0 and 4.0: DEFUS
Quest Super BASIC 1.4: DEFUS
Quest Super BASIC 3.0: DEFUS
Quest Super BASIC 5.0 and 6.0: DEFUS
RCA BASIC3 V1.1: DEFUS
This statement (define the start of user space) is provided to allow the start of program space to be moved further up in memory, as shown in figure 1. It allows the programmer to create a "hole" in memory in which he can store machine language routines. Expr defines where the program space will begin. In Telmas SBASIC the user space begins at @6300 (hexadecimal). The expression must evaluate to a number greater than @6300. BASIC will round down the expression to give only even-page increments of movement. If an attempt is made to define the user space at an address lower than @6300, BASIC will "self-destruct", i.e. since the program overwrites the system area (see figure 1), the BASIC interpreter will no longer work properly. Once a DEFUS statement is executed, the only way to get the program space back to @6300 is by another DEFUS to @6300. The statement destroys the user program currently in memory.
An interesting feature of moving the start of user program space lies in the PSAVE statement. If a program has been generated at a moved location and it has associated with it some machine language routines, a PSAVE statement will save everything from @6300 to the end of program space. Included would be the machine language routines as well as the associated BASIC program. A subsequent PLOAD will load in all of the above, including the machine language routines, and will also redefine the start of user space to where it was when the file was created. No book-keeping is necessary.
moves the start of user space to @6D00
moves the start of program space back to its original location