nanoFORTH  v2.2
n4.h File Reference

nanoForth main controller More...

#include <Arduino.h>
Include dependency graph for n4.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  NanoForth
 

Macros

#define APP_NAME   "\nnanoForth 2.2 "
 
#define N4_API_SZ   8
 
#define TRC_LEVEL   1
 
Arduino Console Output Support
#define log(msg)   Serial.print(F(msg))
 
#define logx(v)   Serial.print((U16)v, HEX)
 
#define INLINE   inline __attribute__((always_inline))
 

Typedefs

typedef U16 IU
 16-bit instruction unit (ADDR) More...
 
typedef S16 DU
 16-bit data unit (CELL) More...
 
typedef S32 DU2
 
Portable Types
typedef uint8_t U8
 8-bit unsigned integer, for char and short int More...
 
typedef uint16_t U16
 16-bit unsigned integer, for return stack, and pointers More...
 
typedef int16_t S16
 16-bit signed integer, for general numbers More...
 
typedef uint32_t U32
 32-bit unsigned integer, for millis() More...
 
typedef int32_t S32
 32-bit signed integer More...
 
typedef void(* FPTR) ()
 function pointer More...
 

Detailed Description

nanoForth main controller

Memory Map

paddr forth objects rom
0x0000 Interrupt Vectors
0x0100 Arduino libraries
0x02c0 0x0000 Dictionary==> x
...1K-byte... x
0x06c0 0x0400 Return Stack==>
...64 entries...
<==Data Stack
0x0740 0x0480 Input Buffer
...free memory...
Arduino heap
0x0900

Macro Definition Documentation

◆ APP_NAME

#define APP_NAME   "\nnanoForth 2.2 "

◆ N4_API_SZ

#define N4_API_SZ   8

@Note 1: N4_API_SZ defines C funcion pointer slots which take 2 bytes each The number can be increased if more interfaces are needed @Note 2: TRC_LEVEL set tracing level 0 - no tracing, N4Asm::see, N4Asm::trace, and N4VM::_dump 1 - detailed tracing info of the above 2 - add execution tracing, N4VM::_nest (slower) The above codes takes extra 1.8K bytes which can be disabled if extra program memory is needed C API func ptr slots

◆ TRC_LEVEL

#define TRC_LEVEL   1

SEE and tracing level

◆ log

#define log (   msg)    Serial.print(F(msg))

◆ logx

#define logx (   v)    Serial.print((U16)v, HEX)

◆ INLINE

#define INLINE   inline __attribute__((always_inline))

Typedef Documentation

◆ U8

typedef uint8_t U8

8-bit unsigned integer, for char and short int

◆ U16

typedef uint16_t U16

16-bit unsigned integer, for return stack, and pointers

◆ S16

typedef int16_t S16

16-bit signed integer, for general numbers

◆ U32

typedef uint32_t U32

32-bit unsigned integer, for millis()

◆ S32

typedef int32_t S32

32-bit signed integer

◆ FPTR

typedef void(* FPTR) ()

function pointer

◆ IU

typedef U16 IU

16-bit instruction unit (ADDR)

nanoForth main control object (with static members that support multi-threading)

◆ DU

typedef S16 DU

16-bit data unit (CELL)

◆ DU2

typedef S32 DU2