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

@ -914,6 +914,13 @@ impl JVM {
wrap_stackframe_error(class, method, frame.operand_stack.push(StackValue::Int(comparison_result)))?;
}
Instruction::ConvertIntToChar() => {
let int_value = wrap_stackframe_error(class, method, frame.operand_stack.pop_int(0))?;
let char_value = int_value & 0x0000FFFF;
frame.operand_stack.push(StackValue::Int(char_value)).unwrap();
}
Instruction::DivideInt() => {
// TODO: Obey all the rules
let quotient = wrap_stackframe_error(class, method, frame.operand_stack.pop_int(0))?;