Compare commits
1 Commits
9648dda3cb
...
f10670d5e3
Author | SHA1 | Date |
---|---|---|
Rekai Nyangadzayi Musuka | f10670d5e3 |
|
@ -1,32 +0,0 @@
|
||||||
const std = @import("std");
|
|
||||||
|
|
||||||
const Bus = @import("../../Bus.zig");
|
|
||||||
const Arm7tdmi = @import("../../cpu.zig").Arm7tdmi;
|
|
||||||
const InstrFn = @import("../../cpu.zig").ThumbInstrFn;
|
|
||||||
|
|
||||||
pub fn format3(comptime op: u2, comptime rd: u3) InstrFn {
|
|
||||||
return struct {
|
|
||||||
fn inner(cpu: *Arm7tdmi, _: *Bus, opcode: u16) void {
|
|
||||||
const offset = @truncate(u8, opcode);
|
|
||||||
|
|
||||||
switch (op) {
|
|
||||||
0b00 => {
|
|
||||||
cpu.r[rd] = offset;
|
|
||||||
|
|
||||||
cpu.cpsr.n.unset();
|
|
||||||
cpu.cpsr.z.write(offset == 0);
|
|
||||||
std.debug.panic("TODO: Implement mov R{}, #0x{X:0>2}", .{ rd, offset });
|
|
||||||
},
|
|
||||||
0b01 => {
|
|
||||||
std.debug.panic("TODO: Implement cmp R{}, #0x{X:0>2}", .{ rd, offset });
|
|
||||||
},
|
|
||||||
0b10 => {
|
|
||||||
std.debug.panic("TODO: Implement add R{}, #0x{X:0>2}", .{ rd, offset });
|
|
||||||
},
|
|
||||||
0b11 => {
|
|
||||||
std.debug.panic("TODO: Implement sub R{}, #0x{X:0>2}", .{ rd, offset });
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.inner;
|
|
||||||
}
|
|
Loading…
Reference in New Issue