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

Subversion Repositories t6507lp

[/] [t6507lp/] [trunk/] [rtl/] [verilog/] [t6507lp_package.v] - Blame information for rev 195

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

Line No. Rev Author Line
1 139 creep
////////////////////////////////////////////////////////////////////////////
2
////                                                                    ////
3
//// T6507LP IP Core                                                    ////
4
////                                                                    ////
5
//// This file is part of the T6507LP project                           ////
6
//// http://www.opencores.org/cores/t6507lp/                            ////
7
////                                                                    ////
8
//// Description                                                        ////
9
//// T6507LP Package                                                    ////
10
////                                                                    ////
11
//// To Do:                                                             ////
12
//// - Documentation                                                    ////
13
//// - Check syntax & Compile                                           ////
14
////                                                                    ////
15
//// Author(s):                                                         ////
16
//// - Gabriel Oshiro Zardo, gabrieloshiro@gmail.com                    ////
17
//// - Samuel Nascimento Pagliarini (creep), snpagliarini@gmail.com     ////
18
////                                                                    ////
19
////////////////////////////////////////////////////////////////////////////
20
////                                                                    ////
21
//// Copyright (C) 2001 Authors and OPENCORES.ORG                       ////
22
////                                                                    ////
23
//// This source file may be used and distributed without               ////
24
//// restriction provided that this copyright statement is not          ////
25
//// removed from the file and that any derivative work contains        ////
26
//// the original copyright notice and the associated disclaimer.       ////
27
////                                                                    ////
28
//// This source file is free software; you can redistribute it         ////
29
//// and/or modify it under the terms of the GNU Lesser General         ////
30
//// Public License as published by the Free Software Foundation;       ////
31
//// either version 2.1 of the License, or (at your option) any         ////
32
//// later version.                                                     ////
33
////                                                                    ////
34
//// This source is distributed in the hope that it will be             ////
35
//// useful, but WITHOUT ANY WARRANTY; without even the implied         ////
36
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR            ////
37
//// PURPOSE. See the GNU Lesser General Public License for more        ////
38
//// details.                                                           ////
39
////                                                                    ////
40
//// You should have received a copy of the GNU Lesser General          ////
41
//// Public License along with this source; if not, download it         ////
42
//// from http://www.opencores.org/lgpl.shtml                           ////
43
////                                                                    ////
44
////////////////////////////////////////////////////////////////////////////
45
 
46
////////////////////////////////////////////////////////////////////////////
47
////                                                                    ////
48
////                    Processor Status Register                       ////
49
////                                                                    ////
50
////////////////////////////////////////////////////////////////////////////
51
////                                                                    ////
52
//// C - Carry Flag                                                     ////
53
//// Z - Zero Flag                                                      ////
54
//// I - Interrupt Disable                                              ////
55
//// D - Decimal Mode                                                   ////
56
//// B - Break Command                                                  ////
57
//// 1 - Constant One                                                   ////
58
//// V - oVerflow Flag                                                  ////
59
//// N - Negative Flag                                                  ////
60
////                                                                    ////
61
////////////////////////////////////////////////////////////////////////////
62
////                                                                    ////
63
////        -------------------------------------------------           ////
64
////        |  N  |  V  |  1  |  B  |  D  |  I  |  Z  |  C  |           ////
65
////        -------------------------------------------------           ////
66
////                                                                    ////
67
////////////////////////////////////////////////////////////////////////////
68
 
69
localparam C = 3'b000;
70
localparam Z = 3'b001;
71
localparam I = 3'b010;
72
localparam D = 3'b011;
73
localparam B = 3'b100;
74
//localparam 1 = 3'b101;
75
localparam V = 3'b110;
76
localparam N = 3'b111;
77
 
78
 
79
// All opcodes are listed in alphabetic order.
80
 
81
////////////////////////////////////////////////////////////////////////////
82
////                                                                    ////
83
////                        Addressing Modes                            ////
84
////                                                                    ////
85
////////////////////////////////////////////////////////////////////////////
86
////                                                                    ////
87
//// IMP - Implicit                                                     ////
88
//// ACC - Accumulator                                                  ////
89
//// IMM - Immediate                                                    ////
90
//// ZPG - Zero Page                                                    ////
91
//// ZPX - Zero Page,X                                                  ////
92
//// ZPY - Zero Page,Y                                                  ////
93
//// REL - Relative                                                     ////
94
//// ABS - Absolute                                                     ////
95
//// ABX - Absolute,X                                                   ////
96
//// ABY - Absolute,Y                                                   ////
97
//// IDX - (Indirect,X)                                                 ////
98
//// IDY - (Indirect),Y                                                 ////
99
////                                                                    ////
100
////////////////////////////////////////////////////////////////////////////
101
 
102
localparam      IMP = 4'h0,
103
                ACC = 4'h1,
104
                IMM = 4'h2,
105
                ZPG = 4'h3,
106
                ZPX = 4'h4,
107
                ZPY = 4'h5,
108
                REL = 4'h6,
109
                ABS = 4'h7,
110
                ABX = 4'h8,
111
                ABY = 4'h9,
112
                IDX = 4'hA,
113
                IDY = 4'hB;
114
 
115
 
116
//TODO: Document all opcodes
117
////////////////////////////////////////////////////////////////////////////
118
////                                                                    ////
119
////                      ADC - Add with Carry                          ////
120
////                                                                    ////
121
////////////////////////////////////////////////////////////////////////////
122
////                                                                    ////
123
//// A,Z,C,N = A+M+C                                                    ////
124
////                                                                    ////
125
//// This instruction adds the contents of a memory location to the     ////
126
//// accumulator together with the carry bit. If overflow occurs the    ////
127
//// carry bit is set, this enables multiple byte addition to be        ////
128
//// performed.                                                         ////
129
////                                                                    ////
130
////////////////////////////////////////////////////////////////////////////
131
////                                                                    ////
132
//// C - Not affected                                                   ////
133
//// Z - Not affected                                                   ////
134
//// I - Not affected                                                   ////
135
//// D - Not affected                                                   ////
136
//// B - Not affected                                                   ////
137
//// V - Not affected                                                   ////
138
//// N - Not affected                                                   ////
139
////                                                                    ////
140
////////////////////////////////////////////////////////////////////////////
141
localparam      ADC_IMM = 8'h69,
142
                ADC_ZPG = 8'h65,
143
                ADC_ZPX = 8'h75,
144
                ADC_ABS = 8'h6D,
145
                ADC_ABX = 8'h7D,
146
                ADC_ABY = 8'h79,
147
                ADC_IDX = 8'h61,
148
                ADC_IDY = 8'h71;
149
 
150
localparam      AND_IMM = 8'h29,
151
                AND_ZPG = 8'h25,
152
                AND_ZPX = 8'h35,
153
                AND_ABS = 8'h2D,
154
                AND_ABX = 8'h3D,
155
                AND_ABY = 8'h39,
156
                AND_IDX = 8'h21,
157
                AND_IDY = 8'h31;
158
 
159
localparam      ASL_ACC = 8'h0A,
160
                ASL_ZPG = 8'h06,
161
                ASL_ZPX = 8'h16,
162
                ASL_ABS = 8'h0E,
163
                ASL_ABX = 8'h1E;
164
 
165
localparam      BCC_REL = 8'h90;
166
 
167
localparam      BCS_REL = 8'hB0;
168
 
169
localparam      BEQ_REL = 8'hF0;
170
 
171
localparam      BIT_ZPG = 8'h24,
172
                BIT_ABS = 8'h2C;
173
 
174
localparam      BMI_REL = 8'h30;
175
 
176
localparam      BNE_REL = 8'hD0;
177
 
178
localparam      BPL_REL = 8'h10;
179
 
180
localparam      BRK_IMP = 8'h00;
181
 
182
localparam      BVC_REL = 8'h50;
183
 
184
localparam      BVS_REL = 8'h70;
185
 
186
localparam      CLC_IMP = 8'h18;
187
 
188
localparam      CLD_IMP = 8'hD8;
189
 
190
localparam      CLI_IMP = 8'h58;
191
 
192
localparam      CLV_IMP = 8'hB8;
193
 
194
localparam      CMP_IMM = 8'hC9,
195
                CMP_ZPG = 8'hC5,
196
                CMP_ZPX = 8'hD5,
197
                CMP_ABS = 8'hCD,
198
                CMP_ABX = 8'hDD,
199
                CMP_ABY = 8'hD9,
200
                CMP_IDX = 8'hC1,
201
                CMP_IDY = 8'hD1;
202
 
203
localparam      CPX_IMM = 8'hE0,
204
                CPX_ZPG = 8'hE4,
205
                CPX_ABS = 8'hEC;
206
 
207
localparam      CPY_IMM = 8'hC0,
208
                CPY_ZPG = 8'hC4,
209
                CPY_ABS = 8'hCC;
210
 
211
localparam      DEC_ZPG = 8'hC6,
212
                DEC_ZPX = 8'hD6,
213
                DEC_ABS = 8'hCE,
214
                DEC_ABX = 8'hDE;
215
 
216
localparam      DEX_IMP = 8'hCA;
217
 
218
localparam      DEY_IMP = 8'h88;
219
 
220
localparam      EOR_IMM = 8'h49,
221
                EOR_ZPG = 8'h45,
222
                EOR_ZPX = 8'h55,
223
                EOR_ABS = 8'h4D,
224
                EOR_ABX = 8'h5D,
225
                EOR_ABY = 8'h59,
226
                EOR_IDX = 8'h41,
227
                EOR_IDY = 8'h51;
228
 
229
localparam      INC_ZPG = 8'hE6,
230
                INC_ZPX = 8'hF6,
231
                INC_ABS = 8'hEE,
232
                INC_ABX = 8'hFE;
233
 
234
localparam      INX_IMP = 8'hE8;
235
 
236
localparam      INY_IMP = 8'hC8;
237
 
238
localparam      JMP_ABS = 8'h4C,
239
                JMP_IND = 8'h6C;
240
 
241
localparam      JSR_ABS = 8'h20;
242
 
243
localparam      LDA_IMM = 8'hA9,
244
                LDA_ZPG = 8'hA5,
245
                LDA_ZPX = 8'hB5,
246
                LDA_ABS = 8'hAD,
247
                LDA_ABX = 8'hBD,
248
                LDA_ABY = 8'hB9,
249
                LDA_IDX = 8'hA1,
250
                LDA_IDY = 8'hB1;
251
 
252
localparam      LDX_IMM = 8'hA2,
253
                LDX_ZPG = 8'hA6,
254
                LDX_ZPY = 8'hB6,
255
                LDX_ABS = 8'hAE,
256
                LDX_ABY = 8'hBE;
257
 
258
localparam      LDY_IMM = 8'hA0,
259
                LDY_ZPG = 8'hA4,
260
                LDY_ZPX = 8'hB4,
261
                LDY_ABS = 8'hAC,
262
                LDY_ABX = 8'hBC;
263
 
264
localparam      LSR_ACC = 8'h4A,
265
                LSR_ZPG = 8'h46,
266
                LSR_ZPX = 8'h56,
267
                LSR_ABS = 8'h4E,
268
                LSR_ABX = 8'h5E;
269
 
270
localparam      NOP_IMP = 8'hEA;
271
 
272
localparam      ORA_IMM = 8'h09,
273
                ORA_ZPG = 8'h05,
274
                ORA_ZPX = 8'h15,
275
                ORA_ABS = 8'h0D,
276
                ORA_ABX = 8'h1D,
277
                ORA_ABY = 8'h19,
278
                ORA_IDX = 8'h01,
279
                ORA_IDY = 8'h11;
280
 
281
localparam      PHA_IMP = 8'h48;
282
 
283
localparam      PHP_IMP = 8'h08;
284
 
285
localparam      PLA_IMP = 8'h68;
286
 
287
localparam      PLP_IMP = 8'h28;
288
 
289
localparam      ROL_ACC = 8'h2A,
290
                ROL_ZPG = 8'h26,
291
                ROL_ZPX = 8'h36,
292
                ROL_ABS = 8'h2E,
293
                ROL_ABX = 8'h3E;
294
 
295
localparam      ROR_ACC = 8'h6A,
296
                ROR_ZPG = 8'h66,
297
                ROR_ZPX = 8'h76,
298
                ROR_ABS = 8'h6E,
299
                ROR_ABX = 8'h7E;
300
 
301
localparam      RTI_IMP = 8'h40;
302
 
303
localparam      RTS_IMP = 8'h60;
304
 
305
localparam      SBC_IMM = 8'hE9,
306
                SBC_ZPG = 8'hE5,
307
                SBC_ZPX = 8'hF5,
308
                SBC_ABS = 8'hED,
309
                SBC_ABX = 8'hFD,
310
                SBC_ABY = 8'hF9,
311
                SBC_IDX = 8'hE1,
312
                SBC_IDY = 8'hF1;
313
 
314
localparam      SEC_IMP = 8'h38;
315
 
316
localparam      SED_IMP = 8'hF8;
317
 
318
localparam      SEI_IMP = 8'h78;
319
 
320
localparam      STA_ZPG = 8'h85,
321
                STA_ZPX = 8'h95,
322
                STA_ABS = 8'h8D,
323
                STA_ABX = 8'h9D,
324
                STA_ABY = 8'h99,
325
                STA_IDX = 8'h81,
326
                STA_IDY = 8'h91;
327
 
328
localparam      STX_ZPG = 8'h86,
329
                STX_ZPY = 8'h96,
330
                STX_ABS = 8'h8E;
331
 
332
localparam      STY_ZPG = 8'h84,
333
                STY_ZPX = 8'h94,
334
                STY_ABS = 8'h8C;
335
 
336
localparam      TAX_IMP = 8'hAA;
337
 
338
localparam      TAY_IMP = 8'hA8;
339
 
340
localparam      TSX_IMP = 8'hBA;
341
 
342
localparam      TXA_IMP = 8'h8A;
343
 
344
localparam      TXS_IMP = 8'h9A;
345
 
346
localparam      TYA_IMP = 8'h98;
347
 
348
// DDT did a job on me...

powered by: WebSVN 2.1.0

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