99 lines
1.2 KiB
Rust
99 lines
1.2 KiB
Rust
|
#[derive (Clone, Copy, Debug, PartialEq)]
|
||
|
pub enum Instruction {
|
||
|
Add (u8, u8, u8),
|
||
|
AddI (u8, u8, i8),
|
||
|
|
||
|
Call (u8, u8, u8),
|
||
|
Closure (u8, u32),
|
||
|
|
||
|
Div (u8, u8, u8),
|
||
|
|
||
|
EqI (u8, i8, bool),
|
||
|
|
||
|
// Equals Constant?
|
||
|
EqK (u8, u8, bool),
|
||
|
|
||
|
ExtraArg (u32),
|
||
|
|
||
|
ForLoop (u8, u32),
|
||
|
|
||
|
ForPrep (u8, u32),
|
||
|
|
||
|
GetField (u8, u8, u8),
|
||
|
|
||
|
// Get Immediate?
|
||
|
GetI (u8, u8, u8),
|
||
|
|
||
|
GetTable (u8, u8, u8),
|
||
|
|
||
|
// Get Table, Upvalue
|
||
|
GetTabUp (u8, u8, u8),
|
||
|
|
||
|
GetUpVal (u8, u8),
|
||
|
|
||
|
// Jump
|
||
|
Jmp (i32),
|
||
|
|
||
|
Len (u8, u8),
|
||
|
|
||
|
// Load F (Float?)
|
||
|
LoadF (u8, i32),
|
||
|
|
||
|
LoadFalse (u8),
|
||
|
|
||
|
// Load Integer?
|
||
|
LoadI (u8, i32),
|
||
|
|
||
|
// Load Constant
|
||
|
LoadK (u8, u32),
|
||
|
|
||
|
LoadNil (u8),
|
||
|
|
||
|
LoadTrue (u8),
|
||
|
|
||
|
// MetaMethod, Binary
|
||
|
MmBin (u8, u8, u8),
|
||
|
|
||
|
MmBinI (u8, i8, u8, bool),
|
||
|
|
||
|
MmBinK (u8, u8, u8, bool),
|
||
|
|
||
|
ModK (u8, u8, u8),
|
||
|
|
||
|
Move (u8, u8),
|
||
|
|
||
|
Mul (u8, u8, u8),
|
||
|
|
||
|
MulK (u8, u8, u8),
|
||
|
|
||
|
NewTable (u8),
|
||
|
|
||
|
Not (u8, u8),
|
||
|
|
||
|
// (A, B, _C, k) Return B - 1 registers starting with A
|
||
|
Return (u8, u8, u8, bool),
|
||
|
|
||
|
Return0,
|
||
|
|
||
|
// Return just one register
|
||
|
Return1 (u8),
|
||
|
|
||
|
SetField (u8, u8, u8, bool),
|
||
|
|
||
|
SetI (u8, u8, u8, bool),
|
||
|
|
||
|
SetList (u8, u8, u8, bool),
|
||
|
|
||
|
SetTabUp (u8, u8, u8),
|
||
|
|
||
|
Sub (u8, u8, u8),
|
||
|
|
||
|
TailCall (u8, u8, u8, bool),
|
||
|
|
||
|
Test (u8, bool),
|
||
|
|
||
|
UnM (u8, u8),
|
||
|
|
||
|
VarArgPrep (i32),
|
||
|
}
|