|
|
@ -30,19 +30,19 @@ pub(crate) fn parse<'a>(pos: &SourcePosition, keyword: &str, mut args: TokenPars |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
"inc" => { |
|
|
|
"inc" => { |
|
|
|
let dst = args.next_wr()?; |
|
|
|
let dst = args.next_rdwr()?; |
|
|
|
ArithOp::Add { |
|
|
|
ArithOp::Add { |
|
|
|
dst, |
|
|
|
dst: dst.wr(), |
|
|
|
a: dst.as_rd(), |
|
|
|
a: dst.rd(), |
|
|
|
b: Rd::immediate(1), |
|
|
|
b: Rd::immediate(1), |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
"dec" => { |
|
|
|
"dec" => { |
|
|
|
let dst = args.next_wr()?; |
|
|
|
let dst = args.next_rdwr()?; |
|
|
|
ArithOp::Sub { |
|
|
|
ArithOp::Sub { |
|
|
|
dst, |
|
|
|
dst: dst.wr(), |
|
|
|
a: dst.as_rd(), |
|
|
|
a: dst.rd(), |
|
|
|
b: Rd::immediate(1), |
|
|
|
b: Rd::immediate(1), |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -57,10 +57,10 @@ pub(crate) fn parse<'a>(pos: &SourcePosition, keyword: &str, mut args: TokenPars |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
2 => { |
|
|
|
2 => { |
|
|
|
let dst = args.next_wr()?; |
|
|
|
let dst = args.next_rdwr()?; |
|
|
|
ArithOp::Add { |
|
|
|
ArithOp::Add { |
|
|
|
dst, |
|
|
|
dst: dst.wr(), |
|
|
|
a: dst.as_rd(), |
|
|
|
a: dst.rd(), |
|
|
|
b: args.next_rd()?, |
|
|
|
b: args.next_rd()?, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -80,10 +80,10 @@ pub(crate) fn parse<'a>(pos: &SourcePosition, keyword: &str, mut args: TokenPars |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
2 => { |
|
|
|
2 => { |
|
|
|
let dst = args.next_wr()?; |
|
|
|
let dst = args.next_rdwr()?; |
|
|
|
ArithOp::Sub { |
|
|
|
ArithOp::Sub { |
|
|
|
dst, |
|
|
|
dst: dst.wr(), |
|
|
|
a: dst.as_rd(), |
|
|
|
a: dst.rd(), |
|
|
|
b: args.next_rd()?, |
|
|
|
b: args.next_rd()?, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -103,10 +103,10 @@ pub(crate) fn parse<'a>(pos: &SourcePosition, keyword: &str, mut args: TokenPars |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
2 => { |
|
|
|
2 => { |
|
|
|
let dst = args.next_wr()?; |
|
|
|
let dst = args.next_rdwr()?; |
|
|
|
ArithOp::Mul { |
|
|
|
ArithOp::Mul { |
|
|
|
dst, |
|
|
|
dst: dst.wr(), |
|
|
|
a: dst.as_rd(), |
|
|
|
a: dst.rd(), |
|
|
|
b: args.next_rd()?, |
|
|
|
b: args.next_rd()?, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -119,13 +119,13 @@ pub(crate) fn parse<'a>(pos: &SourcePosition, keyword: &str, mut args: TokenPars |
|
|
|
"divr" => { |
|
|
|
"divr" => { |
|
|
|
match args.len() { |
|
|
|
match args.len() { |
|
|
|
3 => { |
|
|
|
3 => { |
|
|
|
let dst = args.next_wr()?; |
|
|
|
let dst = args.next_rdwr()?; |
|
|
|
let rem = args.next_wr()?; |
|
|
|
let rem = args.next_wr()?; |
|
|
|
let div = args.next_rd()?; |
|
|
|
let div = args.next_rd()?; |
|
|
|
ArithOp::Div { |
|
|
|
ArithOp::Div { |
|
|
|
dst, |
|
|
|
dst: dst.wr(), |
|
|
|
rem, |
|
|
|
rem, |
|
|
|
a: dst.as_rd(), |
|
|
|
a: dst.rd(), |
|
|
|
div, |
|
|
|
div, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -154,12 +154,12 @@ pub(crate) fn parse<'a>(pos: &SourcePosition, keyword: &str, mut args: TokenPars |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
2 => { |
|
|
|
2 => { |
|
|
|
let dst = args.next_wr()?; |
|
|
|
let dst = args.next_rdwr()?; |
|
|
|
let div = args.next_rd()?; |
|
|
|
let div = args.next_rd()?; |
|
|
|
ArithOp::Div { |
|
|
|
ArithOp::Div { |
|
|
|
dst, |
|
|
|
dst: dst.wr(), |
|
|
|
rem: Wr::discard(), |
|
|
|
rem: Wr::discard(), |
|
|
|
a: dst.as_rd(), |
|
|
|
a: dst.rd(), |
|
|
|
div, |
|
|
|
div, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -179,11 +179,11 @@ pub(crate) fn parse<'a>(pos: &SourcePosition, keyword: &str, mut args: TokenPars |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
2 => { |
|
|
|
2 => { |
|
|
|
let dst = args.next_wr()?; |
|
|
|
let dst = args.next_rdwr()?; |
|
|
|
let div = args.next_rd()?; |
|
|
|
let div = args.next_rd()?; |
|
|
|
ArithOp::Mod { |
|
|
|
ArithOp::Mod { |
|
|
|
dst, |
|
|
|
dst: dst.wr(), |
|
|
|
a: dst.as_rd(), |
|
|
|
a: dst.rd(), |
|
|
|
div, |
|
|
|
div, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -203,10 +203,10 @@ pub(crate) fn parse<'a>(pos: &SourcePosition, keyword: &str, mut args: TokenPars |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
2 => { |
|
|
|
2 => { |
|
|
|
let dst = args.next_wr()?; |
|
|
|
let dst = args.next_rdwr()?; |
|
|
|
ArithOp::And { |
|
|
|
ArithOp::And { |
|
|
|
dst, |
|
|
|
dst: dst.wr(), |
|
|
|
a: dst.as_rd(), |
|
|
|
a: dst.rd(), |
|
|
|
b: args.next_rd()?, |
|
|
|
b: args.next_rd()?, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -226,10 +226,10 @@ pub(crate) fn parse<'a>(pos: &SourcePosition, keyword: &str, mut args: TokenPars |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
2 => { |
|
|
|
2 => { |
|
|
|
let dst = args.next_wr()?; |
|
|
|
let dst = args.next_rdwr()?; |
|
|
|
ArithOp::Or { |
|
|
|
ArithOp::Or { |
|
|
|
dst, |
|
|
|
dst: dst.wr(), |
|
|
|
a: dst.as_rd(), |
|
|
|
a: dst.rd(), |
|
|
|
b: args.next_rd()?, |
|
|
|
b: args.next_rd()?, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -249,10 +249,10 @@ pub(crate) fn parse<'a>(pos: &SourcePosition, keyword: &str, mut args: TokenPars |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
2 => { |
|
|
|
2 => { |
|
|
|
let dst = args.next_wr()?; |
|
|
|
let dst = args.next_rdwr()?; |
|
|
|
ArithOp::Xor { |
|
|
|
ArithOp::Xor { |
|
|
|
dst, |
|
|
|
dst: dst.wr(), |
|
|
|
a: dst.as_rd(), |
|
|
|
a: dst.rd(), |
|
|
|
b: args.next_rd()?, |
|
|
|
b: args.next_rd()?, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -271,10 +271,10 @@ pub(crate) fn parse<'a>(pos: &SourcePosition, keyword: &str, mut args: TokenPars |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
1 => { |
|
|
|
1 => { |
|
|
|
let dst = args.next_wr()?; |
|
|
|
let dst = args.next_rdwr()?; |
|
|
|
ArithOp::Cpl { |
|
|
|
ArithOp::Cpl { |
|
|
|
dst, |
|
|
|
dst: dst.wr(), |
|
|
|
a: dst.as_rd(), |
|
|
|
a: dst.rd(), |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
_ => { |
|
|
|
_ => { |
|
|
@ -293,18 +293,18 @@ pub(crate) fn parse<'a>(pos: &SourcePosition, keyword: &str, mut args: TokenPars |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
2 => { |
|
|
|
2 => { |
|
|
|
let dst = args.next_wr()?; |
|
|
|
let dst = args.next_rdwr()?; |
|
|
|
ArithOp::Rol { |
|
|
|
ArithOp::Rol { |
|
|
|
dst, |
|
|
|
dst: dst.wr(), |
|
|
|
a: dst.as_rd(), |
|
|
|
a: dst.rd(), |
|
|
|
n: args.next_rd()?, |
|
|
|
n: args.next_rd()?, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
1 => { |
|
|
|
1 => { |
|
|
|
let dst = args.next_wr()?; |
|
|
|
let dst = args.next_rdwr()?; |
|
|
|
ArithOp::Rol { |
|
|
|
ArithOp::Rol { |
|
|
|
dst, |
|
|
|
dst: dst.wr(), |
|
|
|
a: dst.as_rd(), |
|
|
|
a: dst.rd(), |
|
|
|
n: Rd::immediate(1), |
|
|
|
n: Rd::immediate(1), |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -324,18 +324,18 @@ pub(crate) fn parse<'a>(pos: &SourcePosition, keyword: &str, mut args: TokenPars |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
2 => { |
|
|
|
2 => { |
|
|
|
let dst = args.next_wr()?; |
|
|
|
let dst = args.next_rdwr()?; |
|
|
|
ArithOp::Ror { |
|
|
|
ArithOp::Ror { |
|
|
|
dst, |
|
|
|
dst: dst.wr(), |
|
|
|
a: dst.as_rd(), |
|
|
|
a: dst.rd(), |
|
|
|
n: args.next_rd()?, |
|
|
|
n: args.next_rd()?, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
1 => { |
|
|
|
1 => { |
|
|
|
let dst = args.next_wr()?; |
|
|
|
let dst = args.next_rdwr()?; |
|
|
|
ArithOp::Ror { |
|
|
|
ArithOp::Ror { |
|
|
|
dst, |
|
|
|
dst: dst.wr(), |
|
|
|
a: dst.as_rd(), |
|
|
|
a: dst.rd(), |
|
|
|
n: Rd::immediate(1), |
|
|
|
n: Rd::immediate(1), |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -355,18 +355,18 @@ pub(crate) fn parse<'a>(pos: &SourcePosition, keyword: &str, mut args: TokenPars |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
2 => { |
|
|
|
2 => { |
|
|
|
let dst = args.next_wr()?; |
|
|
|
let dst = args.next_rdwr()?; |
|
|
|
ArithOp::Lsl { |
|
|
|
ArithOp::Lsl { |
|
|
|
dst, |
|
|
|
dst: dst.wr(), |
|
|
|
a: dst.as_rd(), |
|
|
|
a: dst.rd(), |
|
|
|
n: args.next_rd()?, |
|
|
|
n: args.next_rd()?, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
1 => { |
|
|
|
1 => { |
|
|
|
let dst = args.next_wr()?; |
|
|
|
let dst = args.next_rdwr()?; |
|
|
|
ArithOp::Lsl { |
|
|
|
ArithOp::Lsl { |
|
|
|
dst, |
|
|
|
dst: dst.wr(), |
|
|
|
a: dst.as_rd(), |
|
|
|
a: dst.rd(), |
|
|
|
n: Rd::immediate(1), |
|
|
|
n: Rd::immediate(1), |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -386,18 +386,18 @@ pub(crate) fn parse<'a>(pos: &SourcePosition, keyword: &str, mut args: TokenPars |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
2 => { |
|
|
|
2 => { |
|
|
|
let dst = args.next_wr()?; |
|
|
|
let dst = args.next_rdwr()?; |
|
|
|
ArithOp::Lsr { |
|
|
|
ArithOp::Lsr { |
|
|
|
dst, |
|
|
|
dst: dst.wr(), |
|
|
|
a: dst.as_rd(), |
|
|
|
a: dst.rd(), |
|
|
|
n: args.next_rd()?, |
|
|
|
n: args.next_rd()?, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
1 => { |
|
|
|
1 => { |
|
|
|
let dst = args.next_wr()?; |
|
|
|
let dst = args.next_rdwr()?; |
|
|
|
ArithOp::Lsr { |
|
|
|
ArithOp::Lsr { |
|
|
|
dst, |
|
|
|
dst: dst.wr(), |
|
|
|
a: dst.as_rd(), |
|
|
|
a: dst.rd(), |
|
|
|
n: Rd::immediate(1), |
|
|
|
n: Rd::immediate(1), |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -417,18 +417,18 @@ pub(crate) fn parse<'a>(pos: &SourcePosition, keyword: &str, mut args: TokenPars |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
2 => { |
|
|
|
2 => { |
|
|
|
let dst = args.next_wr()?; |
|
|
|
let dst = args.next_rdwr()?; |
|
|
|
ArithOp::Asr { |
|
|
|
ArithOp::Asr { |
|
|
|
dst, |
|
|
|
dst: dst.wr(), |
|
|
|
a: dst.as_rd(), |
|
|
|
a: dst.rd(), |
|
|
|
n: args.next_rd()?, |
|
|
|
n: args.next_rd()?, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
1 => { |
|
|
|
1 => { |
|
|
|
let dst = args.next_wr()?; |
|
|
|
let dst = args.next_rdwr()?; |
|
|
|
ArithOp::Asr { |
|
|
|
ArithOp::Asr { |
|
|
|
dst, |
|
|
|
dst: dst.wr(), |
|
|
|
a: dst.as_rd(), |
|
|
|
a: dst.rd(), |
|
|
|
n: Rd::immediate(1), |
|
|
|
n: Rd::immediate(1), |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|