Skip to content
Snippets Groups Projects
Verified Commit 8b3846d6 authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

feat: more instructions

parent c2eaf535
No related branches found
No related tags found
No related merge requests found
...@@ -77,7 +77,7 @@ pub const INSTRUCTIONS: [(fn(&mut Cpu), u8, &'static str); 256] = [ ...@@ -77,7 +77,7 @@ pub const INSTRUCTIONS: [(fn(&mut Cpu), u8, &'static str); 256] = [
(ld_b_h, 4, "LD B, H"), (ld_b_h, 4, "LD B, H"),
(noimpl, 4, "! UNIMP !"), (noimpl, 4, "! UNIMP !"),
(noimpl, 4, "! UNIMP !"), (noimpl, 4, "! UNIMP !"),
(noimpl, 4, "! UNIMP !"), (ld_b_a, 4, "LD B, A"),
(noimpl, 4, "! UNIMP !"), (noimpl, 4, "! UNIMP !"),
(noimpl, 4, "! UNIMP !"), (noimpl, 4, "! UNIMP !"),
(noimpl, 4, "! UNIMP !"), (noimpl, 4, "! UNIMP !"),
...@@ -189,7 +189,7 @@ pub const INSTRUCTIONS: [(fn(&mut Cpu), u8, &'static str); 256] = [ ...@@ -189,7 +189,7 @@ pub const INSTRUCTIONS: [(fn(&mut Cpu), u8, &'static str); 256] = [
(noimpl, 4, "! UNIMP !"), (noimpl, 4, "! UNIMP !"),
(xor_a_a, 4, "XOR A, A"), (xor_a_a, 4, "XOR A, A"),
// 0xb opcodes // 0xb opcodes
(noimpl, 4, "! UNIMP !"), (or_a_b, 4, "OR A, B"),
(or_a_c, 4, "OR A, C"), (or_a_c, 4, "OR A, C"),
(noimpl, 4, "! UNIMP !"), (noimpl, 4, "! UNIMP !"),
(noimpl, 4, "! UNIMP !"), (noimpl, 4, "! UNIMP !"),
...@@ -729,6 +729,10 @@ fn ld_b_h(cpu: &mut Cpu) { ...@@ -729,6 +729,10 @@ fn ld_b_h(cpu: &mut Cpu) {
cpu.b = cpu.h; cpu.b = cpu.h;
} }
fn ld_b_a(cpu: &mut Cpu) {
cpu.b = cpu.a;
}
fn ld_c_a(cpu: &mut Cpu) { fn ld_c_a(cpu: &mut Cpu) {
cpu.c = cpu.a; cpu.c = cpu.a;
} }
...@@ -779,6 +783,15 @@ fn xor_a_a(cpu: &mut Cpu) { ...@@ -779,6 +783,15 @@ fn xor_a_a(cpu: &mut Cpu) {
cpu.set_carry(false); cpu.set_carry(false);
} }
fn or_a_b(cpu: &mut Cpu) {
cpu.a |= cpu.b;
cpu.set_sub(false);
cpu.set_zero(cpu.a == 0);
cpu.set_half_carry(false);
cpu.set_carry(false);
}
fn or_a_c(cpu: &mut Cpu) { fn or_a_c(cpu: &mut Cpu) {
cpu.a |= cpu.c; cpu.a |= cpu.c;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment