eForth1  v2.4
eforth_config.h File Reference

eForth configurations and opcode list More...

#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <stdint.h>
#include <time.h>
Include dependency graph for eforth_config.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define APP_NAME   "eForth1 v2.4"
 
#define OPCODES
 
Capacity and Sizing
Attention
reassemble ROM needed if FORTH_TIB_SZ or FORTH_PAD_SZ changed
#define CELLSZ   2
 
#define CFUNC_MAX   8
 
#define FORTH_ROM_SZ   0x2000
 
#define FORTH_UVAR_SZ   0x20
 
#define FORTH_DIC_SZ   (0x400-FORTH_UVAR_SZ)
 
#define FORTH_STACK_SZ   0x80
 
#define FORTH_TIB_SZ   0x80
 
#define FORTH_RAM_SZ
 
Memory Map Addressing

note: Forth only needs a few bytes for Arduino auto (on heap), but Serial default TX/RX buffers uses 0x40 * 2 = 128 bytes

logic and stack op macros (processor dependent)

#define FORTH_BOOT_ADDR   0x0000
 
#define FORTH_RAM_ADDR   FORTH_ROM_SZ
 
#define FORTH_UVAR_ADDR   FORTH_RAM_ADDR
 
#define FORTH_DIC_ADDR   (FORTH_UVAR_ADDR + FORTH_UVAR_SZ)
 
#define FORTH_STACK_ADDR   (FORTH_DIC_ADDR + FORTH_DIC_SZ)
 
#define FORTH_STACK_TOP   (FORTH_STACK_ADDR + FORTH_STACK_SZ)
 
#define FORTH_TIB_ADDR   (FORTH_STACK_TOP)
 
#define FORTH_MAX_ADDR   (FORTH_TIB_ADDR + FORTH_TIB_SZ)
 
Logical

TRUE cannot use 1 because NOT(ffff)==0 while NOT(1)==ffff which does not need boolean op (i.e. in C)

#define TRUE   -1
 
#define FALSE   0
 
VM operational flags
#define fCOLON   0x8000
 

Typedefs

Portable Types
typedef uint32_t U32
 32-bit unsigned integer More...
 
typedef uint16_t U16
 16-bit unsigned integer More...
 
typedef uint8_t U8
 8-bit unsigned integer More...
 
typedef int32_t S32
 32-bit signed integer More...
 
typedef int16_t S16
 16-bit signed integer More...
 
typedef int8_t S8
 8-bit signed integer More...
 
typedef U16 IU
 instruction/address unit (16-bit) More...
 
typedef S16 DU
 data/cell unit More...
 
typedef void(* CFP) ()
 function pointer More...
 

Detailed Description

eForth configurations and opcode list

Macro Definition Documentation

◆ APP_NAME

#define APP_NAME   "eForth1 v2.4"

◆ CELLSZ

#define CELLSZ   2

16-bit cell size

◆ CFUNC_MAX

#define CFUNC_MAX   8

size C function pointer slots (8)

◆ FORTH_ROM_SZ

#define FORTH_ROM_SZ   0x2000

size of ROM (for pre-defined words)

◆ FORTH_UVAR_SZ

#define FORTH_UVAR_SZ   0x20

size of Forth user variables

◆ FORTH_DIC_SZ

#define FORTH_DIC_SZ   (0x400-FORTH_UVAR_SZ)

size of dictionary space

◆ FORTH_STACK_SZ

#define FORTH_STACK_SZ   0x80

size of data/return stack

◆ FORTH_TIB_SZ

#define FORTH_TIB_SZ   0x80

size of terminal input buffer

◆ FORTH_RAM_SZ

#define FORTH_RAM_SZ
Value:
( \
FORTH_UVAR_SZ + FORTH_DIC_SZ + \
FORTH_STACK_SZ + FORTH_TIB_SZ)

total RAM allocated

◆ FORTH_BOOT_ADDR

#define FORTH_BOOT_ADDR   0x0000

◆ FORTH_RAM_ADDR

#define FORTH_RAM_ADDR   FORTH_ROM_SZ

◆ FORTH_UVAR_ADDR

#define FORTH_UVAR_ADDR   FORTH_RAM_ADDR

◆ FORTH_DIC_ADDR

#define FORTH_DIC_ADDR   (FORTH_UVAR_ADDR + FORTH_UVAR_SZ)

◆ FORTH_STACK_ADDR

#define FORTH_STACK_ADDR   (FORTH_DIC_ADDR + FORTH_DIC_SZ)

◆ FORTH_STACK_TOP

#define FORTH_STACK_TOP   (FORTH_STACK_ADDR + FORTH_STACK_SZ)

◆ FORTH_TIB_ADDR

#define FORTH_TIB_ADDR   (FORTH_STACK_TOP)

◆ FORTH_MAX_ADDR

#define FORTH_MAX_ADDR   (FORTH_TIB_ADDR + FORTH_TIB_SZ)

◆ TRUE

#define TRUE   -1

◆ FALSE

#define FALSE   0

◆ fCOLON

#define fCOLON   0x8000

flag a colon word

◆ OPCODES

#define OPCODES

Forth VM Opcodes (for Bytecode Assembler)

Typedef Documentation

◆ U32

typedef uint32_t U32

32-bit unsigned integer

◆ U16

typedef uint16_t U16

16-bit unsigned integer

◆ U8

typedef uint8_t U8

8-bit unsigned integer

◆ S32

typedef int32_t S32

32-bit signed integer

◆ S16

typedef int16_t S16

16-bit signed integer

◆ S8

typedef int8_t S8

8-bit signed integer

◆ IU

typedef U16 IU

instruction/address unit (16-bit)

◆ DU

typedef S16 DU

data/cell unit

◆ CFP

typedef void(* CFP) ()

function pointer

FORTH_DIC_SZ
#define FORTH_DIC_SZ
Definition: eforth_config.h:40
FORTH_TIB_SZ
#define FORTH_TIB_SZ
Definition: eforth_config.h:42