eForth1  v2.4
eforth_core.h
Go to the documentation of this file.
1 
5 #ifndef __EFORTH_CORE_H
6 #define __EFORTH_CORE_H
7 #include "eforth_config.h"
11 #define EXE_TRACE 0
12 #define COMPUTED_GOTO 0
13 #if ARDUINO
17 
18 #include <Arduino.h>
19 #include <avr/pgmspace.h>
20 #define LOG(s) io->print(F(s))
21 #define LOG_C(c) { io->print(c); if (c=='\n') io->flush(); }
22 #define LOG_V(s, n) { io->print(F(s)); io->print((DU)(n)); }
23 #define LOG_H(s, n) { io->print(F(s)); io->print((n), HEX); }
24 #define CLI() cli()
25 #define SEI() sei()
26 
27 #else // !ARDUINO
28 
29 #include <stdlib.h>
30 typedef const char *PGM_P;
31 #define pgm_read_byte(b) *((U8*)(b))
32 #define PROGMEM
33 #define Stream char
34 #define millis() ((U32)clock())
35 #define pinMode(a,b)
36 #define digitalRead(p) (0)
37 #define digitalWrite(p,v)
38 #define analogRead(p) (0)
39 #define analogWrite(p,v)
40 #define map(a,b,c,d,e) (0)
41 #define LOG(s) printf("%s", (s))
42 #define LOG_C(c) printf("%c", (c))
43 #define LOG_V(s, n) printf("%s%d", (s), (n))
44 #define LOG_H(s, n) printf("%s%x", (s), (U16)((n)&0xffff))
45 #define LOW (0)
46 #define HIGH (1)
47 #define CLI()
48 #define SEI()
49 
50 #endif // ARDUINO
51 
55 void intr_reset();
56 U16 intr_hits();
58 void intr_add_tmisr(U8 i, U16 ms, IU xt);
59 void intr_add_pcisr(U8 pin, IU xt);
60 void intr_timer_enable(U8 f);
61 void intr_pci_enable(U8 f);
65 void vm_init(
66  PGM_P rom,
67  U8 *ram,
68  void *io_stream,
69  const char *code
70  );
71 void vm_outer();
72 int ef_save(U8 *ram);
76 int ef_load(U8 *ram);
77 #endif // __EFORTH_CORE_H
vm_init
void vm_init(PGM_P rom, U8 *ram, void *io_stream, const char *code)
Definition: eforth_vm.cpp:169
vm_outer
void vm_outer()
Forth outer interpreter.
intr_pci_enable
void intr_pci_enable(U8 f)
Definition: eforth_core.cpp:107
intr_service
IU intr_service()
Definition: eforth_core.cpp:47
eforth_config.h
eForth configurations and opcode list
code
const PROGMEM char code[]
Definition: eforth1.ino.cpp:10
intr_reset
void intr_reset()
reset interrupts
Definition: eforth_core.cpp:22
intr_hits
U16 intr_hits()
IU
U16 IU
instruction/address unit (16-bit)
Definition: eforth_config.h:28
ef_save
int ef_save(U8 *ram)
save user variables and dictionary to EEPROM
Definition: eforth1.cpp:52
ef_load
int ef_load(U8 *ram)
load user variables and dictionary from EEPROM
Definition: eforth1.cpp:61
intr_add_pcisr
void intr_add_pcisr(U8 pin, IU xt)
Definition: eforth_core.cpp:87
intr_add_tmisr
void intr_add_tmisr(U8 i, U16 ms, IU xt)
Definition: eforth_core.cpp:73
U16
uint16_t U16
16-bit unsigned integer
Definition: eforth_config.h:21
intr_timer_enable
void intr_timer_enable(U8 f)
Definition: eforth_core.cpp:120
U8
uint8_t U8
8-bit unsigned integer
Definition: eforth_config.h:22