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