|
|
@ -39,9 +39,8 @@ void newdef(State& state, Word word)
|
|
|
|
dict.addDefinition(word);
|
|
|
|
dict.addDefinition(word);
|
|
|
|
state.push(addr);
|
|
|
|
state.push(addr);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
void tick(State& state)
|
|
|
|
void find(State& state, Word word)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
auto word = getword(state);
|
|
|
|
|
|
|
|
if (auto j = state.dict.find(word); j > 0) {
|
|
|
|
if (auto j = state.dict.find(word); j > 0) {
|
|
|
|
state.push(state.dict.getexec(j));
|
|
|
|
state.push(state.dict.getexec(j));
|
|
|
|
auto imm = state.dict.read(j) & Dictionary::Immediate;
|
|
|
|
auto imm = state.dict.read(j) & Dictionary::Immediate;
|
|
|
@ -165,7 +164,7 @@ execute:
|
|
|
|
state.compiling(true);
|
|
|
|
state.compiling(true);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 23: // tick
|
|
|
|
case 23: // tick
|
|
|
|
tick(state);
|
|
|
|
find(state, getword(state));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 24: // execute
|
|
|
|
case 24: // execute
|
|
|
|
index = state.pop();
|
|
|
|
index = state.pop();
|
|
|
@ -213,6 +212,16 @@ execute:
|
|
|
|
state.load(st);
|
|
|
|
state.load(st);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 33: // find
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
const Addr caddr = state.pop();
|
|
|
|
|
|
|
|
const Word word {
|
|
|
|
|
|
|
|
static_cast<Addr>(caddr + 1),
|
|
|
|
|
|
|
|
static_cast<Addr>(caddr + 1 + state.dict.readbyte(caddr))
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
find(state, word);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
state.push(index - WordCount);
|
|
|
|
state.push(index - WordCount);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|