Arduino-FVM
Byte Token Threaded Forth Virtual Machine (FVM) for Arduino
|
#include "FVM.h"
Go to the source code of this file.
Macros | |
#define | FVM_THREADING 1 |
#define | FVM_TRACE 1 |
#define | FVM_KERNEL_DICT 1 |
#define | FVM_KERNEL_OPT 1 |
#define | OP(n) case OP_ ## n: |
#define | NEXT() goto INNER |
#define | FALLTHROUGH() |
#define | CALL(fn) tp = fn; goto FNCALL |
#define | MAP(if) (-ir-1) |
#define | FNTAB(ix) fntab[ix] |
#define | FNSTR(ix) fnstr[ix] |
#define | OPSTR(ix) opstr[ix] |
#define | fetch_byte(ip) (*((int8_t*) (ip))) |
#define | fetch_word(ip) (*((cell_t*) (ip))) |
Variables | |
static const char | EXIT_PSTR [] = "exit" |
static const char | ZERO_EXIT_PSTR [] = "?exit" |
static const char | LIT_PSTR [] = "(lit)" |
static const char | CLIT_PSTR [] = "(clit)" |
static const char | SLIT_PSTR [] = "(slit)" |
static const char | VAR_PSTR [] = "(var)" |
static const char | CONST_PSTR [] = "(const)" |
static const char | FUNC_PSTR [] = "(func)" |
static const char | DOES_PSTR [] = "(does)" |
static const char | PARAM_PSTR [] = "(param)" |
static const char | BRANCH_PSTR [] = "(branch)" |
static const char | ZERO_BRANCH_PSTR [] = "(0branch)" |
static const char | DO_PSTR [] = "(do)" |
static const char | I_PSTR [] = "i" |
static const char | J_PSTR [] = "j" |
static const char | LEAVE_PSTR [] = "leave" |
static const char | LOOP_PSTR [] = "(loop)" |
static const char | PLUS_LOOP_PSTR [] = "(+loop)" |
static const char | NOOP_PSTR [] = "noop" |
static const char | EXECUTE_PSTR [] = "execute" |
static const char | YIELD_PSTR [] = "yield" |
static const char | HALT_PSTR [] = "halt" |
static const char | SYSCALL_PSTR [] = "(syscall)" |
static const char | CALL_PSTR [] = "(call)" |
static const char | TRACE_PSTR [] = "trace" |
static const char | ROOM_PSTR [] = "room" |
static const char | C_FETCH_PSTR [] = "c@" |
static const char | C_STORE_PSTR [] = "c!" |
static const char | FETCH_PSTR [] = "@" |
static const char | STORE_PSTR [] = "!" |
static const char | PLUS_STORE_PSTR [] = "+!" |
static const char | DP_PSTR [] = "dp" |
static const char | HERE_PSTR [] = "here" |
static const char | ALLOT_PSTR [] = "allot" |
static const char | COMMA_PSTR [] = "," |
static const char | C_COMMA_PSTR [] = "c," |
static const char | COMPILE_PSTR [] = "(compile)" |
static const char | TO_R_PSTR [] = ">r" |
static const char | R_FROM_PSTR [] = "r>" |
static const char | R_FETCH_PSTR [] = "r@" |
static const char | SP_PSTR [] = "sp" |
static const char | DEPTH_PSTR [] = "depth" |
static const char | DROP_PSTR [] = "drop" |
static const char | NIP_PSTR [] = "nip" |
static const char | EMPTY_PSTR [] = "empty" |
static const char | DUP_PSTR [] = "dup" |
static const char | QUESTION_DUP_PSTR [] = "?dup" |
static const char | OVER_PSTR [] = "over" |
static const char | TUCK_PSTR [] = "tuck" |
static const char | PICK_PSTR [] = "pick" |
static const char | SWAP_PSTR [] = "swap" |
static const char | ROT_PSTR [] = "rot" |
static const char | MINUS_ROT_PSTR [] = "-rot" |
static const char | ROLL_PSTR [] = "roll" |
static const char | TWO_SWAP_PSTR [] = "2swap" |
static const char | TWO_DUP_PSTR [] = "2dup" |
static const char | TWO_OVER_PSTR [] = "2over" |
static const char | TWO_DROP_PSTR [] = "2drop" |
static const char | MINUS_TWO_PSTR [] = "-2" |
static const char | MINUS_ONE_PSTR [] = "-1" |
static const char | ZERO_PSTR [] = "0" |
static const char | ONE_PSTR [] = "1" |
static const char | TWO_PSTR [] = "2" |
static const char | CELL_PSTR [] = "cell" |
static const char | CELLS_PSTR [] = "cells" |
static const char | BOOL_PSTR [] = "bool" |
static const char | NOT_PSTR [] = "not" |
static const char | TRUE_PSTR [] = "true" |
static const char | FALSE_PSTR [] = "false" |
static const char | INVERT_PSTR [] = "invert" |
static const char | AND_PSTR [] = "and" |
static const char | OR_PSTR [] = "or" |
static const char | XOR_PSTR [] = "xor" |
static const char | NEGATE_PSTR [] = "negate" |
static const char | ONE_PLUS_PSTR [] = "1+" |
static const char | ONE_MINUS_PSTR [] = "1-" |
static const char | TWO_PLUS_PSTR [] = "2+" |
static const char | TWO_MINUS_PSTR [] = "2-" |
static const char | TWO_STAR_PSTR [] = "2*" |
static const char | TWO_SLASH_PSTR [] = "2/" |
static const char | PLUS_PSTR [] = "+" |
static const char | MINUS_PSTR [] = "-" |
static const char | STAR_PSTR [] = "*" |
static const char | STAR_SLASH_PSTR [] = "*/" |
static const char | SLASH_PSTR [] = "/" |
static const char | MOD_PSTR [] = "mod" |
static const char | SLASH_MODE_PSTR [] = "/mod" |
static const char | LSHIFT_PSTR [] = "lshift" |
static const char | RSHIFT_PSTR [] = "rshift" |
static const char | WITHIN_PSTR [] = "within" |
static const char | ABS_PSTR [] = "abs" |
static const char | MIN_PSTR [] = "min" |
static const char | MAX_PSTR [] = "max" |
static const char | ZERO_NOT_EQUALS_PSTR [] = "0<>" |
static const char | ZERO_LESS_PSTR [] = "0<" |
static const char | ZERO_EQUALS_PSTR [] = "0=" |
static const char | ZERO_GREATER_PSTR [] = "0>" |
static const char | NOT_EQUALS_PSTR [] = "<>" |
static const char | LESS_PSTR [] = "<" |
static const char | EQUALS_PSTR [] = "=" |
static const char | GREATER_PSTR [] = ">" |
static const char | U_LESS_PSTR [] = "u<" |
static const char | LOOKUP_PSTR [] = "lookup" |
static const char | TO_BODY_PSTR [] = ">body" |
static const char | WORDS_PSTR [] = "words" |
static const char | BASE_PSTR [] = "base" |
static const char | HEX_PSTR [] = "hex" |
static const char | DECIMAL_PSTR [] = "decimal" |
static const char | QUESTION_KEY_PSTR [] = "?key" |
static const char | KEY_PSTR [] = "key" |
static const char | EMIT_PSTR [] = "emit" |
static const char | CR_PSTR [] = "cr" |
static const char | SPACE_PSTR [] = "space" |
static const char | SPACES_PSTR [] = "spaces" |
static const char | U_DOT_PSTR [] = "u." |
static const char | DOT_PSTR [] = "." |
static const char | DOT_S_PSTR [] = ".s" |
static const char | DOT_QUOTE_PSTR [] = "(.\")" |
static const char | TYPE_PSTR [] = "type" |
static const char | DOT_NAME_PSTR [] = ".name" |
static const char | QUESTION_PSTR [] = "?" |
static const char | MICROS_PSTR [] = "micros" |
static const char | MILLIS_PSTR [] = "millis" |
static const char | DELAY_PSTR [] = "delay" |
static const char | PINMODE_PSTR [] = "pinmode" |
static const char | DIGITALREAD_PSTR [] = "digitalread" |
static const char | DIGITALWRITE_PSTR [] = "digitalwrite" |
static const char | DIGITALTOGGLE_PSTR [] = "digitaltoggle" |
static const char | ANALOGREAD_PSTR [] = "analogread" |
static const char | ANALOGWRITE_PSTR [] = "analogwrite" |
Copyright (C) 2016-2017, Mikael Patel
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Definition in file FVM.cpp.
#define FVM_KERNEL_DICT 1 |
#define FVM_KERNEL_OPT 1 |
#define FVM_THREADING 1 |
#define FVM_TRACE 1 |