home *** CD-ROM | disk | FTP | other *** search
/ ST-Computer Leser-CD 2001 January / LCD_01_2001.iso / develop / ttdigger / mc68k.txt < prev    next >
Encoding:
Text File  |  1999-07-21  |  11.2 KB  |  297 lines

  1. (c) 1996 by H. Robbers @ Amsterdam the Netherlands
  2.  
  3. For those familiar with MC68000 family processors who desparately want
  4. to go around any other way but cant.
  5.  
  6.  
  7. SZ=00:B, 01:W, 10:L     defenitely NOT 11
  8.  
  9. column 1:
  10. ' ' = 68000 family
  11. *   = higher than 68000
  12. 1=68010/12, 2=68020, 3=68030, 4=68040, 6=68060, 5=68551, 8=68881,
  13. S=privileged
  14.  
  15. <.....> = effective address:
  16.  .....  = restrictions on addressing mode:
  17.                                  x = 1 octal digit for a register number
  18. c_alt    control alterable                2x       5x 6x 70 71
  19. c_add    control addressable                2x       5x 6x 70 71 72 73 74
  20. m_alt    memory alterable                2x 3x 4x 5x 6x 70 71
  21. d_alt    data alterable            0x      2x 3x 4x 5x 6x 70 71
  22. d_add    data addressable        0x      2x 3x 4x 5x 6x 70 71 72 73 74
  23. alter    all alterable            0x 1xWL 2x 3x 4x 5x 6x 70 71
  24. all                                0x 1xWL 2x 3x 4x 5x 6x 70 71 72 73 74
  25. +         includes (An)+
  26. -        includes -(An)
  27. D        includes Dn direct
  28.  
  29.                     1       0                1     0
  30.                     5432 109 876 543 210    54321098 76543210
  31.                          r1  m1  m0  r0
  32.     ori  -> ccr        0000 000 000 111 100    00000000 ########    B
  33. S    ori  -> sr        0000 000 001 111 100    ######## ########    W
  34.     ori                0000 000 0SZ <d_alt>    #data                B,W,L
  35.     andi -> ccr        0000 001 000 111 100    00000000 ########    B
  36. S    andi -> sr        0000 001 001 111 100    ######## ########    W
  37.     andi            0000 001 0SZ <d_alt>    #data                B,W,L
  38. *    cmp2            0000 0SZ 011 <c_add>    Txxx0000 00000000
  39. *    chk2            0000 0SZ 011 <c_add>    Txxx1000 00000000
  40.     subi            0000 010 0SZ <d_alt>    #data                B,W,L
  41.     addi            0000 011 0SZ <d_alt>    #data                B,W,L
  42. 2    callm            0000 011 011 <c_add>    00000000 ########
  43.     btst  #n,ea        0000 100 000 <d_add>    00000000 ########
  44.     bchg  #n,ea        0000 100 001 <d_alt>    00000000 ########
  45.     bclr  #n,ea        0000 100 010 <d_alt>    00000000 ########
  46.     bset  #n,ea        0000 100 011 <d_alt>    00000000 ########
  47.     eori -> ccr        0000 101 000 111 100    00000000 ########    B
  48. S    eori -> sr        0000 101 001 111 100    ######## ########    W
  49.     eori            0000 101 0SZ <d_alt>    #data                B,W,L
  50.     cmpi            0000 110 0SZ <d_add>    #data                B,W,L
  51. *S    moves            0000 111 0SZ <m_alt>    txxxr000 00000000
  52. *    cas                0000 1ss 011 <m_alt>    0000000u uu000ccc
  53.                                             ss=01:B, 10:W, 11:L
  54. *    cas2            0000 1ss 011 111 100        zie boek               
  55.                                             ss=      10:W, 11:L
  56.     movep            0000 xxx 1rm 001 aaa    
  57.     btst  Dn,ea        0000 xxx 100 <d_add>
  58.     bchg  Dn,ea        0000 xxx 101 <d_alt>
  59.     bclr  Dn,ea        0000 xxx 110 <d_alt>
  60.     bset  Dn,ea        0000 xxx 111 <d_alt>
  61. --------------------------------------------------------------------------------
  62.     move            00ss <d_alt> < all >     ss=01: B, 11:W, 10:L
  63.     movea            00ss aaa 001 < all >    ss=       11:W, 10:L
  64.                     1       0                1     0
  65.                     5432 109 876 543 210    54321098 76543210
  66.                          r1  m1  m0  r0
  67.     negx            0100 000 0SZ <d_alt>
  68. S    move <- sr        0100 000 011 <d_alt>
  69.     clr                0100 001 0SZ <d_alt>
  70. *    move <- ccr        0100 001 011 <d_alt>
  71.     neg                0100 010 0SZ <d_alt>
  72.     move -> ccr        0100 010 011 <d_add>
  73.     not                0100 011 0SZ <d_alt>
  74. S    move -> sr        0100 011 011 <d_add>
  75.  
  76. *    link.l            0100 100 000 001 aaa    32 bit displ
  77.     nbcd            0100 100 000 <d_alt>
  78.     swap            0100 100 001 000 ddd
  79. *    bkpt            0100 100 001 001 ###
  80.     pea                0100 100 001 <c_add>
  81.     ext                0100 100 0ss 000 ddd    ss=10:W, 11:L
  82.     movem ->mem        0100 100 01s <-c_alt>    mmmmmmmm mmmmmmmm    s=0:W,1:L
  83.     extb.l            0100 100 111 000 ddd                        (lea Dn,A4)
  84.  
  85.     tst                0100 101 0SZ <d_alt>
  86. *    tst                0100 101 0SZ < all >
  87.     tas                0100 101 011 <d_alt>
  88.     illegal            0100 101 011 111 100
  89.  
  90. *    mulu.l            0100 110 000 <d_add>    0lll0s00 00000hhh
  91. *    muls.l            0100 110 000 <d_add>    0lll1s00 00000hhh
  92. *    divu.l            0100 110 001 <d_add>    0qqq0s00 00000rrr
  93. *    divs.l            0100 110 001 <d_add>    0qqq1s00 00000rrr
  94.     movem ->reg        0100 110 01s <c_add+>    mmmmmmmm mmmmmmmm    s=0:W,1:L
  95.  
  96.     trap            0100 111 001 00# ###
  97.     link            0100 111 001 010 aaa    dddddddd dddddddd
  98.     unlk            0100 111 001 011 aaa
  99. S    move An,usp        0100 111 001 100 aaa
  100. S    move usp,An        0100 111 001 101 aaa
  101. S    reset            0100 111 001 110 000
  102.     nop                0100 111 001 110 001
  103. S    stop            0100 111 001 110 010    ######## ########
  104. S    rte                0100 111 001 110 011
  105. *    rtd                0100 111 001 110 100    dddddddd dddddddd
  106.     rts                0100 111 001 110 101
  107. 2    rtm    Dn            0100 111 001 110 ddd
  108.     trapv            0100 111 001 110 110
  109.     rtr                0100 111 001 110 111
  110. *S    movec Rc,Rn        0100 111 001 111 010    txxxcccc cccccccc
  111. *S    movec Rn,Rc        0100 111 001 111 011    txxxcccc cccccccc
  112. *    rtm    An            0100 111 001 111 aaa
  113.     jsr                0100 111 010 <c_add>
  114.     jmp                0100 111 011 <c_add>
  115.  
  116. *    chk.l            0100 xxx 100 <d_add>
  117.     chk.w            0100 xxx 110 <d_add>
  118.     lea                0100 aaa 111 <c_add>
  119.                     1       0                1     0
  120.                     5432 109 876 543 210    54321098 76543210
  121.                          r1  m1  m0  r0
  122.     addq            0101 ### 0SZ <alter>
  123.     subq            0101 ### 1SZ <alter>
  124.     dbcc            0101 cccc 11 001 ddd    dddddddd dddddddd
  125.     scc                0101 cccc 11 <d_alt>
  126. *    trapcc.w #        0101 cccc 11 111 010    ######## ########
  127. *    trapcc.l #        0101 cccc 11 111 011    32 bit data
  128. *    trapcc            0101 cccc 11 111 100
  129. --------------------------------------------------------------------------------
  130.                     1       0                1     0
  131.                     5432 1098  7654 3210    54321098 76543210
  132.     bra.b            0110 0000  dddd dddd
  133.     bra.w            0110 0000  0000 0000    dddddddd dddddddd
  134. *    bra.l            0110 0000  1111 1111    32 bits displ
  135.     bsr.b            0110 0001  dddd dddd
  136.     bsr.w            0110 0001  0000 0000    dddddddd dddddddd
  137. *    bsr.l            0110 0001  1111 1111    32 bits displ
  138.     bcc.b            0110 cccc  dddd dddd
  139.     bcc.w            0110 cccc  0000 0000    dddddddd dddddddd
  140. *    bcc.l            0110 cccc  1111 1111    32 bits displ
  141. --------------------------------------------------------------------------------
  142.     moveq            0111 ddd0  #### ####
  143. --------------------------------------------------------------------------------
  144.                     1       0                1     0
  145.                     5432 109 876 543 210    54321098 76543210
  146.                          r1  m1  m0  r0
  147.     or  ea,Dn        1000 ddd 0SZ <d_add>
  148.     divu            1000 ddd 011 <d_add>
  149.     sbcd Dx,Dy        1000 yyy 100 000 ddd
  150.     sbcd -(Ax),-(Ay)1000 yyy 100 001 aaa
  151. *    pack Dx,Dy        1000 yyy 101 000 ddd    jjjjjjjj jjjjjjjj
  152. *    pack -(Ax),-(Ay)1000 yyy 101 001 aaa    jjjjjjjj jjjjjjjj
  153. *    unpk Dx,Dy        1000 yyy 110 000 ddd    jjjjjjjj jjjjjjjj
  154. *    unpk -(Ax),-(Ay)1000 yyy 110 001 aaa    jjjjjjjj jjjjjjjj
  155.     or  Dn,ea        1000 ddd 1SZ <m_alt>
  156.     divs            1000 ddd 111 <d_add>
  157. --------------------------------------------------------------------------------
  158.                          r1  m1  m0  r0
  159.     sub    ea,Dn        1001 xxx 0SZ < all >
  160.     suba.w            1001 aaa 011 < all >
  161.     subx Dx,Dy        1001 yyy 1SZ 000 ddd
  162.     subx -(Ax),-(Ay)1001 yyy 1SZ 001 aaa
  163.     sub    Dn,ea        1001 ddd 1SZ <m_alt> 
  164.     suba.l            1001 aaa 111 < all >
  165. --------------------------------------------------------------------------------
  166.     Linea            1010 ### ### ### ###    Line_a emulator
  167.                     1       0                1     0
  168.                     5432 109 876 543 210    54321098 76543210
  169.                          r1  m1  m0  r0
  170.     cmp    ea,Dn        1011 ddd 0SZ < all >
  171.     cmpa.w            1011 aaa 011 < all >
  172.     cmpm            1011 xxx 1SZ 001 yyy
  173.     eor    Dn,ea        1011 ddd 1SZ <d_alt>                (cmp Dn,ea misbruikt)
  174.     cmpa.l            1011 aaa 111 < all >
  175. --------------------------------------------------------------------------------
  176.                          r1  m1  m0  r0
  177.     and     ea,Dn        1100 ddd 0SZ <d_add>
  178.     mulu            1100 ddd 011 <d_add>
  179.     abcd Dx,Dy        1100 yyy 100 000 ddd
  180.     abcd -(Ax),-(Ay)1100 yyy 100 001 aaa
  181.     and     Dn,ea        1100 ddd 1SZ <m_alt>
  182.     muls            1100 ddd 111 <d_add>
  183.     exg  Dx,Dy        1100 xxx 101 000 yyy
  184.     exg  Ax,Ay        1100 xxx 101 001 yyy
  185.     exg  Dx,Ay        1100 xxx 110 001 yyy
  186. --------------------------------------------------------------------------------
  187.     add    ea,Dn        1101 ddd 0SZ < all >
  188.     adda.w            1101 aaa 011 < all >
  189.     addx Dx,Dy        1101 yyy 1SZ 000 ddd
  190.     addx -(Ax),-(Ay)1101 yyy 1SZ 001 aaa
  191.     add    Dn,ea        1101 ddd 1SZ <m_alt> 
  192.     adda.l            1101 aaa 111 < all >
  193. --------------------------------------------------------------------------------
  194.     asl,asr #,Dn    1110 ### rSZ 000 ddd    shifts: r=0:right,1=left
  195.     lsl,lsr            1110 ### rSZ 001 ddd
  196.     roxl,roxr        1110 ### rSZ 010 ddd
  197.     rol,ror            1110 ### rSZ 011 ddd
  198.  
  199.     asl,asr Dx,Dy    1110 xxx rSZ 100 yyy
  200.     lsl,lsr            1110 xxx rSZ 101 yyy
  201.     roxl,roxr         1110 xxx rSZ 110 yyy
  202.     rol,ror            1110 xxx rSZ 111 yyy
  203.  
  204.     asl,asr <ea>    1110 000 r11 <m_alt>    B
  205.     lsl,lsr            1110 001 r11 <m_alt>    B
  206.     roxl,roxr        1110 010 r11 <m_alt>    B
  207.     rol,ror            1110 011 r11 <m_alt>    B
  208.  
  209. *    bftst            1110 100 011 <Dc_add>    0000dooo ooDwwwww
  210. *    bfextu            1110 100 111 <Dc_add>    0xxxdooo ooDwwwww
  211. *    bfchg            1110 101 011 <Dc_alt>    0000dooo ooDwwwww
  212. *    bfexts            1110 101 111 <Dc_add>    0xxxdooo ooDwwwww
  213. *    bfclr            1110 110 011 <Dc_alt>    0000dooo ooDwwwww
  214. *    bfffo            1110 110 111 <Dc_add>    0xxxdooo ooDwwwww
  215. *    bfset            1110 111 011 <Dc_alt>    0000dooo ooDwwwww
  216. *    bfins            1110 111 111 <Dc_alt>    0xxxdooo ooDwwwww
  217.                     1       0                1     0
  218.                     5432 109 876 543 210    54321098 76543210
  219.                          r1  m1  m0  r0
  220. 35S    pload            1111 000 000 <c_alt>    001000r0 000FFFFF zie boek    
  221. 5    pvalid            1111 000 000 <c_alt>    00101000 00000rrr    "
  222. 3S    pflush            1111 000 000 <c_alt>    001mmm00 MMMFFFFF    "
  223. 5S    pflush            1111 000 000 <c_alt>    001mmm0M MMMFFFFF    "    
  224. 3S    pmove ea,MRn    1111 000 000 <c_alt>    010ppp00 00000000 for srp,crp&tc
  225. 3S    pmove.. MRn,ea    1111 000 000 <c_alt>    010ppp1f 00000000         "
  226.                                             011000r0 00000000 for mmusr
  227.                                             000010rf 00000000 for TT0
  228.                                             000011rf 00000000 for TT1
  229.                                                    f = 1: .. = fd
  230.  
  231. 5S    pmove            1111 000 000 < ')  >    010pppr0 00000000 for tc,drp,srp,
  232.                                                               crp,cal,val,scc,
  233.                                                               ac
  234.                                             011pppr0 000num00 for bad,bac
  235.                                             011pppr0 00000000 for psr,pcsr
  236.                     ') r=1: alter, r=0: all
  237.  
  238. 3S    ptest            1111 000 000 <c_alt>    100lllra xxxFFFFF
  239. 5S    ptest            1111 000 000 <c_alt>    100lllra aaaFFFFF
  240. 5S    pflushr            1111 000 000 <m_add>    10100000 00000000    "
  241.  
  242. 5S    pdbcc            1111 000 001 001 ddd    00000000 00cccccc
  243. 5S    pscc            1111 000 001 <d_alt>    00000000 00cccccc
  244. 5S    ptrapcc            1111 000 001 111 ooo    00000000 00cccccc
  245. 5S    pbcc.w            1111 000 010 ccc ccc    dddddddd dddddddd
  246. 5S    pbcc.l            1111 000 011 ccc ccc    32 bit displ
  247. 5S    psave            1111 000 100 <-c_alt>
  248. 5S    prestore        1111 000 101 <c_add+>
  249.  
  250. *8S fsave            1111 001 100 <-c_alt>
  251. *8S frestore        1111 001 101 <c_add+>
  252.  
  253. very special are:
  254. *8 fmovem ea,m        1111 001 000 <c_add+>    110-0000 mmmmmmmm
  255. *8 fmovem ea,Dn        1111 001 000 <c_add+>    110-1000 0ddd0000
  256. *8 fmovem m,ea        1111 001 000 <-c_alt>    111+0000 mmmmmmmm
  257. *8 fmovem Dn,ea        1111 001 000 <-c_alt>    111+1000 0ddd0000
  258.                     1       0                1     0
  259.                     5432 109 876 543 210    54321098 76543210
  260.                          r1  m1  m0  r0
  261. 46S    cinv            1111 010 0cc 0sc aaa    zie boek
  262. 46S    cpush            1111 010 0cc 1sc aaa        "
  263. 46S    pflush            1111 010 100 0oo aaa        "
  264. 4S    ptestw            1111 010 101 001 aaa        "
  265. 4S    ptestr            1111 010 101 101 aaa        "
  266. 6S    plpa            1111 010 11r 001 aaa        "
  267.  
  268. 46    move16 (Ay)+,L    1111 011 000 000 yyy    32 bit address
  269. 46    move16 L,(Ay)+    1111 011 000 001 yyy    32 bit address
  270. 46    move16 (Ay),L    1111 011 000 010 yyy    32 bit address
  271. 46    move16 L,(Ay)    1111 011 000 011 yyy    32 bit address
  272. 46    move16 Ax+,Ay+    1111 011 000 100 xxx    1yyy0000 00000000
  273.  
  274. 6S    lpstop            1111 100 000 000 000    00000001 11000000 #### #### #### ####
  275.  
  276. General coprocessor instructions:
  277. 23    cpGEN            1111 cpi 000 <.....>    command&extensions
  278. 23    cpDBcc            1111 cpi 001 001 ddd    00000000 00cccccc
  279. 23    cpScc            1111 cpi 001 <d_alt>    00000000 00cccccc
  280. 23    cpTRAPcc        1111 cpi 001 111 ooo    00000000 00cccccc + word|long
  281. 23    cpBcc.w            1111 cpi 010 ccc ccc
  282. 23    cpBcc.l            1111 cpi 011 ccc ccc
  283. 23S cpSAVE            1111 cpi 100 <-c_alt>
  284. 23S cpRESTORE        1111 cpi 101 <c_add+>
  285.  
  286. On the 68040 and 68060 the following floating point opcodes
  287. have the fs.... and fd.... variants:
  288.                 s        d
  289. fabs    0x18    0x58    0x5c
  290. fadd    0x22    0x62    0x66
  291. fdiv    0x20    0x60    0x64
  292. fmove    0x00    0x40    0x44
  293. fmul    0x23    0x63    0x67
  294. fneg    0x1a    0x5a    0x5e
  295. fsqrt    0x04    0x41    0x45
  296. fsub    0x28    0x68    0x6c
  297.