MCPcopy Index your code
hub / github.com/endbasic/endbasic / opcode_of

Function opcode_of

core/src/bytecode.rs:1172–1179  ·  view source on GitHub ↗

Returns the opcode of an instruction.

(instr: u32)

Source from the content-addressed store, hash-verified

1170
1171/// Returns the opcode of an instruction.
1172pub(crate) fn opcode_of(instr: u32) -> Opcode {
1173 #[allow(unsafe_code)]
1174 unsafe {
1175 let num = unchecked_u32_as_u8(instr >> 24);
1176 debug_assert!(num <= Opcode::Eof as u8);
1177 std::mem::transmute::<u8, Opcode>(num)
1178 }
1179}
1180
1181/// Tags used as integer register values to identify the type stored in another register at
1182/// runtime.

Callers 3

format_instrFunction · 0.85
disasmMethod · 0.85
execMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected