6.1.2340 U<
6.1.2360 UM*
6.1.2370 UM/MOD
- 6.1.2380 UNLOOP
+yes 6.1.2380 UNLOOP
yes 6.1.2390 UNTIL
yes 6.1.2410 VARIABLE
yes 6.1.2430 WHILE
: until ['] _jmp0 , , drop ; imm
: do postpone 2>r here ; imm
+: unloop postpone 2r> ['] 2drop , ; imm
: +loop postpone 2r> ['] rot , ['] + , ['] 2dup ,
postpone 2>r ['] - , ['] 0= , ['] _jmp0 , ,
- postpone 2r> ['] 2drop , ; imm
+ postpone unloop ; imm
: loop 1 postpone literal postpone +loop ; imm
: i postpone r@ ; imm
return i >= 0 ? get(i & ~Compiletime) : nullptr;
}
-bool CoreWords::run(int i, State& state)
+void CoreWords::run(int i, State& state)
{
- i &= ~Compiletime;
-
- bool isaword = i >= 0 && i < WordCount;
- if (isaword)
+ if (i >= 0 && i < WordCount)
get(i)(state);
-
- return isaword;
}
static int findi(std::string_view);
static int findi(State&, Word);
static Func find(State&, Word);
- static bool run(int, State&);
+ static void run(int, State&);
private:
// Ends with '\0': regular word
void State::execute(Addr addr)
{
- if (addr < Dictionary::Begin) {
+ if (addr < CoreWords::WordCount) {
// Must be a core-word
CoreWords::run(addr, *this);
} else {
ip += sizeof(Cell);
const auto ins = dict.read(ip);
- if (!CoreWords::run(ins, *this)) {
+ if (ins < CoreWords::WordCount) {
+ CoreWords::run(ins, *this);
+ } else {
pushr(ip);
ip = ins - sizeof(Cell);
}