home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / program / compiler / fasbin21 / doc / as8051.lp < prev    next >
Text File  |  1992-09-13  |  9KB  |  397 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✓s8✓8✓8✓80✓0✓0✓05✓5✓5✓51✓1✓1✓1 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  _✓D_✓e_✓f_✓i_✓n_✓e__✓W_✓o_✓r_✓d__✓D_✓a_✓t_✓a  The Define Word Data pseudo-
  33.        operations generate the byte reversed form for 16 bit
  34.        constants.  The first byte is the low order half, followed
  35.        by the high order byte.
  36.  
  37.        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
  38.  
  39.        A.2.1  _✓I_✓n_✓s_✓t_✓r_✓u_✓c_✓t_✓i_✓o_✓n__✓L_✓i_✓s_✓t
  40.  
  41.        Opcode   Syntax                          Selection Criteria
  42.  
  43.  
  44.        ACALL    expr
  45.  
  46.        ADD      A ',' '#' expr
  47.        ADD      A ',' '@' REG                   R01
  48.        ADD      A ',' REG                       R07
  49.        ADD      A ',' expr
  50.  
  51.        ADDC     A ',' '#' expr
  52.        ADDC     A ',' '@' REG                   R01
  53.        ADDC     A ',' REG                       R07
  54.        ADDC     A ',' expr
  55.  
  56.        AJMP     expr
  57.  
  58.        ANL      A ',' '#' expr
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                                   - 2 -
  71.  
  72.  
  73.  
  74.        Opcode   Syntax                          Selection Criteria
  75.  
  76.        ANL      A ',' '@' REG                   R01
  77.        ANL      A ',' REG                       R07
  78.        ANL      A ',' expr
  79.        ANL      C ',' '/' bit
  80.        ANL      C ',' '/' expr
  81.        ANL      C ',' bit
  82.        ANL      C ',' expr
  83.        ANL      expr ',' '#' expr
  84.        ANL      expr ','A
  85.  
  86.        CJNE     A ',' '#' expr ',' expr
  87.        CJNE     A ',' expr ',' expr
  88.        CJNE     '@' REG ',' '#' expr ',' expr   R01
  89.        CJNE     REG ',' '#' expr ',' expr       R07
  90.  
  91.        CLR      A
  92.        CLR      C
  93.        CLR      bit
  94.        CLR      expr
  95.  
  96.        CPL      A
  97.        CPL      C
  98.        CPL      bit
  99.        CPL      expr
  100.  
  101.        DA       A
  102.  
  103.        DEC      '@' REG                         R01
  104.        DEC      A
  105.        DEC      REG                             R07
  106.        DEC      expr
  107.  
  108.        DIV      AB
  109.  
  110.        DJNZ     REG ',' expr                    R07
  111.        DJNZ     expr ',' expr
  112.  
  113.        INC      '@' REG                         R01
  114.        INC      A
  115.        INC      DPTR
  116.        INC      REG                             R07
  117.        INC      expr
  118.  
  119.        JB       bit ',' expr
  120.        JB       expr ',' expr
  121.  
  122.        JBC      bit ',' expr
  123.        JBC      expr ',' 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.        JC       expr
  143.  
  144.        JMP      '@' A '+' DPTR
  145.  
  146.        JNB      bit ',' expr
  147.        JNB      expr ',' expr
  148.  
  149.        JNC      expr
  150.  
  151.        JNZ      expr
  152.  
  153.        JZ       expr
  154.  
  155.        LCALL    expr
  156.  
  157.        LJMP     expr
  158.  
  159.        MOV      '@' REG ',' '#' expr            R01
  160.        MOV      '@' REG ',' A                   R01
  161.        MOV      '@' REG ',' expr                R01
  162.        MOV      A ',' '#' expr
  163.        MOV      A ',' '@' REG                   R01
  164.        MOV      A ',' REG                       R07
  165.        MOV      A ',' expr
  166.        MOV      C ',' bit
  167.        MOV      C ',' expr
  168.        MOV      DPTR ',' '#' expr
  169.        MOV      REG ',' A                       R07
  170.        MOV      REG ',' '#' expr                R07
  171.        MOV      REG ',' expr                    R07
  172.        MOV      bit ',' C
  173.        MOV      expr ',' '#' expr
  174.        MOV      expr ',' '@' REG                R01
  175.        MOV      expr ',' A
  176.        MOV      expr ',' C
  177.        MOV      expr ',' REG                    R07
  178.        MOV      expr ',' expr
  179.  
  180.        MOVC     A ',' '@' A '+' DPTR
  181.        MOVC     A ',' '@' A '+' PC
  182.  
  183.        MOVX     '@' DPTR ',' A
  184.        MOVX     '@' REG ',' A                   R01
  185.        MOVX     A ',' '@' DPTR
  186.        MOVX     A ',' '@' REG                   R01
  187.  
  188.        MUL      AB
  189.  
  190.        NOP
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.                                   - 4 -
  203.  
  204.  
  205.  
  206.        Opcode   Syntax                          Selection Criteria
  207.  
  208.  
  209.        ORL      A ',' '#' expr
  210.        ORL      A ',' '@' REG                   R01
  211.        ORL      A ',' REG                       R07
  212.        ORL      A ',' expr
  213.        ORL      C ',' '/' bit
  214.        ORL      C ',' '/' expr
  215.        ORL      C ',' bit
  216.        ORL      C ',' expr
  217.        ORL      expr ',' '#' expr
  218.        ORL      expr ',' A
  219.  
  220.        POP      expr
  221.  
  222.        PUSH     expr
  223.  
  224.        RET
  225.  
  226.        RETI
  227.  
  228.        RL       A
  229.  
  230.        RLC      A
  231.  
  232.        RR       A
  233.  
  234.        RRC      A
  235.  
  236.        SETB     C
  237.        SETB     bit
  238.        SETB     expr
  239.  
  240.        SJMP     expr
  241.  
  242.        SUBB     A ',' '#' expr
  243.        SUBB     A ',' '@' REG                   R01
  244.        SUBB     A ',' REG                       R07
  245.        SUBB     A ',' expr
  246.  
  247.        SWAP     A
  248.  
  249.        XCH      A ',' '@' REG                   R01
  250.        XCH      A ',' REG                       R07
  251.        XCH      A ',' expr
  252.  
  253.        XCHD     A ',' '@' REG                   R01
  254.  
  255.        XRL      A ',' '#' expr
  256.        XRL      A ',' '@' REG                   R01
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.                                   - 5 -
  269.  
  270.  
  271.  
  272.        Opcode   Syntax                          Selection Criteria
  273.  
  274.        XRL      A ',' REG                       R07
  275.        XRL      A ',' expr
  276.        XRL      expr ',' '#' expr
  277.        XRL      expr ',' A
  278.  
  279.        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
  280.  
  281.             R01                 Only the reserved symbols R0 and R1
  282.                                 (or r0, r1) are acceptable as the
  283.                                 REG operand.
  284.  
  285.             R07                 All the reserved symbols R0 thru R7
  286.                                 are acceptable as the REG operand.
  287.  
  288.        A.2.3  _✓B_✓i_✓t__✓O_✓p_✓e_✓r_✓a_✓n_✓d_✓s  Bit Addresses can be in two forms.
  289.  
  290.        One form is "expression.constant" where expression gives an
  291.        address for a bit addressable register and constant (in the
  292.        range of 0 to 7) gives the bit number in the byte.
  293.        Expression values must be either in the range of 20h to 2fh,
  294.        or the multiples of 8 between 80h and f8h, and defined in
  295.        the first pass.
  296.  
  297.        The second form is an symbolic expression with value between
  298.        0 and 255.  The value of the expression is placed in the
  299.        operand field of the instruction without modification.
  300.  
  301.        A.2.4  _✓A_✓p_✓o_✓s_✓t_✓r_✓o_✓p_✓h_✓e_✓s  The apostrophes in the syntax field are
  302.        a notation used for the parser generator and are not put in
  303.        the assembler source statement.
  304.  
  305.        A.3  N✓N✓N✓No✓o✓o✓ot✓t✓t✓te✓e✓e✓es✓s✓s✓s
  306.  
  307.        A.3.1  _✓A_✓d_✓d_✓r_✓e_✓s_✓s__✓S_✓p_✓a_✓c_✓e_✓s  The Four address spaces, Program
  308.        Memory, Internal Data Memory, Bit Numbers, and External Data
  309.        Memory are not differentiated in the symbol table.  Which
  310.        address space a symbol refers to is determined by the
  311.        context of the instruction operands it appears in.
  312.  
  313.        A.3.2  _✓R_✓e_✓s_✓e_✓r_✓v_✓e_✓d__✓S_✓y_✓m_✓b_✓o_✓l_✓s
  314.  
  315.        A.3.2.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  A AB C DPTR PC
  316.        R0 R1 R2 R3 R4 R5 R6 R7 a ab c dptr pc r0 r1 r2 r3 r4 r5 r6
  317.        r7
  318.  
  319.        A.3.2.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
  320.        HIGH LE LOW LT MOD NE NOT OR SHL SHR XOR and defined eq ge
  321.        gt high le low lt mod ne not or shl shr xor
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.                                  CONTENTS
  339.  
  340.  
  341.        A.  Appendix for as8051 Frankenstein Assembler...........  1
  342.            A.1  Pseudo Operations...............................  1
  343.            A.2  Instructions....................................  1
  344.            A.3  Notes...........................................  5
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.                                   - i -
  393.  
  394.  
  395.  
  396.  
  397.