1
0
mirror of https://github.com/jborza/emu6502.git synced 2024-06-07 16:16:37 +00:00

added opcodes definition, initial disassembler

This commit is contained in:
jborza 2019-04-14 00:33:20 +02:00
parent c3e475ae83
commit 8b46ab4537
2 changed files with 17 additions and 3 deletions

8
cpu.c
View File

@ -59,13 +59,15 @@ int emulate_6502_op(State6502 * state) {
byte* opcode = &state->memory[state->pc++];
switch (*opcode) {
case 0x00: break; //NOP
case 0x01: //ORA, indirect, x
case ORA_IND_X: //ORA, indirect, x
break;
case 0x05: //ORA, zero page
case ORA_ZP: //ORA, zero page
byte zp = pop_byte(state);
ORA(state, state->memory[zp]);
break;
case 0x09: //ORA
case 0x09: //ORA, immediate
default:
unimplemented_instruction(state); break;
}

12
opcodes.h Normal file
View File

@ -0,0 +1,12 @@
#pragma once
#define NOP 0x00
#define LXI 0x01
#define ORA_IMM 0x09
#define ORA_ZP 0x05
#define ORA_ZP_X 0x15
#define ORA_ABS 0x0D
#define ORA_ABS_X 0x1D
#define ORA_ABS_Y 0x19
#define ORA_IND_X 0x01
#define ORA_IND_Y 0x11