*** AS11.txt The IBM PC 68HC11 cross assembler GENERAL The assembler is named as11.exe Command line arguments specify the filenames to assemble. The assembler accepts options from the command line to be included in the assembly. These options are the following: l enable output listing. cre generate cross reference table. s generate a symbol table. c enable cycle count. nol disable output listing (default). noc disable cycle count. The command line looks like this : as11 file1 file2 ... [ -option1 option2 ...] If this method of passing commands to the assembler is used rather than the OPT pseudo op code, a space should separate the minus sign from the last file name and the first option. Example: as11 program -l cre This command assembles file 'program' with an output listing and a cross reference table. The `S1' formatted object file is placed in file `filename.S19', the listing and error messages are written to the standard output. If multiple files are assembled, the 'S1' file will be placed under the first file's name.S19. The listing file contains the line number, address, and bytes assembled for each line of input followed by the original input line (unchanged, but moved over to the right some). If an input line causes more than 6 bytes to be output (e.g. a long FCC directive), additional bytes (up to 64) are listed on succeding lines with no address preceding them. Equates (EQU) cause the value of the expression to replace the address field in the listing. Equates that have forward references cause Phasing Errors in Pass 2. Expressions may consist of symbols, constants or the character '*' (denoting the current value of the program counter) joined together by one of the operators: +-*/%&|^. The operators are the same as in C: + add - subtract * multiply / divide % remainder after division & bitwise and | bitwise or ^ bitwise exclusive-or Expressions are evaluated left to right and there is no provision for parenthesized expressions. Arithmetic is carried out in signed twos-complement integer precision (16 bits on the IBM PC). Constants are constructed with the same syntax as the Motorola MDOS assembler: ' followed by ASCII character $ followed by hexadecimal constant @ followed by octal constant % followed by binary constant digit decimal constant ERRORS Error diagnostics are placed in the listing file just before the line containing the error. Format of the error line is: Line_number: Description of error or Line_number: Warning --- Description of error Errors of the first type in pass one cause cancellation of pass two. Warnings do not cause cancellation of pass two but should cause you to wonder where they came from. Error messages are meant to be self-explanatory. If more than one file is being assembled, the file name precedes the error: File_name,Line_number: Description of error Finally, some errors are classed as fatal and cause an immediate termination of the assembly. Generally these errors occur when a temporary file cannot be created or is lost during the assembly. Consult your local guru if this happens. DIFFERENCES For indexed addressing, the comma is required before the register; `inc x' and `inc ,x' are not the same. Macros are not supported. (try M4 or M6) The force size operators ('>' and '<') are implemented for all assemblers. The only pseudo-ops supported are: ORG, FCC, FDB, FCB, EQU, RMB, BSZ, ZMB, FILL PAGE and OPT. The OPT pseudo-op allows the following operands: nol Turn off output listing l Turn on output listing (default) noc Disable cycle counts in listing (default) c Enable cycle counts in listing (clear total cycles) contc Re-enable cycle counts (don't clear total cycles) cre Enable printing of a cross reference table s generate a symbol table Some of the more common pseudo-ops are not present: SPC Use blank lines instead END The assembly ends when there is no more input TTL use `pr' to get headings and page numbers NAM[E] Did you ever use this one anyway? The above 4 pseudo-ops are recognized, but ignored. ZMB (Zero Memory Bytes) is equivalent to BSZ (Block Store Zeroes). FILL can be used to initialize memory to something other than zero: FILL val,nbytes. TARGET MACHINE SPECIFICS (as11) 68HC11: Bit manipulation operands are separated by blanks instead of commas since the 'HC11 has bit manipulation instructions that operate on indexed addresses. DETAILS Symbol: A string of characters with a non-initial digit. The string of characters may be from the set: [a-z][A-Z]_.[0-9]$ ( . and _ count as non-digits ). The `$' counts as a digit to avoid confusion with hexadecimal constants. All characters of a symbol are significant, with upper and lower case characters being distinct. The maximum number of characters in a symbol is currently set at 15. The symbol table has room for at least 2000 symbols of length 8 characters or less. Label: A symbol starting in the first column is a label and may optionally be ended with a ':'. A label may appear on a line by itself and is then interpreted as: Label EQU * Mnemonic: A symbol preceded by at least one whitespace character. Upper case characters in this field are converted to lower case before being checked as a legal mnemonic. Thus `nop', `NOP' and even `NoP' are recognized as the same mnemonic. Note that register names that sometimes appear at the end of a mnemonic (e.g. nega or stu) must not be separated by any whitespace characters. Thus `clra' means clear accumulator A, but that `clr a' means clear memory location `a'. Operand: Follows mnemonic, separated by at least one whitespace character. The contents of the operand field is interpreted by each instruction. Whitespace: A blank or a tab Comment: Any text after all operands for a given mnemonic have been processed or, a line beginning with '*' up to the end of line or, an empty line. Continuations: If a line ends with a backslash (\) then the next line is fetched and added to the end of the first line. This continues until a line is seen which doesn't end in \ or until MAXBUF characters have been collected (MAXBUF >= 256). FILES filename.S19 S-record output file STDOUT listing and errors (use redirection for listing file) Fwd_refs Temporary file for forward references. IMPLEMENTATION NOTES This is a classic 2-pass assembler. Pass 1 establishes the symbol table and pass 2 generates the code. 12/11/84 E.J.Rupp This version of the cross assemblers ported to the IBM PC 4/13/87 *** end of AS11.txt