Add FLP instruction

This commit is contained in:
Ry 2022-09-13 17:37:42 -07:00
parent b35bc82cf7
commit 4afe69ed10
2 changed files with 5 additions and 1 deletions

View File

@ -108,7 +108,8 @@ instruction_one = @{
"push" |
"pop" |
"int" |
"tlb"
"tlb" |
"flp"
}
instruction_two = @{

View File

@ -181,6 +181,7 @@ enum InstructionOne {
Pop,
Int,
Tlb,
Flp,
}
#[derive(PartialEq, Debug, Clone, Copy)]
@ -904,6 +905,7 @@ fn parse_instruction_one(pair: pest::iterators::Pair<Rule>, mut operand: AstNode
"pop" => InstructionOne::Pop,
"int" => InstructionOne::Int,
"tlb" => InstructionOne::Tlb,
"flp" => InstructionOne::Flp,
_ => panic!("Unsupported conditional instruction (one): {}", pair.as_str()),
},
operand: Box::new(operand),
@ -1045,6 +1047,7 @@ fn instruction_to_byte(node: &AstNode) -> u8 {
InstructionOne::Pop => 0x1A | size_to_byte(size),
InstructionOne::Int => 0x2C | size_to_byte(size),
InstructionOne::Tlb => 0x2D | size_to_byte(size),
InstructionOne::Flp => 0x3D | size_to_byte(size),
}
}
AstNode::OperationTwo {size, instruction, ..} => {