Fixed issue with converting load_imm, pseudo::load and pseudo::store addresses.

This commit is contained in:
Filipe Rodrigues 2021-04-22 14:12:08 +01:00
parent 491831e867
commit 23b7a4f6fb
3 changed files with 3 additions and 3 deletions

View File

@ -52,7 +52,7 @@ impl Encodable for Inst {
fn encode(&self) -> Self::Iterator {
let addr = self.target.0;
let (lo, hi) = match addr.lo().as_signed() < 0 {
true => (u16::MAX - addr.lo(), addr.hi().wrapping_add(1)),
true => (addr.lo(), addr.hi().wrapping_add(1)),
false => addr.lo_hi(),
};

View File

@ -113,7 +113,7 @@ impl Encodable for Inst {
match self.kind {
Kind::Address(Pos(addr)) => {
let (lo, hi) = match addr.lo().as_signed() < 0 {
true => (u16::MAX - addr.lo(), addr.hi().wrapping_add(1)),
true => (addr.lo(), addr.hi().wrapping_add(1)),
false => addr.lo_hi(),
};

View File

@ -51,7 +51,7 @@ impl Encodable for Inst {
fn encode(&self) -> Self::Iterator {
let addr = self.target.0;
let (lo, hi) = match addr.lo().as_signed() < 0 {
true => (u16::MAX - addr.lo(), addr.hi().wrapping_add(1)),
true => (addr.lo(), addr.hi().wrapping_add(1)),
false => addr.lo_hi(),
};