73#define XT(a) ((a) + sizeof(IU) + 3)
nanoForth main controller
uint16_t U16
16-bit unsigned integer, for return stack, and pointers
Definition n4.h:66
S16 DU
16-bit data unit (CELL)
Definition n4.h:76
U16 IU
16-bit instruction unit (ADDR)
Definition n4.h:75
uint8_t U8
8-bit unsigned integer, for char and short int
Definition n4.h:65
constexpr U8 OP_CDJ
1101 0000
Definition n4_asm.h:54
constexpr U8 OP_UDJ
1110 0000
Definition n4_asm.h:55
N4OP
Definition n4_asm.h:33
@ TKN_WRD
colon (user defined) word
Definition n4_asm.h:35
@ TKN_IMM
immediate word
Definition n4_asm.h:34
@ TKN_NUM
number (literal)
Definition n4_asm.h:37
@ TKN_ERR
parse error (unknown token)
Definition n4_asm.h:39
@ TKN_PRM
primitive built-in word
Definition n4_asm.h:36
@ TKN_EXT
extended built-in word
Definition n4_asm.h:38
constexpr U8 CTL_BITS
1100 0000, JMP - 11nn xxxx, PRM - 10nn nnnn, NUM - 0nnn nnnn
Definition n4_asm.h:44
constexpr U8 OP_CALL
1100 0000
Definition n4_asm.h:53
constexpr IU LFA_END
end of link field
Definition n4_asm.h:72
constexpr U8 OP_NXT
1111 0000
Definition n4_asm.h:56
constexpr U8 PRM_MASK
00nn nnnn, 6-bit primitive opcodes
Definition n4_asm.h:48
constexpr U8 JMP_MASK
11nn xxxx, nn - CALL 00, CDJ 01, UDJ 10, NXT 11
Definition n4_asm.h:47
N4_EXT_OP
Definition n4_asm.h:62
@ I_SQ
S" do_string.
Definition n4_asm.h:66
@ I_NOP
extended opcode (used by for...nxt loop)
Definition n4_asm.h:63
@ I_SEM
; semi-colon
Definition n4_asm.h:64
@ I_I
61, loop counter
Definition n4_asm.h:68
@ I_DQ
." dot_string
Definition n4_asm.h:65
@ I_FOR
62
Definition n4_asm.h:69
@ I_DO
DO>
Definition n4_asm.h:67
@ I_LIT
63 = 0x3f 3-byte literal
Definition n4_asm.h:70
constexpr IU ADR_MASK
0000 aaaa aaaa aaaa 12-bit address in 16-bit branching instructions
Definition n4_asm.h:49
constexpr U8 JMP_OPS
1100 0000
Definition n4_asm.h:45
constexpr U8 PRM_OPS
1000 0000
Definition n4_asm.h:46
IU query()
dictionary, string list scanners
Definition n4_asm.cpp:314
void does(IU xt)
compile a 16-bit value onto dictionary
Definition n4_asm.cpp:404
void save(U8 autorun)
persist user dictionary to EEPROM
Definition n4_asm.cpp:217
void create()
meta compiler
Definition n4_asm.cpp:389
U8 * here
top of dictionary (exposed to _vm for HRE, ALO opcodes)
Definition n4_asm.cpp:98
void dot_str()
Definition n4_asm.cpp:416
void variable()
create a variable on dictionary
Definition n4_asm.cpp:426
void ccomma(DU v)
compile a 16-bit value onto dictionary
Definition n4_asm.cpp:403
void comma(DU v)
compile a 16-bit value onto dictionary
Definition n4_asm.cpp:402
void see()
decode colon word
Definition n4_asm.cpp:478
U16 load(U8 autorun)
restore user dictionary from EEPROM
Definition n4_asm.cpp:256
IU reset()
reset internal pointers (for BYE)
Definition n4_asm.cpp:297
void words()
display words in dictionary
Definition n4_asm.cpp:450
void forget()
forgets word in the dictionary
Definition n4_asm.cpp:464
IU trace(IU a, U8 ir, char delim)
print execution tracing info
Definition n4_asm.cpp:500
U8 * last
pointer to last word, for debugging
Definition n4_asm.cpp:97
N4OP parse(U8 *tkn, IU *rst, U8 run)
Instruction decoder.
Definition n4_asm.cpp:325
void constant(DU v)
Definition n4_asm.cpp:435
static void compile(void)
Definition tforth.c:223