nanoFORTH
v2.2
|
#include "system.h"
Macros | |
#define | KEY_RUNMODE "\x03" ": " "VAR" "FGT" |
#define | KEY_COMPILEMODE "\x0b" "; " "IF " "ELS" "THN" "BGN" "END" "WHL" "RPT" "DO " "LOP" "I " |
#define | KEY_PRIMITIVE "\x19" "DRP" "DUP" "SWP" ">R " "R> " "+ " "- " "* " "/ " "MOD" "AND" "OR " "XOR" "= " "< " "> " "<= " ">= " "<> " "NOT" "@ " "@@ " "! " "!! " ". " |
#define | PFX_UDJ 0x80U |
#define | PFX_CDJ 0xa0U |
#define | PFX_CALL 0xc0U |
#define | PFX_PRIMITIVE 0xe0U |
#define | I_LIT 0xffU |
#define | I_RET 0xfeU |
#define | I_LOOP (PFX_PRIMITIVE | 25U) |
#define | I_RDROP2 (PFX_PRIMITIVE | 26U) |
#define | I_I (PFX_PRIMITIVE | 27U) |
#define | I_P2R2 (PFX_PRIMITIVE | 28U) |
Functions | |
static void | putmsg (char *msg) |
static unsigned char * | gettkn (void) |
static char | literal (unsigned char *str, unsigned short *num) |
static char | lookup (unsigned char *key, unsigned short *adrs) |
static char | find (unsigned char *key, char *list, unsigned char *id) |
static void | compile (void) |
static void | variable (void) |
static void | forget (void) |
static void | execute (unsigned short adrs) |
static void | primitive (unsigned char ic) |
static void | putnum (unsigned short num) |
int | main (void) |
Variables | |
static unsigned short | stack [STACK_SIZE] |
static unsigned short * | retstk |
static unsigned short * | parstk |
static unsigned char | dic [DIC_SIZE] |
static unsigned char * | dicptr |
static unsigned char * | dicent |
#define KEY_RUNMODE "\x03" ": " "VAR" "FGT" |
#define KEY_COMPILEMODE "\x0b" "; " "IF " "ELS" "THN" "BGN" "END" "WHL" "RPT" "DO " "LOP" "I " |
#define KEY_PRIMITIVE "\x19" "DRP" "DUP" "SWP" ">R " "R> " "+ " "- " "* " "/ " "MOD" "AND" "OR " "XOR" "= " "< " "> " "<= " ">= " "<> " "NOT" "@ " "@@ " "! " "!! " ". " |
#define PFX_UDJ 0x80U |
#define PFX_CDJ 0xa0U |
#define PFX_CALL 0xc0U |
#define PFX_PRIMITIVE 0xe0U |
#define I_LIT 0xffU |
#define I_RET 0xfeU |
#define I_LOOP (PFX_PRIMITIVE | 25U) |
#define I_RDROP2 (PFX_PRIMITIVE | 26U) |
#define I_I (PFX_PRIMITIVE | 27U) |
#define I_P2R2 (PFX_PRIMITIVE | 28U) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
int main | ( | void | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |