pub struct Instruction {
pub opcode: Opcode,
pub operand: Operand,
pub line: Option<u32>,
}Expand description
A single instruction in the compiled bytecode.
Fields§
§opcode: Opcode§operand: Operand§line: Option<u32>Implementations§
Source§impl Instruction
impl Instruction
pub fn new(opcode: Opcode, operand: Operand) -> Self
pub fn with_line(opcode: Opcode, operand: Operand, line: u32) -> Self
pub fn simple(opcode: Opcode) -> Self
pub fn push_int(value: i32) -> Self
pub fn push_string(value: String) -> Self
pub fn push_long(value: i64) -> Self
pub fn jump(target: usize) -> Self
pub fn branch_not(target: usize) -> Self
pub fn branch_equals(target: usize) -> Self
pub fn branch_less_than(target: usize) -> Self
pub fn branch_greater_than(target: usize) -> Self
pub fn branch_less_than_or_equals(target: usize) -> Self
pub fn branch_greater_than_or_equals(target: usize) -> Self
pub fn gosub(script_id: i32) -> Self
pub fn gosub_with_params(script_id: i32) -> Self
pub fn push_int_local(var_id: i32) -> Self
pub fn pop_int_local(var_id: i32) -> Self
pub fn push_string_local(var_id: i32) -> Self
pub fn pop_string_local(var_id: i32) -> Self
pub fn push_long_local(var_id: i32) -> Self
pub fn pop_long_local(var_id: i32) -> Self
pub fn join_string(count: u32) -> Self
Trait Implementations§
Source§impl Clone for Instruction
impl Clone for Instruction
Source§fn clone(&self) -> Instruction
fn clone(&self) -> Instruction
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Instruction
impl RefUnwindSafe for Instruction
impl Send for Instruction
impl Sync for Instruction
impl Unpin for Instruction
impl UnsafeUnpin for Instruction
impl UnwindSafe for Instruction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more