aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/insn.rs
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2023-03-05 22:20:48 +0100
committerJohannes Stoelp <johannes.stoelp@gmail.com>2023-03-05 22:20:48 +0100
commit8316b628bbc9945fd1d08305317cf49a6482801f (patch)
treeffc730d9ad9a131a2dbe54d41a4ab026e06f1ff3 /src/insn.rs
parent005fca316085c3a2ce3e43b92531f006a15fbdd2 (diff)
downloadjuicebox-asm-8316b628bbc9945fd1d08305317cf49a6482801f.tar.gz
juicebox-asm-8316b628bbc9945fd1d08305317cf49a6482801f.zip
Added CALL and call extern fn example
Diffstat (limited to 'src/insn.rs')
-rw-r--r--src/insn.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/insn.rs b/src/insn.rs
index 2a6ca42..8810085 100644
--- a/src/insn.rs
+++ b/src/insn.rs
@@ -1,6 +1,7 @@
//! Trait definitions of various instructions.
mod add;
+mod call;
mod dec;
mod jmp;
mod jnz;
@@ -15,6 +16,11 @@ pub trait Add<T, U> {
fn add(&mut self, op1: T, op2: U);
}
+pub trait Call<T> {
+ /// Emit a call instruction.
+ fn call(&mut self, op1: T);
+}
+
pub trait Dec<T> {
/// Emit a decrement instruction.
fn dec(&mut self, op1: T);