eForth1  v2.4
EfVM Namespace Reference

Functions

void _init ()
 
void _yield ()
 

yield to interrupt service

More...
 
void _qrx ()
 

( – c ) fetch a char from console

More...
 
void _txsto ()
 

(c – ) send a char to console

More...
 
void _ummod ()
 (udl udh u – ur uq) unsigned double divided by a single More...
 
void _out (U16 p, U16 v)
 
U8 BGET (U16 d)
 
U16 GET (U16 d)
 
void SET (U16 d, U16 v)
 

Function Documentation

◆ _init()

void EfVM::_init ( )

Forth Virtual Machine primitive functions

virtual machine initializer

  • reset interrupt handlers

setup control variables

FORTH_UVAR_ADDR; 'TIB console input buffer pointer BASE current radix for numeric ops CP, top of dictionary, same as HERE CONTEXT name field of last word LAST, same as CONTEXT 'MODE eval mode (interpreter or compiler) 'ABORT exception rescue handler (QUIT) tmp storage (alternative to return stack)

setup Forth user variables

  • set 'TIB pointer
  • set BASE to 10
  • top of dictionary

fetch cold boot vector

display init prompt

◆ _yield()

void EfVM::_yield ( )

yield to interrupt service

serve interrupt routines

  • still servcing interrupt
  • check interrupts
  • service interrupt?
  • flag return address as IRET
  • skip opENTER

◆ _qrx()

void EfVM::_qrx ( )

( – c ) fetch a char from console

console IO functions

fetch from IO stream

◆ _txsto()

void EfVM::_txsto ( )

(c – ) send a char to console

◆ _ummod()

void EfVM::_ummod ( )

(udl udh u – ur uq) unsigned double divided by a single

CC: auto variable uses C stack

remainder

quotient

◆ _out()

void EfVM::_out ( U16  p,
U16  v 
)
  • mask out RX,TX

◆ BGET()

U8 EfVM::BGET ( U16  d)

byte (8-bit) fetch from either RAM or ROM depends on filtered range

◆ GET()

U16 EfVM::GET ( U16  d)

word (16-bit) fetch from either RAM or ROM depends on filtered range

◆ SET()

void EfVM::SET ( U16  d,
U16  v 
)

Variable Documentation

◆ IP

IU EfVM::IP

instruction pointer, IU is 16-bit, opcode is 8-bit

◆ W

IU EfVM::W

work register, IU is 16-bit

◆ DS

DU* EfVM::DS

data stack pointer, Dr. Ting's stack

◆ RS

DU* EfVM::RS

return stack pointer, Dr. Ting's rack

◆ top

DU EfVM::top

ALU (i.e. cached top of stack value)

◆ rtop

DU EfVM::rtop

cached loop counter on return stack

◆ IR

IU EfVM::IR

interrupt service routine

◆ _rom

PGM_P EfVM::_rom

ROM, Forth word stored in Arduino Flash Memory.

◆ _ram

U8 * EfVM::_ram

RAM, memory block for user define dictionary.

◆ _pre

U8* EfVM::_pre

Pre-built/embedded Forth code.

◆ _api

CFP EfVM::_api[CFUNC_MAX]

◆ io

Stream * EfVM::io

Stream IO interface.