MCPcopy Create free account
hub / github.com/Sin7Y/olavm / binary_length

Method binary_length

core/src/program/binary_program.rs:85–98  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

83 pub const BIT_SHIFT_OP1_IMM: usize = 62;
84
85 pub fn binary_length(&self) -> u8 {
86 let mut len = 1;
87 len += match self.op0 {
88 Some(OlaOperand::ImmediateOperand { .. })
89 | Some(OlaOperand::RegisterWithOffset { .. }) => 1,
90 _ => 0,
91 };
92 len += match self.op1 {
93 Some(OlaOperand::ImmediateOperand { .. })
94 | Some(OlaOperand::RegisterWithOffset { .. }) => 1,
95 _ => 0,
96 };
97 len
98 }
99
100 pub fn encode(&self) -> Result<Vec<String>, String> {
101 let mut instruction_u64: u64 = 0;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected