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

  1. ----------------------------------------------------------------
  2. |                                                              |
  3. |                                                              |
  4. |                             RCA                              |
  5. |                                                              |
  6. |               1     88888      000      22222                |
  7. |              11    8     8    0   0    2     2               |
  8. |               1    8     8   0   0 0        2                |
  9. |               1     88888    0  0  0     222                 |
  10. |               1    8     8   0 0   0    2                    |
  11. |               1    8     8    0   0    2                     |
  12. |              111    88888      000     2222222               |
  13. |                                                              |
  14. |    CDP1802 COSMAC Microprocessor Instruction Set Summary     |
  15. |                                                              |
  16. |                                                              |
  17. |                                                              |
  18. |                                                              |
  19. |                                                              |
  20. |                    _________    _________                    |
  21. |                  _|         \__/         |_                  |
  22. |       --> CLOCK |_|1                   40|_| Vdd             |
  23. |            ____  _|                      |_  ____            |
  24. |        --> WAIT |_|2                   39|_| XTAL -->        |
  25. |           _____  _|                      |_  ______          |
  26. |       --> CLEAR |_|3                   38|_| DMA IN <--      |
  27. |                  _|                      |_  _______         |
  28. |           <-- Q |_|4                   37|_| DMA OUT <--     |
  29. |                  _|                      |_  _________       |
  30. |         <-- SC1 |_|5                   36|_| INTERRUPT <--   |
  31. |                  _|                      |_  ___             |
  32. |         <-- SC0 |_|6                   35|_| MWR <--         |
  33. |             ___  _|                      |_                  |
  34. |         <-- MRD |_|7                   34|_| TPA -->         |
  35. |                  _|                      |_                  |
  36. |      <--> BUS 7 |_|8                   33|_| TPB -->         |
  37. |                  _|                      |_                  |
  38. |      <--> BUS 6 |_|9                   32|_| MA7 -->         |
  39. |                  _|                      |_                  |
  40. |      <--> BUS 5 |_|10       1802       31|_| MA6 -->         |
  41. |                  _|                      |_                  |
  42. |      <--> BUS 4 |_|11                  30|_| MA5 -->         |
  43. |                  _|                      |_                  |
  44. |      <--> BUS 3 |_|12                  29|_| MA4 -->         |
  45. |                  _|                      |_                  |
  46. |      <--> BUS 2 |_|13                  28|_| MA3 -->         |
  47. |                  _|                      |_                  |
  48. |      <--> BUS 1 |_|14                  27|_| MA2 -->         |
  49. |                  _|                      |_                  |
  50. |      <--> BUS 0 |_|15                  26|_| MA1 -->         |
  51. |                  _|                      |_                  |
  52. |             Vcc |_|16                  25|_| MA0 -->         |
  53. |                  _|                      |_  ___             |
  54. |          <-- N2 |_|17                  24|_| EF1 <--         |
  55. |                  _|                      |_  ___             |
  56. |          <-- N1 |_|18                  23|_| EF2 <--         |
  57. |                  _|                      |_  ___             |
  58. |          <-- N0 |_|19                  22|_| EF3 <--         |
  59. |                  _|                      |_  ___             |
  60. |             Vss |_|20                  21|_| EF4 <--         |
  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        August 1981                                    |
  78. |Updated        April 1985                                     |
  79. |Issue          1.3                Copyright (C) J.P.Bowen 1985|
  80. ----------------------------------------------------------------
  81. ----------------------------------------------------------------
  82. |Mnem. |Op|F|Description                 |Notes                |
  83. |------+--+-+----------------------------+---------------------|
  84. |ADC   |74|*|Add with Carry              |{DF,D}=mx+D+DF       |
  85. |ADCI i|7C|*|Add with Carry Immediate    |{DF,D}=mp+D+DF,p=p+1 |
  86. |ADD   |F4|*|Add                         |{DF,D}=mx+D          |
  87. |ADI  i|FC|*|Add Immediate               |{DF,D}=mp+D,p=p+1    |
  88. |AND   |F2|*|Logical AND                 |D={mx}&D             |
  89. |ANI  i|FA|*|Logical AND Immediate       |D={mp}&D,p=p+1       |
  90. |B1   a|34|-|Branch if EF1               |If EF1=1 BR else NBR |
  91. |B2   a|35|-|Branch if EF2               |If EF2=1 BR else NBR |
  92. |B3   a|36|-|Branch if EF3               |If EF3=1 BR else NBR |
  93. |B4   a|37|-|Branch if EF4               |If EF4=1 BR else NBR |
  94. |BDF  a|33|-|Branch if DF                |If DF=1 BR else NBR  |
  95. |BGE  a|33|-|Branch if Greater or Equal  |See BDF              |
  96. |BL   a|38|-|Branch if Less              |See BNF BR else NBR  |
  97. |BM   a|38|-|Branch if Minus             |See BNF              |
  98. |BN1  a|3C|-|Branch if Not EF1           |If EF1=0 BR else NBR |
  99. |BN2  a|3D|-|Branch if Not EF2           |If EF2=0 BR else NBR |
  100. |BN3  a|3E|-|Branch if Not EF3           |If EF3=0 BR else NBR |
  101. |BN4  a|3F|-|Branch if Not EF4           |If EF4=0 BR else NBR |
  102. |BNF  a|38|-|Branch if Not DF            |If DF=0 BR else NBR  |
  103. |BNQ  a|39|-|Branch if Not Q             |If Q=0 BR else NBR   |
  104. |BNZ  a|3A|-|Branch if D Not Zero        |If D=1 BR else NBR   |
  105. |BPZ  a|33|-|Branch if Positive or Zero  |See BDF              |
  106. |BQ   a|31|-|Branch if Q                 |If Q=1 BR else NBR   |
  107. |BR   a|30|-|Branch                      |pl=mp                |
  108. |BZ   a|32|-|Branch if D Zero            |If D=0 BR else NBR   |
  109. |DEC  r|2N|-|Decrement register N        |n=n-1                |
  110. |DIS   |71|-|Disable                     |{X,P}=mx,x=x+1,IE=0  |
  111. |GHI  r|9N|-|Get High register N         |D=nh                 |
  112. |GLO  r|8N|-|Get Low register N          |D=nl                 |
  113. |IDL   |00|-|Idle (wait for DMA or int.) |Bus=m0               |
  114. |INC  r|1N|-|Increment register N        |n=n+1                |
  115. |INP  d|6N|-|Input (N=d+8=9-F)           |mx=Bus,D=Bus,Nlines=d|
  116. |IRX   |60|-|Increment register X        |x=x+1                |
  117. |LBDF a|C3|-|Long Branch if DF           |If DF=1 LBR else LNBR|
  118. |LBNF a|C8|-|Long Branch if Not DF       |If DF=0 LBR else LNBR|
  119. |LBNQ a|C9|-|Long Branch if Not Q        |If Q=0 LBR else LNBR |
  120. |LBNZ a|CA|-|Long Branch if D Not Zero   |If D=1 LBR else LNBR |
  121. |LBQ  a|C1|-|Long Branch if Q            |If Q=1 LBR else LNBR |
  122. |LBR  a|C0|-|Long Branch                 |p=mp                 |
  123. |LBZ  a|C2|-|Long Branch if D Zero       |If D=0 LBR else LNBR |
  124. |LDA  r|4N|-|Load advance                |D=mn,n=n+1           |
  125. |LDI  i|F8|-|Load Immediate              |D=mp,p=p+1           |
  126. |LDN  r|0N|-|Load via N (except N=0)     |D=mn                 |
  127. |LDX   |F0|-|Load via X                  |D=mx                 |
  128. |LDXA  |72|-|Load via X and Advance      |D=mx,x=x+1           |
  129. |LSDF  |CF|-|Long Skip if DF             |If DF=1 LSKP else NOP|
  130. |LSIE  |CC|-|Long Skip if IE             |If IE=1 LSKP else NOP|
  131. |LSKP  |C8|-|Long Skip                   |See NLBR             |
  132. |LSNF  |C7|-|Long Skip if Not DF         |If DF=0 LSKP else NOP|
  133. |LSNQ  |C5|-|Long Skip if Not Q          |If Q=0 LSKP else NOP |
  134. |LSNZ  |C6|-|Long Skip if D Not Zero     |If D=1 LSKP else NOP |
  135. |LSQ   |CD|-|Long Skip if Q              |If Q=1 LSKP else NOP |
  136. |LSZ   |CE|-|Long Skip if D Zero         |If D=0 LSKP else NOP |
  137. |MARK  |79|-|Push X,P to stack  (T={X,P})|m2={X,P},X=P,r2=r2-1 |
  138. |NBR   |38|-|No short Branch (see SKP)   |p=p+1                |
  139. |NLBR a|C8|-|No Long Branch (see LSKP)   |p=p+2                |
  140. |NOP   |C4|-|No Operation                |Continue             |
  141. |OR    |F1|*|Logical OR                  |D={mx}vD             |
  142. |ORI  i|F9|*|Logical OR Immediate        |D={mp}vD,p=p+1       |
  143. |OUT  d|6N|-|Output (N=d=1-7)            |Bus=mx,x=x+1,Nlines=d|
  144. |PLO  r|AN|-|Put Low register N          |nl=D                 |
  145. |PHI  r|BN|-|Put High register N         |nh=D                 |
  146. |REQ   |7A|-|Reset Q                     |Q=0                  |
  147. |RET   |70|-|Return                      |{X,P}=mx,x=x+1,IE=1  |
  148. |RSHL  |7E|*|Ring Shift Left             |See SHLC             |
  149. |RSHR  |76|*|Ring Shift Right            |See SHRC             |
  150. |SAV   |78|-|Save                        |mx=T                 |
  151. |SDB   |75|*|Subtract D with Borrow      |{DF,D}=mx-D-DF       |
  152. |SDBI i|7D|*|Subtract D with Borrow Imm. |{DF,D}=mp-D-DF,p=p+1 |
  153. |SD    |F5|*|Subtract D                  |{DF,D}=mx-D          |
  154. |SDI  i|FD|*|Subtract D Immediate        |{DF,D}=mp-D,p=p+1    |
  155. |SEP  r|DN|-|Set P                       |P=N                  |
  156. |SEQ   |7B|-|Set Q                       |Q=1                  |
  157. |SEX  r|EN|-|Set X                       |X=N                  |
  158. |SHL   |FE|*|Shift Left                  |{DF,D}={DF,D,0}<-    |
  159. |SHLC  |7E|*|Shift Left with Carry       |{DF,D}={DF,D}<-      |
  160. ----------------------------------------------------------------
  161. ----------------------------------------------------------------
  162. |Mnem. |Op|F|Description                 |Notes                |
  163. |------+--+-+----------------------------+---------------------|
  164. |SHR   |F6|*|Shift Right                 |{D,DF}=->{0,D,DF}    |
  165. |SHRC  |76|*|Shift Right with Carry      |{D,DF}=->{D,DF}      |
  166. |SKP   |38|-|Short Skip                  |See NBR              |
  167. |SMB   |77|*|Subtract Memory with Borrow |{DF,D}=D-mx-{~DF}    |
  168. |SMBI i|7F|*|Subtract Mem with Borrow Imm|{DF,D}=D-mp-~DF,p=p+1|
  169. |SM    |F7|*|Subtract Memory             |{DF,D}=D-mx          |
  170. |SMI  i|FF|*|Subtract Memory Immediate   |{DF,D}=D-mp,p=p+1    |
  171. |STR  r|5N|-|Store via N                 |mn=D                 |
  172. |STXD  |73|-|Store via X and Decrement   |mx=D,x=x-1           |
  173. |XOR   |F3|*|Logical Exclusive OR        |D={mx}.D             |
  174. |XRI  i|FB|*|Logical Exclusive OR Imm.   |D={mp}.D,p=p+1       |
  175. |      |  |-|Interrupt action            |T={X,P},P=1,X=2,IE=0 |
  176. |------+--+-+--------------------------------------------------|
  177. |      |??| |8-bit hexadecimal opcode                          |
  178. |      |?N| |Opcode with register/device in low 4/3 bits       |
  179. |      |  |-|DF flag unaffected                                |
  180. |      |  |*|DF flag affected                                  |
  181. |-----------+--------------------------------------------------|
  182. | mn        |Register addressing                               |
  183. | mx        |Register-indirect addressing                      |
  184. | mp        |Immediate addressing                              |
  185. | R( )      |Stack addressing (implied addressing)             |
  186. |-----------+--------------------------------------------------|
  187. |DFB n(,n)  |Define Byte                                       |
  188. |DFS n      |Define Storage block                              |
  189. |DFW n(,n)  |Define Word                                       |
  190. |-----------+--------------------------------------------------|
  191. | D         |Data register (accumulator, 8-bit)                |
  192. | DF        |Data Flag (ALU carry, 1-bit)                      |
  193. | I         |High-order instruction digit (4-bit)              |
  194. | IE        |Interrupt Enable (1-bit)                          |
  195. | N         |Low-order instruction digit (4-bit)               |
  196. | P         |Designates Program Counter register (4-bit)       |
  197. | Q         |Output flip-flop (1-bit)                          |
  198. | R         |1 of 16 scratchpad Registers(16-bit)              |
  199. | T         |Holds old {X,P} after interrupt (X high, 8-bit)   |
  200. | X         |Designates Data Pointer register (4-bit)          |
  201. |-----------+--------------------------------------------------|
  202. | mn        |Memory byte addressed by R(N)                     |
  203. | mp        |Memory byte addressed by R(P)                     |
  204. | mx        |Memory byte addressed by R(X)                     |
  205. | m?        |Memory byte addressed by R(?)                     |
  206. | n         |Short form for R(N)                               |
  207. | nh        |High-order byte of R(N)                           |
  208. | nl        |Low-order byte of R(N)                            |
  209. | p         |Short form for R(P)                               |
  210. | pl        |Low-order byte of R(P)                            |
  211. | r?        |Short form for R(?)                               |
  212. | x         |Short form for R(X)                               |
  213. |-----------+--------------------------------------------------|
  214. | R(N)      |Register specified by N                           |
  215. | R(P)      |Current program counter                           |
  216. | R(X)      |Current data pointer                              |
  217. | R(?)      |Specific register                                 |
  218. |-----------+--------------------------------------------------|
  219. | a         |Address expression                                |
  220. | d         |Device number (1-7)                               |
  221. | i         |Immediate expression                              |
  222. | n         |Expression                                        |
  223. | r         |Register (hex digit or an R followed by hex digit)|
  224. |-----------+--------------------------------------------------|
  225. | +         |Arithmetic addition                               |
  226. | -         |Arithmetic subtraction                            |
  227. | *         |Arithmetic multiplication                         |
  228. | /         |Arithmetic division                               |
  229. | &         |Logical AND                                       |
  230. | ~         |Logical NOT                                       |
  231. | v         |Logical inclusive OR                              |
  232. | .         |Logical exclusive OR                              |
  233. | <-        |Rotate left                                       |
  234. | ->        |Rotate right                                      |
  235. | { }       |Combination of operands                           |
  236. | ?         |Hexadecimal digit (0-F)                           |
  237. | -->       |Input pin                                         |
  238. | <--       |Output pin                                        |
  239. | <-->      |Input/output pin                                  |
  240. ----------------------------------------------------------------
  241.