previous page next page reference home emBASIC home page

13 System data
EmBasic has several system areas available for user. There are system variables (primitive and compound) and system constants.
13.1 Memory access
There are system variables (arrays) to access controller memory:
@MEMORY8 of type BYTE
@MEMORY16 of type WORD
@MEMORY32 of type LWORD.
They may be used in expressions and in assignments:
@memory16[800000h] |=[AS41][WLG42][NM43] 100h
These constructs are necessary to access processor i/o pins or internal peripherals like counters or ADCs on systems where there is no Express-i/o layer to support process i/o. The TLCS900 processors have their internal registers for i/o access starting at address 0, the processor handbook has tables at the end listing all registers and their meaning. Please always consult the boards schematics to see which other devices could be affected by writing to a certain port as.
Bitwise write is a problem on TLCS900 because many registers cannot be read back. Shadow registers would have to be introduced to allow different tasks to access the same memory bits without altering the contents of other bits. mCAT problem

No sanity check can be made during memory accessing – use them at your own risk!

13.2 System constants
[AS44][WLG45][NM46]Many constants have been defined using mCAT documentation. Some constants are not hardware specific:
- Kernel version
- Build number
- Country information
- Terminal specification array (each serial line can have its terminal)
- Current time zone[WLG47][NM48]

The rest of constants are hardware specific and described in the mCAT documentation.
13.3 System variables
Following the list of system variables, where TASK corresponds to the desired task/sequence or SELF for the current task.
Default emBASIC console
Last error code, where name is task name or SELF
Current task/sequence name
Process identifier
Default emBASIC console
Time factor for *ALL* timed commands
Last error code
Debug output channel (will be removed in release version)
Serial speed (SERIAL configuration replacement)
Serial mode (SERIAL configuration replacement)
Serial parity (SERIAL configuration replacement)
Serial handshake (SERIAL configuration replacement)
Current ex[NM49]ecution line of code[WLG50]
Byte memory access (MEMBYTE replacement)
Word memory access (MEMWORD replacement)
LWORD memory access(MEMLONG replacement)