home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / LANGUAGES / xlate.lzh / test3.68 < prev    next >
Text File  |  1994-08-10  |  15KB  |  325 lines

  1. * TRANSLATION CARRIED OUT IN 68020 FULL-FORMAT MODE VIA TAB 
  2.  
  3. * 6809 to 68000 test file
  4.  
  5. modes       move.b      #1,d0                * lda #1
  6.             move.b      (a0),d0              * lda ,x
  7.             move.b      (a1),d0              * lda ,y
  8.             move.b      (a7),d0              * lda ,s
  9.             move.b      (a6),d0              * lda ,u
  10.             move.b      (0,a0),d0            * lda 0,x
  11.             move.b      (2,a6),d0            * lda 2,dp
  12.             move.b      ($2000,a0),d0        * lda $2000,x
  13.             move.b      (a0)+,d0             * lda ,x+
  14.             move.b      (a0)+,d0             * lda ,x++
  15.             move.b      -(a0),d0             * lda ,-x
  16.             move.b      -(a0),d0             * lda ,--x
  17.             move.b      ($2000,pc),d0        * lda $2000,pcr
  18.  
  19.             move.w      #1,d2                * ldd #1
  20.             move.w      (a0),d2              * ldd ,x
  21.             move.w      (a1),d2              * ldd ,y
  22.             move.w      (a7),d2              * ldd ,s
  23.             move.w      (a6),d2              * ldd ,u
  24.             move.w      (0,a0),d2            * ldd 0,x
  25.             move.w      (2,a6),d2            * ldd 2,dp
  26.             move.w      ($2000,a0),d2        * ldd $2000,x
  27.             move.w      (a0)+,d2             * ldd ,x+
  28.             move.w      (a0)+,d2             * ldd ,x++
  29.             move.w      -(a0),d2             * ldd ,-x
  30.             move.w      -(a0),d2             * ldd ,--x
  31.             move.w      ($2000,pc),d2        * ldd $2000,pcr
  32.  
  33.             move.b      ([10,a6]),d0         * lda [10]
  34.             move.b      ([a0]),d0            * lda [,x]
  35.             move.b      ([a1]),d0            * lda [,y]
  36.             move.b      ([a7]),d0            * lda [,s]
  37.             move.b      ([a6]),d0            * lda [,u]
  38.             move.b      ([0,a0]),d0          * lda [0,x]
  39.             move.b      ([$2000,a0]),d0      * lda [$2000,x]
  40.             move.l      (a0)+,a5             Load indirection register
  41.             move.b      (a5),d0              * lda [,x++]
  42.             move.l      -(a0),a5             Load indirection register
  43.             move.b      (a5),d0              * lda [,--x]
  44.             move.b      ([$2000,pc]),d0      * lda [$2000,pcr]
  45.             move.w      ([10,a6]),d2         * ldd [10]
  46.             move.w      ([a0]),d2            * ldd [,x]
  47.             move.w      ([a1]),d2            * ldd [,y]
  48.             move.w      ([a7]),d2            * ldd [,s]
  49.             move.w      ([a6]),d2            * ldd [,u]
  50.             move.w      ([0,a0]),d2          * ldd [0,x]
  51.             move.w      ([$2000,a0]),d2      * ldd [$2000,x]
  52.             move.l      (a0)+,a5             Load indirection register
  53.             move.w      (a5),d2              * ldd [,x++]
  54.             move.l      -(a0),a5             Load indirection register
  55.             move.w      (a5),d2              * ldd [,--x]
  56.             move.w      ([$2000,pc]),d2      * ldd [$2000,pcr]
  57.  
  58. start       ext.w       d1                   Extend to word
  59.             lea         (a0,d1.w),a0         * abx
  60.             fail Carry flag not included 
  61.             add.b       #1,d0                * adca #1
  62.             fail Carry flag not included 
  63.             add.b       #1,d1                * adcb #1
  64.             fail Carry flag not included 
  65.             add.b       (a0),d0              * adca ,x
  66.             fail Carry flag not included 
  67.             add.b       (a0),d1              * adcb ,x
  68.  
  69.             add.b       #1,d0                * adda #1
  70.             add.b       #1,d1                * addb #1
  71.             add.w       #1,d2                * addd #1
  72.             add.b       (a0),d0              * adda ,x
  73.             add.b       (a0),d1              * addb ,x
  74.             add.w       (a0),d2              * addd ,x
  75.  
  76.             and.b       #1,d0                * anda #1
  77.             and.b       #1,d1                * andb #1
  78.             and.b       (a0),d0              * anda ,x
  79.             and.b       (a0),d1              * andb ,x
  80.             andi        #1,ccr               * andcc #1
  81.  
  82.             asl.b       #1,d0                * asla
  83.             asl.b       #1,d1                * aslb
  84.             asl         (a0)                 * asl ,x
  85.  
  86.             asr.b       #1,d0                * asra
  87.             asr.b       #1,d1                * asrb
  88.             asr         (a0)                 * asr ,x
  89.  
  90.             fail Tested register contents altered 
  91.             and.b       #1,d0                * bita #1
  92.             fail Tested register contents altered 
  93.             and.b       #1,d1                * bitb #1
  94.             fail Tested register contents altered 
  95.             and.b       (a0),d0              * bita ,x
  96.             fail Tested register contents altered 
  97.             and.b       (a0),d1              * bitb ,x
  98.  
  99.             clr.b       d0                   * clra
  100.             clr.b       d1                   * clrb
  101.             clr.b       (a0)                 * clr ,x
  102.  
  103.             cmp.b       #1,d0                * cmpa #1
  104.             cmp.b       #1,d1                * cmpb #1
  105.             cmp.w       #1,d2                * cmpd #1
  106.             cmp.l       #1,a7                * cmps #1
  107.             cmp.l       #1,a6                * cmpu #1
  108.             cmp.l       #1,a0                * cmpx #1
  109.             cmp.l       #1,a1                * cmpy #1
  110.             cmp.b       (a0),d0              * cmpa ,x
  111.             cmp.b       (a0),d1              * cmpb ,x
  112.             cmp.w       (a0),d2              * cmpd ,x
  113.             cmp.l       (a0),a7              * cmps ,x
  114.             cmp.l       (a0),a6              * cmpu ,x
  115.             cmp.l       (a0),a0              * cmpx ,x
  116.             cmp.l       (a0),a1              * cmpy ,x
  117.  
  118.             not.b       d0                   * coma
  119.             not.b       d1                   * comb
  120.             not.b       (a0)                 * com ,x
  121.  
  122.             stop        *                    cwai
  123.             fail No 68000 equivalent 
  124.             daa         *                    daa
  125.  
  126.             subq.b      #1,d0                * deca
  127.             subq.b      #1,d1                * decb
  128.             subq.b      #1,(a0)              * dec ,x
  129.  
  130.             eori.b      #1,d0                * eora #1
  131.             eori.b      #1,d1                * eorb #1
  132.             fail 68000 eor instruction operates on memory 
  133.             eor.b       d0,(a0)              * eora ,x
  134.             fail 68000 eor instruction operates on memory 
  135.             eor.b       d1,(a0)              * eorb ,x
  136.  
  137.             exg         d0,d1                * exg a,b
  138.             exg         d2,a0                * exg d,x
  139.  
  140.             addq.b      #1,d0                * inca
  141.             addq.b      #1,d1                * incb
  142.             addq.b      #1,(a0)              * inc ,x
  143.  
  144.             jmp         (start,a6)           * jmp start
  145.             jsr         (start,a6)           * jsr start
  146.             jmp         ([a6])               * jmp [,u]
  147.             jsr         ([a6])               * jsr [,u]
  148.  
  149.             move.b      #1,d0                * lda #1
  150.             move.b      #1,d1                * ldb #1
  151.             move.w      #1,d2                * ldd #1
  152.             move.l      #1,a7                * lds #1
  153.             move.l      #1,a6                * ldu #1
  154.             move.l      #1,a0                * ldx #1
  155.             move.l      #1,a1                * ldy #1
  156.             move.b      (a0),d0              * lda ,x
  157.             move.b      (a0),d1              * ldb ,x
  158.             move.w      (a0),d2              * ldd ,x
  159.             move.l      (a0),a7              * lds ,x
  160.             move.l      (a0),a6              * ldu ,x
  161.             move.l      (a0),a0              * ldx ,x
  162.             move.l      (a0),a1              * ldy ,x
  163.  
  164.             lea.l       (a0),a7              * leas ,x
  165.             lea.l       (a0),a6              * leau ,x
  166.             lea.l       (a0),a0              * leax ,x
  167.             lea.l       (a0),a1              * leay ,x
  168.  
  169.             lsl.b       #1,d0                * lsla
  170.             lsl.b       #1,d1                * lslb
  171.             lsl         (a0)                 * lsl ,x
  172.  
  173.             lsr.b       #1,d0                * lsra
  174.             lsr.b       #1,d1                * lsrb
  175.             lsr         (a0)                 * lsr ,x
  176.  
  177.             ext.w       d0                   Extend to word
  178.             ext.w       d1                   Extend to word
  179.             move.w      d1,d2                Move to destination register
  180.             mulu.w      d0,d2                * mul
  181.  
  182.             neg.b       d0                   * nega
  183.             neg.b       d1                   * negb
  184.             neg.b       (a0)                 * neg ,x
  185.  
  186.             nop                              * nop
  187.  
  188.             or.b        #1,d0                * ora #1
  189.             or.b        #1,d1                * orb #1
  190.             ori         #1,ccr               * orcc #1
  191.             or.b        (a0),d0              * ora ,x
  192.             or.b        (a0),d1              * orb ,x
  193.             ori         ,x,ccr               * orcc ,x
  194.  
  195.             movem.l     d0,-(a7)             * pshs a
  196.             fail Cannot push DP register 
  197.             movem.l     d0/d1/d2/a0/a1/a6,-(a7) * pshs a,b,d,x,y,u,dp
  198.             movem.l     d0/d2,-(a7)          * pshs a,d,ccr
  199.             fail Cannot push PC register 
  200.             movem.l     d0/d2,-(a7)          * pshs a,d,pc
  201.             fail Cannot push PC register 
  202.             movem.l     d0,-(a6)             * pshu a
  203.             fail Cannot push DP register 
  204.             movem.l     d0/d1/d2/a0/a1/a7,-(a6) * pshu a,b,d,x,y,s,dp
  205.             movem.l     d0/d2,-(a6)          * pshu a,d,ccr
  206.             fail Cannot push PC register 
  207.             movem.l     d0/d2,-(a6)          * pshu a,d,pc
  208.             fail Cannot push PC register 
  209.  
  210.             movem.l     (a7)+,d0             * puls a
  211.             fail Cannot pull DP register 
  212.             movem.l     (a7)+,d0/d1/d2/a0/a1/a6 * puls a,b,d,x,y,u,dp
  213.             movem.l     (a7)+,d0/d2          * puls a,d,ccr
  214.             movem.l     (a7)+,d0/d2          * puls a,d,pc
  215.             rts 
  216.             rts                              * puls ccr,pc 
  217.             movem.l     (a6)+,d0             * pulu a
  218.             fail Cannot pull DP register 
  219.             movem.l     (a6)+,d0/d1/d2/a0/a1/a7 * pulu a,b,d,x,y,s,dp
  220.             movem.l     (a6)+,d0/d2          * pulu a,d,ccr
  221.             fail Cannot pull PC register 
  222.             movem.l     (a6)+,d0/d2          * pulu a,d,pc
  223.             fail Cannot pull PC register 
  224.  
  225.             rol.b       #1,d0                * rola
  226.             rol.b       #1,d1                * rolb
  227.             rol         (a0)                 * rol ,x
  228.  
  229.             ror.b       #1,d0                * rora
  230.             ror.b       #1,d1                * rorb
  231.             ror         (a0)                 * ror ,x
  232.  
  233.             rte                              * rti
  234.             rts                              * rts
  235.  
  236.             fail Carry flag not included 
  237.             sub.b       #1,d0                * sbca #1
  238.             fail Carry flag not included 
  239.             sub.b       #1,d1                * sbcb #1
  240.             fail Carry flag not included 
  241.             sub.b       (a0),d0              * sbca ,x
  242.             fail Carry flag not included 
  243.             sub.b       (a0),d1              * sbcb ,x
  244.  
  245.             fail No 68000 equivalent 
  246.             sex         *                    sex
  247.  
  248.             move.b      d0,(a0)              * sta ,x
  249.             move.b      d1,(a0)              * stb ,x
  250.             move.w      d2,(a0)              * std ,x
  251.             move.l      a7,(a0)              * sts ,x
  252.             move.l      a6,(a0)              * stu ,x
  253.             move.l      a0,(a0)              * stx ,x
  254.             move.l      a1,(a1)              * sty ,y
  255.  
  256.             sub.b       #1,d0                * suba #1
  257.             sub.b       #1,d1                * subb #1
  258.             sub.w       #1,d2                * subd #1
  259.             sub.b       (a0),d0              * suba ,x
  260.             sub.b       (a0),d1              * subb ,x
  261.             sub.w       (a0),d2              * subd ,x
  262.  
  263.             trap        #0                   * swi
  264.             trap        #1                   * swi2
  265.             trap        #2                   * swi3
  266.  
  267.             fail No 68000 equivalent 
  268.             sync        *                    sync
  269.  
  270.             move.b      d0,d1                * tfr a,b
  271.             move.w      d2,a0                * tfr d,x
  272.  
  273.             tst.b       d0                   * tsta
  274.             tst.b       d1                   * tstb
  275.             tst.b       (a0)                 * tst ,x
  276.  
  277.             bra.s       start                * bra start
  278.             fail 68000 lacks brn and lbrn 
  279.             nop                              * brn start
  280.             bcc.s       start                * bcc start
  281.             bcs.s       start                * bcs start
  282.             beq.s       start                * beq start
  283.             bge.s       start                * bge start
  284.             bgt.s       start                * bgt start
  285.             bhi.s       start                * bhi start
  286.             bhs.s       start                * bhs start
  287.             ble.s       start                * ble start
  288.             blo.s       start                * blo start
  289.             bls.s       start                * bls start
  290.             blt.s       start                * blt start
  291.             bmi.s       start                * bmi start
  292.             bne.s       start                * bne start
  293.             bmi.s       start                * bmi start
  294.             bne.s       start                * bne start
  295.             bpl.s       start                * bpl start
  296.             bvc.s       start                * bvc start
  297.             bvs.s       start                * bvs start
  298.  
  299.             bra         start                * lbra start
  300.             fail 68000 lacks brn and lbrn 
  301.             nop                              * lbrn start
  302.             bcc         start                * lbcc start
  303.             bcs         start                * lbcs start
  304.             beq         start                * lbeq start
  305.             bge         start                * lbge start
  306.             bgt         start                * lbgt start
  307.             bhi         start                * lbhi start
  308.             bhs         start                * lbhs start
  309.             ble         start                * lble start
  310.             blo         start                * lblo start
  311.             bls         start                * lbls start
  312.             blt         start                * lblt start
  313.             bmi         start                * lbmi start
  314.             bne         start                * lbne start
  315.             bmi         start                * lbmi start
  316.             bne         start                * lbne start
  317.             bpl         start                * lbpl start
  318.             bvc         start                * lbvc start
  319.             bvs         start                * lbvs start
  320.  
  321.             bsr.s       start                * bsr start
  322.             bsr         start                * lbsr start
  323.  
  324.  
  325.