home *** CD-ROM | disk | FTP | other *** search
/ MacGames Sampler / PHT MacGames Bundle.iso / MacSource Folder / Samples from the CD / Assembly / Mac68k / MANUAL / MAN5.DOC < prev    next >
Encoding:
Text File  |  1985-08-11  |  12.1 KB  |  559 lines  |  [TEXT/Anon]

  1.  
  2. MAC.68K
  3.  
  4.  
  5.  
  6.                                 BSS                                BSS                                BSS
  7.  
  8.  
  9.   PURPOSE         To switch assembly into the block storage segment.
  10.  
  11.  
  12.   FORMAT               BSS
  13.  
  14.  
  15.   DESCRIPTION     BSS changes the current assembly segment to the
  16.                block storage segment. Instructions and data
  17.                generating op codes may not be used within this
  18.                segment. Storage may be allocated and symbols defined
  19.                by using the DS op codes.
  20.  
  21.  
  22.  
  23.   EXAMPLE              BSS
  24.                BUFF    DS       128
  25.                NAME    DS.B     8
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.                                 COMM                                COMM                                COMM
  34.  
  35.  
  36.   PURPOSE         To declare a common area.
  37.  
  38.  
  39.   FORMAT               COMM   label,expression
  40.  
  41.  
  42.   DESCRIPTION     COMM specifies a symbol name (label) and a length
  43.                (expression) to be set up as a shared area with other
  44.                programs. The link utility LO68 (CPM-68K only) will
  45.                establish one starting address for all common areas
  46.                with the same label name. The length of this area will
  47.                be the largest value specified from the linked
  48.                programs.
  49.  
  50.  
  51.  
  52.   EXAMPLES
  53.                      COMM     BUFFER,$100
  54.                      COMM     FOO,2
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                               -21-                              MAC.68K
  64.                                                                 MAC.68K
  65.  
  66.  
  67.                                 DATA                                DATA                                DATA
  68.  
  69.  
  70.  
  71.   PURPOSE         To switch assembly into the data segment.
  72.  
  73.  
  74.  
  75.   FORMAT               DATA
  76.  
  77.  
  78.  
  79.   DESCRIPTION     DATA changes the current assembly segment to the
  80.                data segment. Any data, instruction, or reservation op
  81.                code may be used within the DATA segment.
  82.  
  83.  
  84.  
  85.   EXAMPLE              DATA
  86.               ANAME    DC.L     'QUIRK'
  87.               BOOKS    DS       120
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125. MAC.68K                                  -22-
  126. MAC.68K
  127.  
  128.  
  129.                                 DC                                DC                                DC
  130.                                 DC.B                                DC.B                                DC.B
  131.                                 DC.L                                DC.L                                DC.L
  132.  
  133.  
  134.  
  135.   PURPOSE         To declare data values.
  136.  
  137.  
  138.  
  139.   FORMAT       symbol  DC     expression
  140.  
  141.  
  142.  
  143.   DESCRIPTION     DC places the value of expression into one or more
  144.                word, byte, or long word memory locations. Numeric
  145.                data types are placed into a single unit of the
  146.                specified memory size. Character data types are
  147.                aligned and placed into however many units of sized
  148.                memory necessary to contain the entire string.  DC and
  149.                DC.L are automatically aligned to an even word
  150.                boundary.  DC.B may begin on an odd byte boundary.
  151.  
  152.  
  153.  
  154.   EXAMPLES
  155.               DATE    DC     10L 04/21/78
  156.               TIME    DC.L   #L* 11:34 *
  157.               LIST    DC.B   'A','Z',0
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.                               -23-                              MAC.68K
  188.                                                                 MAC.68K
  189.  
  190.  
  191.                                DEFER                               DEFER                               DEFER
  192.  
  193.  
  194.  
  195.   PURPOSE         To define a block of source line input that is to be
  196.                saved and then inserted later.
  197.  
  198.  
  199.  
  200.   FORMAT               DEFER
  201.              defname   DEFER
  202.  
  203.  
  204.  
  205.   DESCRIPTION     DEFER marks the beginning and end of a block of
  206.                code that is to be appended to an internal buffer.
  207.                Multiple named DEFER buffers may be active and are
  208.                specified by use of the defname in the location field
  209.                of the beginning DEFER.  A subsequent HERE pseudo op
  210.                empties the specified buffer, and the accumulated
  211.                block(s) of code are assembled. DEFERs cannot be
  212.                nested.
  213.  
  214.                    Defered code is saved in memory buffers until it
  215.                is used. The number of active buffers and the amount
  216.                of code in them is limited only by available memory
  217.                space.
  218.  
  219.  
  220.  
  221.   EXAMPLES         see example for pseudo op HERE
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249. MAC.68K                                  -24-
  250. MAC.68K
  251.  
  252.  
  253.                                 DS                                DS                                DS
  254.                                 DS.B                                DS.B                                DS.B
  255.                                 DS.L                                DS.L                                DS.L
  256.  
  257.  
  258.  
  259.   PURPOSE         To reserve storage.
  260.  
  261.  
  262.  
  263.   FORMAT               DS     expression
  264.              symbol    DS     expression
  265.  
  266.  
  267.  
  268.   DESCRIPTION     DS reserves expression number of words, bytes, or
  269.                long words in memory. If a symbol is used in the
  270.                location field it is assigned the current value of the
  271.                location counter. DS and DS.L are automatically
  272.                aligned to an even word boundary. DS.B may begin on an
  273.                odd byte boundary.
  274.  
  275.  
  276.  
  277.   EXAMPLES
  278.               BUFFER   DS.B    $128
  279.                        DS      4
  280.               FILENAME DS.L    2
  281.               ALIGN    DS.W    0
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.                               -25-                              MAC.68K
  312.                                                                 MAC.68K
  313.  
  314.  
  315.                                 DUP                                DUP                                DUP
  316.  
  317.  
  318.  
  319.   PURPOSE         To define a block of code that is to be duplicated.
  320.  
  321.  
  322.  
  323.   FORMAT               DUP    dupcount
  324.              dupname   DUP    dupcount
  325.  
  326.  
  327.  
  328.   DESCRIPTION     DUP marks the beginning of a block of code
  329.                terminated by an ENDD. The expression dupcount
  330.                specifies the number of times the block is to be
  331.                duplicated. The duplication may be terminated at any
  332.                time with a STOPDUP pseudo op. A dupcount of zero
  333.                results in no assembly of the block of code.
  334.  
  335.                    DUP blocks may be nested up to 5 levels by using a
  336.                dupname on the DUP/ENDD pairs.
  337.  
  338.  
  339.  
  340.   EXAMPLES        DUP     10               REP4      DUP     4
  341.                   DS.B    1                          DS.L    1
  342.                   ENDD                               DC      20
  343.                                            REP4      ENDD
  344.  
  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. MAC.68K                                  -26-
  374. MAC.68K
  375.  
  376.  
  377.                                 ECHO                                ECHO                                ECHO
  378.  
  379.  
  380.  
  381.   PURPOSE         To duplicate a block of code while supplying arguments
  382.                for inline parameter substitution.
  383.  
  384.  
  385.  
  386.   FORMAT               ECHO   lnct,p1=(list1)
  387.              dupname   ECHO   ,p1=(list1),p2=(list2),...
  388.  
  389.  
  390.  
  391.   DESCRIPTION     ECHO marks the beginning of a block of code
  392.                specified by the optional line count field lnct, or
  393.                terminated by an ENDD when no line count field is
  394.                supplied. Up to 127 parameter names with variable
  395.                length lists may be used. The block is duplicated the
  396.                number of times equal to the shortest argument count
  397.                present in any of the lists.  The duplication may be
  398.                terminated at any time with a STOPDUP pseudo op. A
  399.                list with no arguments results in no assembly of the
  400.                block of code.
  401.  
  402.                    Parameter names and substitution rules are the
  403.                same as for MACRO. Null arguments are allowed, and
  404.                arguments may be embedded within parenthesis pairs.
  405.  
  406.                    ECHO blocks may be nested up to 5 levels by using
  407.                a dupname on the ECHO/ENDD pairs.
  408.  
  409.  
  410.  
  411.   EXAMPLES        ECHO    1,CC=(A,B,C)
  412.                   DC.B    'CC'
  413.  
  414.                   ECHO    ,AA=(1,1,2),BB=(A,B,C2)
  415.                   DS.B    AA
  416.                   DC.B    'BB'
  417.                   ENDD
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.                               -27-                              MAC.68K
  436.                                                                 MAC.68K
  437.  
  438.  
  439.                                 ELSE                                ELSE                                ELSE
  440.  
  441.  
  442.  
  443.   PURPOSE         To reverse the current state of an IF test.
  444.  
  445.  
  446.  
  447.   FORMAT                ELSE                        ELSE    lnct
  448.                ifname   ELSE               ifname   ELSE    lnct
  449.  
  450.  
  451.  
  452.   DESCRIPTION     An ELSE is used to stop assembly and begin skipping
  453.                source lines within an IF block, or to stop skipping
  454.                source lines and resume assembly. A named ELSE with an
  455.                ifname that matches the current skip ifname, or an
  456.                unnamed ELSE stops source line skipping started by an
  457.                IF, SKIP, or another ELSE.
  458.  
  459.                    If a line count lnct is specified, then an ELSE
  460.                that stops assembly ignores the next lnct lines.
  461.                Otherwise the assembly ignores lines until an unnamed
  462.                ENDC, an ENDC with a matching ifname, or another ELSE
  463.                is encountered.
  464.  
  465.  
  466.  
  467.   EXAMPLES
  468.  
  469.     IFEQ    OPT,10          IFEQ    OPT,10          FOO   IFEQ    OPT,10
  470.     MOVEQ   #1,D0           MOVEQ   #1,D0                 MOVEQ   #1,D0
  471.     ELSE                    ELSE    1               FOO   ELSE
  472.     MOVEQ   #2,D0           MOVEQ   #2,D0                 MOVEQ   #2,D0
  473.     ENDC                                            FOO   ENDC
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497. MAC.68K                                  -28-
  498. MAC.68K
  499.  
  500.  
  501.                                 END                                END                                END
  502.  
  503.  
  504.   PURPOSE         To signal the end of program text.
  505.  
  506.  
  507.   FORMAT               END
  508.  
  509.  
  510.   DESCRIPTION     END terminates the assembly of a program. It is a
  511.                required card and an error will be flagged if an end
  512.                of source file input is reached without an END card.
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.                                 ENDC                                ENDC                                ENDC
  521.  
  522.  
  523.   PURPOSE         To terminate source line skipping and resume assembly.
  524.  
  525.  
  526.   FORMAT               ENDC
  527.              ifname    ENDC
  528.  
  529.  
  530.   DESCRIPTION     ENDC terminates source line skipping. If skipping
  531.                is not active ENDC has no effect. If skipping is being
  532.                done with a line count, the ENDC is counted as a line
  533.                but otherwise has no effect. A named ENDC terminates
  534.                skipping only if its name matches the active ifname.
  535.  
  536.  
  537.  
  538.   EXAMPLES        IFEQ    X                          IFEQ    X
  539.                   MOVE    A2,D1                      MOVE    A2,D1
  540.                   ELSE    6                          ELSE
  541.                   IFEQ    Z                  FOO     IFEQ    Z
  542.                   MOVE    A3,D1                      MOVE    A3,D1
  543.                   ELSE    2                  FOO     ELSE    2
  544.                   MOVE    A4,A1                      MOVE    A4,D1
  545.                   ENDC                               ENDC
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.                               -29-                              MAC.68K