home *** CD-ROM | disk | FTP | other *** search
/ messroms.de / 2007-01-13_www.messroms.de.zip / CPU / 65C02 < prev    next >
Text File  |  2007-01-13  |  16KB  |  241 lines

  1. ----------------------------------------------------------------
  2. |                                                              |
  3. |                                                              |
  4. |                           Rockwell                           |
  5. |                                                              |
  6. |         666     5555555     CCCC      000      22222         |
  7. |        6        5          C    C    0   0    2     2        |
  8. |       6         5         C         0   0 0        2         |
  9. |       666666    555555    C         0  0  0     222          |
  10. |       6     6         5   C         0 0   0    2             |
  11. |       6     6         5    C    C    0   0    2              |
  12. |        66666    555555      CCCC      000     2222222        |
  13. |                                                              |
  14. |      65C02 CMOS MICROPROCESSOR Instruction Set Summary       |
  15. |                                                              |
  16. |                                                              |
  17. |                                                              |
  18. |                                                              |
  19. |                                                              |
  20. |                    _________    _________                    |
  21. |                  _|         \__/         |_  ___             |
  22. |             Vss |_|1                   40|_| RES <--         |
  23. |                  _|                      |_                  |
  24. |         --> RDY |_|2                   39|_| CLK2 -->        |
  25. |                  _|                      |_                  |
  26. |        <-- CLK1 |_|3                   38|_| NC              |
  27. |             ___  _|                      |_                  |
  28. |         --> IRQ |_|4                   37|_| CLK0 <--        |
  29. |                  _|                      |_                  |
  30. |              NC |_|5                   36|_| NC              |
  31. |             ___  _|                      |_                  |
  32. |         --> NMI |_|6                   35|_| NC              |
  33. |                  _|                      |_    _             |
  34. |        --> SYNC |_|7                   34|_| R/W -->         |
  35. |                  _|                      |_                  |
  36. |             Vcc |_|8                   33|_| DB7 <-->        |
  37. |                  _|                      |_                  |
  38. |          <-- A0 |_|9                   32|_| DB6 <-->        |
  39. |                  _|                      |_                  |
  40. |          <-- A1 |_|10      65C02       31|_| DB5 <-->        |
  41. |                  _|                      |_                  |
  42. |          <-- A2 |_|11                  30|_| DB4 <-->        |
  43. |                  _|                      |_                  |
  44. |          <-- A3 |_|12                  29|_| DB3 <-->        |
  45. |                  _|                      |_                  |
  46. |          <-- A4 |_|13                  28|_| DB2 <-->        |
  47. |                  _|                      |_                  |
  48. |          <-- A5 |_|14                  27|_| DB1 <-->        |
  49. |                  _|                      |_                  |
  50. |          <-- A6 |_|15                  26|_| DB0 <-->        |
  51. |                  _|                      |_                  |
  52. |          <-- A7 |_|16                  25|_| A15 -->         |
  53. |                  _|                      |_                  |
  54. |          <-- A8 |_|17                  24|_| A14 -->         |
  55. |                  _|                      |_                  |
  56. |          <-- A9 |_|18                  23|_| A13 -->         |
  57. |                  _|                      |_                  |
  58. |         <-- A10 |_|19                  22|_| A12 -->         |
  59. |                  _|                      |_                  |
  60. |         <-- A11 |_|20                  21|_| Vss             |
  61. |                   |______________________|                   |
  62. |                                                              |
  63. |                                                              |
  64. |                                                              |
  65. |                                                              |
  66. |                                                              |
  67. |                                                              |
  68. |Written by     Jonathan Bowen                                 |
  69. |               Programming Research Group                     |
  70. |               Oxford University Computing Laboratory         |
  71. |               8-11 Keble Road                                |
  72. |               Oxford OX1 3QD                                 |
  73. |               England                                        |
  74. |                                                              |
  75. |               Tel +44-865-273840                             |
  76. |                                                              |
  77. |Created        November 1984                                  |
  78. |Updated        April 1985                                     |
  79. |Issue          1.1                Copyright (C) J.P.Bowen 1985|
  80. ----------------------------------------------------------------
  81. ----------------------------------------------------------------
  82. |Mnem. |Op|NVBDIZC|A#ZBIRX@|~|Description          |Notes      |
  83. |------+--+-------+--------+-+---------------------+-----------|
  84. |ADC  s|6D|**---**| XxX  XX|4|Add with Carry       |A=A+s+C   %|
  85. |AND  s|2D|*----*-| XxX  XX|4|Logical AND          |A=A&s     %|
  86. |ASL  d|0E|*----**|  xx    |6|Arith. Shift Left    |d={C,d,0}<-|
  87. |ASLA  |0A|*----**|X       |2|Arith. Shift Left    |A={C,d,0}<-|
  88. |BBRb z|0F|-------|  *  X  |2|Branch if Bit Reset  |If s<b>=0  |
  89. |BBSb z|8F|-------|  *  X  |2|Branch if Bit Set    |If s<b>=1  |
  90. |BCC  a|90|-------|     X  |2|Branch if Carry Clear|If C=0(4~)%|
  91. |BCS  a|B0|-------|     X  |2|Branch if Carry Set  |If C=1(4~)%|
  92. |BEQ  a|F0|-------|     X  |2|Branch if Equal      |If Z=1(4~)%|
  93. |BIT  s|2C|**---*-| Xxx    |4|Bit Test             |A&s       $|
  94. |BMI  a|30|-------|     X  |2|Branch if Minus      |If N=1(4~)%|
  95. |BNE  a|D0|-------|     X  |2|Branch if Not Equal  |If Z=0(4~)%|
  96. |BPL  a|10|-------|     X  |2|Branch if Plus       |If N=0(4~)%|
  97. |BRA  a|80|-------|     X  |2|Branch Always        |PC=a  (4~)%|
  98. |BRK   |00|--+-1--|    X   |7|Break(-[S]={PC+2,P}) |PC=[FFFEH] |
  99. |BVC  a|50|-------|     X  |2|Branch if Overflw Clr|If V=0(4~)%|
  100. |BVS  a|70|-------|     X  |2|Branch if Overflw Set|If V=1(4~)%|
  101. |CLC   |18|------0|    X   |2|Clear Carry flag     |C=0        |
  102. |CLD   |D8|---0---|    X   |2|Clear Decimal mode   |D=0        |
  103. |CLI   |58|----0--|    X   |2|Clear Int. disable   |I=0        |
  104. |CLV   |B8|-0-----|    X   |2|Clear Overflow flag  |V=0        |
  105. |CMP  s|CD|*----**| XxX  XX|4|Compare              |A-s        |
  106. |CPX  s|EC|*----**| X**    |4|Compare index reg.   |X-s        |
  107. |CPY  s|CC|*----**| X**    |4|Compare index reg.   |Y-s        |
  108. |DEC  d|CE|*----*-|  xx    |6|Decrement            |d=d-1      |
  109. |DECA  |3A|*----*-|X       |6|Decrement Acc.       |A=A-1      |
  110. |DEX   |CA|*----*-|    X   |2|Decrement index reg. |X=X-1      |
  111. |DEY   |88|*----*-|    X   |2|Decrement index reg. |Y=Y-1      |
  112. |EOR  s|4D|*----*-| XxX  XX|4|Logical Exclusive OR |A=Axs     %|
  113. |INC  d|EE|*----*-|  xx    |6|Increment            |d=d+1      |
  114. |INCA  |1A|*----*-|X       |6|Increment Acc.       |A=A+1      |
  115. |INX   |E8|*----*-|    X   |2|Increment index reg. |X=X+1      |
  116. |INY   |C8|*----*-|    X   |2|Increment index reg. |Y=Y+1      |
  117. |JMP  s|4C|-------|   *   X|3|Jump                 |PC=s      $|
  118. |JSR  s|20|-------|   *    |6|Jump to Subroutine   |-[S]=PC+2=s|
  119. |LDA  s|AD|*----*-| XxX  XX|4|Load Accumulator     |A=s       %|
  120. |LDX  s|AE|*----*-| Xyy    |4|Load index register  |X=s      $%|
  121. |LDY  s|AC|*----*-| Xxx    |4|Load index register  |Y=s       %|
  122. |LSR  d|4E|0----**|  xx    |6|Logical Shift Right  |d=->{0,d,C}|
  123. |LSRA  |4A|0----**|X       |2|Logical Shift Right  |A=->{0,A,C}|
  124. |NOP   |EA|-------|    X   |2|No Operation         |           |
  125. |ORA  s|0D|*----*-| XxX  XX|4|Logical Inclusive OR |A=Avs      |
  126. |PHA   |48|-------|    X   |3|Push Accumulator     |-[S]=A     |
  127. |PHP   |08|-------|    X   |3|Push status register |-[S]=P     |
  128. |PHX   |DA|-------|    X   |2|Push index register  |-[S]=X     |
  129. |PHY   |5A|-------|    X   |2|Push index register  |-[S]=Y     |
  130. |PLA   |68|-------|    X   |4|Pull Accumulator     |A=[S]+     |
  131. |PLP   |28|*******|    X   |4|Pull status register |P=[S]+     |
  132. |PLX   |FA|-------|    X   |2|Pull index register  |X=[S]+     |
  133. |PLY   |7A|-------|    X   |2|Pull index register  |Y=[S]+     |
  134. |RMBb d|07|-------|  *     |5|Reset Memory Bit     |d<b>=0     |
  135. |ROL  d|2E|*----**|  xx    |6|Rotate Left          |d={C,d}<-  |
  136. |ROLA  |2A|*----**|X       |2|Rotate Left Acc.     |A={C,A}<-  |
  137. |ROR  d|6E|*----**|  xx    |6|Rotate Right         |d=->{C,d}  |
  138. |RORA  |6A|*----**|X       |2|Rotate Right Acc.    |A=->{C,A}  |
  139. |RTI   |40|*******|    X   |6|Return from Interrupt|{PC,P}=[S]+|
  140. |RTS   |60|-------|    X   |6|Return from Subr.    |PC={[S]+}+1|
  141. |SBC  s|ED|*----**| XxX  XX|4|Subtract with Carry  |A=A-s-C   %|
  142. |SEC   |38|------1|    X   |2|Set Carry flag       |C=1        |
  143. |SED   |F8|---1---|    X   |2|Set Decimal mode     |D=1        |
  144. |SEI   |78|----1--|    X   |2|Set Interrupt disable|I=1        |
  145. |SMBb d|87|-------|  *     |5|Set Memory Bit       |d<b>=1     |
  146. |STA  d|8D|-------|  xX  XX|4|Store Accumulator    |d=A        |
  147. |STX  d|8E|-------|  y*    |4|Store index register |d=X        |
  148. |STY  d|8C|-------|  x*    |4|Store index register |d=Y        |
  149. |STZ  d|9C|-------|  xx    |4|Store Zero           |d=0       $|
  150. |TAX   |AA|*----*-|    X   |2|Transfer Accumulator |X=A        |
  151. |TAY   |A8|*----*-|    X   |2|Transfer Accumulator |Y=A        |
  152. |TRB  d|1C|**---*-|  **    |2|Test and Reset Bits  |d=~A&d     |
  153. |TSB  d|0C|**---*-|  **    |2|Test and Set Bits    |d=Avd      |
  154. |TSX   |BA|*----*-|    X   |2|Transfer Stack ptr   |X=S        |
  155. |TXA   |8A|*----*-|    X   |2|Transfer index reg.  |A=X        |
  156. |TXS   |9A|-------|    X   |2|Transfer index reg.  |S=X        |
  157. |TYA   |98|*----*-|    X   |2|Transfer index reg.  |A=Y        |
  158. |------+--+-------+--------+-+---------------------------------|
  159. |      |XX|       |        |X|Hexadecimal opcode/no. of cycles |
  160. ----------------------------------------------------------------
  161. ----------------------------------------------------------------
  162. |Mnemonic |NVBDIZC|A#ZBIRX@|Description                        |
  163. |---------+-------+--------+-----------------------------------|
  164. | P       |-*01+  |        |Unaff/affected/reset/set/stack set |
  165. | N       |N      |        |Negative status (Bit 7)            |
  166. | V       | V     |        |Overflow status (Bit 6)            |
  167. | B       |  B    |        |Break command indicator (Bit 4)    |
  168. | D       |   D   |        |Decimal mode control (Bit 3)       |
  169. | I       |    I  |        |Interrupt disable control (Bit 2)  |
  170. | Z       |     Z |        |Zero status (Bit 1)                |
  171. | C       |      C|        |Carry status (Bit 0)               |
  172. |------------------+--------+----------------------------------|
  173. |                 |*       |Only non-indexed mode valid        |
  174. |                 |x       |X and non-indexed mode valid       |
  175. |                 |y       |Y and non-indexed mode valid       |
  176. |                 |X       |All modes valid                    |
  177. |-----------------+--------+-----------------------------------|
  178. |                 |        |Add XXH to opcode          |+XXH|  |
  179. |                 |        |Subtract XXH from opcode   |-XXH|  |
  180. |                 |        |Add X to number of cycles  |    |+X|
  181. |                 |        |Subtract X from cycles     |    |-X|
  182. |-----------------+--------+---------------------------+----+--|
  183. | b               |        |Bit number (b=0-7)         |+b0H|  |
  184. | A               |A       |Accumulator                |    |  |
  185. | #n              | #      |Immediate                  |-0CH|-2|
  186. | #n              | #      | ditto (opcode = XDH)      | X9H| 2|
  187. | BIT #n          | #      | ditto (special case)      | 89H| 2|
  188. | <n              |  Z     |Zero page                  |-08H|-1|
  189. | STZ n           |  Z     | ditto (special case)      | 64H| 3|
  190. | n               |  *     |Zero page (direct mode)    |-08H|-1|
  191. | n,X             |  x     |Zero page indexed (X)      |+08H|+0|
  192. | n,Y             |  y     |Zero Page indexed (Y)      |+08H|+0|
  193. | >nn             |   B    |Absolute                   |+00H|+0|
  194. | nn              |   *    |Absolute (extended mode)   |+00H|+0|
  195. | nn,X            |   x    |Absolute indexed (X)       |+10H|+0|
  196. | nn,Y            |   y    |Absolute indexed (Y)       |+0CH|+0|
  197. | LDX nn,Y        |   y    | ditto (special case)      | BEH| 4|
  198. |                 |    I   |Implicit                   |    |  |
  199. | a               |     R  |Relative (PC=PC+1+offset)  |    |+2|
  200. | [nn,X]          |      x |Indexed indirect (X)       |-0CH|+2|
  201. | [nn],Y          |      y |Indirect indexed (Y)       |+04H|+1|
  202. | [nn]            |       @|Absolute indirect          |+05H|+1|
  203. | JMP [nn]        |       @| ditto (special case)      | 6CH| 5|
  204. |--------------------------+-----------------------------------|
  205. | A                        |Accumulator (8-bit)                |
  206. | P                        |Processor status register (8-bit)  |
  207. | PC                       |Program Counter (16-bit)           |
  208. | S                        |Stack pointer (9-bit, MSB=1)       |
  209. | X                        |Index register X (8-bit)           |
  210. | Y                        |Index register Y (8-bit)           |
  211. |--------------------------+-----------------------------------|
  212. | a                        |Relative address (-128 to +127)    |
  213. | b                        |Bit number (0 to 7)                |
  214. | d                        |Destination                        |
  215. | n                        |8-bit expression (0 to 255)        |
  216. | nn                       |16-bit expression (0 to 65535)     |
  217. | s                        |Source                             |
  218. | z                        |Zero page, relative address (n,a)  |
  219. |--------------------------+-----------------------------------|
  220. | +   -                    |Arithmetic addition/subtraction    |
  221. | *   /                    |Arithmetic multiplication/division |
  222. | &   ~                    |Logical AND/NOT                    |
  223. | v   x                    |Logical inclusive/exclusive OR     |
  224. | <-  ->                   |Rotate left/right                  |
  225. | [ ]                      |Indirect addressing                |
  226. | [ ]+                     |Post-increment indirect addressing |
  227. | -[ ]                     |Pre-decrement indirect addressing  |
  228. | { }                      |Combination of operands            |
  229. | < >                      |Bit number                         |
  230. | $                        |Special case for addressing mode   |
  231. | %                        |~s=~s+1 if crossing page boundary  |
  232. |--------------------------+-----------------------------------|
  233. |0000H to 00FFH            |Page 0 (see zero page addressing)  |
  234. |0100H to 01FFH            |Page 1 (stack area, 01FFH = start) |
  235. |XX00H to XXFFH            |Page n (where n=XXH)               |
  236. |FFFAH to FFFBH            |Non maskable interrupt vector(NMI) |
  237. |FFFCH to FFFDH            |Reset (RES) vector                 |
  238. |FFFEH to FFFFH            |Interrupt Request vector (IRQ)     |
  239. |FFFEH to FFFFH            |Break command vector (see BRK)     |
  240. ----------------------------------------------------------------
  241.