EMMA 02

BASIC

  • Home
  • Download
  • Change Log
  • Help
  • Compilation
    • Windows
    • OS X
    • Ubuntu
    • Fedora
    • openSUSE
  • Forums
  • Tape Conversion
  • Machine Code
    • SYSTEM00
    • CDP1801
    • CDP1802
    • CDP1804
    • CDP1805
    • Differences
  • Pseudo Code
    • AMVBAS
    • AM4KBAS
    • CARDTRAN
    • Chip-8, 8X, ETI-660 & Elf
    • FEL-1
    • FPA-1
    • FPL-2
    • FPL-4
    • GPL-2
    • GPL-3
    • GPL-4
    • GPL-A (2K RAM)
    • GPL-A (2K ROM)
    • ST2
    • ST4
    • STK
    • Test-Word
    • Super-chip
  • XML Code
    • Main Elements
    • I/O
    • System
    • A/D Convertor
    • BASIC
    • Batch wav
    • Bootstrap
    • Cassette
    • CD4536B
    • CDP1851
    • CDP1852
    • CDP1854
    • CDP1855
    • CDP1877
    • CDP1878
    • CDP1879
    • Debugger
    • COMX Diagnostic
    • Dip switch
    • Disk
    • EF Buttons
    • Flip Flop
    • Front Panel
    • GUI
    • HEX Modem
    • I/O Group
    • Keyboard
    • Keyfile
    • Locations
    • Memory
    • MM57109
    • Printer
    • RTC
    • Sound
    • Splash
    • USB
    • Video
    • Videodump
    • vt
    • X Modem
  • BASIC
    • General Information
    • COMX BASIC V1.00
    • Floating Point BASIC 2.2
    • Pecom 32 BASIC
    • Pecom 64 BASIC 1.0 & 4.0
    • Quest Super BASIC 1.4
    • Quest Super BASIC 3.0
    • Quest Super BASIC 5.0
    • Quest Super BASIC 6.0
    • RCA BASIC3 V1.1
    • Telmac SBASIC v24.3
    • Error Messages
  • Computer List

 

 

 

 

 

 

 

 

 

 

 

 

DEFUS

Format: DEFUS expr

Supported by: Pecom 32 BASIC, Pecom 64 BASIC 1.0 and 4.0

Similar commands:
COMX BASIC V1.00: DEFUS
Floating Point BASIC 2.2: 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
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 Pecom 64 BASIC 1.0 and 4.0 the user space begins at &0200 (hexadecimal). The expression must evaluate to a number greater than &0200. 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 &0200, 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 &0200 is by another DEFUS to &0200. 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.

DEFUS @6D00

Or

DEFUS @6DCC

moves the start of user space to @6D00

DEFUS @0200

moves the start of program space back to its original location

Figure 1: Action by DEFUS to move the beginning of program space up