home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / sigm / vols000 / vol092 / a68k.doc < prev    next >
Text File  |  1984-04-29  |  8KB  |  265 lines

  1.  
  2.  
  3.  
  4.                       A68K - 68000 Cross Assembler Notes
  5.           
  6.                                    11/09/82
  7.           
  8.           
  9.           Command line to invoke the assembler:
  10.           
  11.                   A68K <filename>                   ; short form
  12.                   A68K <object>,<listing>=<source>  ; full form
  13.           
  14.                   ----------------- Equivalence ----------------
  15.           
  16.                   XYZ                 XYZ.HEX,XYZ.PRN=XYZ.ASM
  17.                   ,CON:=XYZ           NUL:,CON:=XYZ.ASM
  18.                   XYZ,=XYZ            XYZ.HEX,NUL:=XYZ.ASM
  19.                   XYZ.OBJ=XYZ.SRC     XYZ.OBJ,XYZ.PRN=XYZ.SRC
  20.                   ,CON:=CON:          NUL:,CON:=CON:
  21.           
  22.                   Object file may be in Motorola S-record (default)
  23.                   or Intel HEX format.
  24.           
  25.           
  26.           <symbol>  SET   <expression>            ; temp val
  27.           <symbol>  EQU   <expression>            ; perm val
  28.           <symbol>  REG   <register expression>   ; perm val
  29.           
  30.                   Note that a size attribute may be tacked onto
  31.                   SET or EQU to govern the way string constants
  32.                   appearing in the expression are handled.  The
  33.                   default size is long.  String  constants  are
  34.                   left justified  according  to  size  and zero
  35.                   filled.
  36.           
  37.           <register expression>          for use in MOVEM
  38.                   <Rn>    <next reg>
  39.           
  40.           <next reg>
  41.                   - <Rn>   <next reg>
  42.                   /        <register expression>
  43.           
  44.           <Rn>
  45.                   A <rnum>
  46.                   D <rnum>
  47.           
  48.           
  49.           Labels are symbols which receive the current value of
  50.                   the program counter.
  51.                   For labels beginning in column 1, colon is optional.
  52.                   For labels preceded by blanks,    colon is required.
  53.           
  54.           
  55.                     OPT   <option>,<option>,.....
  56.           
  57.           <option>
  58.                   BRL     ; long  branch forward ref. - default
  59.                   BRS     ; short branch forward ref.
  60.                   FRL     ; long  absolute fwd. ref.  - default
  61.                   FRS     ; short absolute fwd. ref.
  62.                   OBJ-S   ; hex file Motorola style   - default
  63.                   OBJ-H   ; hex file Intel style (16 bit address limit)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                   NOP1L   ; no pass 1 listing         - default
  71.                   P1L     ;    pass 1 listing
  72.           
  73.           
  74.           * <comment>
  75.           
  76.           
  77.            .S & .L  may be appended to BRA, BSR, Bcc, JMP and JSR
  78.                   to override automatic size determination.
  79.                   They  may  also  be   appended  to  absolute  address
  80.                   operands in other instructions.  But, it is necessary
  81.                   to isolate  the  period  from a  symbol  by enclosing
  82.                   the symbol in parentheses.  This  is  due to the fact
  83.                   that period is a valid character in symbols.
  84.           
  85.           
  86.           <symbol>
  87.                   Symbols begin with a letter or period.  Additional
  88.                   characters may be letters, digits, periods, dollar
  89.                   signs and underscores.
  90.           
  91.                   * represents the program counter
  92.           
  93.                   Symbols may have up to 31 significant characters.
  94.           
  95.                   The symbol table is currently of fixed size:
  96.                            500 Symbols max
  97.                           2000 Characters max
  98.           
  99.           
  100.           Constants begin with:
  101.                   char    - '
  102.                   hex     - $
  103.                   octal   - @
  104.                   binary  - %
  105.                   decimal - 0 thru 9
  106.           
  107.           
  108.           Strings:
  109.                   Delimited by '
  110.                   '' represents '
  111.           
  112.           
  113.           Expressions and symbols are classified as constants
  114.                   or addresses.
  115.           
  116.           
  117.           Operators for expressions (in precedence group order):
  118.           
  119.                   + -
  120.           
  121.                   * /        only implemented for 16 bits now
  122.                   \          mod - only 16 bits for now
  123.           
  124.                   &          AND
  125.                   ! |        both allowed for OR
  126.                   ^          exclusive OR
  127.           
  128.                   <<         shift left
  129.                   >>         shift right
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.           
  137.                   -          unary minus
  138.                   ~          unary NOT
  139.           
  140.                   Except for + and -,  only  expressions  which evaluate
  141.                   constants are allowed as  operands to  operators.  For
  142.                   + and -, (a + a) and (c - a) produce errors.  Embedded
  143.                   spaces are not allowed in expressions (spaces serve as
  144.                   field delimiters).
  145.           
  146.           
  147.           Automatic conversions:
  148.           
  149.                   ADD     #e   ,<ea>      ADDQ or ADDI when possible
  150.                           <ea> ,An        ADDA
  151.           
  152.                   SUB     #e   ,<ea>      SUBQ or SUBI when possible
  153.                           <ea> ,An        ADDA
  154.           
  155.                   CMP     #e   ,<ea>      CMPI when possible
  156.                           (An)+,(An)+     CMPM
  157.                           <ea> ,An        CMPA
  158.           
  159.                   AND     #e   ,<ea>      ANDI when possible
  160.           
  161.                   OR      #e   ,<ea>      ORI  when possible
  162.           
  163.                   EOR     #e   ,<ea>      EORI when possible
  164.           
  165.           
  166.           Addressing Mode Syntax Interpretation:
  167.           
  168.                           c  expression must evaluate to constant
  169.                           a  expression must evaluate to address
  170.                           b  expression may  evaluate to either
  171.           
  172.               Syntax used            Interpreted as    Mode,reg
  173.                   # e                     #c              7,4
  174.           
  175.                   D n                     Dn              0
  176.           
  177.                   A n                     An              1
  178.           
  179.                   - ( A n )               -(An)           4
  180.           
  181.                   ( A n ) +               (An)+           3
  182.           
  183.                   ( A n )                 (An)            2
  184.           
  185.                   ( A n , R i )
  186.                   ( A n , R i . W )       0(An,Ri.s)      6
  187.                   ( A n , R i . L )
  188.           
  189.                   e ( A n , R i )
  190.                   e ( A n , R i . W )     c(An,Ri.s)      6
  191.                   e ( A n , R i . L )
  192.           
  193.                   e ( A n )               c(An)           5
  194.           
  195.                   e ( D i )
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.                   e ( R i . W )           a(PC,Ri.s)      7,3
  203.                   e ( R i . L )
  204.           
  205.                   e ( PC , R i )
  206.                   e ( PC , R i . W )      a(PC,Ri.s)      7,3
  207.                   e ( PC , R i . L )
  208.           
  209.                   e ( PC )                a(PC)           7,2
  210.           
  211.                   e . L                   b.L             7,1          **
  212.           
  213.                   e . S                   b.S             7,0          **
  214.           
  215.                   e                       b               7,0 or 7,1   **
  216.           
  217.                   ****   SP may be used for A7 anywhere An appears, but not
  218.                   where Ri appears for index specification.
  219.           
  220.                   **     Explicit  range   specification   via   (.S or .L)
  221.                   overrides  the  automatic range  selection  for  absolute
  222.                   addressing.  For auto, if the expression contains forward
  223.                   references, the  range is  determined by  the "FR" option
  224.                   currently in  effect  (FRL default).   If  the expression
  225.                   contains  no  forward references, the range is made short
  226.                   if the expression lies between -32768 and +32767.
  227.           
  228.           
  229.           
  230.           
  231.           
  232.           
  233.           
  234.           
  235.           
  236.           
  237.           
  238.           
  239.           
  240.           
  241.           
  242.           
  243.           
  244.           
  245.           
  246.           
  247.           
  248.           
  249.           
  250.           
  251.           
  252.           
  253.           
  254.           
  255.           
  256.           
  257.           
  258.           
  259.           
  260.           
  261.           
  262.  
  263.  
  264.  
  265.