summaryrefslogtreecommitdiff
path: root/CPU.h
diff options
context:
space:
mode:
authorleo <leo@azuminha.com>2023-11-20 13:23:48 -0300
committerleo <leo@azuminha.com>2023-11-20 13:23:48 -0300
commit312f231d5d3b4523a5763eb01981885d0a66b8cd (patch)
tree1e7ade8b82f95fc56d12a4e41f16535634042eff /CPU.h
parent3dec06f9af2854969805cc3267a6095158a298dd (diff)
and, asl, enable/disable flags
Diffstat (limited to 'CPU.h')
-rw-r--r--CPU.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/CPU.h b/CPU.h
index 6157914..4600621 100644
--- a/CPU.h
+++ b/CPU.h
@@ -1,6 +1,15 @@
#ifndef _CPU
#define _CPU
+#define CARRY 0b00000001
+#define ZERO 0b00000010
+#define INTERRUPT_DISABLE 0b00000100
+#define DECIMAL_MODE 0b00001000
+#define BREAK 0b00010000
+#define BREAK2 0b00100000
+#define OVERFLOW 0b01000000
+#define NEGATIV 0b10000000
+
struct CPU{
uint8_t register_a;
uint8_t register_x;
@@ -37,5 +46,10 @@ void lda(struct CPU *cpu, enum adressing_mode mode);
void interpret(struct CPU *cpu);
uint16_t mem_read_u16(struct CPU *cpu, uint16_t pos);
uint16_t get_operand_address(struct CPU *cpu, enum adressing_mode mode);
+void and(struct CPU *cpu, enum adressing_mode mode);
+void enable_flag(struct CPU *cpu, uint8_t flag);
+void disable_flag(struct CPU *cpu, uint8_t flag);
+void asl(struct CPU *cpu, enum adressing_mode mode);
+
#endif \ No newline at end of file