home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / program / compiler / fasbin21 / doc / as6805.lp < prev    next >
Text File  |  1992-09-13  |  14KB  |  595 lines

  1.  
  2.  
  3.  
  4.                                   - 1 -
  5.  
  6.  
  7.  
  8.        A.  A✓A✓A✓Ap✓p✓p✓pp✓p✓p✓pe✓e✓e✓en✓n✓n✓nd✓d✓d✓di✓i✓i✓ix✓x✓x✓x f✓f✓f✓fo✓o✓o✓or✓r✓r✓r a✓a✓a✓as✓s✓s✓s6✓6✓6✓68✓8✓8✓80✓0✓0✓05✓5✓5✓5 F✓F✓F✓Fr✓r✓r✓ra✓a✓a✓an✓n✓n✓nk✓k✓k✓ke✓e✓e✓en✓n✓n✓ns✓s✓s✓st✓t✓t✓te✓e✓e✓ei✓i✓i✓in✓n✓n✓n A✓A✓A✓As✓s✓s✓ss✓s✓s✓se✓e✓e✓em✓m✓m✓mb✓b✓b✓bl✓l✓l✓le✓e✓e✓er✓r✓r✓r
  9.  
  10.        A.1  P✓P✓P✓Ps✓s✓s✓se✓e✓e✓eu✓u✓u✓ud✓d✓d✓do✓o✓o✓o O✓O✓O✓Op✓p✓p✓pe✓e✓e✓er✓r✓r✓ra✓a✓a✓at✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓ns✓s✓s✓s
  11.  
  12.        A.1.1  _✓S_✓t_✓a_✓n_✓d_✓a_✓r_✓d__✓P_✓s_✓e_✓u_✓d_✓o__✓O_✓p_✓e_✓r_✓a_✓t_✓i_✓o_✓n__✓M_✓n_✓e_✓m_✓o_✓n_✓i_✓c_✓s
  13.  
  14.             End                                END
  15.             File Inclusion                     INCL INCLUDE
  16.             If                                 IF
  17.             Else                               ELSE
  18.             End If                             ENDI
  19.             Equate                             EQU
  20.             Set                                SET
  21.             Org                                ORG
  22.             Reserve Memory                     RESERVE RMB
  23.             Define Byte Data                   BYTE DB FCB
  24.             Define Word Data                   DW FDB WORD
  25.             Define String Data                 FCC STRING
  26.             Define Character Set Translation   CHARSET
  27.             Define Character Value             CHARDEF CHD
  28.             Use Character Translation          CHARUSE
  29.  
  30.        A.1.2  _✓M_✓a_✓c_✓h_✓i_✓n_✓e__✓D_✓e_✓p_✓e_✓n_✓d_✓e_✓n_✓t__✓P_✓s_✓e_✓u_✓d_✓o__✓O_✓p_✓e_✓r_✓a_✓t_✓i_✓o_✓n_✓s
  31.  
  32.        A.1.2.1  _✓I_✓n_✓s_✓t_✓r_✓u_✓c_✓t_✓i_✓o_✓n__✓S_✓e_✓t__✓S_✓e_✓l_✓e_✓c_✓t_✓i_✓o_✓n
  33.  
  34.             CPU string
  35.  
  36.        The instruction set can be specified in the source file with
  37.        the CPU pseudooperation.  The string, delimited by quotes or
  38.        apostrophes, is scanned for a substring which selects which
  39.        instruction set is used.  When the program is invoked, this
  40.        operation is performed on the name of the program, then the
  41.        -p optional arguement, if any, and then any CPU statements.
  42.        The last one selects which subset of the instructions the
  43.        assembler will accept.  The instruction set can be changed
  44.        at any place in the source file.
  45.  
  46.             Instruction Set          Substrings
  47.             68hc05                   hc HC
  48.             146805                   4
  49.             6305                     3
  50.             6805                     05 l05 L05
  51.  
  52.        A.2  I✓I✓I✓In✓n✓n✓ns✓s✓s✓st✓t✓t✓tr✓r✓r✓ru✓u✓u✓uc✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓ns✓s✓s✓s
  53.  
  54.        A.2.1  _✓I_✓n_✓s_✓t_✓r_✓u_✓c_✓t_✓i_✓o_✓n__✓L_✓i_✓s_✓t
  55.  
  56.        Opcode   Syntax                    Selection Criteria
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                                   - 2 -
  71.  
  72.  
  73.  
  74.        Opcode   Syntax                    Selection Criteria
  75.  
  76.        ADC       '#' expr
  77.        ADC       expr                     DIRECT
  78.        ADC       expr                     EXTENDED
  79.        ADC       indexed                  INDEX0
  80.        ADC       indexed                  INDEX1
  81.        ADC       indexed                  INDEX2
  82.  
  83.        ADD       '#' expr
  84.        ADD       expr                     DIRECT
  85.        ADD       expr                     EXTENDED
  86.        ADD       indexed                  INDEX0
  87.        ADD       indexed                  INDEX1
  88.        ADD       indexed                  INDEX2
  89.  
  90.        AND       '#' expr
  91.        AND       expr                     DIRECT
  92.        AND       expr                     EXTENDED
  93.        AND       indexed                  INDEX0
  94.        AND       indexed                  INDEX1
  95.        AND       indexed                  INDEX2
  96.  
  97.        ASL       expr                     DIRECT
  98.        ASL       indexed                  INDEX0
  99.        ASL       indexed                  INDEX1
  100.  
  101.        ASLA
  102.  
  103.        ASLX
  104.  
  105.        ASR       expr                     DIRECT
  106.        ASR       indexed                  INDEX0
  107.        ASR       indexed                  INDEX1
  108.  
  109.        ASRA
  110.  
  111.        ASRX
  112.  
  113.        BCC       expr
  114.  
  115.        BCLR      expr ',' expr
  116.  
  117.        BCS       expr
  118.  
  119.        BEQ       expr
  120.  
  121.        BHCC      expr
  122.  
  123.        BHCS      expr
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.                                   - 3 -
  137.  
  138.  
  139.  
  140.        Opcode   Syntax                    Selection Criteria
  141.  
  142.        BHI       expr
  143.  
  144.        BHS       expr
  145.  
  146.        BIH       expr
  147.  
  148.        BIL       expr
  149.  
  150.        BIT       '#' expr
  151.        BIT       expr                     DIRECT
  152.        BIT       expr                     EXTENDED
  153.        BIT       indexed                  INDEX0
  154.        BIT       indexed                  INDEX1
  155.        BIT       indexed                  INDEX2
  156.  
  157.        BLO       expr
  158.  
  159.        BLS       expr
  160.  
  161.        BMC       expr
  162.  
  163.        BMI       expr
  164.  
  165.        BMS       expr
  166.  
  167.        BNE       expr
  168.  
  169.        BPL       expr
  170.  
  171.        BRA       expr
  172.  
  173.        BRCLR     expr ',' expr ',' expr
  174.  
  175.        BRN       expr
  176.  
  177.        BRSET     expr ',' expr ',' expr
  178.  
  179.        BSET      expr ',' expr
  180.  
  181.        BSR       expr
  182.  
  183.        CLC
  184.  
  185.        CLI
  186.  
  187.        CLR       expr                     DIRECT
  188.        CLR       indexed                  INDEX0
  189.        CLR       indexed                  INDEX1
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.                                   - 4 -
  203.  
  204.  
  205.  
  206.        Opcode   Syntax                    Selection Criteria
  207.  
  208.        CLRA
  209.  
  210.        CLRX
  211.  
  212.        CMP       '#' expr
  213.        CMP       expr                     DIRECT
  214.        CMP       expr                     EXTENDED
  215.        CMP       indexed                  INDEX0
  216.        CMP       indexed                  INDEX1
  217.        CMP       indexed                  INDEX2
  218.  
  219.        COM       expr                     DIRECT
  220.        COM       indexed                  INDEX0
  221.        COM       indexed                  INDEX1
  222.  
  223.        COMA
  224.  
  225.        COMX
  226.  
  227.        CPX       '#' expr
  228.        CPX       expr                     DIRECT
  229.        CPX       expr                     EXTENDED
  230.        CPX       indexed                  INDEX0
  231.        CPX       indexed                  INDEX1
  232.        CPX       indexed                  INDEX2
  233.  
  234.        DAA                                INSTDAA
  235.  
  236.        DEC       expr                     DIRECT
  237.        DEC       indexed                  INDEX0
  238.        DEC       indexed                  INDEX1
  239.  
  240.        DECA
  241.  
  242.        DECX
  243.  
  244.        EOR       '#' expr
  245.        EOR       expr                     DIRECT
  246.        EOR       expr                     EXTENDED
  247.        EOR       indexed                  INDEX0
  248.        EOR       indexed                  INDEX1
  249.        EOR       indexed                  INDEX2
  250.  
  251.        INC       expr                     DIRECT
  252.        INC       indexed                  INDEX0
  253.        INC       indexed                  INDEX1
  254.  
  255.        INCA
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.                                   - 5 -
  269.  
  270.  
  271.  
  272.        Opcode   Syntax                    Selection Criteria
  273.  
  274.        INCX
  275.  
  276.        JMP       expr                     DIRECT
  277.        JMP       expr                     EXTENDED
  278.        JMP       indexed                  INDEX0
  279.        JMP       indexed                  INDEX1
  280.        JMP       indexed                  INDEX2
  281.  
  282.        JSR       expr                     DIRECT
  283.        JSR       expr                     EXTENDED
  284.        JSR       indexed                  INDEX0
  285.        JSR       indexed                  INDEX1
  286.        JSR       indexed                  INDEX2
  287.  
  288.        LDA       '#' expr
  289.        LDA       expr                     DIRECT
  290.        LDA       expr                     EXTENDED
  291.        LDA       indexed                  INDEX0
  292.        LDA       indexed                  INDEX1
  293.        LDA       indexed                  INDEX2
  294.  
  295.        LDX       '#' expr
  296.        LDX       expr                     DIRECT
  297.        LDX       expr                     EXTENDED
  298.        LDX       indexed                  INDEX0
  299.        LDX       indexed                  INDEX1
  300.        LDX       indexed                  INDEX2
  301.  
  302.        LSL       expr                     DIRECT
  303.        LSL       indexed                  INDEX0
  304.        LSL       indexed                  INDEX1
  305.  
  306.        LSLA
  307.  
  308.        LSLX
  309.  
  310.        LSR       expr                     DIRECT
  311.        LSR       indexed                  INDEX0
  312.        LSR       indexed                  INDEX1
  313.  
  314.        LSRA
  315.  
  316.        LSRX
  317.  
  318.        MUL                                INSTMUL
  319.  
  320.        NEG       expr                     DIRECT
  321.        NEG       indexed                  INDEX0
  322.        NEG       indexed                  INDEX1
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.                                   - 6 -
  335.  
  336.  
  337.  
  338.        Opcode   Syntax                    Selection Criteria
  339.  
  340.  
  341.        NEGA
  342.  
  343.        NEGX
  344.  
  345.        NOP
  346.  
  347.        ORA       '#' expr
  348.        ORA       expr                     DIRECT
  349.        ORA       expr                     EXTENDED
  350.        ORA       indexed                  INDEX0
  351.        ORA       indexed                  INDEX1
  352.        ORA       indexed                  INDEX2
  353.  
  354.        ROL       expr                     DIRECT
  355.        ROL       indexed                  INDEX0
  356.        ROL       indexed                  INDEX1
  357.  
  358.        ROLA
  359.  
  360.        ROLX
  361.  
  362.        ROR       expr                     DIRECT
  363.        ROR       indexed                  INDEX0
  364.        ROR       indexed                  INDEX1
  365.  
  366.        RORA
  367.  
  368.        RORX
  369.  
  370.        RSP
  371.  
  372.        RTI
  373.  
  374.        RTS
  375.  
  376.        SBC       '#' expr
  377.        SBC       expr                     DIRECT
  378.        SBC       expr                     EXTENDED
  379.        SBC       indexed                  INDEX0
  380.        SBC       indexed                  INDEX1
  381.        SBC       indexed                  INDEX2
  382.  
  383.        SEC
  384.  
  385.        SEI
  386.  
  387.        STA       expr                     DIRECT
  388.        STA       expr                     EXTENDED
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.                                   - 7 -
  401.  
  402.  
  403.  
  404.        Opcode   Syntax                    Selection Criteria
  405.  
  406.        STA       indexed                  INDEX0
  407.        STA       indexed                  INDEX1
  408.        STA       indexed                  INDEX2
  409.  
  410.        STOP                               INSTSTWA
  411.  
  412.        STX       expr                     DIRECT
  413.        STX       expr                     EXTENDED
  414.        STX       indexed                  INDEX0
  415.        STX       indexed                  INDEX1
  416.        STX       indexed                  INDEX2
  417.  
  418.        SUB       '#' expr
  419.        SUB       expr                     DIRECT
  420.        SUB       expr                     EXTENDED
  421.        SUB       indexed                  INDEX0
  422.        SUB       indexed                  INDEX1
  423.        SUB       indexed                  INDEX2
  424.  
  425.        SWI
  426.  
  427.        TAX
  428.  
  429.        TST       expr                     DIRECT
  430.        TST       indexed                  INDEX0
  431.        TST       indexed                  INDEX1
  432.  
  433.        TSTA
  434.  
  435.        TSTX
  436.  
  437.        TXA
  438.  
  439.        WAIT                               INSTSTWA
  440.  
  441.        A.2.2  _✓S_✓e_✓l_✓e_✓c_✓t_✓i_✓o_✓n__✓C_✓r_✓i_✓t_✓e_✓r_✓i_✓a__✓K_✓e_✓y_✓w_✓o_✓r_✓d_✓s
  442.  
  443.             DIRECT              The direct addressing mode can be
  444.                                 used if the expression has a value
  445.                                 between 0 and 255. The expression
  446.                                 will be treated as a two byte long
  447.                                 value if it is not defined when the
  448.                                 statement is processed in the first
  449.                                 pass.
  450.  
  451.             EXTENDED            The expression can be a 2 byte long
  452.                                 value.
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.                                   - 8 -
  467.  
  468.  
  469.  
  470.             INDEX0              The Indexed addressing mode with no
  471.                                 offset can be used.
  472.  
  473.             INDEX1              The Indexed addressing mode with a
  474.                                 one byte offset can be used.
  475.  
  476.             INDEX2              The Indexed addressing mode with
  477.                                 two byte offset can be used.
  478.  
  479.             INSTSTWA            The instruction is only available
  480.                                 in the 146805, 6305, and 68hc05
  481.                                 instruction sets.
  482.  
  483.             INSTMUL             The instruction is only available
  484.                                 in the 68hc05 instruction set.
  485.  
  486.             INSTDAA             The instruction is only available
  487.                                 in the 6305 instruction set.
  488.  
  489.        A.2.3  _✓A_✓p_✓o_✓s_✓t_✓r_✓o_✓p_✓h_✓e_✓s  The apostrophes in the syntax field are
  490.        a notation used for the parser generator and are not put in
  491.        the assembler source statement.
  492.  
  493.        A.3  N✓N✓N✓No✓o✓o✓ot✓t✓t✓te✓e✓e✓es✓s✓s✓s
  494.  
  495.        A.3.1  _✓B_✓i_✓t__✓N_✓u_✓m_✓b_✓e_✓r_✓s  The bit number expression in the BSET,
  496.        BCLR, BRCLR, BRSET operations has to have value defined when
  497.        the instruction is read in the first pass.  The value must
  498.        be between 0 and 7.
  499.  
  500.        A.3.2  _✓I_✓n_✓d_✓e_✓x_✓e_✓d__✓A_✓d_✓d_✓r_✓e_✓s_✓s_✓i_✓n_✓g  The indexed addressing mode is
  501.        represented in two ways.
  502.  
  503.        First, with no offset, the form ",X" is used.
  504.  
  505.        Second, the form "expression, X" is used for both the one
  506.        and two byte offsets modes. The expression will be treated
  507.        as a two byte long value if it is not defined when the
  508.        statement is processed in the first pass.
  509.  
  510.        A.3.3  _✓R_✓e_✓s_✓e_✓r_✓v_✓e_✓d__✓S_✓y_✓m_✓b_✓o_✓l_✓s
  511.  
  512.        A.3.3.1  _✓M_✓a_✓c_✓h_✓i_✓n_✓e__✓D_✓e_✓p_✓e_✓n_✓d_✓e_✓n_✓t__✓R_✓e_✓s_✓e_✓r_✓v_✓e_✓d__✓S_✓y_✓m_✓b_✓o_✓l_✓s  X x
  513.  
  514.        A.3.3.2  _✓S_✓t_✓a_✓n_✓d_✓a_✓r_✓d__✓R_✓e_✓s_✓e_✓r_✓v_✓e_✓d__✓S_✓y_✓m_✓b_✓o_✓l_✓s  AND DEFINED EQ GE GT
  515.        HIGH LE LOW LT MOD NE NOT OR SHL SHR XOR and defined eq ge
  516.        gt high le low lt mod ne not or shl shr xor
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.                                  CONTENTS
  537.  
  538.  
  539.        A.  Appendix for as6805 Frankenstein Assembler...........  1
  540.            A.1  Pseudo Operations...............................  1
  541.            A.2  Instructions....................................  1
  542.            A.3  Notes...........................................  8
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.                                   - i -
  591.  
  592.  
  593.  
  594.  
  595.