aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/insn/sub.rs
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2024-12-13 01:13:20 +0100
committerJohannes Stoelp <johannes.stoelp@gmail.com>2024-12-13 01:13:20 +0100
commit758f014afb8ec5c20ef2fc862fc12e80f65d3d25 (patch)
tree41900866f4502e63aa5e20e725a30d543cf936f1 /src/insn/sub.rs
parenta403a7255190f65ea73ccaf382ec7af1a98b94ad (diff)
downloadjuicebox-asm-758f014afb8ec5c20ef2fc862fc12e80f65d3d25.tar.gz
juicebox-asm-758f014afb8ec5c20ef2fc862fc12e80f65d3d25.zip
mem: make all memory operands explicit in size
* remove non size explicit MemOp * introduce private Mem trait * implement Mem8, Mem16, Mem32 and Mem64 operands * implement EncodeX helpers based on explicit memory operands * fixup instructions with explicit memory operands * fixup examples
Diffstat (limited to 'src/insn/sub.rs')
-rw-r--r--src/insn/sub.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/insn/sub.rs b/src/insn/sub.rs
index 814744c..d56daae 100644
--- a/src/insn/sub.rs
+++ b/src/insn/sub.rs
@@ -1,5 +1,5 @@
use super::Sub;
-use crate::{Asm, Imm8, MemOp, Reg64};
+use crate::{Asm, Imm8, Mem8, Reg64};
impl Sub<Reg64, Reg64> for Asm {
fn sub(&mut self, op1: Reg64, op2: Reg64) {
@@ -7,8 +7,8 @@ impl Sub<Reg64, Reg64> for Asm {
}
}
-impl Sub<MemOp, Imm8> for Asm {
- fn sub(&mut self, op1: MemOp, op2: Imm8) {
- self.encode_mi(0x83, 5, op1, op2);
+impl Sub<Mem8, Imm8> for Asm {
+ fn sub(&mut self, op1: Mem8, op2: Imm8) {
+ self.encode_mi(0x80, 5, op1, op2);
}
}