OpenCores
URL https://opencores.org/ocsvn/rtf65002/rtf65002/trunk

Subversion Repositories rtf65002

[/] [rtf65002/] [trunk/] [rtl/] [verilog/] [rtf65002_defines.v] - Blame information for rev 30

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 robfinch
`timescale 1ns / 1ps
2
// ============================================================================
3
//        __
4
//   \\__/ o\    (C) 2013  Robert Finch, Stratford
5
//    \  __ /    All rights reserved.
6
//     \/_//     robfinch<remove>@opencores.org
7
//       ||
8
//
9
// rtf65002.v
10
//  - 32 bit CPU
11
//
12
// This source file is free software: you can redistribute it and/or modify 
13
// it under the terms of the GNU Lesser General Public License as published 
14
// by the Free Software Foundation, either version 3 of the License, or     
15
// (at your option) any later version.                                      
16
//                                                                          
17
// This source file is distributed in the hope that it will be useful,      
18
// but WITHOUT ANY WARRANTY; without even the implied warranty of           
19
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            
20
// GNU General Public License for more details.                             
21
//                                                                          
22
// You should have received a copy of the GNU General Public License        
23
// along with this program.  If not, see <http://www.gnu.org/licenses/>.    
24
//                                                                          
25
// ============================================================================
26
//
27
`define TRUE            1'b1
28
`define FALSE           1'b0
29
 
30
//`define SUPPORT_ICACHE        1'b1
31
`define SUPPORT_DCACHE  1'b1
32
`define SUPPORT_BCD             1'b1
33
`define SUPPORT_DIVMOD          1'b1
34
//`define SUPPORT_EM8           1'b1
35
//`define SUPPORT_BYTE_IRQ      1'b1
36
`define SUPPORT_EXEC    1'b1
37
`define SUPPORT_BERR    1'b1
38
`define SUPPORT_STRING  1'b1
39
`define SUPPORT_SHIFT   1'b1
40
 
41
`define RST_VECT        34'h3FFFFFFF8
42
`define NMI_VECT        34'h3FFFFFFF4
43
`define IRQ_VECT        34'h3FFFFFFF0
44
`define BRK_VECTNO      9'd0
45
`define SLP_VECTNO      9'd1
46
`define BYTE_RST_VECT   34'h00000FFFC
47
`define BYTE_NMI_VECT   34'h00000FFFA
48
`define BYTE_IRQ_VECT   34'h00000FFFE
49
 
50
`define BRK                     8'h00
51
`define RTI                     8'h40
52
`define RTS                     8'h60
53
`define PHP                     8'h08
54
`define CLC                     8'h18
55
`define PLP                     8'h28
56
`define SEC                     8'h38
57
`define PHA                     8'h48
58
`define CLI                     8'h58
59
`define PLA                     8'h68
60
`define SEI                     8'h78
61
`define DEY                     8'h88
62
`define TYA                     8'h98
63
`define TAY                     8'hA8
64
`define CLV                     8'hB8
65
`define INY                     8'hC8
66
`define CLD                     8'hD8
67
`define INX                     8'hE8
68
`define SED                     8'hF8
69
`define ROR_ACC         8'h6A
70
`define TXA                     8'h8A
71
`define TXS                     8'h9A
72
`define TAX                     8'hAA
73
`define TSX                     8'hBA
74
`define DEX                     8'hCA
75
`define NOP                     8'hEA
76
`define TXY                     8'h9B
77
`define TYX                     8'hBB
78
`define TAS                     8'h1B
79
`define TSA                     8'h3B
80
`define TRS                     8'h8B
81
`define TSR                     8'hAB
82
`define STP                     8'hDB
83
`define NAT                     8'hFB
84
`define EMM                     8'hFB
85
`define INA                     8'h1A
86
`define DEA                     8'h3A
87
 
88
`define RR                      8'h02
89
`define ADD_RR                  4'd0
90
`define SUB_RR                  4'd1
91
`define CMP_RR                  4'd2
92
`define AND_RR                  4'd3
93
`define EOR_RR                  4'd4
94
`define OR_RR                   4'd5
95
`define MUL_RR                  4'd8
96
`define MULS_RR                 4'd9
97
`define DIV_RR                  4'd10
98
`define DIVS_RR                 4'd11
99
`define MOD_RR                  4'd12
100
`define MODS_RR                 4'd13
101
`define ASL_RRR                 4'd14
102
`define LSR_RRR                 4'd15
103
`define LD_RR           8'h7B
104
 
105
`define ADD_IMM8        8'h65           // 8 bit operand
106
`define ADD_IMM16       8'h79           // 16 bit operand
107
`define ADD_IMM32       8'h69           // 32 bit operand
108
`define ADD_ZPX         8'h75           // there is no ZP mode, use R0 to syntheisze
109
`define ADD_IX          8'h61
110
`define ADD_IY          8'h71
111
`define ADD_ABS         8'h6D
112
`define ADD_ABSX        8'h7D
113
`define ADD_RIND        8'h72
114
`define ADD_DSP         8'h63
115
 
116
`define SUB_IMM8        8'hE5
117
`define SUB_IMM16       8'hF9
118
`define SUB_IMM32       8'hE9
119
`define SUB_ZPX         8'hF5
120
`define SUB_IX          8'hE1
121
`define SUB_IY          8'hF1
122
`define SUB_ABS         8'hED
123
`define SUB_ABSX        8'hFD
124
`define SUB_RIND        8'hF2
125
`define SUB_DSP         8'hE3
126
 
127
// CMP = SUB r0,....
128
 
129
`define ADC_IMM         8'h69
130
`define ADC_ZP          8'h65
131
`define ADC_ZPX         8'h75
132
`define ADC_IX          8'h61
133
`define ADC_IY          8'h71
134
`define ADC_ABS         8'h6D
135
`define ADC_ABSX        8'h7D
136
`define ADC_ABSY        8'h79
137
`define ADC_I           8'h72
138
 
139
`define SBC_IMM         8'hE9
140
`define SBC_ZP          8'hE5
141
`define SBC_ZPX         8'hF5
142
`define SBC_IX          8'hE1
143
`define SBC_IY          8'hF1
144
`define SBC_ABS         8'hED
145
`define SBC_ABSX        8'hFD
146
`define SBC_ABSY        8'hF9
147
`define SBC_I           8'hF2
148
 
149
`define CMP_IMM8        8'hC5
150
`define CMP_IMM32       8'hC9
151
`define CMP_IMM         8'hC9
152
`define CMP_ZP          8'hC5
153
`define CMP_ZPX         8'hD5
154
`define CMP_IX          8'hC1
155
`define CMP_IY          8'hD1
156
`define CMP_ABS         8'hCD
157
`define CMP_ABSX        8'hDD
158
`define CMP_ABSY        8'hD9
159
`define CMP_I           8'hD2
160
 
161
 
162
`define LDA_IMM8        8'hA5
163
`define LDA_IMM16       8'hB9
164
`define LDA_IMM32       8'hA9
165
 
166
`define AND_IMM8        8'h25
167
`define AND_IMM16       8'h39
168
`define AND_IMM32       8'h29
169
`define AND_IMM         8'h29
170
`define AND_ZP          8'h25
171
`define AND_ZPX         8'h35
172
`define AND_IX          8'h21
173
`define AND_IY          8'h31
174
`define AND_ABS         8'h2D
175
`define AND_ABSX        8'h3D
176
`define AND_ABSY        8'h39
177
`define AND_RIND        8'h32
178
`define AND_I           8'h32
179
`define AND_DSP         8'h23
180
 
181
`define OR_IMM8         8'h05
182
`define OR_IMM16        8'h19
183
`define OR_IMM32        8'h09
184
`define OR_ZPX          8'h15
185
`define OR_IX           8'h01
186
`define OR_IY           8'h11
187
`define OR_ABS          8'h0D
188
`define OR_ABSX         8'h1D
189
`define OR_RIND         8'h12
190
`define OR_DSP          8'h03
191
 
192
`define ORA_IMM         8'h09
193
`define ORA_ZP          8'h05
194
`define ORA_ZPX         8'h15
195
`define ORA_IX          8'h01
196
`define ORA_IY          8'h11
197
`define ORA_ABS         8'h0D
198
`define ORA_ABSX        8'h1D
199
`define ORA_ABSY        8'h19
200
`define ORA_I           8'h12
201
 
202
`define EOR_IMM         8'h49
203
`define EOR_IMM8        8'h45
204
`define EOR_IMM16       8'h59
205
`define EOR_IMM32       8'h49
206
`define EOR_ZP          8'h45
207
`define EOR_ZPX         8'h55
208
`define EOR_IX          8'h41
209
`define EOR_IY          8'h51
210
`define EOR_ABS         8'h4D
211
`define EOR_ABSX        8'h5D
212
`define EOR_ABSY        8'h59
213
`define EOR_RIND        8'h52
214
`define EOR_I           8'h52
215
`define EOR_DSP         8'h43
216
 
217
// LD is OR rt,r0,....
218
 
219
`define ST_ZPX          8'h95
220
`define ST_IX           8'h81
221
`define ST_IY           8'h91
222
`define ST_ABS          8'h8D
223
`define ST_ABSX         8'h9D
224
`define ST_RIND         8'h92
225
`define ST_DSP          8'h83
226
 
227
`define ORB_ZPX         8'hB5
228
`define ORB_IX          8'hA1
229
`define ORB_IY          8'hB1
230
`define ORB_ABS         8'hAD
231
`define ORB_ABSX        8'hBD
232
 
233
`define STB_ZPX         8'h74
234
`define STB_ABS         8'h9C
235
`define STB_ABSX        8'h9E
236
 
237
 
238
//`define LDB_RIND      8'hB2   // Conflict with LDX #imm16
239
 
240
`define LDA_IMM         8'hA9
241
`define LDA_ZP          8'hA5
242
`define LDA_ZPX         8'hB5
243
`define LDA_IX          8'hA1
244
`define LDA_IY          8'hB1
245
`define LDA_ABS         8'hAD
246
`define LDA_ABSX        8'hBD
247
`define LDA_ABSY        8'hB9
248
`define LDA_I           8'hB2
249
 
250
`define STA_ZP          8'h85
251
`define STA_ZPX         8'h95
252
`define STA_IX          8'h81
253
`define STA_IY          8'h91
254
`define STA_ABS         8'h8D
255
`define STA_ABSX        8'h9D
256
`define STA_ABSY        8'h99
257
`define STA_I           8'h92
258
 
259
`define ASL_IMM8        8'h24
260
`define ASL_ACC         8'h0A
261
`define ASL_ZP          8'h06
262
`define ASL_RR          8'h06
263
`define ASL_ZPX         8'h16
264
`define ASL_ABS         8'h0E
265
`define ASL_ABSX        8'h1E
266
 
267
`define ROL_ACC         8'h2A
268
`define ROL_ZP          8'h26
269
`define ROL_RR          8'h26
270
`define ROL_ZPX         8'h36
271
`define ROL_ABS         8'h2E
272
`define ROL_ABSX        8'h3E
273
 
274
`define LSR_IMM8        8'h34
275
`define LSR_ACC         8'h4A
276
`define LSR_ZP          8'h46
277
`define LSR_RR          8'h46
278
`define LSR_ZPX         8'h56
279
`define LSR_ABS         8'h4E
280
`define LSR_ABSX        8'h5E
281
 
282
`define ROR_RR          8'h66
283
`define ROR_ZP          8'h66
284
`define ROR_ZPX         8'h76
285
`define ROR_ABS         8'h6E
286
`define ROR_ABSX        8'h7E
287
 
288
`define DEC_RR          8'hC6
289
`define DEC_ZP          8'hC6
290
`define DEC_ZPX         8'hD6
291
`define DEC_ABS         8'hCE
292
`define DEC_ABSX        8'hDE
293
`define INC_RR          8'hE6
294
`define INC_ZP          8'hE6
295
`define INC_ZPX         8'hF6
296
`define INC_ABS         8'hEE
297
`define INC_ABSX        8'hFE
298
 
299
`define BIT_IMM         8'h89
300
`define BIT_ZP          8'h24
301
`define BIT_ZPX         8'h34
302
`define BIT_ABS         8'h2C
303
`define BIT_ABSX        8'h3C
304
 
305
// CMP = SUB r0,...
306
// BIT = AND r0,...
307
`define BPL                     8'h10
308
`define BVC                     8'h50
309
`define BCC                     8'h90
310
`define BNE                     8'hD0
311
`define BMI                     8'h30
312
`define BVS                     8'h70
313
`define BCS                     8'hB0
314
`define BEQ                     8'hF0
315
`define BRL                     8'h82
316
`define BRA                     8'h80
317
`define BHI                     8'h13
318
`define BLS                     8'h33
319
`define BGE                     8'h93
320
`define BLT                     8'hB3
321
`define BGT                     8'hD3
322
`define BLE                     8'hF3
323
 
324
`define JML                     8'h5C
325
`define JMP                     8'h4C
326
`define JMP_IND         8'h6C
327
`define JMP_INDX        8'h7C
328
`define JMP_RIND        8'hD2
329
`define JSR                     8'h20
330
`define JSL                     8'h22
331
`define JSR_INDX        8'hFC
332
`define JSR_RIND        8'hC2
333
`define RTS                     8'h60
334
`define RTL                     8'h6B
335
`define BSR                     8'h62
336
`define NOP                     8'hEA
337
 
338
`define BRK                     8'h00
339
`define PLX                     8'hFA
340
`define PLY                     8'h7A
341
`define PHX                     8'hDA
342
`define PHY                     8'h5A
343
`define WAI                     8'hCB
344
`define PUSH            8'h0B
345
`define POP                     8'h2B
346
 
347
`define LDX_IMM         8'hA2
348
`define LDX_ZP          8'hA6
349
`define LDX_ZPX         8'hB6
350
`define LDX_ZPY         8'hB6
351
`define LDX_ABS         8'hAE
352
`define LDX_ABSY        8'hBE
353
 
354
`define LDX_IMM32       8'hA2
355
`define LDX_IMM16       8'hB2
356
`define LDX_IMM8        8'hA6
357
 
358
`define LDY_IMM         8'hA0
359
`define LDY_ZP          8'hA4
360
`define LDY_ZPX         8'hB4
361
`define LDY_IMM32       8'hA0
362
`define LDY_ABS         8'hAC
363
`define LDY_ABSX        8'hBC
364
 
365
`define STX_ZP          8'h86
366
`define STX_ZPX         8'h96
367
`define STX_ZPY         8'h96
368
`define STX_ABS         8'h8E
369
 
370
`define STY_ZP          8'h84
371
`define STY_ZPX         8'h94
372
`define STY_ABS         8'h8C
373
 
374
`define STZ_ZP          8'h64
375
`define STZ_ZPX         8'h74
376
`define STZ_ABS         8'h9C
377
`define STZ_ABSX        8'h9E
378
 
379
`define CPX_IMM         8'hE0
380
`define CPX_IMM32       8'hE0
381
`define CPX_ZP          8'hE4
382
`define CPX_ZPX         8'hE4
383
`define CPX_ABS         8'hEC
384
`define CPY_IMM         8'hC0
385
`define CPY_IMM32       8'hC0
386
`define CPY_ZP          8'hC4
387
`define CPY_ZPX         8'hC4
388
`define CPY_ABS         8'hCC
389
 
390
`define TRB_ZP          8'h14
391
`define TRB_ZPX         8'h14
392
`define TRB_ABS         8'h1C
393
`define TSB_ZP          8'h04
394
`define TSB_ZPX         8'h04
395
`define TSB_ABS         8'h0C
396
 
397
`define BAZ                     8'hC1
398
`define BXZ                     8'hD1
399
`define BEQ_RR          8'hE2
400
`define INT0            8'hDC
401
`define INT1            8'hDD
402
`define SUB_SP8         8'h85
403
`define SUB_SP16        8'h99
404
`define SUB_SP32        8'h89
405
`define MVP                     8'h44
406
`define MVN                     8'h54
407
`define STS                     8'h64
408
`define EXEC            8'hEB
409
`define ATNI            8'h4B
410
 
411
`define PG2                     8'h42
412
 
413
`define NOTHING         4'd0
414
`define SR_70           4'd1
415
`define SR_310          4'd2
416
`define BYTE_70         4'd3
417
`define WORD_310        4'd4
418
`define PC_70           4'd5
419
`define PC_158          4'd6
420
`define PC_2316         4'd7
421
`define PC_3124         4'd8
422
`define PC_310          4'd9
423
`define WORD_311        4'd10
424
`define IA_310          4'd11
425
`define IA_70           4'd12
426
`define IA_158          4'd13
427
`define BYTE_71         4'd14
428
`define WORD_312        4'd15
429
 
430
`define STW_DEF         6'h0
431
`define STW_ACC         6'd1
432
`define STW_X           6'd2
433
`define STW_Y           6'd3
434
`define STW_PC          6'd4
435
`define STW_PC2         6'd5
436
`define STW_PCHWI       6'd6
437
`define STW_SR          6'd7
438
`define STW_RFA         6'd8
439
`define STW_RFA8        6'd9
440
`define STW_RFA         6'd10
441
`define STW_RFA8        6'd11
442
`define STW_A           6'd12
443
`define STW_B           6'd13
444
`define STW_CALC        6'd14
445
 
446
`define STW_ACC8        6'd16
447
`define STW_X8          6'd17
448
`define STW_Y8          6'd18
449
`define STW_PC3124      6'd19
450
`define STW_PC2316      6'd20
451
`define STW_PC158       6'd21
452
`define STW_PC70        6'd22
453
`define STW_SR70        6'd23
454
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.