diff --git a/src/fox32.pest b/src/fox32.pest index e917224..19c2079 100644 --- a/src/fox32.pest +++ b/src/fox32.pest @@ -108,7 +108,8 @@ instruction_one = @{ "push" | "pop" | "int" | - "tlb" + "tlb" | + "flp" } instruction_two = @{ diff --git a/src/main.rs b/src/main.rs index 0a11d9b..0dec331 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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, 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, ..} => {