Format: DEFUS expr
Supported by: Quest Super BASIC 1.4
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 3.0: DEFUS
Quest Super BASIC 5.0 and 6.0: DEFUS
RCA BASIC3 V1.1: DEFUS
Telmac SBASIC v 24.3: 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 Quest Super BASIC 1.4 the user space begins at @2C00 (hexadecimal). The expression must evaluate to a number greater than @2C00. 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 @2C00, 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 @2C00 is by another DEFUS to @2C00. The statement destroys the user program currently in memory.
An interesting feature of moving the start of user program space lies in the CSAVE statement. If a program has been generated at a moved location and it has associated with it some machine language routines, a CSAVE statement will save everything from @2C00 to the end of program space. Included would be the machine language routines as well as the associated BASIC program. A subsequent CLOAD 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