small stuff
This commit is contained in:
@@ -172,7 +172,7 @@ impl Code {
|
||||
self.bytes.push(0xc3);
|
||||
}
|
||||
|
||||
pub fn sub(&mut self, mut dst: Reg, src: impl Into<Imm>) -> ERes {
|
||||
pub fn sub(&mut self, dst: Reg, src: impl Into<Imm>) -> ERes {
|
||||
let mut src = src.into();
|
||||
let mut width = src.width_signed()?;
|
||||
let dst_width = dst.width().min(Width::B32);
|
||||
@@ -188,16 +188,16 @@ impl Code {
|
||||
src = src.reinterpret(dst_width);
|
||||
width = src.width_signed()?;
|
||||
}
|
||||
|
||||
if dst.width() == Width::B8 {
|
||||
self.bytes.push(0x80);
|
||||
} else if width == Width::B8 {
|
||||
self.bytes.push(0x83);
|
||||
} else {
|
||||
if width == Width::B8 {
|
||||
self.bytes.push(0x83);
|
||||
} else {
|
||||
self.bytes.push(0x81);
|
||||
width = dst_width;
|
||||
}
|
||||
self.bytes.push(0x81);
|
||||
width = dst_width;
|
||||
}
|
||||
|
||||
self.bytes.push(modrm(0b11, 0b101, dst.base()));
|
||||
self.imm(src, width);
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user