feat(cpu): implement branch and exchange
If I want to continue with armwrestler, I'll have to implement THUMB instructions now
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
const std = @import("std");
|
||||
const util = @import("../util.zig");
|
||||
|
||||
const Bus = @import("../Bus.zig");
|
||||
@@ -16,3 +17,11 @@ pub fn branch(comptime L: bool) InstrFn {
|
||||
}
|
||||
}.inner;
|
||||
}
|
||||
|
||||
pub fn branchAndExchange(cpu: *Arm7tdmi, _: *Bus, opcode: u32) void {
|
||||
const rn = opcode & 0xF;
|
||||
cpu.cpsr.t.write(cpu.r[rn] & 1 == 1);
|
||||
|
||||
// TODO: Is this how I should do it?
|
||||
cpu.r[15] = cpu.r[rn] & 0xFFFF_FFFE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user