Make AM registers into an array

This commit is contained in:
2025-08-10 20:30:07 +01:00
parent 52a42d2937
commit 57c39fd00b
14 changed files with 311 additions and 288 deletions

View File

@@ -6,8 +6,24 @@
#define AM_STACK_SIZE 128U
#define AM_ARGL(am) am->regs[ARGL]
#define AM_ENV(am) am->regs[ENV]
#define AM_EXPR(am) am->regs[EXPR]
#define AM_UNEV(am) am->regs[UNEV]
#define AM_VAL(am) am->regs[VAL]
typedef enum {
ARGL,
ENV,
EXPR,
UNEV,
VAL,
AM_REG_COUNT,
} am_reg_t;
typedef struct am {
expr_t *argl, *env, *expr, *unev, *val;
expr_t *regs[AM_REG_COUNT];
expr_t **sp, *stack[AM_STACK_SIZE];
store_t store;
} am_t;