SilverSight/c/avm_types.h
allaun 3b6baec64e wip: durability snapshot of local working tree (pre-existing, uncommitted)
Snapshot of previously-uncommitted local work so nothing is lost after the
power outage. NOT reviewed for correctness — a WIP checkpoint, not a feature:
- multi-language hachimoji encoders (c/cpp/fortran/julia/octave/r/scala/go/rust/coq)
- formal Lean WIP (BraidTree, Eisenstein, HachimojiCapture, MathlibConnect,
  ModularFormBridge, ClusterManifold) + lakefile + E8Sidon edit
- docs/, experiments/ (epyc oisc benches), deploy/, scripts, test scaffolding
- .gitignore: exclude **/target/ and Coq build artifacts

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-02 20:49:53 -05:00

38 lines
812 B
C

/* AVM ISA v1 — Shared type definitions for C port */
#ifndef AVM_TYPES_H
#define AVM_TYPES_H
#include <stdint.h>
#include <stdbool.h>
typedef enum { TY_Q0, TY_Q16, TY_BOOL } AvmTy;
typedef struct {
AvmTy ty;
union { int32_t i; bool b; } val;
} AnyVal;
typedef enum {
OP_PUSH_Q16, OP_PUSH_BOOL, OP_PUSH_Q0,
OP_POP, OP_DUP, OP_SWAP, OP_LOAD, OP_STORE,
OP_JUMP, OP_JUMP_IF, OP_PRIM, OP_HALT
} OpCode;
typedef enum {
PRIM_ADD_Q0, PRIM_SUB_Q0, PRIM_ADD_Q16, PRIM_SUB_Q16,
PRIM_MUL_Q16, PRIM_DIV_Q16, PRIM_LT_Q16, PRIM_EQ_Q16,
PRIM_AND, PRIM_OR, PRIM_NOT
} PrimCode;
typedef struct { OpCode op; int32_t arg; bool arg2; } Instr;
typedef struct {
int pc;
AnyVal stack[1024];
int sp;
AnyVal locals[256];
bool local_set[256];
bool halted;
} State;
#endif