-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdecoder.h
More file actions
36 lines (28 loc) · 772 Bytes
/
Copy pathdecoder.h
File metadata and controls
36 lines (28 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* SimAK65 instruction decoder
* Copyright A.K. 2018, 2023
*/
#ifndef SIMAK65_DECODER_H_
#define SIMAK65_DECODER_H_
#include "types.h"
enum opcode {
ADC, AND, ASL, BCC, BCS, BEQ, BIT, BMI,
BNE, BPL, BRK, BVC, BVS, CLC, CLD, CLI,
CLV, CMP, CPX, CPY, DEC, DEX, DEY, EOR,
INC, INX, INY, JMP, JSR, LDA, LDX, LDY,
LSR, NOP, ORA, PHA, PHP, PLA, PLP, ROL,
ROR, RTI, RTS, SBC, SEC, SED, SEI, STA,
STX, STY, TAX, TAY, TSX, TXA, TXS, TYA
};
enum addrmode{
mode_acc, mode_abs, mode_abx, mode_aby,
mode_imm, mode_imp, mode_ind, mode_inx,
mode_iny, mode_rel, mode_zp, mode_zpx,
mode_zpy
};
struct opinfo {
enum opcode opcode;
enum addrmode mode;
};
struct opinfo decode(u8 opcode);
const char *opcodetostring(enum opcode opcode);
#endif /* SIMAK65_DECODER_H_ */