aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/insn.rs
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2024-12-06 22:17:01 +0100
committerJohannes Stoelp <johannes.stoelp@gmail.com>2024-12-06 22:17:01 +0100
commit36345d8ab93d23d9f94372863e3747a07222b6ce (patch)
tree9391cfc2149c74d82a551977fed9c8efcb565561 /src/insn.rs
parent7653ced7e8ce18b9ada2b666c63832007f8becf2 (diff)
downloadjuicebox-asm-36345d8ab93d23d9f94372863e3747a07222b6ce.tar.gz
juicebox-asm-36345d8ab93d23d9f94372863e3747a07222b6ce.zip
asm: add inc, xor insn and initial support for memory base+idx
Diffstat (limited to 'src/insn.rs')
-rw-r--r--src/insn.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/insn.rs b/src/insn.rs
index c02206c..2f80d3d 100644
--- a/src/insn.rs
+++ b/src/insn.rs
@@ -6,6 +6,7 @@ mod cmovnz;
mod cmovz;
mod cmp;
mod dec;
+mod inc;
mod jmp;
mod jnz;
mod jz;
@@ -15,6 +16,7 @@ mod pop;
mod push;
mod ret;
mod test;
+mod xor;
/// Trait for [`add`](https://www.felixcloutier.com/x86/add) instruction kinds.
pub trait Add<T, U> {
@@ -57,6 +59,12 @@ pub trait Dec<T> {
fn dec(&mut self, op1: T);
}
+/// Trait for [`inc`](https://www.felixcloutier.com/x86/inc) instruction kinds.
+pub trait Inc<T> {
+ /// Emit a increment instruction.
+ fn inc(&mut self, op1: T);
+}
+
/// Trait for [`jmp`](https://www.felixcloutier.com/x86/jmp) instruction kinds.
pub trait Jmp<T> {
/// Emit an unconditional jump instruction.
@@ -101,3 +109,9 @@ pub trait Test<T, U> {
/// `SF`, `ZF`, and `PF` status flags, the result is discarded.
fn test(&mut self, op1: T, op2: U);
}
+
+/// Trait for [`xor`](https://www.felixcloutier.com/x86/xor) instruction kinds.
+pub trait Xor<T, U> {
+ /// Emit a xor instruction.
+ fn xor(&mut self, op1: T, op2: U);
+}