slige/compiler/arch.ts

33 lines
552 B
TypeScript
Raw Normal View History

2024-11-01 13:06:28 +01:00
export type Ins = Ops | number;
export type Program = Ins[];
2024-11-08 12:22:42 +01:00
// NOTICE: keep up to date with runtime/arch.hpp
2024-11-08 09:24:09 +01:00
export type Ops = typeof Ops;
2024-11-01 13:06:28 +01:00
export const Ops = {
Nop: 0,
PushNull: 1,
PushInt: 2,
2024-11-11 15:31:54 +01:00
PushBool: 3,
PushString: 4,
PushPtr: 5,
Pop: 6,
LoadLocal: 7,
StoreLocal: 8,
Call: 9,
Return: 10,
Jump: 11,
JumpIfTrue: 12,
Add: 13,
Subtract: 14,
Multiply: 15,
Divide: 16,
Remainder: 17,
Equal: 18,
LessThan: 19,
And: 20,
Or: 21,
Xor: 22,
Not: 23,
2024-11-01 13:06:28 +01:00
} as const;