eForth1
v2.4
|
eForth Virtual Machine module header More...
#include "eforth_core.h"
Go to the source code of this file.
Namespaces | |
EfVM | |
Macros | |
#define | RAM_FLAG 0xe000 |
#define | IDX_MASK 0x07ff |
#define | IRET_FLAG 0x8000 |
#define | BOOL(f) ((f) ? TRUE : FALSE) |
#define | RAM(i) &_ram[(i) - FORTH_RAM_ADDR] |
#define | BSET(d, c) (_ram[(d)&IDX_MASK]=(U8)(c)) |
#define | S2D(h, l) (((S32)(h)<<16) | ((l)&0xffff)) |
#define | DEPTH() ((DU)((U8*)DS - RAM(FORTH_STACK_ADDR)) >> 1) |
#define | PUSH(v) { *++DS = top; top = (v); } |
#define | RPUSH(v) { *--RS = rtop; rtop = (v); } |
#define | POP() (top = *DS--) |
#define | RPOP() (rtop = *RS++) |
#define | DTOP(d) { *DS = (d)&0xffff; top = (d)>>16; } |
Tracing | |
#define | DEBUG(s, v) |
#define | TAB() /* skip */ |
#define | TRACE(op, ip, w, t, s) /* skip */ |
Functions | |
U8 | EfVM::BGET (U16 d) |
U16 | EfVM::GET (U16 d) |
void | EfVM::SET (U16 d, U16 v) |
eForth Virtual Machine module header
Note: Dr. Ting uses U8 (0~255) for wrap-around control
#define RAM_FLAG 0xe000 |
RAM ranger (0x2000~0x7fff)
#define IDX_MASK 0x07ff |
RAM index mask (0x0000~0x07ff)
#define IRET_FLAG 0x8000 |
interrupt return flag
#define RAM | ( | i | ) | &_ram[(i) - FORTH_RAM_ADDR] |
#define S2D | ( | h, | |
l | |||
) | (((S32)(h)<<16) | ((l)&0xffff)) |
#define DEPTH | ( | ) | ((DU)((U8*)DS - RAM(FORTH_STACK_ADDR)) >> 1) |
push a value onto stack top
#define PUSH | ( | v | ) | { *++DS = top; top = (v); } |
#define RPUSH | ( | v | ) | { *--RS = rtop; rtop = (v); } |
#define POP | ( | ) | (top = *DS--) |
#define RPOP | ( | ) | (rtop = *RS++) |
#define DTOP | ( | d | ) | { *DS = (d)&0xffff; top = (d)>>16; } |
#define DEBUG | ( | s, | |
v | |||
) |
#define TAB | ( | ) | /* skip */ |
#define TRACE | ( | op, | |
ip, | |||
w, | |||
t, | |||
s | |||
) | /* skip */ |