Implement ConvertIntToChar

This commit is contained in:
vegowotenks 2024-09-11 00:36:55 +02:00
parent 95beeef1c5
commit 202d7692bc
2 changed files with 9 additions and 0 deletions

View file

@ -88,6 +88,7 @@ impl Bytecode {
0x82 => (Instruction::XorInt(), 1),
0x84 => (Instruction::IncrementLocalInt(self.bytes[offset+1], i8::from_be_bytes([self.bytes[offset+2]])), 3),
0x92 => (Instruction::ConvertIntToChar(), 1),
0x95 => (Instruction::CompareFloatL(), 1),
0x96 => (Instruction::CompareFloatG(), 1),
0x99 => {
@ -334,6 +335,7 @@ pub enum Instruction {
XorInt() = 0x82, // value, value => xor
IncrementLocalInt(u8, i8) = 0x84, // increment local variable by constant i8
ConvertIntToChar() = 0x92, // truncate int to 16 bits
CompareFloatL() = 0x95, // compare float, push -1 if one is NaN
CompareFloatG() = 0x96, // compare float, push 1 if one is NaN
BranchZero(i16) = 0x99, // branch if value == 0