-
Notifications
You must be signed in to change notification settings - Fork 0
/
cp4_defs.h
191 lines (179 loc) · 4.64 KB
/
cp4_defs.h
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
/* :ts=4 cp4_defs.h
*
* cp4 - Commodore C+4 emulator
* Copyright (C) 1998 Gáti Gergely
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* e-mail: [email protected]
*/
#ifndef CP4_DEFS_H
#define CP4_DEFS_H
#define BASICBASE 0x8000
#define KERNALBASE 0xC000
#define MAXRAM 65536
#define NOOPERAND -1 // nincs operandus
#define NOAMI -1 // nincs amigás megfelelõ
// Addressing modes
#define ILL 0
#define BYTE 1
#define ABS 2
#define ZP 3
#define ACC 4
#define IMP 5
#define IZPX 6
#define IZPY 7
#define ZPX 8
#define ABSX 9
#define ABSY 10
#define REL 11
#define IABS 12
#define ZPY 13
#define NONE 14
// addressless extra addressing modes
#define A_ILL -1
#define A_BYTE -2
#define A_ACCU -3
#define A_IMP -4
// extra operands
#define OP_ILL -1
#define OP_NONE -2
// illegal opcode
#define O_ILL -1
char *addressing[]={ "ILL","#BYTE","ABS","ZP","ACC","IMP","(ZP,X)",
"(ZP),Y","ZP,X","ABS,X","ABS,Y","REL","(ABS)","ZP,Y","NONE" };
/*
* Statements defines / names
*/
#define ADC 0
#define AND 1
#define ASL 2
#define BCC 3
#define BCS 4
#define BEQ 5
#define BIT 6
#define BMI 7
#define BNE 8
#define BPL 9
#define BRK 10
#define BVC 11
#define BVS 12
#define CLC 13
#define CLD 14
#define CLI 15
#define CLV 16
#define CMP 17
#define CPX 18
#define CPY 19
#define DEC 20
#define DEX 21
#define DEY 22
#define EOR 23
#define INC 24
#define INX 25
#define INY 26
#define JMP 27
#define JSR 28
#define LDA 29
#define LDX 30
#define LDY 31
#define LSR 32
#define NOP 33
#define ORA 34
#define PHA 35
#define PHP 36
#define PLA 37
#define PLP 38
#define ROL 39
#define ROR 40
#define RTI 41
#define RTS 42
#define SBC 43
#define SEC 44
#define SED 45
#define SEI 46
#define STA 47
#define STX 48
#define STY 49
#define TAX 50
#define TAY 51
#define TSX 52
#define TXA 53
#define TXS 54
#define TYA 55
#define XXX 56
// illegális kódok
#define I_CRA 101 // Crash
#define I_NOP 102 // NOP
#define I_NO2 103 // NOP2
#define I_NO3 104 // NOP3
#define I_LAX 105 // LDA & TAX
#define I_DCC 106 // DEC & CMP
#define I_ICS 107 // INC & SBC
#define I_RLA 108 // ROL & AND
#define I_RRA 109 // ROR & ADC
#define I_ALO 110 // ASL & ORA
#define I_LRE 111 // LSR & EOR
#define I_AND 112 // AND ZP
#define I_ALR 113 // AND BYTE & LSR
#define I_AXS 114 // AND ACC,X --> (ZP,X)
#define I_AXM 115 // AND ACC,X --> ZP
#define I_XAA 116 // TXA & AND BYTE
#define I_AXP 117 // AND ACC,X --> ABS
#define I_AXI 118 // AND ACC,X --> ZP,X
#define I_AYS 119 // AND Y,BYTE+1 --> ABS,X
#define I_AXB 120 // AND X,BYTE+1 --> ABS,Y
#define I_AXF 121 // AND ACC,X,BYTE+1 --> ABS,Y
#define I_AXN 122 // AND ACC,X --> X & X-=BYTE (noCarry)
#define I_SBC 123 // SBC BYTE
#define iCRA 101
#define iNOP 102
#define iNO2 103
#define iNO3 104
#define iSLO 105
#define iANC 106
#define iRLA 107
#define iSRE 108
#define iRRA 109
#define iARR 110
#define iSAX 111
#define iANE 112
#define iSHA 113
#define iSHS 114
#define iSHY 115
#define iSHX 116
#define iLAX 117
#define iLAS 118
#define iDCP 119
#define iSBX 120
#define iISB 121
#define iSBC 122
#define iASR 123
#define iLXA 124
char *statements[]={
"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","???" };
char *illstatements[]={ // [iXXX-100]
"???","CRA","NOP","NO2","NO3","SLO","ANC","RLA",
"SRE","RRA","ARR","SAX","ANE","SHA","SHS","SHY",
"SHX","LAX","LAS","DCP","SBX","ISB","SBC","ASR",
"LXA"
};
#endif