home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 363_01 / asm68020.doc < prev    next >
Text File  |  1991-09-26  |  29KB  |  730 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.                                      68020
  19.                                 CROSSASSEMBLER
  20.  
  21.                                  Version 1.0
  22.                                  Autumn 1991
  23.  
  24.                                       by
  25.  
  26.                                Andrew E. Romer
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.      The information in this document has been carefully checked and is
  34. believed to be entirely reliable. No responsibility, however, is assumed for
  35. inaccuracies.
  36. Index
  37. 1.  Introduction
  38. 2.  Assembler command line
  39. 3.  Source file format
  40.     3.1. Empty statement
  41.     3.2. Label statement
  42.     3.3. Comment statement
  43.     3.4. Full statement
  44. 4.  Statement fields
  45.     4.1. Label field
  46.     4.2. Operation field
  47.     4.3. Operand field
  48.     4.4. Comment field
  49. 5.  Character set
  50. 6.  Microprocessor instructions
  51. 7.  Assembler directives
  52.     7.1. END
  53.     7.2. ORG
  54.     7.3. EQU
  55.     7.4. SET
  56.     7.5. REG
  57.     7.6. DC - define constant
  58.     7.7. DCB - define constant block
  59.     7.8. DS - define storage
  60. 8.  Expressions
  61.     8.1. Numeric values
  62.     8.2. Order of precedence
  63.     8.3. Operators
  64. 9.  Assembler processing
  65. 10. Addressing modes
  66.     10.1. Size
  67.     10.2. QUICK instructions
  68. 11. Assembler output
  69. 12. Assembly listing
  70. 13. Error reporting
  71. 14. References
  72.  
  73.  
  74. 1. Introduction.
  75.  
  76.     The 68020 Cross-Assembler is an IBM PC (or compatible) program that
  77. processes source program statements written in the 68020 Assembly Language and
  78. produces machine-readable binary code.
  79.     This Assembler is an upgrade of the 68000 Cross-Assembler, Ref. 2; it has
  80. been designed to conform to the format defined by Motorola (Ref. 1).
  81.  
  82. 2. Assembler command line
  83.  
  84.     The Assembler is invoked by the following command line, entered at the DOS
  85. prompt:
  86.  
  87.             asm [-switches] filename
  88.  
  89.  
  90. where 'filename' is the name of the source file. If 'filename' has no
  91. extension then '.asm' extension is assumed by default. Otherwise the specified
  92. extension is used.
  93.  
  94.     The following optional switches are valid:
  95.  
  96.              c  - Generates full hex code listing. Only one line of listing is
  97.                   generated by default. This switch has no effect if the -l
  98.                   switch is not invoked.
  99.              h  - Displays a brief help message on the screen. No other
  100.                   switches have any effect if this switch is invoked, and
  101.                   'filename' is not processed.
  102.              l  - Enables assembly listing file 'filename.lis' generation.
  103.                   No assembly listing file is generated by default.
  104.              n  - Disables the target code generation. The target code
  105.                   'filename.h68'is generated by default.
  106.  
  107.     The switches can be entered, in arbitrary sequence, without intervening
  108. spaces, after the '-' character, or each switch can be entered following a
  109. separate '-', in which case separating spaces are required. Therefore the
  110. following examples are valid:
  111.  
  112.             asm -lc filename
  113.             asm -cl filename
  114.             asm -l -c filename
  115.  
  116.     The help message can also be displayed by entering:
  117.  
  118.                 -  asm
  119.  
  120. (without arguments), or
  121.  
  122.                 -  asm ?
  123.  
  124. at the DOS prompt.
  125.  
  126. 3. Source file format
  127.  
  128.     An assembler source file is an ASCII file which contains a sequence of
  129. source statements. The first source statement begins with the first character
  130. of the source file and is terminated by the 'newline character', NL; the
  131. statements following the first are delimited by NL's.
  132.     Under DOS NL is a sequence of two characters: Carriage Return CR
  133. (hexadecimal 0D) followed by Line Feed LF (hexadecimal 0A). The characters
  134. contained between, but excluding, the NL delimiters are the statement context.
  135.  
  136. 3.1. Empty statement
  137.  
  138.     A source statement whose context consists exclusively of white space
  139. (blanks and horizontal tabs) is called an empty statement. Empty statements do
  140. not generate target code, but are included in the assembly listing.
  141.  
  142. 3.2. Label statement
  143.  
  144.     A label statement consists of a 'valid first label-character', optionally
  145. followed by a sequence of 'valid subsequent label-characters', followed by a
  146. colon ':', and, optionally, by white space. Valid first, and subsequent, label
  147. characters are defined in the paragraph "label field" below.
  148.     No white space may precede the label.
  149.  
  150. 3.3. Comment statement
  151.  
  152.     A statement beginning with the asterisk ('*') is a comment statement.
  153. Comment statements do not generate target code, but their context is included
  154. in the assembly listing. Comments can also be included in the comment field of
  155. a full statement.
  156.  
  157.  
  158. 3.4. Full statement
  159.  
  160.     A full statement consists of up to 4 fields: label field, operation field,
  161. operand field, and comment field. The fields are separated by white space.
  162.     The label field is optional as a rule. The exceptions from this rule are
  163. listed in 7.
  164.     The operation field is obligatory. The operand field is not always
  165. required, and if it is not required then the characters entered in the operand
  166. field are regarded as belonging to the comment field. The comment field is
  167. optional.
  168.  
  169. 4. Statement fields
  170.  
  171. 4.1. Label field
  172.  
  173.     If the first character of a statement line is a white-space character then
  174. the label field is empty. Otheriwse it must be a 'valid first label-character',
  175. optionally followed by 'valid subsequent label-characters'.
  176.     Valid first label-character may be any of the following:
  177.  
  178.     - letters of the alphabet A...Z, a...z
  179.     - the underscore _
  180.     - the full stop .
  181.  
  182. and valid subsequent label-characters may be:
  183.  
  184.     - letters of the alphabet A...Z, a...z
  185.     - the numerals 0...9
  186.     - the underscore _
  187.  
  188.     Upper and lower case letters are not distinct, i.e. name, NAME or nAMe are
  189. regarded as identical. Only the first eight characters are significant, i.e.
  190. longname, longnameone, longname123 are regarded as identical, but will be
  191. passed to the assembly listing unchanged, as will the spelling using upper and
  192. lower cases.
  193.     Using labels differing in the characters beyond the eighth, and labels
  194. using different case spelling, is not recommended as it makes the source code
  195. more difficult to understand.
  196.     Certain operations require the label field to be present, and some require
  197. it not to be present (7. Assembler directives). If the source line contravenes
  198. either of these requirements then an error message, or warning message, is
  199. generated by the assembler (see 13. Error reporting).
  200.     Labels associated with an opcode become equal to the value of the
  201. assembler program counter at the time when the source line is read; those
  202. associated with directives are defined by the directive itself.
  203.     The uses of a label include: a symbol in an expression,  an address
  204. pointer.
  205.  
  206. 4.2. Operation field
  207.  
  208.     An operation field is always required in a full statement. An operation,
  209. represented by the operation mnemonic, can either be a microprocessor
  210. instruction, or an assembler directive. An instruction, together with its
  211. operand, if required, will cause the assembler to generate a corresponding
  212. binary operation code (opcode) that can be acted upon by the microprocessor.
  213. The opcode generated is entered as a sequence of hexadecimal digits in the
  214. target and listing files.
  215.     An assembler directive generates no opcode, it instructs the assembler to
  216. follow a specified course of action instead.
  217.  
  218. 4.3. Operand field
  219.  
  220.     If the opcode or directive requires an operand then the field immediately
  221. following the operation field is the operand field, otherwise it is the
  222. comment field. The operand field format depends on the operation it follows.
  223. For microprocessor instructions (opcodes) the operand format will be found in
  224. Ref. 1, for directives it will be defined together with the directive
  225. definition in this manual, see 7. Assembler directives.
  226.     If an operand is absent, and it is required for an operation, then an error
  227. message is issued.
  228.  
  229. 4.4. Comment field
  230.  
  231.     The comment field is optional. It generates no code, but is passed to the
  232. assembly listing unchanged. It can therefore be used to explain the meaning
  233. of the operation it is attached to. Skilful use of comments, whether in
  234. comment statements or in comment fields, is an important part of a good
  235. programming practice.
  236.  
  237. 5. Character set
  238.  
  239.     Except in character strings delimited by single quotes, the assembler does
  240. not distinguish between upper and lower cases of letters of the alphabet.
  241.     All printable characters are recognized by the assembler in quoted strings
  242. of characters. In these the single quote character is represented by
  243. repetition, to distinguish a single quote from the string terminator: 'It''s a
  244. string' is read by the assembler as: It's a string.
  245.     Characters valid in the label field have been defined in the field's
  246. description.
  247.     The following characters are valid in the operation field:
  248.  
  249.     - the letters of the alphabet,
  250.     - the full stop '.',
  251.     - the characters '[', ']', ':' (in bit field operations),
  252.  
  253.     The operand field recognizes:
  254.  
  255.     - the letters of the alphabet,
  256.     - the decimal digits,
  257.     - the numeric base designator prefix characters: $, @, %,
  258.     - the ASCII constant delimiter: ',
  259.     - the arithmetic operands: +, -, *, /, \,
  260.     - the Boolean operators: & (AND), ! (OR), ~ (NOT),
  261.     - shift operators: <<, >>
  262.     - the special characters: , (comma), : (colon), . (full stop), and the
  263.                                                  brackets (, ), [, ], {, },
  264.  
  265.     All printable characters are recognized in comments.
  266.  
  267. 6. Microprocessor instructions.
  268.  
  269.     All mnemonics defined by Motorola are recognized, as are the size
  270. specifiers:
  271.  
  272.                 .b - byte (8 bits),
  273.                 .s - short (8 bits),
  274.                 .w - word (16 bits),
  275.                 .l - long word (32 bits).
  276.  
  277. .b, .w, and .l are used with operations other than branch operations,
  278. .s, .w, and .l with branch operations.
  279.  
  280.     It is beyond the scope of this manual to describe the details of
  281. mnemonics, the full description can be found in Ref. 1.
  282.     If no size specifier is present then WORD size '.w' is assumed by default.
  283. In branch operations the size of the operation is calculated by the assembler
  284. and the smallest size necessary is used, provided that the destination of the
  285. branch operation is known when the operation is processed.
  286.     If the destination is not known then a 16-bit branch is assumed by default.
  287. If the assembler finds later that an 8-bit branch would be sufficient then a
  288. warning is issued; if the long branch is found necessary then the operation is
  289. flagged as an error.
  290.  
  291. 7. Assembler Directives
  292.  
  293. 7.1. END
  294.  
  295.     The END directive indicates the end of the source file, any source lines
  296. following this directive will be ignored by the assembler. This directive does
  297. not require an operand and must not have a label.
  298.     The use of the END directive is optional; if it is not present the
  299. assembler will process source lines until the end of the source file.
  300.  
  301. 7.2. ORG
  302.  
  303.     Format:
  304.  
  305.         [<label>]    ORG    <expression>
  306.  
  307.     The ORG (origin) directive resets the assembler's program counter to the
  308. directive's operand. The operand can be any valid arithmetic expression.
  309.     The directive may have, but does not require, a label. The label, if
  310. present, becomes equal to the directive's operand.
  311.  
  312. 7.3. EQU
  313.  
  314.     Format:
  315.  
  316.         <label>      EQU    <expression>
  317.  
  318.     The EQU (equate) directive equates the value of the obligatory label to
  319. the directive's operand. The operand can be any valid arithmetic expression
  320. and must be defined before the point at which the EQU directive appears. The
  321. label defined by the EQU directive must not be redefined.
  322.  
  323. 7.4. SET
  324.  
  325.     Format:
  326.  
  327.         <label>      SET    <expression>
  328.  
  329.     The SET directive equates the value of the obligatory label to the
  330. directive's operand. The operand can be any valid arithmetic expression and
  331. must be defined before the point at which the SET directive appears. The
  332. label defined by the SET directive, unlike the EQU directive, may be
  333. redefined.
  334.  
  335. 7.5. REG
  336.  
  337.     Format:
  338.  
  339.         <label>      REG    <register range>[/<register range>...]
  340.  
  341.     The REG directive equates the obligatory label to the register list, to be
  342. handled as a single operand by subsequent MOVEM instructions.
  343.  
  344.     The 'register range' operand can either be a single register, <Dn> or <An>,
  345. or a range of registers <Dn-Dm>, <An-Am>. The registers and ranges may be
  346. specified in any order, thus all the following are identical:
  347.  
  348.     D1/D2/D3/A0/A1/A2/A3, D1-D3/A0-A3, A3-A0/D3-RD
  349.  
  350. 7.6. DC - define constant
  351.  
  352.     Format:
  353.  
  354.         [<label>]    DC[.<size>]   <item>[,<item>...]
  355.  
  356.     This directive will cause aa appropriate number of memory locations to be
  357. initialized to the values specified by the consecutive item operands. The
  358. optional label is equated to the address of the start of the block, and the
  359. size parameter defines the number of bytes allocated for each item. The item
  360. argument is an expression defining the value to be placed in the corresponding
  361. memory locations.
  362.  
  363. 7.7. DCB - define constant block
  364.  
  365.     Format:
  366.  
  367.         [<label>]    DCB[.<size>]    <length>,<value>
  368.  
  369.     The optional label is equated to the address of the start of the block.
  370. The size code specifies a block of bytes (size code .B), words (.W) or long
  371. words (.L). If the size code is omitted then word size is assumed.
  372.     The length argument can be any non-negative expression, it defines the
  373. number of elements in the block. It has to be defined before the statement
  374. where the DCB directive appears.
  375.     The value argument is an expression defining the value to be placed in
  376. each element of the block; it does not have to befined beforehand.
  377.     Word and long word sized elements are placed starting at a word boundary,
  378. the assembler will increment the location counter by one if necessary. On the
  379. other hand, a block of byte sized elements will start at any location, but the
  380. following instruction will be placed at a word boundary, again by incrementing
  381. the location counter if necessary.
  382.  
  383. 7.8. DS - define storage
  384.  
  385.     Format:
  386.  
  387.         [<label>]    DS[.<size>]    <length>
  388.  
  389.     The optional label is equated to the address of the start of the block.
  390. The size code specifies a block of bytes (size code .B), words (.W) or long
  391. words (.L). If the size code is omitted then word size is assumed.
  392.     The length argument can be any non-negative expression, it defines the
  393. number of elements in the block. It has to be defined before the statement
  394. where the DCB directive appears.
  395.     Word and long word sized elements are placed starting at a word boundary,
  396. the assembler will increment the location counter by one if necessary. On the
  397. other hand, a block of byte sized elements will start at any location, but the
  398. following instruction will be placed at a word boundary, again by incrementing
  399. the location counter if necessary.
  400.     The memory block reserved for storage by the DS directive is not
  401. initialized.
  402.  
  403. 8. Expressions
  404.  
  405.     An expression is a sequence of numeric values and operators.
  406.  
  407. 8.1 Numeric values
  408.  
  409.     The numeric values can be entered as symbols (4.1.), or as explicit values
  410. in a decimal, octal, binary, or hexadecimal base.
  411.     A sequence of decimal digits is assumed to be a decimal value. Explicit
  412. values in bases other than decimal are denoted by preceding the sequence of
  413. digits with the base  designator:
  414.  
  415.             binary          %
  416.             octal           @
  417.             hexadecimal     $
  418.  
  419.     The usual conventions apply as regards the digits used in non-decimal
  420. bases:
  421.  
  422.             binary digits   0, 1
  423.             octal           0, 1, 2, 3, 4, 5, 6, 7
  424.             hexadecimal     0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f
  425.                 or          0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
  426.  
  427.     Examples:
  428.  
  429.     Valid numeric values are: decimal:      0, 5, 142857
  430.                               binary:       %0, %101, %100010111000001001
  431.                               octal:        @0, @5, @427011
  432.                               hexadecimal:  $0, $5, $3fe, $FF7B
  433.  
  434.     All values in an expression, both intermediate and final, are limited to
  435. 32 bits. Larger values, whether entered or generated, are reduced modulo (2 to
  436. the power of 32) = $100000000.
  437.  
  438. 8.2. Order of precedence
  439.  
  440.     Expressions are evaluated in the usual order of precedence: the
  441. parenthesized sub-expressions are evaluated first, then the expression is
  442. evaluated in the order of precedence of the operators. Precedence of operators
  443. is listed below.
  444.  
  445. 8.3. Operators
  446.  
  447.     The operators recognized by the assembler are listed below, in groups of
  448. precedence. Highest precedence is listed first:
  449.  
  450.     1. Unary minus -,
  451.        Bitwise negation ~ (one's complement),
  452.     2. Left shift << (a<<b results in a shifted b bits, zero filled),
  453.        Right shift >> (a>>b results in a shifted b bits, zero filled),
  454.     3. Bitwise AND &,
  455.        Bitwise OR !
  456.     4. Multiplication *,
  457.        Division / (truncated integer division, i.e. 5/3=1),
  458.        Remainder \ (5\3=2),
  459.     5. Addition +,
  460.        Subtraction -.
  461.  
  462.     Operators of the same precedence are evaluated left to right.
  463.  
  464. 9. Assembler processing
  465.  
  466.     The assembler processes the source file in two passes.
  467.  
  468.     In the first pass:
  469.  
  470.      - each label string of characters is stored in the label table, together
  471.        with its value stored when the definition of the label is encountered,
  472.      - the number of target code bytes is established for each source line.
  473.  
  474.     When the number of target code bytes depends on the operand size, and the
  475. operand size is unknown at the time it is encountered (e.g. the operand uses
  476. a label which has not been defined yet), then the most pessimistic assumption
  477. (i.e. 32-bit size) is made, except for the branch operations. Branch operations
  478. of unknown size are assumed to be 16-bit branches.
  479.     At the second pass the required output (target code, assembly listing) is
  480. generated.
  481.     The assembler will make assumptions in some other cases. For instance MOVE
  482. mnemonic will be processed as MOVEA if the operand is an address, or as MOVEQ
  483. if the source operand is an immediate value not exceeding 8 bits and the target
  484. operand is a data register.
  485.  
  486. 10. Addressing modes
  487.  
  488.     All addressing modes of the effective address as specified in Ref. 1. are
  489. supported. The following symbols are used to describe the operand formats:
  490.  
  491.      Dn     = Data Register
  492.      An     = Address Register
  493.      SP     = A7
  494.      Xn     = Data or Address register used as Index register
  495.      size   = size code (B, W or L)
  496.      scale  = scale in indexed addressing (1, 2, 4 or 8)
  497.      d8     = 8-bit displacement
  498.      d16    = 16-bit displacement
  499.      bd     = base displacement (16- or 32-bit)
  500.      od     = outer displacement (16- or 32-bit)
  501.      ex16   = Expression that evaluates to a 16-bit value
  502.      ex     = Any expression
  503.      PC     = Program Counter
  504.  
  505.     The following register names may be also used as operands in certain
  506. instructions (e.g.: MOVEC to CCR):
  507.  
  508.      SR   = Status Register
  509.      CCR  = Condition Code Register
  510.      USP  = User Stack Pointer
  511.      SFC  = Source Function Code Register
  512.      DFC  = Destination Function Code Register
  513.      VBR  = Vector Base Register
  514.      CACR = Cache Control Register
  515.      CAAR = Cache Address Register
  516.      MSP  = Master Stack Pointer
  517.      ISP  = Interrupt Stack Pointer
  518.  
  519.                  Effective Address Modes
  520.  
  521. Mode                                                Assembler Format
  522. ---------------------------------------------       ----------------
  523. Data Register Direct                                Dn
  524. Address Register Direct                             An
  525. Address Register Indirect                           (An)
  526. Address Register Indirect with Postincrement        (An)+
  527. Address Register Indirect with Predecrement         -(An)
  528. Address Register Indirect with Displacement         (d16,An)
  529. Address Register Indirect with Index
  530.         (8-bit displacement)                        (d8,An,Xn.size*scale)
  531. Address Register Indirect with Index
  532.         (base displacement)                         (bd,An,Xn.size*scale)
  533. Memory Indirect Post-Indexed                        ([bd,An],Xn.size*scale,od)
  534. Memory Indirect Pre-Indexed                         ([bd,An,Xn.size*scale],od)
  535. Program Counter Indirect with Displacement          (d16,PC)
  536. Program Counter Indirect with Index
  537.         (8-bit displacement)                        (d8,PC,Xn.size*scale)
  538. Program Counter Indirect with Index
  539.         (base displacement)                         (bd,PC,Xn.size*scale)
  540. Program Counter Memory Indirect Post-Indexed        ([bd,PC],Xn.size*scale,od)
  541. Program Counter Memory Indirect Pre-Indexed         ([bd,PC,Xn.size*scale],od)
  542. Absolute Long Address                               (ex).L
  543. Absolute Short Address                              (ex16).W
  544. Immediate Data                                      #ex
  545.  
  546. In all non-indexed modes SP can be used in place of A7.
  547.  
  548. The following special cases of the above addressing modes, while legal, are not
  549. supported:
  550.  
  551.   - Memory Indirect with all elements suppressed    ([],,) and ([,],)
  552.   - Memory Indirect without index                   ([An],,) and ([An,],)
  553.   - Memory Indirect without base register           ([],Xn,) and ([,Xn],)
  554.   - PC Memory Indirect with all elements suppressed ([ZPC],,) and ([ZPC,],)
  555.   - PC Memory Indirect without index                ([PC],,) and ([PC,],)
  556.   - PC Memory Indirect without base register        ([ZPC],Xn,) and ([ZPC,Xn],)
  557.  
  558. 10.1. Size
  559.  
  560.     Many instructions, and directives, can have their size specified. The
  561. size specification is coded by appending .B for 8-bit, W for 12-bit, and .L
  562. for 32-bit size. The only exception is the set of the branch instructions
  563. where the three sizes are coded as .S, .W, and .L, respectively.
  564.     When the size specification is omitted, the assembler tries to make a
  565. guess: if the value of the expression is known at the first pass the assembler
  566. will allocate size as appropriate, otherwise it will allocate the 32-bit size
  567. as the most pessimistic assumption. Again the branch instructions are handled
  568. differently - 16-bit branches are assumed by default.
  569.     At the second pass all expression values are known and the assembler will
  570. flag excessive branch sizes as warnings, and 32-bit branches with 16-bit sizes
  571. as errors.
  572.     Not all microprocessor instructions accept all three sizes. Refer to
  573. Ref. 1. for details.
  574.  
  575. 10.2. QUICK instructions
  576.  
  577.     The three "quick" instructions: ADDQ, MOVEQ, and SUBQ are automatically
  578. selected by the assembler when the addressing mode and operand value conform
  579. to the "quick" version requirements:
  580.                 move.l #<data>,Dn
  581. will be coded as
  582.                 moveq #<data>,Dn
  583. if <data> is known at the first pass and does not exceed 8 bits, and similarly
  584.                 add[.size] #<data>,<ea>
  585.                 sub[.size] #<data>,<ea>
  586. will be coded as
  587.                 addq #<data>,<ea>
  588.                 subq #<data>,<ea>
  589. if <data> is known at the first pass and falls within the range of 1 to 8..
  590.     The MOVEQ instruction will accept both signed and unsigned operands, i.e.
  591. <data> within -128 and 255. Naturally, negative operands are coded as
  592. corresponding positive operands above 127, according to the rules of "two's
  593. complement", e.g. decimal values -55 and +201 will both be coded as hexadecimal
  594. C9.
  595.  
  596. 11. Assembler output
  597.  
  598.     The target code is stored in the file bearing the same file name as the
  599. source file, but with the extension changed to .H68. The code is stored using
  600. the Motorola S-record format.
  601.  
  602. 12. Assembly listing
  603.  
  604.     The assembly listing is stored in a file bearing the same name as the
  605. source file, but with the extension changed to .LIS. The listing format is
  606. as follows: each line starts with a 5-digit decimal line number, generated
  607. automatically by the assembler, followed by the 8-digit hexadecimal program
  608. counter value. This in turn is followed by the hexadecimal opcode and its
  609. argument, after which the source line is appended.
  610.     The listing is formatted. Whatever the size of the source file fields, the
  611. listing allocates the following field sizes, listed in the order of their
  612. appearance in the listing line:
  613.  
  614.         line number                 -   6 characters
  615.         program counter             -   9 characters
  616.         hex opcode and argument     -   35 characters
  617.         label field                 -   10 characters
  618.         opcode mnemonic             -   8 characters
  619.         operand                     -   16 characters
  620.         comment                     -   remainder of line.
  621.  
  622.     Except the line number and the program counter fields, each field's content
  623. can exceed its allocated size. If hexadecimal opcode and argument exceed their
  624. allocation, then only part of the code is shown, with an ellipsis ("...")
  625. appended to indicate that the listing is not complete. To show all code it is
  626. necessary to invoke the assembler with the -c option. In this case the
  627. remainder of the code is printed in the following line.
  628.     The fields following the line number and and the progrem counter use up as
  629. much space as required, with just one blank separating each field from the
  630. next.
  631.     Obviously it is not convenient to have lines overflowing the printer's
  632. line length. In most cases if the source line does not exceed 80 characters
  633. then the resulting listing line does not exceed 132 characters. Most printers
  634. can accommodate this line length, at least in condensed mode.
  635.  
  636. 13. Error reporting
  637.  
  638.     As the assembler processes each source statement it records any errors
  639. found. An error is classed according to its severity and recorded in an error
  640. buffer. If more than one error is found then the error in the buffer is
  641. replaced by the newly found one, provided, that the new error's severity is
  642. higher; otherwise the new error is ignored. When the source statement
  643. processing is complete, the error in the buffer is reported, both in the 
  644. assembly listing file in the line following the statement it refers to, and on 
  645. the screen.
  646.  
  647.     There are four severity classes:
  648.  
  649.       - severe errors,
  650.       - errors,
  651.       - minor errors,
  652.       - warnings.
  653.  
  654.     The format of an assembly listing error message is:
  655.  
  656.         ERROR: <error message>
  657.  
  658. for severe errors, errors, and minor errors, or
  659.  
  660.         WARNING: <error message>
  661.  
  662. for warnings. The error message appearing on the screen is preceded by:
  663.  
  664.         in line <line number>:
  665.  
  666.     There are the following error messages, listed according to severity:
  667.  
  668.     Severe errors:
  669.  
  670.       - Invalid syntax
  671.       - Invalid opcode
  672.       - Invalid addressing mode
  673.       - Label required with this directive
  674.       - Symbol value differs between first and second pass
  675.       - This code is not implemented
  676.       - Short branch to the immediately following instruction is not allowed
  677.  
  678.     Errors:
  679.  
  680.       - Undefined symbol
  681.       - Division by zero attempted
  682.       - Symbol multiply defined
  683.       - Register list multiply defined
  684.       - Register list symbol not previously defined
  685.       - Forward references not allowed with this directive
  686.       - Block length is less that zero
  687.  
  688.     Minor errors:
  689.  
  690.       - Invalid size code
  691.       - Invalid vector number
  692.       - Branch instruction displacement is out of range or invalid
  693.       - Displacement out of range
  694.       - Absolute address exceeds 16 bits
  695.       - Immediate data exceeds 3 bits
  696.       - Immediate data exceeds 8 bits
  697.       - Immediate data exceeds 16 bits
  698.       - Origin value is odd, location counter set to next higher address
  699.       - The symbol specified is not a register list symbol
  700.       - Register list symbol used in an expression
  701.       - Invalid constant shift count
  702.       - Invalid label character
  703.  
  704.     Warnings:
  705.  
  706.       - ASCII constant exceeds 4 characters
  707.       - Numeric constant exceeds 32 bits
  708.       - Evaluation of expression could not be completed
  709.       - Excessive size
  710.       - Unsized instruction, size ignored
  711.       - Invalid or illegal size ignored
  712.       - Invalid size, corrected
  713.       - MOVEQ instruction constant exceeds 8 bits,
  714.         Least significant 8 bits used
  715.       - No message defined
  716.  
  717.     The last message is included as a safety measure. It will intercept an
  718. illegal internal error code if it were generated because of a malfunction of
  719. the assembler.
  720.     There are also a number of error messages potentially generated by various
  721. functions of the assembler. These are included to aid assembler modifications
  722. and should only be visible if changes are made to the assembler.
  723.  
  724. 14. References
  725.  
  726. 1. Motorola "MC68020 Users's Manual", MC68020UM/AD REV 1, Second Edition.
  727. 2. 68000 Assembler, Version 1.0, written by P. McKee at North Carolina State
  728.                University, Electrical and Computer Engineering department,
  729.                released to Public Domain by M. Shaban, 8/4/89.
  730.