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

Method set_reg

core/src/vm/context.rs:240–246  ·  view source on GitHub ↗

Sets the value of register `reg` to `value`. Panics if the register is invalid.

(&mut self, reg: Register, value: u64)

Source from the content-addressed store, hash-verified

238 ///
239 /// Panics if the register is invalid.
240 fn set_reg(&mut self, reg: Register, value: u64) {
241 let index = self.reg_index(reg);
242 if index >= self.regs.len() {
243 self.regs.resize(index + 1, 0);
244 }
245 self.regs[index] = value;
246 }
247
248 /// Sets the program counter to `pc`.
249 pub(super) fn set_pc(&mut self, pc: Address) {

Callers 15

do_binary_double_opMethod · 0.80
do_binary_integer_opMethod · 0.80
do_binary_boolean_opMethod · 0.80
do_binary_text_opMethod · 0.80
do_allocMethod · 0.80
do_alloc_arrayMethod · 0.80
do_bitwise_notMethod · 0.80
do_concatMethod · 0.80
do_double_to_integerMethod · 0.80
do_integer_to_doubleMethod · 0.80

Calls 2

reg_indexMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected