move non essential opcodes to primitives and add userdata

This commit is contained in:
Lobo 2026-01-23 11:00:28 -03:00
parent e654143a90
commit 45e2c0d406
17 changed files with 234 additions and 37 deletions

View file

@ -28,6 +28,7 @@ enum {
OP_CALL,
OP_TAIL_DOWORD, // Tail call to dictionary word (reuses current frame)
OP_TAIL_CALL, // Tail call to quotation (reuses current frame)
OP_PRIM,
OP_RETURN,
OP_CHOOSE,
OP_ADD,
@ -47,10 +48,7 @@ enum {
OP_GTE,
OP_AND,
OP_OR,
OP_TYPE,
OP_CONCAT,
OP_PPRINT,
OP_PRINTSTACK,
};
#define STACK_SIZE 256
@ -82,4 +80,10 @@ enum {
V vm_init(Vm *);
V vm_deinit(Vm *);
I vm_run(Vm *, Bc *, I);
V vm_push(Vm *, O);
O vm_pop(Vm *);
V vm_tpush(Vm *, O);
O vm_tpop(Vm *);
#endif