aboutsummaryrefslogtreecommitdiff
path: root/lib/xixanta/src/object.rs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/xixanta/src/object.rs')
-rw-r--r--lib/xixanta/src/object.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/xixanta/src/object.rs b/lib/xixanta/src/object.rs
index 5904b56..170d872 100644
--- a/lib/xixanta/src/object.rs
+++ b/lib/xixanta/src/object.rs
@@ -98,6 +98,18 @@ impl Bundle {
])
}
}
+
+ /// Considering that the first element of the 'bytes' property is the
+ /// instruction identifier, returns the two last bytes as if they were a
+ /// 16-bit value.
+ pub fn arg(&self) -> u16 {
+ self.bytes[1] as u16 + ((self.bytes[2] as u16) << 8)
+ }
+
+ /// Returns the address to the next instruction after this bundle.
+ pub fn next_address(&self) -> usize {
+ self.address + self.size as usize
+ }
}
/// The type of object being referenced, which is either a value as-is, or an