feat(cpu): implement ARM multiply instructions

This commit is contained in:
2022-01-30 02:04:24 -04:00
parent 6c008ce950
commit a459d4b433
3 changed files with 37 additions and 1 deletions

View File

@@ -92,7 +92,10 @@ pub fn format4(comptime op: u4) InstrFn {
// MUL
const result = cpu.r[rs] * cpu.r[rd];
cpu.r[rd] = result;
std.debug.panic("[CPU|THUMB|MUL] TODO: Set flags on ALU MUL", .{});
cpu.cpsr.n.write(result >> 31 & 1 == 1);
cpu.cpsr.z.write(result == 0);
// V is unaffected, assuming similar behaviour to ARMv4 MUL C is undefined
},
0xE => {
// BIC