Mon 16 Mar 11:09:06 CET 2026

This commit is contained in:
sbosse 2026-03-16 11:12:16 +01:00
parent 8b6cb530fe
commit d571145a25

27
src/reg.h Normal file
View File

@ -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