MCPcopy Create free account
hub / github.com/digorithm/LC-3-Rust / execute_program

Function execute_program

src/hardware/mod.rs:11–23  ·  view source on GitHub ↗
(vm: &mut VM)

Source from the content-addressed store, hash-verified

9pub const MEMORY_SIZE: usize = std::u16::MAX as usize;
10
11pub fn execute_program(vm: &mut VM) {
12 //initialize Registers
13 while vm.registers.pc < MEMORY_SIZE as u16 {
14 //read instruction
15 let instruction = vm.read_memory(vm.registers.pc);
16
17 //increment program counter
18 vm.registers.pc += 1;
19
20 //extract op_code and execute operation...
21 instruction::execute_instruction(instruction, vm)
22 }
23}

Callers 1

mainFunction · 0.85

Calls 2

execute_instructionFunction · 0.85
read_memoryMethod · 0.80

Tested by

no test coverage detected