Go to the documentation of this file.
24 #define APP_NAME "\nnanoForth 2.2 "
44 #define log(msg) Serial.print(F(msg))
45 #define logx(v) Serial.print((U16)v, HEX)
46 #else // !ARDUINO // for debugging
52 #define millis() 10000
53 #define random(v) (rand()%v)
54 #define pgm_read_byte(p) (*(p))
55 #define log(msg) ::printf("%s", msg)
56 #define logx(v) ::printf("%x", (U16)v)
60 #define INLINE inline __attribute__((always_inline))
static void yield()
nanoForth yield to user tasks
Definition: n4.cpp:42
static void call_api(U16 id)
call C API interface
Definition: n4.cpp:33
S32 DU2
Definition: n4.h:77
void setup(const char *code=0, Stream &io=Serial, U8 ucase=0)
placeholder for extra setup
Definition: n4.cpp:20
S16 DU
16-bit data unit (CELL)
Definition: n4.h:76
#define N4_API_SZ
Definition: n4.h:37
void(* FPTR)()
function pointer
Definition: n4.h:70
int16_t S16
16-bit signed integer, for general numbers
Definition: n4.h:67
uint16_t U16
16-bit unsigned integer, for return stack, and pointers
Definition: n4.h:66
int32_t S32
32-bit signed integer
Definition: n4.h:69
Stream * io
default to Arduino Serial Monitor
Definition: n4_core.cpp:27
uint32_t U32
32-bit unsigned integer, for millis()
Definition: n4.h:68
static void add_api(U16 i, void(*fp)())
Definition: n4.cpp:13
uint8_t U8
8-bit unsigned integer, for char and short int
Definition: n4.h:65
static FPTR api[N4_API_SZ]
C API function pointer slots.
Definition: n4.h:80
void exec()
nanoForth execute one line of command input
Definition: n4.cpp:27
U16 IU
16-bit instruction unit (ADDR)
Definition: n4.h:75
static void wait(U32 ms)
pause NanoForth thread for ms microseconds, yield to user tasks
Definition: n4.cpp:49