CORE words: Multitasker, Evaluator, Timers and System


Multitasker

Name Stack Effect Summary Token
LOCAL  ( tid n -- a ) Access another task's data xt = 0x1EC
Access another task's user variables
SEM-GET  ( semaphore -- ) Acquire access to a semaphore xt = 0x1F0
Get a semaphore, locking out other tasks from using the resource related to this semaphore.
REASSIGN  ( xt tid -- ) Assign a new xt to a task xt = 0x1EB
TID  ( -- addr ) ID of current task xt = 0x18B
TCB structure: sp0 / rp0 / pc / sp / rp / status / link / userdata... offsets: -20 -16 -12 -8 -4 0 4 8
SEM-RELEASE  ( semaphore -- ) Release a semaphore xt = 0x1F1
Release a semaphore, allowing other tasks to access the resource related to this semaphore
STOP  ( -- ) Stop the current task xt = 0x1EA
SLEEP  ( tid -- ) Turn off a task xt = 0x1E9
WAKE  ( tid -- ) Turn on a task xt = 0x1E8
ALSOTASK  ( tid -- ) add to the task queue xt = 0x1EF
Places a new task between current and next tasks
NEWTASK  ( user dstack rstack <xt> -- ) newtask xt = 0x1EE
Create a new task. run-time: ( -- tid ) Three memory areas sizes are in bytes TCB structure: sp0 rp0 pc sp rp status link userdata cell offsets: -5 -4 -3 -2 -1 0 1 2 MEM USAGE: TCB USER DSTACK| RSTACK|
PAUSE  ( -- ) switch to the next active task xt = 0x18A

Evaluator

Name Stack Effect Summary Token
REBIND  ( xtsrc xtdest -- ) bind a new action to a word xt = 0x1A8
BIND[  ( xtsrc xtdest -- | R: -- xt cfa ) bind a new action to a word xt = 0x1A9
(LIT32)  ( <l> -- ) compile 32-bit literal xt = 0x1C2
IMMEDIATE
(LIT16)  ( <w> -- ) compile signed 16-bit literal xt = 0xD6
IMMEDIATE
(LIT8)  ( <c> -- ) compile signed 8-bit literal xt = 0xD5
IMMEDIATE
EVALUATE  ( addr -- ior ) evaluate a block of input xt = 0x1D7
test checksum before loading ior: 0 = ok, 1000 = bad checksum, 1001 = bad header, other = stack changed
EVAL  ( -- ) evaluate the input stream xt = 0x1D6
EGETCH  ( -- c ) get next byte from input stream xt = 0x1AF
LIFTTOKEN  ( -- xt ) get next token# from input stre xt = 0x1B4
EGETCH16  ( -- n ) get the next 16-bit value xt = 0x1B3
CHAR  ( <char> -- ) gets char from the input stream xt = 0xFC
RELATIVE  ( -- ) reset base for relative tokens xt = 0x1D5
]BIND  ( -- | R: xt cfa -- ) restore old action xt = 0x1AA
<EVAL  ( addr -- ) set start address for evaluator xt = 0x1CF
EVAL=MEM  ( -- ) set up to evaluate from memory xt = 0x1D8
EVAL=CODE  ( -- ) set up to evaluate program mem xt = 0x1D9
#IF#  ( f -- ) skip forward if zero xt = 0x1C4
Used to conditionally evaluate incoming bytecode.
EVAL>  ( -- c ) terminate evaluator input xt = 0x1D0
ABORT  ( -- ) terminate evaluator input xt = 0x1CD
END  ( -- ) terminates the evaluator xt = 0xFF
IMMEDIATE

Timers

Name Stack Effect Summary Token
CALTIMER  ( addr msec -- ) calibrates a short timer xt = 0x1E3
Run this at startup to calibrate timers
COUNTER<  ( d1 d2 -- f ) compare time values, T if t2>t1 xt = 0x1A5
COUNTER@  ( -- udtime ) get 32-bit count, double cell xt = 0x193
double
MS  ( u -- ) make time delay, milliseconds xt = 0x1E1
Invokes PAUSE until the desired number of milliseconds has elapsed. For better performance, use TICKS.
TICKS  ( d -- ) make time delay, timer ticks xt = 0x1E0
Invokes PAUSE for the double-cell number of timebase ticks.
CTRSCALE  ( -- x ) msec per tick * 2^cellsize xt = 0x196
constant Assumes tick rate = 4096 Hz on 683XX
COUNTER!  ( udtime -- ) set 32-bit timer count xt = 0x194
PREMATURE?  ( addr -- f ) tests a timer for timeout xt = 0x1E2
Compares a variable against the present time, returns F and clears it if it has timed out. Uses double variable: mark|threshold
|COUNTER|  ( d1 -- d2 ) truncate difference to 32 bits xt = 0x195

System-related words in the CORE wordlist 

Name Stack Effect Summary Token
SYSINIT  ( -- ) Initialize drivers xt = 0x1DF
DOORPAUSE  ( -- ) backdoor debugger hook xt = 0x1BC
MAINEVENT  ( -- ) called forever in a loop xt = 0x1DB
CPUTYPE  ( -- x ) cpu code type: 1 = 8051, 3 = Coldfire/68K xt = 0x1AB
UNINITIALIZED  ( -- ) error handler for DEFERed words xt = 0x197
BIND@  ( xt -- cfa ) extract CFA from the binding table xt = 0x18F
NEWBINDINGS  ( addr -- ) initialize binding table from ROM xt = 0x1DD
NEWVALUES  ( addr -- ) initialize data space table from ROM xt = 0x1DE
WATCHDOG+  ( -- ) raise watchdog timer line xt = 0x180
WATCHDOG-  ( -- ) lower watchdog timer line xt = 0x181
'BIND  ( xt -- addr ) point to a jump in the binding table xt = 0x18E
_UNINIT  ( -- ) report call to an uninitialized xt xt = 0x1DC
REBOOT  ( -- ) reset the processor xt = 0x192
BIND!  ( cfa xt -- ) store CFA to the binding table xt = 0x190