home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / program / compiler / fasbin21 / doc / as8048.lp < prev    next >
Text File  |  1992-09-13  |  10KB  |  529 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✓04✓4✓4✓48✓8✓8✓8 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.             80C48                    C48 c48 C35 c35
  48.             80C49                    C49 c49 C39 c39
  49.             80C50                    C50 c50 C40 c40
  50.             8048                     48 35
  51.             8049                     49 39
  52.             8050                     50 40
  53.             8041                     41
  54.             8042                     42
  55.  
  56.        A.1.2.2  _✓R_✓e_✓g_✓i_✓s_✓t_✓e_✓r__✓S_✓e_✓t
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                                   - 2 -
  71.  
  72.  
  73.  
  74.             Label REGISTER expr
  75.  
  76.        The REGISTER statement is a version of the SET statement
  77.        that checks that the value of its expression is a valid data
  78.        register location for the current CPU selection.  The
  79.        REGISTER statement sets the symbol specified in the label
  80.        field with the numeric value of the expression.  The
  81.        REGISTER statement can change the value of a symbol, but
  82.        only if the symbol is originally defined in a previous SET
  83.        or REGISTER statement.
  84.  
  85.             Example
  86.  
  87.             dtabl   register        32
  88.  
  89.                     mov     r1, #dtabl
  90.                     mov     a, @r1
  91.  
  92.        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
  93.  
  94.        A.2.1  _✓I_✓n_✓s_✓t_✓r_✓u_✓c_✓t_✓i_✓o_✓n__✓L_✓i_✓s_✓t
  95.  
  96.        Opcode   Syntax                  Selection Criteria
  97.  
  98.  
  99.        ADD       A ',' '#' expr
  100.        ADD       A ',' '@' REG
  101.        ADD       A ',' REG
  102.  
  103.        ADDC      A ',' '#' expr
  104.        ADDC      A ',' '@' REG
  105.        ADDC      A ',' REG
  106.  
  107.        ANL       A ',' '#' expr
  108.        ANL       A ',' '@' REG
  109.        ANL       A ',' REG
  110.        ANL       BUS ',' '#' expr       INSTNOT41
  111.        ANL       P1 ',' '#' expr
  112.        ANL       P2 ',' '#' expr
  113.  
  114.        ANLD      P47 ',' A
  115.  
  116.        CALL      expr
  117.  
  118.        CLR       A
  119.        CLR       C
  120.        CLR       F0
  121.        CLR       F1
  122.  
  123.        CPL       A
  124.        CPL       C
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.                                   - 3 -
  137.  
  138.  
  139.  
  140.        Opcode   Syntax                  Selection Criteria
  141.  
  142.        CPL       F0
  143.        CPL       F1
  144.  
  145.        DA        A
  146.  
  147.        DEC       A
  148.        DEC       REG
  149.  
  150.        DIS       I
  151.        DIS       TCNTI
  152.  
  153.        DJNZ      REG ',' expr
  154.  
  155.        EN        DMA                    INST41
  156.        EN        FLAGS                  INST41
  157.        EN        I
  158.        EN        TCNTI
  159.  
  160.        ENT0      CLK                    INSTNOT41
  161.  
  162.        HALT                             INSTIDL
  163.  
  164.        IDL                              INSTIDL
  165.  
  166.        IN        A ',' DBB              INST41
  167.        IN        A ',' P1
  168.        IN        A ',' P2
  169.  
  170.        INC       '@' REG
  171.        INC       A
  172.        INC       REG
  173.  
  174.        INS       A ',' BUS              INSTNOT41
  175.  
  176.        JB0       expr
  177.  
  178.        JB1       expr
  179.  
  180.        JB2       expr
  181.  
  182.        JB3       expr
  183.  
  184.        JB4       expr
  185.  
  186.        JB5       expr
  187.  
  188.        JB6       expr
  189.  
  190.        JB7       expr
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.                                   - 4 -
  203.  
  204.  
  205.  
  206.        Opcode   Syntax                  Selection Criteria
  207.  
  208.  
  209.        JC        expr
  210.  
  211.        JF0       expr
  212.  
  213.        JF1       expr
  214.  
  215.        JMP       expr
  216.  
  217.        JMPP      '@' A
  218.  
  219.        JNC       expr
  220.  
  221.        JNI       expr                   INSTNOT41
  222.  
  223.        JNIBF     expr                   INST41
  224.  
  225.        JNT0      expr
  226.  
  227.        JNT1      expr
  228.  
  229.        JNZ       expr
  230.  
  231.        JOBF      expr                   INST41
  232.  
  233.        JT0       expr
  234.  
  235.        JT1       expr
  236.  
  237.        JTF       expr
  238.  
  239.        JZ        expr
  240.  
  241.        MOV       '@' REG ',' '#' expr
  242.        MOV       '@' REG ',' A
  243.        MOV       A ',' '#' expr
  244.        MOV       A ',' '@' REG
  245.        MOV       A ',' PSW
  246.        MOV       A ',' T
  247.        MOV       A ',' REG
  248.        MOV       PSW ',' A
  249.        MOV       STS ',' A
  250.        MOV       T ',' A
  251.        MOV       REG ',' '#' expr
  252.        MOV       REG ',' A
  253.  
  254.        MOVD      A ',' P47
  255.        MOVD      P47 ',' A
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.                                   - 5 -
  269.  
  270.  
  271.  
  272.        Opcode   Syntax                  Selection Criteria
  273.  
  274.        MOVP3     A ',' '@' A
  275.  
  276.        MOVP      A ',' '@' A
  277.  
  278.        MOVX      '@' REG ',' A          INSTNOT41
  279.        MOVX      A ',' '@' REG          INSTNOT41
  280.  
  281.        NOP
  282.  
  283.        ORL       A ',' '#' expr
  284.        ORL       A ',' '@' REG
  285.        ORL       A ',' REG
  286.        ORL       BUS ',' '#' expr       INSTNOT41
  287.        ORL       P1 ',' '#' expr
  288.        ORL       P2 ',' '#' expr
  289.  
  290.        ORLD      P47 ',' A
  291.  
  292.        OUT       DBB ',' A              INST41
  293.  
  294.        OUTL      BUS ',' A              INSTNOT41
  295.        OUTL      P1 ',' A
  296.        OUTL      P2 ',' A
  297.  
  298.        RET
  299.  
  300.        RETR
  301.  
  302.        RL        A
  303.  
  304.        RLC       A
  305.  
  306.        RR        A
  307.  
  308.        RRC       A
  309.  
  310.        SEL       MSELC                  INSTNOT41
  311.        SEL       RSELC
  312.  
  313.        STOP      TCNT
  314.  
  315.        STRT      CNT
  316.        STRT      T
  317.  
  318.        SWAP      A
  319.  
  320.        XCH       A ',' '@' REG
  321.        XCH       A ',' REG
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.                                   - 6 -
  335.  
  336.  
  337.  
  338.        Opcode   Syntax                  Selection Criteria
  339.  
  340.        XCHD      A ',' '@' REG
  341.  
  342.        XRL       A ',' '#' expr
  343.        XRL       A ',' '@' REG
  344.        XRL       A ',' REG
  345.  
  346.        A.2.2  _✓O_✓p_✓e_✓r_✓a_✓n_✓d_✓s
  347.  
  348.             REG                 REG can be any of r0, r1, r2, r3,
  349.                                 r4, r5, r6, r7, unless proceeded by
  350.                                 a
  351.  
  352.             MSELC               MSELC represents the symbols mb0
  353.                                 and mb1.
  354.  
  355.             RSELC               RSELC represents the symbols rb0
  356.                                 and rb1.
  357.  
  358.             P47                 P47 represents the symbols p4, p5,
  359.                                 p6, p7.
  360.  
  361.        There are uppercase versions of all the reserved symbols.
  362.  
  363.        A.2.3  _✓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
  364.  
  365.             INSTIDL             The instruction is only available
  366.                                 on CMOS implementations.
  367.  
  368.             INSTNOT41           The instruction is not available in
  369.                                 the 8041.
  370.  
  371.             INST41              The instruction is only available
  372.                                 in the 8041.
  373.  
  374.        A.2.4  _✓A_✓p_✓o_✓s_✓t_✓r_✓o_✓p_✓h_✓e_✓s  The apostrophes in the syntax field are
  375.        a notation used for the parser generator and are not put in
  376.        the assembler source statement.
  377.  
  378.        A.3  N✓N✓N✓No✓o✓o✓ot✓t✓t✓te✓e✓e✓es✓s✓s✓s
  379.  
  380.        A.3.1  _✓R_✓e_✓s_✓e_✓r_✓v_✓e_✓d__✓S_✓y_✓m_✓b_✓o_✓l_✓s
  381.  
  382.        A.3.1.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 BUS C CLK CNT
  383.        DBB DMA F0 F1 FLAGS I MB0 MB1 P1 P2 P4 P5 P6 P7 PSW R0 R1 R2
  384.        R3 R4 R5 R6 R7 RB0 RB1 STS T TCNT TCNTI a bus c clk cnt dbb
  385.        dma f0 f1 flags i mb0 mb1 p1 p2 p4 p5 p6 p7 psw r0 r1 r2 r3
  386.        r4 r5 r6 r7 rb0 rb1 sts t tcnt tcnti
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.                                   - 7 -
  401.  
  402.  
  403.  
  404.        A.3.1.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
  405.        HIGH LE LOW LT MOD NE NOT OR SHL SHR XOR and defined eq ge
  406.        gt high le low lt mod ne not or shl shr xor
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.                                  CONTENTS
  471.  
  472.  
  473.        A.  Appendix for as8048 Frankenstein Assembler...........  1
  474.            A.1  Pseudo Operations...............................  1
  475.            A.2  Instructions....................................  2
  476.            A.3  Notes...........................................  6
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.                                   - i -
  525.  
  526.  
  527.  
  528.  
  529.