Add support for imul
, idiv
, and irem
This commit is contained in:
parent
b40c8d50b6
commit
abd160e6e5
|
@ -116,8 +116,11 @@ instruction_two = @{
|
|||
"add" |
|
||||
"sub" |
|
||||
"mul" |
|
||||
"imul" |
|
||||
"div" |
|
||||
"idiv" |
|
||||
"rem" |
|
||||
"irem" |
|
||||
"and" |
|
||||
"or" |
|
||||
"xor" |
|
||||
|
|
|
@ -190,8 +190,11 @@ enum InstructionTwo {
|
|||
Add,
|
||||
Sub,
|
||||
Mul,
|
||||
Imul,
|
||||
Div,
|
||||
Idiv,
|
||||
Rem,
|
||||
Irem,
|
||||
And,
|
||||
Or,
|
||||
Xor,
|
||||
|
@ -919,8 +922,11 @@ fn parse_instruction_two(pair: pest::iterators::Pair<Rule>, mut lhs: AstNode, mu
|
|||
"add" => InstructionTwo::Add,
|
||||
"sub" => InstructionTwo::Sub,
|
||||
"mul" => InstructionTwo::Mul,
|
||||
"imul" => InstructionTwo::Imul,
|
||||
"div" => InstructionTwo::Div,
|
||||
"idiv" => InstructionTwo::Idiv,
|
||||
"rem" => InstructionTwo::Rem,
|
||||
"irem" => InstructionTwo::Irem,
|
||||
"and" => InstructionTwo::And,
|
||||
"or" => InstructionTwo::Or,
|
||||
"xor" => InstructionTwo::Xor,
|
||||
|
@ -1054,8 +1060,11 @@ fn instruction_to_byte(node: &AstNode) -> u8 {
|
|||
InstructionTwo::Add => 0x01 | size_to_byte(size),
|
||||
InstructionTwo::Sub => 0x21 | size_to_byte(size),
|
||||
InstructionTwo::Mul => 0x02 | size_to_byte(size),
|
||||
InstructionTwo::Imul => 0x14 | size_to_byte(size),
|
||||
InstructionTwo::Div => 0x22 | size_to_byte(size),
|
||||
InstructionTwo::Idiv => 0x34 | size_to_byte(size),
|
||||
InstructionTwo::Rem => 0x32 | size_to_byte(size),
|
||||
InstructionTwo::Irem => 0x35 | size_to_byte(size),
|
||||
InstructionTwo::And => 0x03 | size_to_byte(size),
|
||||
InstructionTwo::Or => 0x13 | size_to_byte(size),
|
||||
InstructionTwo::Xor => 0x23 | size_to_byte(size),
|
||||
|
|
Loading…
Reference in New Issue
Block a user