aboutsummaryrefslogtreecommitdiffstats
path: root/state.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2023-02-19 11:52:18 -0500
committerClyne Sullivan <clyne@bitgloo.com>2023-02-19 11:52:18 -0500
commit171b82dab0d6e35ad7b57a4c750333c95b802b0e (patch)
tree3be66f5d834ba3f1ead15bb644b841918834a28a /state.cpp
parent12cb6b9e5607e9db2255afd977814cbb0e3fceae (diff)
fundamental compiling words
Diffstat (limited to 'state.cpp')
-rw-r--r--state.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/state.cpp b/state.cpp
index 0fe0905..6d056ba 100644
--- a/state.cpp
+++ b/state.cpp
@@ -40,13 +40,18 @@ void State::compiling(bool yes)
void State::execute(Addr addr)
{
- pushr(0);
- ip = addr - sizeof(Cell);
-
- do {
- ip += sizeof(Cell);
- CoreWords::run(dict.read(ip), *this);
- } while (ip);
+ if (addr < Dictionary::Begin) {
+ // Must be a core-word
+ CoreWords::run(addr, *this);
+ } else {
+ pushr(0);
+ ip = addr - sizeof(Cell);
+
+ do {
+ ip += sizeof(Cell);
+ CoreWords::run(dict.read(ip), *this);
+ } while (ip);
+ }
}
Cell State::beyondip() const