eForth1  v2.4
eforth_config.h
Go to the documentation of this file.
1 
5 #ifndef __EFORTH_CONFIG_H
6 #define __EFORTH_CONFIG_H
7 #include <stdio.h>
8 #include <string.h>
9 #include <stdarg.h>
10 #include <stdint.h>
11 #include <time.h>
12 #ifdef ESP8266
13 #include "user_interface.h"
14 #endif // ESP8266
15 
16 #define APP_NAME "eForth1 v2.4"
17 typedef uint32_t U32;
21 typedef uint16_t U16;
22 typedef uint8_t U8;
23 
24 typedef int32_t S32;
25 typedef int16_t S16;
26 typedef int8_t S8;
27 
28 typedef U16 IU;
29 typedef S16 DU;
30 typedef void (*CFP)();
31 #define CELLSZ 2
37 #define CFUNC_MAX 8
38 #define FORTH_ROM_SZ 0x2000
39 #define FORTH_UVAR_SZ 0x20
40 #define FORTH_DIC_SZ (0x400-FORTH_UVAR_SZ)
41 #define FORTH_STACK_SZ 0x80
42 #define FORTH_TIB_SZ 0x80
43 #define FORTH_RAM_SZ ( \
44  FORTH_UVAR_SZ + FORTH_DIC_SZ + \
45  FORTH_STACK_SZ + FORTH_TIB_SZ)
46 #define FORTH_BOOT_ADDR 0x0000
57 #define FORTH_RAM_ADDR FORTH_ROM_SZ
58 #define FORTH_UVAR_ADDR FORTH_RAM_ADDR
59 #define FORTH_DIC_ADDR (FORTH_UVAR_ADDR + FORTH_UVAR_SZ)
60 #define FORTH_STACK_ADDR (FORTH_DIC_ADDR + FORTH_DIC_SZ)
61 #define FORTH_STACK_TOP (FORTH_STACK_ADDR + FORTH_STACK_SZ)
62 #define FORTH_TIB_ADDR (FORTH_STACK_TOP)
63 #define FORTH_MAX_ADDR (FORTH_TIB_ADDR + FORTH_TIB_SZ)
64 #define TRUE -1
71 #define FALSE 0
72 #define fCOLON 0x8000
76 #define OPCODES \
81  OP(EXIT), \
82  OP(ENTER), \
83  OP(BYE), \
84  OP(QRX), \
85  OP(TXSTO), \
86  OP(DOLIT), \
87  OP(DOVAR), \
88  OP(EXECU), \
89  OP(DOES), \
90  OP(DONEXT), \
91  OP(QBRAN), \
92  OP(BRAN), \
93  OP(STORE), \
94  OP(PSTOR), \
95  OP(AT), \
96  OP(CSTOR), \
97  OP(CAT), \
98  OP(RFROM), \
99  OP(RAT), \
100  OP(TOR), \
101  OP(DROP), \
102  OP(DUP), \
103  OP(SWAP), \
104  OP(OVER), \
105  OP(ROT), \
106  OP(PICK), \
107  OP(AND), \
108  OP(OR), \
109  OP(XOR), \
110  OP(INV), \
111  OP(LSH), \
112  OP(RSH), \
113  OP(ADD), \
114  OP(SUB), \
115  OP(MUL), \
116  OP(DIV), \
117  OP(MOD), \
118  OP(NEG), \
119  OP(GT), \
120  OP(EQ), \
121  OP(LT), \
122  OP(ZGT), \
123  OP(ZEQ), \
124  OP(ZLT), \
125  OP(ONEP), \
126  OP(ONEM), \
127  OP(QDUP), \
128  OP(DEPTH), \
129  OP(RP), \
130  OP(BL), \
131  OP(CELL), \
132  OP(ABS), \
133  OP(MAX), \
134  OP(MIN), \
135  OP(WITHIN),\
136  OP(TOUPP), \
137  OP(COUNT), \
138  OP(ULESS), \
139  OP(UMMOD), \
140  OP(UMSTAR), \
141  OP(MSTAR), \
142  OP(UMPLUS),\
143  OP(SSMOD), \
144  OP(SMOD), \
145  OP(MSLAS), \
146  OP(S2D), \
147  OP(D2S), \
148  OP(DNEG), \
149  OP(DADD), \
150  OP(DSUB), \
151  OP(SPAT), \
152  OP(TRC), \
153  OP(SAVE), \
154  OP(LOAD), \
155  OP(CALL), \
156  OP(CLK), \
157  OP(PIN), \
158  OP(MAP), \
159  OP(IN), \
160  OP(OUT), \
161  OP(AIN), \
162  OP(PWM), \
163  OP(TMISR), \
164  OP(PCISR), \
165  OP(TMRE), \
166  OP(PCIE)
167 
168 #endif // __EFORTH_CONFIG_H
S32
int32_t S32
32-bit signed integer
Definition: eforth_config.h:24
CFP
void(* CFP)()
function pointer
Definition: eforth_config.h:30
S16
int16_t S16
16-bit signed integer
Definition: eforth_config.h:25
U32
uint32_t U32
32-bit unsigned integer
Definition: eforth_config.h:20
IU
U16 IU
instruction/address unit (16-bit)
Definition: eforth_config.h:28
U16
uint16_t U16
16-bit unsigned integer
Definition: eforth_config.h:21
DU
S16 DU
data/cell unit
Definition: eforth_config.h:29
S8
int8_t S8
8-bit signed integer
Definition: eforth_config.h:26
U8
uint8_t U8
8-bit unsigned integer
Definition: eforth_config.h:22