MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / cpu_write_reg

Function cpu_write_reg

core/cpu.c:240–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238 return value;
239}
240static void cpu_write_reg(int i, uint8_t value) {
241 switch (i) {
242 case 0: cpu.registers.B = value; break;
243 case 1: cpu.registers.C = value; break;
244 case 2: cpu.registers.D = value; break;
245 case 3: cpu.registers.E = value; break;
246 case 4: cpu_write_index_high(value); break;
247 case 5: cpu_write_index_low(value); break;
248 case 6: cpu_write_byte(cpu_index_address(), value); break;
249 case 7: cpu.registers.A = value; break;
250 default: unreachable();
251 }
252}
253static void cpu_read_write_reg(int read, int write) {
254 uint8_t value;
255 int old_prefix = cpu.PREFIX;

Callers 2

cpu_read_write_regFunction · 0.85
cpu_executeFunction · 0.85

Calls 4

cpu_write_index_highFunction · 0.85
cpu_write_index_lowFunction · 0.85
cpu_write_byteFunction · 0.85
cpu_index_addressFunction · 0.85

Tested by

no test coverage detected