home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR2 / 68000ASM.ZIP / ASM.DOC next >
Text File  |  1989-04-10  |  28KB  |  700 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.                                  68000 Assembler
  9.  
  10.                                   by Paul McKee
  11.  
  12.  
  13.  
  14.                                   User's Manual
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.                           Table of Contents 
  34.  
  35.  
  36.      1.       Introduction .............................  2
  37.  
  38.      2.       Source Code Format .......................  3
  39.      2.1       Source Line Format.......................  3
  40.      2.1.1       Label Field............................  3
  41.      2.1.2       Operation Field........................  3
  42.      2.1.3       Operand Field..........................  3
  43.      2.1.4       Comment Field..........................  4
  44.      2.2       Symbols..................................  4
  45.      2.3       Expressions..............................  4
  46.      2.3.1       Operands in Expressions................  4
  47.      2.3.1.1       Decimal Numbers......................  4
  48.      2.3.1.2       Hexadecimal Numbers..................  4
  49.      2.3.1.3       Binary Numbers.......................  5
  50.      2.3.1.4       Octal Numbers........................  5
  51.      2.3.1.5       ASCII Constants......................  5
  52.      2.3.2       Operators in Expressions...............  5
  53.      2.4       Addressing Mode Specifications...........  6
  54.                                                            
  55.      3.       Assembly Details .........................  7
  56.      3.1       Branch Instructions......................  7
  57.      3.2       MOVEM Instruction........................  7
  58.      3.3       Quick Instructions (MOVEQ, ADDQ, SUBQ)...  7
  59.                                                            
  60.      4.       Assembler Directives .....................  8
  61.      4.1       ORG - Set Origin.........................  8
  62.      4.2       Symbol Definition Directives.............  8
  63.      4.2.1       EQU - Equate Symbol....................  8
  64.      4.2.2       SET - Set Symbol.......................  8
  65.      4.2.3       REG - Register List Symbol.............  9
  66.      4.3       Data Storage Directives..................  9
  67.      4.3.1       DC - Define Constant...................  9
  68.      4.3.2       DCB - Define Constant Block............ 10
  69.      4.3.3       DS - Define Storage.................... 11
  70.      4.4       END - End of Source File................. 12
  71.                                                            
  72.      5.       Usage .................................... 13
  73.      5.1       Command Line............................. 13
  74.      5.2       Listing File Format...................... 13
  75.      5.3       Object Code File Format.................. 14
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.                                  1
  92.  
  93.                                                                           2
  94.                           1. Introduction 
  95.  
  96.  
  97.      The program described here, 68000 Assembler, is a basic two-
  98. pass assembler for the 68000 and 68010 microprocessors.  It 
  99. supports the complete instruction set of both processors as well 
  100. as a modest but capable set of assembler directives. The program 
  101. produces formatted listing files as well as object code files in 
  102. S-record format.
  103.  
  104.      The program was written in VAX-11 C by Paul McKee during the 
  105. fall semester, 1986.  The program should be portable (with rea 
  106. sonable changes) to any C language implementation that supports 
  107. 32-bit integers. 
  108.  
  109.                                                                           3
  110.                        2. Source Code Format 
  111.  
  112.  
  113.  2.1  Source Line Format 
  114.  
  115.      The input to the assembler is a file containing instruc 
  116. tions, assembler directives, and comments. Each line of the file 
  117. may be up to 256 characters long. It is recommended, however, 
  118. that the source lines be no longer that 80 characters, as this 
  119. will guarantee that the lines of the listing file do not exceed 
  120. 132 characters in length.  The assembler treats uppercase and 
  121. lowercase identically.
  122.  
  123.      Each line of the source code consists of the following 
  124. fields:
  125.  
  126.     LABEL  OPERATION    OPERAND,OPERAND,...  COMMENT
  127.  
  128. For example,
  129.  
  130.     LOOP   MOVE.L       (A0)+,(A1)+          Sample source line
  131.  
  132. The fields may be separated by any combination of spaces and 
  133. tabs. Except for the comment field and quoted strings, there must 
  134. be no spaces or tabs within a field.
  135.  
  136.  
  137.  2.1.1  Label Field 
  138.  
  139.      Legal labels follow the rules for forming symbol names 
  140. described in section 2.2.  Labels may be distinguished in one of 
  141. two ways:  (1) They may begin in column 1, or (2) they may end in 
  142. a colon, which does not become part of the label but simply 
  143. serves to mark its end.  A line may consist of a label alone. 
  144. When a label is encountered in the source code, it is defined to 
  145. have a value equal to the current location counter.  This symbol 
  146. may be used elsewhere is the program to refer to that location.
  147.  
  148.  
  149.  2.1.2  Operation Field 
  150.  
  151.      The operation field specifies the instruction that is to be 
  152. assembled or the assembler directive that is to be performed.  A 
  153. size code (.B, .W, .L, or .S) may be appended to the operation 
  154. code if allowed, to specify Byte, Word, Long, or Short opera 
  155. tions, respectively.  The operation field must not begin in the 
  156. column 1, because the operation would be confused with a label. 
  157.  
  158.  
  159.  
  160.  2.1.3  Operand Field 
  161.  
  162.      The operand field may or may not be required, depending on 
  163. the instruction or directive being used.  If present, the field 
  164. consists of one or more comma-separated items with no intervening 
  165.  
  166. spaces or tabs. (There may be spaces or tabs within an item, but 
  167. only within quoted strings.)
  168.  
  169.  
  170.                                                                           4
  171.  2.1.4  Comment Field 
  172.  
  173.      The comment field usually consists of everything on a source 
  174. line after the operand field.  No special character is needed to 
  175. introduce the comment, and it may contain any characters desired.
  176.  
  177.      A comment may also be inserted in the source file in another 
  178. way:  An asterisk ("*") at the beginning of the line or after the 
  179. label field will cause the rest of the line to be ignored, i.e., 
  180. treated as a comment.
  181.  
  182.  
  183.  2.2  Symbols 
  184.  
  185.      Symbols appear in the source code as labels, constants, and 
  186. operands.  The first character of a symbol must be either a 
  187. letter (A-Z) or a period (".").  The remaining characters may be 
  188. letters, dollar signs ("$"), periods ("."), or underscores("_").  
  189. A symbol may be of any length, but only the first 8 characters 
  190. are significant.  Remember that capitalization is ignored, so 
  191. symbols which are capitalized differently are really the same.
  192.  
  193.  
  194.  2.3  Expressions 
  195.  
  196.      An expression may be used in the source program anywhere a 
  197. number is called for.  An expression consists of one or more 
  198. operands (numbers or symbols), combined with unary or binary 
  199. operators.  These components are described below.  The value of 
  200. the expression and intermediate values are always computed to 32 
  201. bits, with no account being made of any overflow that may occur.  
  202. (Division by zero, however, will cause an error.) 
  203.  
  204.  
  205.  2.3.1  Operands in Expressions 
  206.  
  207.      An operand in an expression is either a symbol or one of the 
  208. following sorts of constants.
  209.  
  210.  
  211.  2.3.1.1  Decimal Numbers 
  212.  
  213.      A decimal number consists of a sequence of decimal digits 
  214. (0-9) of any length.  A warning will be generated if the value of 
  215. the number cannot be represented in 32 bits.
  216.  
  217.  
  218.  2.3.1.2  Hexadecimal Numbers 
  219.  
  220.      A hexadecimal number consists of a dollar sign ("$") fol 
  221. lowed by a sequence of hexadecimal digits (0-9 and A-F) of any 
  222.  
  223. length.  A warning will be generated if the value of the number 
  224. cannot be represented in 32 bits.
  225.  
  226.  
  227.                                                                           5
  228.  2.3.1.3  Binary Numbers 
  229.  
  230.      A binary number consists of a percent sign ("%") followed by 
  231. a sequence of binary digits (0 and 1) of any length.  A warning 
  232. will be generated if the number consists of more that 32 digits.
  233.  
  234.  
  235.  2.3.1.4  Octal Numbers 
  236.  
  237.      An octal number consists of a commercial at sign ("@") 
  238. followed by a sequence of octal digits (0-7) of any length.  A 
  239. warning will be generated if the value of the number cannot be 
  240. represented in 32 bits.
  241.  
  242.  
  243.  2.3.1.5  ASCII Constants 
  244.  
  245.      An ASCII constant consists of one to four ASCII characters 
  246. enclosed in single quote marks.  If it is desired to put a single 
  247. quote mark inside an ASCII constant, then two consecutive single 
  248. quotes may be used to represent one such character.
  249.  
  250.      If the ASCII constant consists of one character, then it 
  251. will be placed in the bottom byte of the 32 bit value; two 
  252. characters will be placed in the bottom word, with the first 
  253. character in the higher-order position.  If four characters are 
  254. used, then all four bytes will contain characters, with the first 
  255. in the highest-order location.  However, if three characters are 
  256. used, then they will be placed in the three  highest-order  bytes 
  257. of the 32-bit value, with 0 in the low byte (this is to accom 
  258. modate the high-byte-first addressing used on the 68000).
  259.  
  260.      Note that ASCII constants in expressions are different from 
  261. strings in DC directives, as the latter may be of any length.
  262.  
  263.  
  264.  2.3.2  Operators in Expressions 
  265.  
  266.      The operators allowed in expressions are shown in the fol 
  267. lowing table, in order of decreasing precedence. Within each 
  268. group, the operators are evaluated in left-to-right order (except 
  269. for group 2, which is evaluated right-to-left).
  270.  
  271.  
  272.                     Operators in Expressions
  273.  
  274.      1.  ()  Parenthesized subexpressions
  275.      2.  -   Unary minus (two's complement)
  276.          ~   Bitwise not (one's complement)
  277.      3.  <<  Shift left (x<<y produces x shifted left by
  278.                          y bits and zero filled)
  279.          >>  Shift right
  280.      4.  &   Bitwise and
  281.          !   Bitwise or
  282.      5.  *   Multiplication
  283.          /   Integer division
  284.          \   Modulus (x\y produces the remainder when x
  285.                       is divided by y)
  286.      6.  +   Addition
  287.          -   Subtraction
  288.  
  289.  
  290.                                                                           6
  291.  2.4  Addressing Mode Specifications 
  292.  
  293.      The 68000 and 68010 provide 14 general addressing modes.  
  294. The formats used to specify these modes in assembly language 
  295. programs are listed in the table below.  The following symbols 
  296. are used to describe the operand formats:
  297.  
  298.      Dn     = Data Register
  299.      An     = Address Register (SP may used instead of A7)
  300.      Xn     = Data or Address register
  301.      .s     = Index register size code (either .W or .L, .W will 
  302.               be assumed if omitted)
  303.      <ex8>  = Expression that evaluates to an 8-bit value (may be 
  304.               empty, in which case 0 will be used)
  305.      <ex16> = Expression that evaluates to a 16-bit value (may be 
  306.               empty, in which case 0 will be used)
  307.      <ex>   = Any expression
  308.      PC     = Program Counter
  309.  
  310.  
  311.                  Addressing Mode Specifications
  312.  
  313. Mode                                             Assembler Format
  314. ---------------------------------------------    ----------------
  315. Data Register Direct                             Dn
  316. Address Register Direct                          An
  317. Address Register Indirect                        (An)
  318. Address Register Indirect with Predecrement      -(An)
  319. Address Register Indirect with Postincrement     (An)+
  320. Address Register Indirect with Displacement      <ex16>(An)
  321. Address Register Indirect with Index             <ex8>(An,Xn.s)
  322. Absolute Short or Long (chosen by assembler)     <ex>
  323. Program Counter with Displacement                <ex16>(PC)
  324. Program Counter with Index                       <ex8>(PC,Xn.s)
  325. Immediate                                        #<ex>
  326.  
  327.  
  328.      In addition to the general addressing modes, the following 
  329. register names may be used as operands in certain instructions 
  330. (e.g., MOVEC or EORI to CCR):
  331.  
  332.      SR   = Status Register
  333.      CCR  = Condition Code Register
  334.      USP  = User Stack Pointer
  335.      VBR  = Vector Base Register (68010)
  336.      SFC  = Source Function Code Register (68010)
  337.      DFC  = Destination Function Code Register (68010)
  338.  
  339.                                                                           7
  340.                        3.  Assembly Details 
  341.  
  342.  
  343.  3.1  Branch Instructions 
  344.  
  345.      The branch instructions (Bcc, BRA, and BSR) are unique in 
  346. that they can take a ".S" size code.  This suffix directs the 
  347. assembler to assemble these as short branch instructions, i.e., 
  348. one-word instructions with a range to -128 to +127 bytes.  If the 
  349. ".S" size code is used, and the destination is actually outside 
  350. this range, then the assembler will print an error message.  If 
  351. the ".L" size code is used, the assembler will use a long branch, 
  352. which is a two-word instruction with a range of -32768 to +32767 
  353. bytes.  If neither size code is specified, then the assembler 
  354. will use a short branch if possible (the branch destination must 
  355. be known on the first pass to be within the short branch range); 
  356. otherwise it will use long branch. 
  357.  
  358.  
  359.  3.2  MOVEM Instruction 
  360.  
  361.      The MOVEM instruction, which is used for saving and restor 
  362. ing sets of registers, has one the following two forms:
  363.  
  364.      MOVEM   <register_list>,<effective_address>
  365.      MOVEM   <effective_address>,<register_list>
  366.  
  367. The register list may be an explicit register list of the form 
  368. described in Section 4.2.3.  On the other hand, if a particular 
  369. set of registers is to be saved and restored repeatedly, the REG 
  370. directive (Section 4.2.3) can be used to define a register list 
  371. symbol that specifies the registers.  For example, if the regis 
  372. ter list symbol WORKSET is defined as follows:
  373.  
  374.      WORKSET  REG     A0-A4/D1/D2
  375.  
  376. then the following instructions will perform the same function:
  377.  
  378.      MOVEM.L  WORKSET,-(SP)
  379.      MOVEM.L  A0-A4/D1/D2,-(SP)
  380.  
  381. If a register list symbol is used, it must be defined before it 
  382. appears in any MOVEM instructions.
  383.  
  384.  
  385.  3.3  Quick Instructions (MOVEQ, ADDQ, SUBQ) 
  386.  
  387.      The MOVE, ADD, and SUB instructions have one-word "quick" 
  388. variations which can be used certain addressing modes and operand 
  389. values.  The assembler will use these faster variations automat 
  390. ically when possible, or they may be specified explicitly by 
  391. writing the mnemonic as MOVEQ, ADDQ, or SUBQ.
  392.  
  393.      The MOVEQ instruction may be used for moving an immediate 
  394. value in the range -128 to +127 into a data register.  The assem 
  395.  
  396. bler will assemble a MOVE.L #<value>,Dn as a MOVEQ if the value 
  397. is known on the first pass. 
  398.  
  399.      The ADDQ (SUBQ) instruction adds (subtracts) an immediate 
  400. value from 1 to 8 to (from) any alterable destination.  The 
  401. assembler will use the quick form if the value is known on the 
  402. first pass to be in the range 1 to 8.
  403.  
  404.                                                                          8
  405.                      4.  Assembler Directives 
  406.  
  407.  
  408.  4.1  ORG - Set Origin 
  409.  
  410.      The assembler maintains a 32-bit location counter, whose 
  411. value is initially zero and which is incremented by some amount 
  412. whenever an instruction is assembled or a data storage directive 
  413. is carried out.  The value of this location counter may be set 
  414. with the ORG directive.  This is typically done at the start of a 
  415. program and at appropriate places within it.  The format of the 
  416. ORG directive is
  417.  
  418.      <label> ORG     <expression>
  419.  
  420. where <expression> is an expression containing no forward refer 
  421. ences, i.e., its value must be known on the first pass at the 
  422. point where the ORG directive appears.  An error will result if 
  423. an attempt is made to set the location counter to an odd value; 
  424. in this case the location counter will be set to the specified 
  425. value plus one.  The <label> is optional and, if present, the 
  426. specified symbol will be set to the  new  value of the location 
  427. counter.
  428.  
  429.  
  430.  4.2  Symbol Definition Directives 
  431.  
  432.  4.2.1  EQU - Equate Symbol 
  433.  
  434.      The equate directive is used to define symbols whose value 
  435. will not change within the program.  The format of this directive 
  436. is 
  437.      <label> EQU     <expression>
  438.  
  439. where <expression> is an expression containing no forward refer 
  440. ences, i.e., its value must be known on the first pass at the 
  441. point where the EQU directive appears. The <label> must be speci 
  442. fied, since it tells what symbol is being defined.  If <label> is 
  443. omitted, an error will result.  If an attempt is made to redefine 
  444. a symbol that was defined with EQU, either as a label or using 
  445. any symbol definition directive, an error message will be printed.
  446.  
  447.  
  448.  4.2.2  SET - Set Symbol 
  449.  
  450.      The SET directive is similar in function and format to the 
  451. equate directive, with one important difference:  symbols defined 
  452. using SET may be redefined later using another SET directive (but 
  453. not using a EQU or REG directive). The format of this directive 
  454. is 
  455.  
  456.      <label> SET     <expression>
  457.  
  458.                                                                           9
  459.  4.2.3  REG - Register Range
  460.  
  461.      Register ranges consist of lists of registers separated by 
  462. slashes ("/").  Each register range may be either a single 
  463. register ("An" or "Dn") or a range of registers ("An-Am" or 
  464. "Dn-Dm"), which denotes all the registers between the two 
  465. registers listed (they may be given in either order).  For exam 
  466. ple, the following register list specifies that D0, D1, D2, D3, 
  467. D7, A1, A2, and A3 are to be saved (or restored):
  468.  
  469.      D3-D0/D7/A1-A3
  470.  
  471. The registers and ranges may be specified in any order.  The same 
  472. format for register lists may be used with the MOVEM instruction 
  473. directly.  In order to avoid confusion, it is best to avoid 
  474. specifying a range that includes both an address register and a 
  475. data register, although the assembler will not treat this as an 
  476. error. 
  477.  
  478.  
  479.  4.3  Data Storage Directives 
  480.  
  481.  4.3.1  DC - Define Constant 
  482.  
  483.      The define constant directive is used to store strings and 
  484. lists of constants in memory.  The format of a DC directive is
  485.  
  486.      <label> DC.<size>  <item>,<item>,...
  487.  
  488. The label will be defined to equal the address of the start of 
  489. the list of data.  The size code specifies that a list of bytes 
  490. (.B), words (.W), or longwords (.L) is being defined; if omitted, 
  491. word size is used.  
  492.  
  493.      A list of items follows the directive; each item may be an 
  494. expression or a string. If an item is an expression, the expres 
  495. sion is evaluated and stored as the size indicated, i.e., a byte, 
  496. a word, or a longword.  An error is generated if the value will 
  497. not fit as either a signed or unsigned value in the specified 
  498. size.  If an item is a string, delimited by single quotes, then 
  499. the string will be stored in successive entities of the size 
  500. specified; if words or longwords are being generated, and the 
  501. string does not fit into an whole number of words or longwords, 
  502. then the string will be padded with zeros at the end to make a 
  503.  
  504. whole number of words or longwords.  Strings and expressions may 
  505. intermixed in a single DC directive.
  506.  
  507.      If words (DC.W) or longwords (DC.L) are being generated, 
  508. then the start of the list of constants will be aligned on a word 
  509. boundary by increasing the location counter by one, if necessary.  
  510. This is not performed for DC.B directives, so that strings of 
  511. bytes may be contiguous in memory.  If an instruction follows a 
  512. DC.B directive, the assembler will automatically adjust the loca 
  513. tion counter (if necessary) to place the instruction on a word 
  514. boundary.
  515.  
  516.                                                                          10
  517.      An example of a DC directive that defines a null-terminated 
  518. string:
  519.  
  520.      TEXT    DC.B    'DC Example',$0D,$0A,0
  521.  
  522. This directive results in the following data at location TEXT:
  523.  
  524.      44 43 20 45 78 61 6D 70 6C 65 0D 0A 00  (hexadecimal)
  525.  
  526.  
  527.  4.3.2  DCB - Define Constant Block 
  528.  
  529.      The define constant block directive generates a block of 
  530. bytes, words, or longwords that are all initialized to the same 
  531. value by the assembler.  The format of the directive is
  532.  
  533.      <label>  DCB.<size>  <length>,<value>
  534.  
  535. The label will be defined to equal the address of the start of 
  536. the block.  The size code specifies that a block of bytes (.B), 
  537. words (.W), or longwords (.L) is being set up; if omitted, word 
  538. size is used.
  539.  
  540.      The length argument is an expression that tells the number 
  541. of bytes, words, or longwords that are to be in the block.  This 
  542. value must be known on the first pass at the point where the DCB 
  543. directive appears, and it must be non-negative.  The value argu 
  544. ment is an expression whose value is to be placed in each data 
  545. item in the block; it needn't be known on the first pass.  An 
  546. warning message will be printed if the value will not fit (as a 
  547. signed or unsigned number) in the data size selected.  
  548.  
  549.                                                                          11
  550.      If word or longword size is selected, then the start of the 
  551. block will be placed on a word boundary by increasing the loca 
  552. tion counter by one, if necessary.  If an instruction follows a 
  553. DCB.B directive, the assembler will automatically adjust the 
  554. location counter (if necessary) to place the instruction on a 
  555. word boundary.
  556.  
  557.  
  558.  4.3.3  DS - Define Storage 
  559.  
  560.      The define storage directive generates an uninitialized 
  561.  
  562. block of bytes, words, or longwords.  The format of the directive 
  563. is
  564.  
  565.      <label>  DS.<size>  <length>
  566.  
  567. The label will be defined to equal the address of the start of 
  568. the block.  The size code specifies that a block of bytes (.B), 
  569. words (.W), or longwords (.L) is being set up; if omitted, word 
  570. size is used.
  571.  
  572.      The length argument is an expression that tells the number 
  573. of bytes, words, or longwords that are to be in the block.  This 
  574. value must be known on the first pass at the point where the DCB 
  575. directive appears, and it must be non-negative.  The effect of 
  576. the DS directive is basically to increase the value of the loca 
  577. tion counter by <length> times one (if DS.B is used), two (if 
  578. DS.W is used), or four (if DS.L is used)
  579.  
  580.      If word or longword size is selected, then the start of the 
  581. block will be placed on a word boundary by increasing the loca 
  582. tion counter by one, if necessary.  Thus, DS.W 0 can be used to 
  583. force the location counter to be aligned on a word boundary 
  584. without allocating any space.  However, if an instruction follows 
  585. a DS.B directive, the assembler will automatically adjust the 
  586. location counter (if necessary) to align the instruction on a 
  587. word boundary.
  588.  
  589.                                                                          12
  590.  4.4  END - End of Source File 
  591.  
  592.      The end directive is used to mark the end of the source 
  593. file.  It is purely optional.  The format is simply
  594.  
  595.              END
  596.  
  597. The assembler will ignore anything in the source file after the 
  598. END directive.
  599.  
  600.                                                                          13
  601.                              5.  Usage 
  602.  
  603.  
  604.  5.1  Command Line 
  605.  
  606.      The 68000 Assembler is run by typing a command line of the 
  607. following form:
  608.  
  609.      ASM <options> <filename>
  610.  
  611.      The options are a string of letters, preceded by a dash, 
  612. which alter the behavior of the assembler. The following option 
  613. letters are allowed:
  614.  
  615.       C = Show all the Constants produced by DC directives
  616.           (see Section 5.2)
  617.       L = Produce a Listing file
  618.       N = Produce No object code file
  619.  
  620. If these options are not specified, the defaults are to show only 
  621. one line of data from a DC directive, to produce no listing, and 
  622. to produce an object file.
  623.  
  624.      The filename is the name, including directory specifica 
  625. tions, of the file to be assembled.  No default file extension is 
  626. applied.  The names of the listing and object code files, if 
  627. generated, are constructed by using the source file name with an 
  628. extension of ".LIS" (for the listing) or ".H68" (for the object 
  629. file); the output files are always placed in the user's default 
  630. directory.  
  631.  
  632.      The program will print "68000 Assembler by PGM" when it 
  633. begins work.  If any errors occur, the program will print "ERROR 
  634. in line X" or "WARNING in line X" (this information is also 
  635. placed in the listing file).  Upon conclusion, it will print the 
  636. number of errors encountered and warnings generated during the 
  637. assembly.  
  638.  
  639.      If there is an error in the command line, e.g., if no file 
  640. name is specified, then the assembler will print a brief usage 
  641. summary and abort.
  642.  
  643.  
  644.  5.2  Listing File Format 
  645.  
  646.      The assembler produces a listing file which shows the source 
  647. code alongside the the object code produced by the assembler.  A 
  648. typical listing file line might appear as follows (not to scale):
  649.  
  650.   0000102E  22D8           200  LOOP  MOVE.L (A0)+,(A1)+    Sample
  651.  
  652. The eight digit hexadecimal number at the left is the assembler's 
  653. location counter; the generated instruction word, $22D8, is 
  654. placed at that address.  The next number is the source file line 
  655. number, and the remainder of the line simply repeats the source 
  656.  
  657. line.  Remember that if the source lines are no longer than 80 
  658. columns, then the listing file lines will not exceed 132 columns.
  659.  
  660.                                                                          14
  661.      If an error is encountered or a warning is generated for a 
  662. given source line, then in the listing that line will be followed 
  663. by a line that describes the error.  At the end of the listing, 
  664. the program prints the total number of errors and warnings.
  665.  
  666.      There is only limited space to list the object code in this 
  667. format.  There is sufficient space for the longest possible 
  668. instruction, but the DC directive poses a problem, since it may 
  669. generate, e.g., dozens of longwords from a single source line.  
  670. The assembler's -C command line option controls the assembler's 
  671. actions when the object code exceeds the space available on one 
  672. line.  If -C is not specified, then the assembler will print only 
  673. one listing line with an ellipsis ("...") at the end of the 
  674. object code field, indicating that some of the data produced by 
  675. the directive was omitted from the listing.  If -C is included on 
  676. the command line, then the assembler will use as many source 
  677. lines as are needed to print all the data produced by the direc 
  678. tive.  Each line after the first will contain only the location 
  679. counter and the object code field (the source line is not re 
  680. peated).  
  681.  
  682.  
  683.  5.3  Object Code File Format 
  684.  
  685.      The 68000 Assembler produces an object code output file in 
  686. S-record format.  The object file name is the source file name, 
  687. with the extension changed to ".H68".  The object file and the 
  688. listing file are always placed in the user's default directory.  
  689.  
  690.      The S-record format is designed to allow files containing 
  691. any data to be interchanged in text file format with checksum 
  692. error detection.  The format of these files will not be described 
  693. here, but the following technical information will be provided:  
  694. The first line of the object file is an S0 (header) record and 
  695. the last line is an S9 (termination) record.  The lines in be 
  696. tween are S1, S2, or S3 records, depending on the whether the 
  697. address of the first byte in a record requires 2, 3, or 4 bytes 
  698. to be represented.  No record is longer than 80 characters.
  699.  
  700.