aboutsummaryrefslogtreecommitdiffstats
path: root/state.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2023-02-17 08:15:30 -0500
committerClyne Sullivan <clyne@bitgloo.com>2023-02-17 08:15:30 -0500
commit24a61f3c99125c97ca79ea173c959d7bd89f1a48 (patch)
tree4d89ad660335f718f32482f49f985747de4e5c5f /state.cpp
parente45926fa2a1bc332214f0467de6020529d91b7ba (diff)
some cleanup
Diffstat (limited to 'state.cpp')
-rw-r--r--state.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/state.cpp b/state.cpp
index ae9c059..0fe0905 100644
--- a/state.cpp
+++ b/state.cpp
@@ -16,6 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
+#include "corewords.hpp"
#include "state.hpp"
#include <iterator>
@@ -37,6 +38,17 @@ void State::compiling(bool yes)
dict.write(Dictionary::Compiling, yes);
}
+void State::execute(Addr addr)
+{
+ pushr(0);
+ ip = addr - sizeof(Cell);
+
+ do {
+ ip += sizeof(Cell);
+ CoreWords::run(dict.read(ip), *this);
+ } while (ip);
+}
+
Cell State::beyondip() const
{
return dict.read(ip + sizeof(Cell));