6510 OP_Codes

Started by Baggey, October 24, 2021, 08:48:49

Previous topic - Next topic

Baggey

So,

  Here is my complete list of OpCodes for the C64 Emulator. Including UN-Documented!

  Now, The next step is to create the memory structure. So i can start Loading Rom's And check my codes with Disassembling against known Disassembly's :o

Ive cut and paste them in from my Emulator  8)

The Format is Decimal, Binary, Hex, Address mode, Operand, Discription of operation, Byte's for instruction, Tcycles taken. Note there are extra TCycles added for Page passing!

Executing:C64_Emulator.exe

6510 OPcodes

000  00000000  00  IMP  BRK            Force Break                                       1 Byte  7 Tstates
001  00000001  01  IDX  ORA            Or Memory with Accumulator                        2 Byte  6 Tstates
002  00000010  02  IMP  KIL            Frezze the CPU                                    1 Byte  1 Tstates
003  00000011  03  IDX  SLO            ASL oper + ORA oper                               2 Byte  8 Tstates
004  00000100  04  ZPG  NOP            Do Nothing                                        2 Byte  3 Tstates
005  00000101  05  ZPG  ORA            OR Memory with Accumulator                        2 Byte  3 Tstates
006  00000110  06  ZPG  ASL            Shift one Bit (Memory or Accumulator)             2 Byte  5 Tstates
007  00000111  07  ZPG  SLO            ASL oper + ORA oper                               2 Byte  5 Tstates
008  00001000  08  IMP  PHP            Push Processor Status on Stack                    1 Byte  3 Tstates
009  00001001  09  IMM  ORA            Or Memory with Accumulator                        2 Byte  2 Tstates
010  00001010  0A  IMP  ALS            Shift Left One Bit (Memory or Accumulator)        1 Byte  2 Tstates
011  00001011  0B  IMM  ANC            AND oper + set C as ROL                           2 Byte  2 Tstates
012  00001100  0C  ABS  NOP            Do Nothing                                        3 Byte  4 Tstates
013  00001101  0D  ABS  ORA            Or Memory with Accumulator                        3 Byte  4 Tstates
014  00001110  0E  ABS  ASL            Shift Left One Bit (Memory or Accumulator)        3 Byte  6 Tstates
015  00001111  0F  ABS  SLO            ASL oper + ORA oper                               3 Byte  6 Tstates
016  00010000  10  REL  BPL            Branch on Result Positive                         2 Byte  2 Tstates
017  00010001  11  IDY  ORA            Or Memory with Accumulator                        2 Byte  5 Tstates
018  00010010  12  IMP  KIL            Frezze the CPU                                    0 Byte  1 Tstates
019  00010011  13  IDY  SLO            ASL oper + ORA oper                               2 Byte  8 Tstates
020  00010100  14  ZPX  NOP            Do Nothing                                        2 Byte  4 Tstates
021  00010101  15  ZPX  ORA            Or Memory with Accumulator                        2 Byte  4 Tstates
022  00010110  16  ZPX  ASL            Shift Left One Bit (Memory or Accumulator)        2 Byte  6 Tstates
023  00010111  17  ZPX  SLO            ASL oper + ORA oper                               2 Byte  6 Tstates
024  00011000  18  IMP  CLC            Clear Carry Flag                                  1 Byte  2 Tstates
025  00011001  19  ABY  ORA            Or Memory with Accumulator                        3 Byte  4 Tstates
026  00011010  1A  IMP  NOP            Do Nothing                                        1 Byte  2 Tstates
027  00011011  1B  ABY  SLO            ASL oper + ORA oper                               3 Byte  7 Tstates
028  00011100  1C  ABX  NOP            Do Nothing                                        3 Byte  4 Tstates
029  00011101  1D  ABX  ORA            OR Memory with Accumulator                        3 Byte  4 Tstates
030  00011110  1E  ABX  ASL            Shift Left One Bit (Memory or Accumulator)        3 Byte  7 Tstates
031  00011111  1F  ABX  SLO            ASL oper + ORA oper                               3 Byte  7 Tstates
032  00100000  20  ABS  JSR            Jump to New Location Saving Return Address        3 Byte  6 Tstates
033  00100001  21  IDX  AND            AND Memory with Accumulator                       2 Byte  6 Tstates
034  00100010  22  IMP  KIL            Frezze the CPU                                    0 Byte  1 Tstates
035  00100011  23  IDX  RLA            ROL oper + AND oper                               2 Byte  8 Tstates
036  00100100  24  ZPG  BIT            Test Bits in Memory with Accumulator              2 Byte  3 Tstates
037  00100101  25  ZPG  AND            AND Memory with Accumulator                       2 Byte  3 Tstates
038  00100110  26  ZPG  ROL            Rotate One Bit Left (Memory or Accumulator)       2 Byte  5 Tstates
039  00100111  27  ZPG  RLA            ROL oper + AND oper                               2 Byte  5 Tstates
040  00101000  28  IMP  PLP            Pull Processor Status from Stack                  1 Byte  4 Tstates
041  00101001  29  IMM  AND            AND Memory with Accumulator                       2 Byte  2 Tstates
042  00101010  2A  IMP  ROL            Rotate One Bit Left (Memory or Accumulator)       1 Byte  2 Tstates
043  00101011  2B  IMM  ANC            AND oper + set C as ASL                           2 Byte  2 Tstates
044  00101100  2C  ABS  BIT            Test Bits in Memory with Accumulator              3 Byte  4 Tstates
045  00101101  2D  ABS  AND            AND Memory with Accumulator                       3 Byte  4 Tstates
046  00101110  2E  ABS  ROL            Rotate One Bit Left (Memory or Accumulator)       3 Byte  6 Tstates
047  00101111  2F  ABS  RLA            ROL oper + AND oper                               3 Byte  6 Tstates
048  00110000  30  REL  BMI            Branch on Result Minus                            2 Byte  2 Tstates
049  00110001  31  IDY  AND            AND Memory with Accumulator                       2 Byte  5 Tstates
050  00110010  32  IMP  KIL            Frezze the CPU                                    0 Byte  1 Tstates
051  00110011  33  IDY  RLA            ROL oper + AND oper                               2 Byte  8 Tstates
052  00110100  34  ZPX  NOP            Do Nothing                                        2 Byte  4 Tstates
053  00110101  35  ZPX  AND            AND Memory with Accumulator                       2 Byte  4 Tstates
054  00110110  36  ZPX  ROL            Rotate One Bit Left (Memory Or Accumulator)       2 Byte  6 Tstates
055  00110111  37  ZPX  RLA            ROL oper + AND oper                               3 Byte  6 Tstates
056  00111000  38  IMP  SEC            Set Carry Flag                                    1 Byte  2 Tstates
057  00111001  39  ABY  AND            AND Memory with Accumulator                       3 Byte  4 Tstates
058  00111010  3A  IMP  NOP            Do Nothing                                        1 Byte  2 Tstates
059  00111011  3B  ABY  RLA            ROL oper + AND oper                               3 Byte  7 Tstates
060  00111100  3C  ABX  NOP            UnKnown                                           3 Byte  4 Tstates
061  00111101  3D  ABX  AND            AND Memory with Accumulator                       3 Byte  4 Tstates
062  00111110  3E  ABX  ROL            Rotate One Bit Left (Memory or Accumulator)       3 Byte  7 Tstates
063  00111111  3F  ABX  RLA            ROL oper + AND oper                               3 Byte  7 Tstates
064  01000000  40  IMP  RTI            Return from Interrupt                             1 Byte  6 Tstates
065  01000001  41  IDX  EOR            Exclusive-OR Memory with Accumulator              2 Byte  6 Tstates
066  01000010  42  IMP  KIL            Frezze the CPU                                    0 Byte  1 Tstates
067  01000011  43  IDX  SRE            LSR oper + EOR oper                               2 Byte  8 Tstates
068  01000100  44  ZPG  NOP            Do Nothing                                        2 Byte  3 Tstates
069  01000101  45  ZPG  EOR            Exclusive-OR Memory with Accumulator              2 Byte  3 Tstates
070  01000110  46  ZPG  LSR            Shift One Bit Right (Memory or Accumulator)       2 Byte  5 Tstates
071  01000111  47  ZPO  SRE            LSR oper + EOR oper                               2 Byte  5 Tstates
072  01001000  48  IMP  PHA            Push Accumulator on Stack                         1 Byte  3 Tstates
073  01001001  49  IMM  EOR            Exclusive-OR Memory with Accumulator              2 Byte  2 Tstates
074  01001010  4A  IMP  LSR            Shift One Bit Right (Memory or Accumulator)       1 Byte  2 Tstates
075  01001011  4B  IMM  ALR            AND oper + LSR                                    2 Byte  2 Tstates
076  01001100  4C  ABS  JMP            Jump to New Location                              3 Byte  3 Tstates
077  01001101  4D  ABS  EOR            Exclusive-OR Memory with Accumulator              3 Byte  4 Tstates
078  01001110  4E  ABS  LSR            Shift One Bit Right (Memory or Accumulator)       3 Byte  6 Tstates
079  01001111  4F  ABS  SRE            LSR oper + EOR oper                               3 Byte  6 Tstates
080  01010000  50  REL  BVC            Branch on Overflow Clear                          2 Byte  2 Tstates
081  01010001  51  IDY  EOR            Exclusive-OR Memory with Accumulator              2 Byte  5 Tstates
082  01010010  52  IMP  KIL            Frezze the CPU                                    0 Byte  1 Tstates
083  01010011  53  IDY  SRE            LSR oper + EOR oper                               2 Byte  8 Tstates
084  01010100  54  ZPX  NOP            Do Nothing                                        2 Byte  4 Tstates
085  01010101  55  ZPX  EOR            Exclusive-OR Memory with Accumulator              2 Byte  4 Tstates
086  01010110  56  ZPX  LSR            Shift One Bit Right (Memory or Accumulator)       2 Byte  6 Tstates
087  01010111  57  ZPX  SRE            LSR oper + EOR oper                               2 Byte  6 Tstates
088  01011000  58  IMP  CLI            Clear Interrupt Disable Bit                       1 Byte  2 Tstates
089  01011001  59  ABY  EOR            Exclusive-OR Memory with Accumulator              3 Byte  4 Tstates
090  01011010  5A  IMP  NOP            Do Nothing                                        1 Byte  2 Tstates
091  01011011  5B  ABY  SRE            LSR oper + EOR oper                               3 Byte  7 Tstates
092  01011100  5C  ABX  NOP            Do Nothing                                        3 Byte  4 Tstates
093  01011101  5D  ABX  EOR            Exclusive-OR Memory with Accumulator              3 Byte  4 Tstates
094  01011110  5E  ABX  LSR            Shift One Bit Right (Memory or Accumulator)       3 Byte  7 Tstates
095  01011111  5F  ABX  SRE            LSR oper + EOR oper                               3 Byte  7 Tstates
096  01100000  60  IMP  RTS            Return from Subroutine                            1 Byte  6 Tstates
097  01100001  61  IDX  ADC            Add Memory to Accumulator with Carry              2 Byte  6 Tstates
098  01100010  62  UNK  KIL            Frezze the CPU                                    0 Byte  1 Tstates
099  01100011  63  ADX  RRA            ROR oper + ADC oper                               2 Byte  8 Tstates
100  01100100  64  ZPG  NOP            Do Nothing                                        2 Byte  3 Tstates
101  01100101  65  ZPO  ADC            Add Memory to Accumulator with Carry              2 Byte  3 Tstates
102  01100110  66  ZPG  ROR            Rotate One Bit Right (Memory or Accumulator)      2 Byte  5 Tstates
103  01100111  67  ZPG  RRA            ROR oper + ADC oper                               2 Byte  5 Tstates
104  01101000  68  IMP  PLA            Pull Accumulator from Stack                       1 Byte  4 Tstates
105  01101001  69  IMM  ADC            Add Memory to Accumulator with Carry              2 Byte  2 Tstates
106  01101010  6A  IMP  ROR            Rotate One Bit Right (Memory or Accumulator)      1 Byte  2 Tstates
107  01101011  6B  IMM  ARR            AND oper + ROR                                    2 Byte  2 Tstates
108  01101100  6C  IND  JMP            Jump to New Location                              3 Byte  3 Tstates
109  01101101  6D  ABS  ADC            Add Memory to Accumulator with Carry              3 Byte  4 Tstates
110  01101110  6E  ABS  ROR            Rotate One Bit Right (Memory or Accumulator)      3 Byte  6 Tstates
111  01101111  6F  ABS  RRA            ROR oper + ADC oper                               3 Byte  6 Tstates
112  01110000  70  REL  BVS            Branch on Overflow Set                            2 Byte  2 Tstates
113  01110001  71  IDY  ADC            Add Memory to Accumulator with Carry              2 Byte  5 Tstates
114  01110010  72  IMP  KIL            Frezze the CPU                                    0 Byte  1 Tstates
115  01110011  73  ABY  RRA            ROR oper + ADC oper                               2 Byte  8 Tstates
116  01110100  74  ZPX  NOP            Do Nothing                                        2 Byte  4 Tstates
117  01110101  75  ZPX  ADC            Add Memory to Accumulator with Carry              2 Byte  4 Tstates
118  01110110  76  ZPX  ROR            Rotate One Bit Right (Memory or Accumulator)      2 Byte  6 Tstates
119  01110111  77  ZPX  RRA            ROR oper + ADC oper                               2 Byte  6 Tstates
120  01111000  78  IMP  SEI            Set Interrupt Disable Status                      1 Byte  2 Tstates
121  01111001  79  ABY  ADC            Add Memory to Accumulator with Carry              3 Byte  4 Tstates
122  01111010  7A  IMP  NOP            Do Nothing                                        1 Byte  2 Tstates
123  01111011  7B  ABY  RRA            ROR oper + ADC oper                               3 Byte  7 Tstates
124  01111100  7C  ABX  NOP            Do Nothing                                        0 Byte  4 Tstates
125  01111101  7D  ABX  ADC            Add Memory to Accumulator with Carry              3 Byte  4 Tstates
126  01111110  7E  ABX  ROR            Rotate One Bit Right (Memory or Accumulator)      3 Byte  7 Tstates
127  01111111  7F  ABX  RRA            ROR oper + ADC oper                               3 Byte  7 Tstates
128  10000000  80  IMM  NOP            Do Nothing                                        2 Byte  2 Tstates
129  10000001  81  IDX  STA            Store Accumulator in Memory                       2 Byte  6 Tstates
130  10000010  82  IMM  NOP            Do Nothing                                        2 Byte  2 Tstates
131  10000011  83  IDX  SAX            A and X are put on the bus at the same time (resul2 Byte  6 Tstates
132  10000100  84  ZPG  STY            Store Index Y in Memory                           2 Byte  3 Tstates
133  10000101  85  ZPG  STA            Store Accumulator in Memory                       2 Byte  3 Tstates
134  10000110  86  ZPG  STX            Store Index X in Memory                           2 Byte  3 Tstates
135  10000111  87  ZPG  SAX            A and X are put on the bus at the same time (resul2 Byte  3 Tstates
136  10001000  88  IMP  DEY            Decrement Index Y by One                          1 Byte  2 Tstates
137  10001001  89  IMM  NOP            Do Nothing                                        2 Byte  2 Tstates
138  10001010  8A  IMP  TXA            Transfer Index X to Accumulator                   1 Byte  2 Tstates
139  10001011  8B  IMM  XAA            UnKnown                                           0 Byte  2 Tstates
140  10001100  8C  ABS  STY            Sore Index Y in Memory                            3 Byte  4 Tstates
141  10001101  8D  ABS  STA            Store Accumulator in Memory                       3 Byte  4 Tstates
142  10001110  8E  ABS  STX            Store Index X in Memory                           3 Byte  4 Tstates
143  10001111  8F  ABS  SAX            A and X are put on the bus at the same time (resul3 Byte  4 Tstates
144  10010000  90  REL  BCC            Branch on Carry Clear                             2 Byte  2 Tstates
145  10010001  91  IDY  STA            Store Accumulator in Memory                       2 Byte  5 Tstates
146  10010010  92  IMP  KIL            Frezze the CPU                                    0 Byte  1 Tstates
147  10010011  93  IDY  SHA            Stores A AND X AND (high-byte of addr. + 1) at add2 Byte  6 Tstates
148  10010100  94  ZPX  STY            Store Index Y in Memory                           2 Byte  4 Tstates
149  10010101  95  ZPX  STA            Store Accumulator in Memory                       2 Byte  4 Tstates
150  10010110  96  ZPY  STX            Store Index X in Memory                           2 Byte  4 Tstates
151  10010111  97  ZPY  SAX            A and X are put on the bus at the same time (resul2 Byte  4 Tstates
152  10011000  98  IMP  TYA            Transfer Index Y to Accumulator                   1 Byte  2 Tstates
153  10011001  99  ABY  STA            Store Accumulator in Memory                       3 Byte  4 Tstates
154  10011010  9A  IMP  TXS            Transfer Index X to Stack Register                1 Byte  2 Tstates
155  10011011  9B  ABY  TAS            Puts A AND X in SP and stores A AND X AND (high-by3 Byte  5 Tstates
156  10011100  9C  ABX  SHY            Stores Y AND (high-byte of addr. + 1) at addr.    3 Byte  5 Tstates
157  10011101  9D  ABX  STA            Store Accumulator in Memory                       3 Byte  4 Tstates
158  10011110  9E  ABY  SHX            Stores X AND (high-byte of addr. + 1) at addr.    3 Byte  5 Tstates
159  10011111  9F  ABY  SHA            Stores A AND X AND (high-byte of addr. + 1) at add3 Byte  5 Tstates
160  10100000  A0  IMM  LDY            Load Index Y with Memory                          2 Byte  2 Tstates
161  10100001  A1  IDX  LDA            Load Accumulator with Memory                      2 Byte  6 Tstates
162  10100010  A2  IMM  LDX            Load Index X with Memory                          2 Byte  2 Tstates
163  10100011  A3  IDX  LAX            LDA oper + LDX oper                               2 Byte  6 Tstates
164  10100100  A4  ZPG  LDY            Load Index Y with Memory                          2 Byte  3 Tstates
165  10100101  A5  ZPG  LDA            Load Accumulator with Memory                      2 Byte  3 Tstates
166  10100110  A6  ZPG  LDX            Load Index X with Memory                          2 Byte  3 Tstates
167  10100111  A7  ZPG  LAX            LDA oper + LDX oper                               2 Byte  3 Tstates
168  10101000  A8  IMP  TAY            Transfer Accumulator to Index Y                   1 Byte  2 Tstates
169  10101001  A9  IMM  LDA            Load Accumulator with Memory                      2 Byte  2 Tstates
170  10101010  AA  IMP  TAX            Transfer Accumulator to Index X                   1 Byte  2 Tstates
171  10101011  AB  IMM  LXA            Store * AND oper in A and X                       2 Byte  2 Tstates
172  10101100  AC  ABS  LDY            Load Index Y with Memory                          3 Byte  4 Tstates
173  10101101  AD  ABS  LDA            Load Accumulator with Memory                      3 Byte  4 Tstates
174  10101110  AE  ABS  LDX            Load Index X with Memory                          3 Byte  4 Tstates
175  10101111  AF  ABS  LAX            LDA oper + LDX oper                               3 Byte  4 Tstates
176  10110000  B0  REL  BCS            Branch on Carry Set                               2 Byte  2 Tstates
177  10110001  B1  IDY  LDA            Load Accumulator with Memory                      2 Byte  5 Tstates
178  10110010  B2  IMP  KIL            Frezze the CPU                                    0 Byte  1 Tstates
179  10110011  B3  IDY  LAX            LDA oper + LDX oper                               2 Byte  5 Tstates
180  10110100  B4  ZPX  LDY            Load Index Y with Memory                          2 Byte  4 Tstates
181  10110101  B5  ZPX  LDA            Load Accumulator with Memory                      2 Byte  4 Tstates
182  10110110  B6  ZPY  LDX            UnKnown                                           0 Byte  4 Tstates
183  10110111  B7  ZPY  LAX            LDA oper + LDX oper                               2 Byte  4 Tstates
184  10111000  B8  IMP  CLV            Clear Overflow Flag                               1 Byte  2 Tstates
185  10111001  B9  ABY  LDA            Load Accumulator with Memory                      3 Byte  4 Tstates
186  10111010  BA  IMP  TSX            Transfer Stack Pointer To Index X                 1 Byte  2 Tstates
187  10111011  BB  ABY  LAS            LDA/TSX oper                                      3 Byte  4 Tstates
188  10111100  BC  ABX  LDY            Load Index Y with Memory                          3 Byte  4 Tstates
189  10111101  BD  ABX  LDA            Load Accumulator with Memory                      3 Byte  4 Tstates
190  10111110  BE  ABY  LDX            Load Index X with Memory                          3 Byte  4 Tstates
191  10111111  BF  ABY  LAX            LDA oper + LDX oper                               3 Byte  4 Tstates
192  11000000  C0  IMM  CPY            Compare Memory and Index Y                        2 Byte  2 Tstates
193  11000001  C1  IDX  CMP            Compare Memory with Accumulator                   2 Byte  6 Tstates
194  11000010  C2  IMM  NOP            Do Nothing                                        2 Byte  2 Tstates
195  11000011  C3  IDX  DCP            DEC oper + CMP oper                               2 Byte  8 Tstates
196  11000100  C4  ZPG  CPY            Compare Memory and Index Y                        2 Byte  3 Tstates
197  11000101  C5  ZPG  CMP            Compare Memory with Accumulator                   2 Byte  3 Tstates
198  11000110  C6  ZPG  DEC            Decrement Memory by One                           2 Byte  5 Tstates
199  11000111  C7  ZPG  DCP            DEC oper + CMP oper                               2 Byte  5 Tstates
200  11001000  C8  IMP  INY            Increment Index Y by One                          1 Byte  2 Tstates
201  11001001  C9  IMM  CMP            Compare Memory with Accumulator                   2 Byte  2 Tstates
202  11001010  CA  IMP  DEX            Decrement Index X by One                          1 Byte  2 Tstates
203  11001011  CB  IMM  SAX            UnKnown                                           0 Byte  2 Tstates
204  11001100  CC  ABS  CPY            Compare Memory and Index Y                        3 Byte  4 Tstates
205  11001101  CD  ABS  CMP            Compare Memory with Accumulator                   3 Byte  4 Tstates
206  11001110  CE  ABS  DEC            Decrement Memory by One                           3 Byte  6 Tstates
207  11001111  CF  ABS  DCP            DEC oper + CMP oper                               3 Byte  6 Tstates
208  11010000  D0  REL  BNE            Branch on Result not Zero                         2 Byte  2 Tstates
209  11010001  D1  IDY  CMP            Compare Memory with Accumulator                   2 Byte  5 Tstates
210  11010010  D2  IMP  KIL            Frezze the CPU                                    0 Byte  1 Tstates
211  11010011  D3  IDY  DCP            DEC oper + CMP oper                               2 Byte  8 Tstates
212  11010100  D4  ZPX  NOP            Do Nothing                                        2 Byte  4 Tstates
213  11010101  D5  ZPX  CMP            Compare Memory with Accumulator                   2 Byte  4 Tstates
214  11010110  D6  ZPX  DEC            Decrement Memory by One                           2 Byte  6 Tstates
215  11010111  D7  ZPX  DCP            DEC oper + CMP oper                               2 Byte  6 Tstates
216  11011000  D8  IMP  CLD            Clear Decimal Mode                                1 Byte  2 Tstates
217  11011001  D9  ABY  CMP            Compare Memory with Accumulator                   3 Byte  4 Tstates
218  11011010  DA  IMP  NOP            Do Nothing                                        1 Byte  2 Tstates
219  11011011  DB  ABY  DCP            DEC oper + CMP oper                               3 Byte  7 Tstates
220  11011100  DC  ABX  NOP            Do Nothing                                        3 Byte  4 Tstates
221  11011101  DD  ABX  CMP            Compare Memory with Accumulator                   3 Byte  4 Tstates
222  11011110  DE  ABX  DEC            Decrement Memory by One                           3 Byte  7 Tstates
223  11011111  DF  ABX  DCP            DEC oper + CMP oper                               3 Byte  7 Tstates
224  11100000  E0  IMM  CPX            Compare Memory and Index X                        2 Byte  2 Tstates
225  11100001  E1  IDX  SBC            Subtract Memory from Accumulator with Borrow      2 Byte  6 Tstates
226  11100010  E2  IMM  NOP            Do Nothing                                        2 Byte  2 Tstates
227  11100011  E3  IDX  ISC            INC oper + SBC oper                               2 Byte  8 Tstates
228  11100100  E4  IDX  CPX            Compare Memory and Index X                        2 Byte  3 Tstates
229  11100101  E5  ZPG  SBC            Subtract Memory from Accumulator with Borrow      2 Byte  3 Tstates
230  11100110  E6  ZPG  INC            Increment Memory by One                           2 Byte  5 Tstates
231  11100111  E7  ZPO  ISC            INC oper + SBC oper                               2 Byte  5 Tstates
232  11101000  E8  IMP  INX            Increment Index X by One                          1 Byte  2 Tstates
233  11101001  E9  IMM  SBC            Subtract Memory from Accumulator with Borrow      2 Byte  2 Tstates
234  11101010  EA  IMP  NOP            Do Nothing                                        1 Byte  2 Tstates
235  11101011  EB  IMM  SBC            SBC oper + NOP                                    2 Byte  2 Tstates
236  11101100  EC  ABS  CPX            Compare Memory and Index X                        3 Byte  4 Tstates
237  11101101  ED  ABS  SBC            Subtract Memory from Accumulator with Borrow      3 Byte  4 Tstates
238  11101110  EE  ABS  INC            Increment Memory by One                           3 Byte  6 Tstates
239  11101111  EF  ABS  ISC            INC oper + SBC oper                               3 Byte  6 Tstates
240  11110000  F0  REL  BEQ            Branch on Result Zero                             2 Byte  2 Tstates
241  11110001  F1  IDY  SBC            Subtract Memory from Accumulator with Borrow      2 Byte  5 Tstates
242  11110010  F2  IMP  KIL            Frezze the CPU                                    0 Byte  1 Tstates
243  11110011  F3  IDY  ISC            INC oper + SBC oper                               2 Byte  4 Tstates
244  11110100  F4  ZPX  NOP            Do Nothing                                        2 Byte  4 Tstates
245  11110101  F5  ZPX  SBC            Subtract Memory from Accumulator with Borrow      2 Byte  4 Tstates
246  11110110  F6  ZPX  INC            Increment Memory by One                           2 Byte  6 Tstates
247  11110111  F7  ZPX  ISC            INC oper + SBC oper                               2 Byte  6 Tstates
248  11111000  F8  IMP  SED            Set Decimal Flag                                  1 Byte  2 Tstates
249  11111001  F9  ABY  SBC            Subtract Memory from Accumulator with Borrow      3 Byte  0 Tstates
250  11111010  FA  IMP  NOP            Do Nothing                                        1 Byte  2 Tstates
251  11111011  FB  ABY  ISC            INC oper + SBC oper                               3 Byte  7 Tstates
252  11111100  FC  ABX  NOP            Do Nothing                                        3 Byte  4 Tstates
253  11111101  FD  ABX  SBC            Subtract Memory from Accumulator with Borrow      3 Byte  4 Tstates
254  11111110  FE  ABX  INC            Increment Memory by One                           3 Byte  7 Tstates
255  11111111  FF  ABX  ISC            INC oper + SBC oper                               3 Byte  7 Tstates

Process complete


Kind Regards Baggey
Running a PC that just Aint fast enough!? i7 Quad core 16GB ram 1TB SSD and NVIDIA Quadro K620 . DID Technology stop! Or have we been assimulated!

ZX Spectrum 48k, C64, ORIC Atmos 48K, Enterprise 128K, The SID chip. Im Misunderstood!

Xerra

I think that, if you're going to make a C64 emulator, then you should definitely implement a clear distinction between the use of official and undocumented op-codes. As I recall, while most coders were probably aware that these - what they called - illegal op-codes existed, they didn't usually use them in software for sale. Mostly because they weren't documented so they only worked out by trial and error what they did, and they could never be certain there weren't other issues that they didn't notice, because their code worked ok. Things like minor variations in the hardware of some machines might mean something that worked on one C64 might not work on a newer/older model perhaps. A disaster if you're selling a game and can't confirm compatibility for your buyers.

Also, you have to expect that some of these op-codes might not have made the list and got documented either because of lack of time when documenting the hardware, or perhaps they had known bugs/issues so C= didn't want people to use them.

Obviously, in modern times, the machine has been thoroughly covered and you can just google for the ones that are ok to use, and Demo coders have been using them for decades now. But still a configuration setting giving users the option to allow or disallow their use when compiling is never a bad idea.
M2 Pro Mac mini - 16GB 512 SSD
ACER Nitro 5 15.6" Gaming Laptop - Intel® Core™ i7, RTX 3050, 1 TB SSD
Vic 20 - 3.5k 1mhz 6502

Latest game - https://xerra.itch.io/Gridrunner
Blog: http://xerra.co.uk
Itch.IO: https://xerra.itch.io/

Baggey

Quote from: Xerra on October 24, 2021, 11:12:46
But still a configuration setting giving users the option to allow or disallow their use when compiling is never a bad idea.

This is an option to eaisily implement Ive set up the Opcodes with a Field OPcode_Illegal=1 so i can make this an option! 8)

Kind Regards Baggey
Running a PC that just Aint fast enough!? i7 Quad core 16GB ram 1TB SSD and NVIDIA Quadro K620 . DID Technology stop! Or have we been assimulated!

ZX Spectrum 48k, C64, ORIC Atmos 48K, Enterprise 128K, The SID chip. Im Misunderstood!

Baggey

#3
Been Battleing through the C6510 Menomics and upcodes.  :))

The Addressing modes invention was a load of old cobblers  >:D You could rip all this information out of current day literature and throw it away! I think they overcomplicated something that could of been much simpler! By this time you've forgotten what the instruction is oh and how many bytes do i need to code it? :-[

For instance i have this instruction CMP (Indirect),y To even understand it. You need to find out how many Bytes relate to the type of addressing? You have to Read a load of rubbish on ADDRESS mode's and fathem out what indirect is! Why there even talked about beggers believe!

What it actually means is CMP A,(n+y) it's a 2 Byte instruction, with 5 or 6 TCycles, CODE to use this instruction, D1,n

Compare the A Register's Contents with Address contents given by (n+Y) Thats it!

Two other thing's to Know. Page or Boundary crossing, In a Nut shell.

If n+y is greater than 255 we have a Page Cross ADD 1 TCycle.
ie, the byte would wraparound passed 255 starting at 0 and going up again!

Flags Affected Negative, Zero and Carry' That really is it!

Which dosent talk about modes at all! Currently re-writting the C6510/C6502 op-code's. Im going to end up with The C6502/C6510 For DUMMIES ::)  I may post this list when done?

It means Compare the contents of the A Register with the contents of Memory location (x + Y Register). Im growing Fond of the C6510 because there are only 252 instructions to learn Almost half of these are UnDocumented! as well and dont get used anyway!
Running a PC that just Aint fast enough!? i7 Quad core 16GB ram 1TB SSD and NVIDIA Quadro K620 . DID Technology stop! Or have we been assimulated!

ZX Spectrum 48k, C64, ORIC Atmos 48K, Enterprise 128K, The SID chip. Im Misunderstood!

Xerra

CMP is just to compare the accumulator against a direct number, or a number stored at a certain location. It runs in conjunction usually with a branch instruction, such as BEQ, short for branch if equal. Kind of like how basic would work with an If/Then condition, if you like.

It's not something like CMP A because CMP itself means compare against the accumulator, rather than using something more logical like CPA. The operations to compare either X or Y against another field are CPX and CPY after all.

Sounds like you just want something that tells you how many screen cycles each command takes so you can work out how much code you can execute within a single screen refresh, but it's not quite as simple as that because you might be comparing to a single number #255, which would probably only take 2 cycles, whereas, if you were comparing to the number within an address then you might find the cycles increases as a result.
M2 Pro Mac mini - 16GB 512 SSD
ACER Nitro 5 15.6" Gaming Laptop - Intel® Core™ i7, RTX 3050, 1 TB SSD
Vic 20 - 3.5k 1mhz 6502

Latest game - https://xerra.itch.io/Gridrunner
Blog: http://xerra.co.uk
Itch.IO: https://xerra.itch.io/

Baggey

#5
Quote from: Xerra on November 21, 2021, 14:39:15
CMP is just to compare the accumulator against a direct number, or a number stored at a certain location. It runs in conjunction usually with a branch instruction, such as BEQ, short for branch if equal. Kind of like how basic would work with an If/Then condition, if you like.

It's not something like CMP A because CMP itself means compare against the accumulator, rather than using something more logical like CPA. The operations to compare either X or Y against another field are CPX and CPY after all.

Sounds like you just want something that tells you how many screen cycles each command takes so you can work out how much code you can execute within a single screen refresh, but it's not quite as simple as that because you might be comparing to a single number #255, which would probably only take 2 cycles, whereas, if you were comparing to the number within an address then you might find the cycles increases as a result.

I was thinking of going down the route of CMP A, CMP X, CMP Y short for Compare! But just as Eaisily CP A, CP X or CP Y I see your point But the notation of getting away from Address modes would help beginners.  ::)

Kind Regards Baggey
Running a PC that just Aint fast enough!? i7 Quad core 16GB ram 1TB SSD and NVIDIA Quadro K620 . DID Technology stop! Or have we been assimulated!

ZX Spectrum 48k, C64, ORIC Atmos 48K, Enterprise 128K, The SID chip. Im Misunderstood!