nanoFORTH
v2.2
|
nanoForth Assmebler implementation More...
Namespaces | |
N4Asm | |
Macros | |
Branching | |
#define | JMP00(j) ENCA(here, (j)<<8) |
#define | JMPTO(idx, f) ENCA(here, (idx) | ((f)<<8)) |
#define | JMPSET(idx, p1) |
Stack Ops (note: return stack grows downward) | |
#define | RPUSH(a) (*(vm.rp++)=(IU)(a)) |
#define | RPOP() (*(--vm.rp)) |
Dictionary Index <=> Pointer Converter | |
#define | DIC(n) ((U8*)dic + (n)) |
#define | IDX(p) ((IU)((U8*)(p) - dic)) |
Functions | |
U8 | N4Asm::_find (U8 *tkn, IU *adr) |
search the keyword through colon word linked-list More... | |
void | N4Asm::_add_word () |
void | N4Asm::_add_branch (U8 op) |
void | N4Asm::_add_str () |
void | N4Asm::_list_voc (U16 n) |
void | N4Asm::save (U8 autorun=0) |
persist user dictionary to EEPROM More... | |
U16 | N4Asm::load (U8 autorun=0) |
restore user dictionary from EEPROM More... | |
IU | N4Asm::reset () |
reset internal pointers (for BYE) More... | |
IU | N4Asm::query () |
dictionary, string list scanners More... | |
N4OP | N4Asm::parse (U8 *tkn, IU *rst, U8 run) |
Instruction decoder. More... | |
void | N4Asm::compile (IU *rp0) |
Forth compiler. More... | |
void | N4Asm::create () |
meta compiler More... | |
void | N4Asm::comma (DU v) |
compile a 16-bit value onto dictionary More... | |
void | N4Asm::ccomma (DU v) |
More... | |
void | N4Asm::does (IU xt) |
More... | |
void | N4Asm::dot_str () |
void | N4Asm::variable () |
create a variable on dictionary More... | |
void | N4Asm::constant (DU v) |
void | N4Asm::words () |
display words in dictionary More... | |
void | N4Asm::forget () |
forgets word in the dictionary More... | |
void | N4Asm::see () |
decode colon word More... | |
IU | N4Asm::trace (IU adr, U8 ir, char delim=0) |
print execution tracing info More... | |
Variables | |
constexpr U16 | N4_SIG = (((U16)'N'<<8)+(U16)'4') |
EEPROM signature. More... | |
constexpr U16 | N4_AUTO = N4_SIG | 0x8080 |
EEPROM auto-run signature. More... | |
constexpr U16 | ROM_HDR = 6 |
EEPROM header size. More... | |
constexpr U8 | WORDS_PER_ROW = 16 |
words per row when showing dictionary More... | |
U8 * | N4Asm::last { NULL } |
pointer to last word, for debugging More... | |
U8 * | N4Asm::here { NULL } |
top of dictionary (exposed to _vm for HRE, ALO opcodes) More... | |
U8 | N4Asm::tab = 0 |
nanoForth built-in vocabularies | |
#define | N4_WORDS |
const PROGMEM char | IMM [] |
const PROGMEM char | JMP [] |
words for branching ops in compile mode. More... | |
const PROGMEM char | PRM [] |
primitive words (53 of 61 allocated, 3 pre-allocated). More... | |
const PROGMEM char | PMX [] = "\x2" "I " "FOR" |
loop control opcodes Note: Standard Forth VAL - CONSTANT DLY - MS NOT - INVERT NXT - NEXT, but break at 1 More... | |
nanoForth Assmebler implementation
#define N4_WORDS |
#define JMP00 | ( | j | ) | ENCA(here, (j)<<8) |
#define JMPTO | ( | idx, | |
f | |||
) | ENCA(here, (idx) | ((f)<<8)) |
#define JMPSET | ( | idx, | |
p1 | |||
) |
#define RPUSH | ( | a | ) | (*(vm.rp++)=(IU)(a)) |
push address onto return stack
#define RPOP | ( | ) | (*(--vm.rp)) |
pop address from return stack
const PROGMEM char IMM[] |
JMP |
words for branching ops in compile mode.
PRM |
primitive words (53 of 61 allocated, 3 pre-allocated).
PMX = "\x2" "I " "FOR" |
loop control opcodes Note: Standard Forth VAL - CONSTANT DLY - MS NOT - INVERT NXT - NEXT, but break at 1
|
constexpr |
EEPROM header size.
|
constexpr |
words per row when showing dictionary