The ASxxxx assemblers are command line oriented. Most sytems require the option(s) and file(s) arguments to follow the ASxxxx assembler name: as6809 [-Options] file1 [file2 file3 ...] Some systems may request the arguments after the assembler is started at a system specific prompt: as6809 argv: [-Options] file1 [file2 file3 ...] The options are: -d decimal listing -q octal listing -x hex listing (default) The listing radix affects the .lst, .rel, and .sym files. -g undefined symbols made global -a all user symbols made global -b display .define substitutions in listing -bb and display without .define substitutions -j enable NOICE debug symbols -y enable SDCC debug symbols -l create list output file1.lst -o create object output file1.rel -s create symbol output file1.sym -p disable listing pagination -u disable .list/.nlist processing -w wide listing format for symbol table -z disable case sensitivity for symbols relocatable reference flagging: -f by ` in the listing file -ff by mode in the listing file The file name for the .lst, .rel, and .sym files is the first file name specified in the command line. All output files are THE ASSEMBLER PAGE 1-36 INVOKING ASXXXX ascii text files which may be edited, copied, etc. The output files are the concatenation of all the input files, if files are to be assembled independently invoke the assembler for each file. The .rel file contains a radix directive so that the linker will use the proper conversion for this file. Linked files may have different radices. If the list (l) option is specified without the symbol table (s) option, the symbol table is placed at the end of the listing file.
The ASxxxx assemblers provide limited diagnostic error codes during the assembly process, these errors will be noted in the listing file and printed on the stderr device. The assembler reports the errors on the stderr device as ?ASxxxx-Error-<*> in line nnn of filename where * is the error code, nnn is the line number, and filename is the source/include file. The errors are: (.) This error is caused by an absolute direct assign- ment of the current location counter . = expression (incorrect) rather than the correct . = . + expression (a) Indicates a machine specific addressing or address- ing mode error. (b) Indicates a direct page boundary error. (d) Indicates a direct page addressing error. (e) Caused by a .error or .assume directive. (i) Caused by an .include file error or an .if/.endif mismatch. (m) Multiple definitions of the same label, multiple .module directives, or multiple conflicting attri- butes in an .area directive. (o) Directive or mnemonic error or the use of the .org directive in a relocatable area. (p) Phase error: label location changing between passes 2 and 3. Normally caused by having more than one level of forward referencing. (q) Questionable syntax: missing or improper operators, terminators, or delimiters. (r) Relocation error: logic operation attempted on a relocatable term, addition of two relocatable terms, subtraction of two relocatable terms not within the same programming area or external symbols. (s) String substitution / recursion error. (u) Undefined symbol encountered during assembly. (z) Divide by 0 or Modulus by 0 error: result is 0.
The (-l) option produces an ascii output listing file. Each page of output contains a five line header: 1. The ASxxxx program name and page number 2. Assembler Radix and Address Bits 3. Title from a .title directive (if any) 4. Subtitle from a .sbttl directive (if any) 5. Blank line Each succeeding line contains five fields: 1. Error field (first two characters of line) 2. Current location counter 3. Generated code in byte format 4. Source text line number 5. Source text The error field may contain upto 2 error flags indicating any errors encountered while assembling this line of source code. The current location counter field displays the 16-bit, 24-bit, or 32-bit program position. This field will be in the selected radix. The generated code follows the program location. The listing radix determines the number of bytes that will be displayed in this field. Hexidecimal listing allows six bytes of data within the field, decimal and octal allow four bytes within the field. If more than one field of data is generated from the assembly of a single line of source code, then the data field is repeated on successive lines. The source text line number is printed in decimal and is fol- lowed by the source text. A Source line with a .page directive is never listed. Two additional options are available for printing the source line text. If the -b option is specified then the listed source line contains all the .define substitutions. If the -bb option is specified then the original source line is printed before the source line with substitutions. Two data field options are available to flag those bytes which will be relocated by the linker. If the -f option is specified then each byte to be relocated will be preceeded by the '`' character. If the -ff option is specified then each byte to be relocated will be preceeded by one of the following characters: 1. * paged relocation 2. u low byte of unsigned word or unsigned byte 3. v high byte of unsigned word 4. p PCR low byte of word relocation or PCR byte 5. q PCR high byte of word relocation 6. r low byte relocation or byte relocation 7. s high byte relocation Assemblers which use 24-bit or 32-bit addressing use an ex- tended flagging mode: 1. * paged relocation 2. u 1st byte of unsigned value 3. v 2nd byte of unsigned value 4. U 3rd byte of unsigned value 5. V 4th byte of unsigned value 6. p PCR 1st byte of relocation value or PCR byte 7. q PCR 2nd byte of relocation value 8. P PCR 3rd byte of relocation value 9. Q PCR 4th byte of relocation value 10. r 1st byte of relocation value or byte relocation 11. s 2nd byte of relocation value 12. R 3rd byte of relocation value 13. S 4th byte of relocation value
The symbol table has two parts: 1. The alphabetically sorted list of symbols and/or labels defined or referenced in the source program. 2. A list of the program areas defined during assembly of the source program. The sorted list of symbols and/or labels contains the follow- ing information: 1. Program area number (none if absolute value or exter- nal) 2. The symbol or label 3. Directly assigned symbol is denoted with an (=) sign 4. The value of a symbol, location of a label relative to the program area base address (=0), or a **** indicat- ing the symbol or label is undefined. 5. The characters: G - global, R - relocatable, and X - external. The list of program areas provides the correspondence between the program area numbers and the defined program areas, the size of the program areas, and the area flags (attributes).
The object file is an ascii file containing the information needed by the linker to bind multiple object modules into a com- plete loadable memory image. The object module contains the following designators: [XDQ][HL][234] X Hexidecimal radix D Decimal radix Q Octal radix H Most significant byte first L Least significant byte first 2 16-Bit Addressing 3 24-Bit Addressing 4 32-Bit Addressing H Header M Module G Merge Mode B Bank A Area S Symbol T Object code R Relocation information P Paging information Refer to the linker for a detailed description of each of the designators and the format of the information contained in the object file.Return to the Assembler Index