MCPcopy Create free account
hub / github.com/AxlLind/AdventOfCode / fetch_inst

Method fetch_inst

2019/src/intcoder.rs:115–127  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

113 }
114
115 fn fetch_inst(&mut self) -> (i64,i64,i64,i64) {
116 let a = self.fetch_adr(1);
117 let b = self.fetch_adr(2);
118 let c = self.fetch_write_adr(3);
119 let op = self.get(self.pc) % 100;
120 self.pc += match op {
121 ADD|MUL|SLT|SEQ => 4,
122 OUT|BSE => 2,
123 JNZ|JZ => 3,
124 _ => 0,
125 };
126 (op,a,b,c)
127 }
128}

Callers 1

executeMethod · 0.80

Calls 3

fetch_adrMethod · 0.80
fetch_write_adrMethod · 0.80
getMethod · 0.80

Tested by

no test coverage detected