From d571145a2560b23466cf3db13bf4af432b7ffe81 Mon Sep 17 00:00:00 2001 From: sbosse Date: Mon, 16 Mar 2026 11:12:16 +0100 Subject: [PATCH] Mon 16 Mar 11:09:06 CET 2026 --- src/reg.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/reg.h diff --git a/src/reg.h b/src/reg.h new file mode 100644 index 0000000..15b0f06 --- /dev/null +++ b/src/reg.h @@ -0,0 +1,27 @@ +#ifndef _REG_H +#define _REG_H + +#include "error.h" + +typedef struct { + address_t pc; // program counter in execution + error_t error; // execution or compilation error + vm_state_t state; // VM process state + index_t context; // index to global context table + int8_t debug; // debug level + index_t steps; // number of instructions the VM should process at once + time_t timeout; // INTERRUPT/TIMEOUT, next event handling time + index_t event; // event value in rhs + address_t data; +#if HAS_FUNC > 0 + address_t fp; // (function) frame pointer for local variables +#endif +#if PROFILE>0 + int32_t opcount; +#endif +} reg_t; + +reg_t * RegAllocate(); +void RegInit(reg_t *R); + +#endif