Implemented more opcodes and unsafe stuff

This commit is contained in:
vegowotenks 2024-11-07 10:35:02 +01:00
parent dfb6060df9
commit d38d5b2897
5 changed files with 340 additions and 84 deletions

View file

@ -19,6 +19,8 @@ impl Bytecode {
0x06 => (Instruction::PushConstInt3(), 1),
0x07 => (Instruction::PushConstInt4(), 1),
0x08 => (Instruction::PushConstInt5(), 1),
0x09 => (Instruction::PushConstLong0(), 1),
0x0A => (Instruction::PushConstLong1(), 1),
0x0B => (Instruction::PushConstFloat0(), 1),
0x0C => (Instruction::PushConstFloat1(), 1),
0x0D => (Instruction::PushConstFloat2(), 1),
@ -86,6 +88,7 @@ impl Bytecode {
0x57 => (Instruction::Pop(), 1),
0x59 => (Instruction::Duplicate(), 1),
0x5A => (Instruction::DuplicateInsertDown(), 1),
0x5C => (Instruction::DuplicateComputationalValue(), 1),
0x60 => (Instruction::AddInt(), 1),
0x61 => (Instruction::AddLong(), 1),
@ -302,6 +305,8 @@ pub enum Instruction {
PushConstInt3() = 0x06, // Push 3
PushConstInt4() = 0x07, // Push 4
PushConstInt5() = 0x08, // Push 5
PushConstLong0() = 0x09, // Push 0
PushConstLong1() = 0x0A, // Push 1
PushConstFloat0() = 0x0B, // Push 0.0f
PushConstFloat1() = 0x0C, // Push 1.0f
PushConstFloat2() = 0x0D, // Push 2.0f
@ -366,6 +371,7 @@ pub enum Instruction {
Pop() = 0x57, // Pop top stack value
Duplicate() = 0x59, // duplicate top stack value
DuplicateInsertDown() = 0x5A, // duplicate top stack value and insert two low
DuplicateComputationalValue() = 0x5C, // duplicate top computational value
AddInt() = 0x60, // int addition
AddLong() = 0x61, // long addition