eForth1  v2.4
eforth_core.h File Reference

eForth prototype and interface More...

#include "eforth_config.h"
#include <Arduino.h>
#include <avr/pgmspace.h>
Include dependency graph for eforth_core.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

Compiler options
#define EXE_TRACE   0
 
#define COMPUTED_GOTO   0
 
Arduino Support Macros
#define LOG(s)   io->print(F(s))
 
#define LOG_C(c)   { io->print(c); if (c=='\n') io->flush(); }
 
#define LOG_V(s, n)   { io->print(F(s)); io->print((DU)(n)); }
 
#define LOG_H(s, n)   { io->print(F(s)); io->print((n), HEX); }
 
#define CLI()   cli()
 
#define SEI()   sei()
 

Functions

interrupt handle routines
void intr_reset ()
 reset interrupts More...
 
U16 intr_hits ()
 
IU intr_service ()
 
void intr_add_tmisr (U8 i, U16 ms, IU xt)
 
void intr_add_pcisr (U8 pin, IU xt)
 
void intr_timer_enable (U8 f)
 
void intr_pci_enable (U8 f)
 
eForth Virtual Machine Functions
void vm_init (PGM_P rom, U8 *ram, void *io_stream, const char *code)
 
void vm_outer ()
 Forth outer interpreter. More...
 
eForth Assembler Functions
int ef_save (U8 *ram)
 save user variables and dictionary to EEPROM More...
 
int ef_load (U8 *ram)
 load user variables and dictionary from EEPROM More...
 

Detailed Description

eForth prototype and interface

Macro Definition Documentation

◆ EXE_TRACE

#define EXE_TRACE   0

VM execution tracing flag

◆ COMPUTED_GOTO

#define COMPUTED_GOTO   0

dispatcher (~3% faster, +180 bytes RAM)

◆ LOG

#define LOG (   s)    io->print(F(s))

◆ LOG_C

#define LOG_C (   c)    { io->print(c); if (c=='\n') io->flush(); }

◆ LOG_V

#define LOG_V (   s,
 
)    { io->print(F(s)); io->print((DU)(n)); }

◆ LOG_H

#define LOG_H (   s,
 
)    { io->print(F(s)); io->print((n), HEX); }

◆ CLI

#define CLI ( )    cli()

◆ SEI

#define SEI ( )    sei()

Function Documentation

◆ intr_reset()

void intr_reset ( )

reset interrupts

reset interrupt states

◆ intr_hits()

U16 intr_hits ( )

◆ intr_service()

IU intr_service ( )

cached interrupt flags

throttle counter

  • on x86 platform
  • throttle down (boot performance a bit)
  • reset throttle counter

◆ intr_add_tmisr()

void intr_add_tmisr ( U8  i,
U16  ms,
U16  xt 
)

add timer interrupt service routine

◆ intr_add_pcisr()

void intr_add_pcisr ( U8  p,
U16  xt 
)

add pin change interrupt service routine

◆ intr_timer_enable()

void intr_timer_enable ( U8  f)

enable/disable timer2 interrupt

◆ intr_pci_enable()

void intr_pci_enable ( U8  f)

enable/disable pin change interrupt

◆ vm_init()

void vm_init ( PGM_P  rom,
U8 ram,
void *  io_stream,
const char *  code 
)
  • resetting user variables
Parameters
rompointer to Arduino flash memory block (ROM)
rampointer to Arduino RAM block (RAM)
io_streampointer to Stream object of Arduino
codeembeded Forth code

◆ vm_outer()

void vm_outer ( )

Forth outer interpreter.

◆ ef_save()

int ef_save ( U8 ram)

save user variables and dictionary to EEPROM

  • store dictionary byte-by-byte

◆ ef_load()

int ef_load ( U8 ram)

load user variables and dictionary from EEPROM

< CP addr in EEPROM (aka HERE)

  • >IN (buffer pointer)
  • keep vIN, vNTIB
  • retrieve dictionary byte-by-byte
  • restore vIN, vNTIB