diff options
author | Johannes Stoelp <johannes.stoelp@gmail.com> | 2024-12-11 22:22:48 +0100 |
---|---|---|
committer | Johannes Stoelp <johannes.stoelp@gmail.com> | 2024-12-11 22:51:10 +0100 |
commit | 4f60de32bbba15a6fdad1cccbe43c638c3aef338 (patch) | |
tree | 90d45021e8f82f4176ec1d20dc18741046a8d8be /src/insn/add.rs | |
parent | 7fa0970336a8ed489ae40f803554fd603cf3c8b5 (diff) | |
download | juicebox-asm-4f60de32bbba15a6fdad1cccbe43c638c3aef338.tar.gz juicebox-asm-4f60de32bbba15a6fdad1cccbe43c638c3aef338.zip |
asm: add sub insn, add imm8
Diffstat (limited to 'src/insn/add.rs')
-rw-r--r-- | src/insn/add.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/insn/add.rs b/src/insn/add.rs index d5312be..1f5294e 100644 --- a/src/insn/add.rs +++ b/src/insn/add.rs @@ -1,5 +1,5 @@ use super::Add; -use crate::{Asm, Imm16, MemOp, Reg16, Reg32, Reg64}; +use crate::{Asm, Imm16, Imm8, MemOp, Reg16, Reg32, Reg64}; impl Add<Reg64, Reg64> for Asm { fn add(&mut self, op1: Reg64, op2: Reg64) { @@ -25,6 +25,12 @@ impl Add<MemOp, Reg16> for Asm { } } +impl Add<MemOp, Imm8> for Asm { + fn add(&mut self, op1: MemOp, op2: Imm8) { + self.encode_mi(0x83, 0, op1, op2); + } +} + impl Add<MemOp, Imm16> for Asm { fn add(&mut self, op1: MemOp, op2: Imm16) { self.encode_mi(0x81, 0, op1, op2); |