Motorola Free Ware Cross Assemblers release TER_2.0 1.0 COPY RIGHT NOTICE You may not distribute these cross assemblers and charge more than a nominal fee for the distribution media itself. This software is the property of Motorola and is made available as free ware for the purpose of developing software for their microprocessors only. "Free Ware" means that no charge is made for copying or for the use of computer software but that all other rights including but not limited to use of the software in whole or in part in other programs remains with Motorola. Software means the source code and all versions of object code or computer coded instructions in whole or in part. All copies must carry this notice. 1.1 Disclaimer The cross assemblers are supplied "as is" without warranty of any kind expressed or implied. They are believed to be accurate but the user takes upon him or herself the entire responsibility and consequences of their use. Neither Motorola nor any of the contributing authors warrant that the software is without errors, will operate without interruption or will be compatible with any software or hardware possessed or to be possessed by the user or that the use of the software or any of its parts will result in any economic advantage or reduction in cost. Neither Motorola nor any of the contributing authors will be liable for any special or incidental or consequential damages, even if informed of the possibility of such damages in advance. 1.2 Contributing Authors Original Code E.J. Rupp 12/11/84 Releases beginning with TER Terry E. Rogers (modifications & manual only) 6255 Henryk Woods Rd. Clay, New York 13041 Note: This software is a direct descendant of the E.J. Rupp version. Other versions may exist. page -1- 2.0 INDEX 1.0 Copy right notice & Disclaimer 2.0 Index 3.0 General 3.1 Assemblers 3.2 Command Line Format & Options 3.3 Compatibility with previous versions 3.4 Compatibility between host DOS systems and support equipment 4.0 Assembler Source Code Format 4.1 Labels & Symbols 4.2 Opcode 4.3 Operand 4.3.1 Constants 4.3.2 Symbols 4.3.3 Expressions 5.0 Pseudo Opcodes 5.1 List of Pseudo Opcodes 5.2 Symbol value assignment; EQU 5.3 Memory allocation & definition; ORG, FCC, FDB, FCB, RMB, ZMB,BSZ, FILL 5.4 Conditional Assembly & Include Files; IFD, IFND, ELSE, ENDIF, END, INCLUDE 5.5 Listing Control; PAGE, OPT paging, symbol tables, cycle count 5.6 Program Counter control; CODE, DATA, BSS, RAM, AUTO 5.7 Ignored; SPC, TTL, NAME 6.0 Target Machine Specifics 6.1 6800 6.2 6801 6.3 6804 6.4 6805 6.5 6809 6.6 68HC11 7.0 Limitations & Errors 7.1 File & Symbol Table Size 7.2 Symbol Names 7.3 Lost & Locked Files 7.4 Phasing (pass 2 symbol value) 7.5 Error Listings 7.6 Warning Listings 7.7 Fatal Error Listings page -2- 8.0 Host Specifics 8.1 MS-DOS PCs 8.2 Apple MAC 8.3 Commodore Amiga 8.3.1 Shell & CLI 8.3.2 WorkBench 9.0 Formats 9.1 Symbol Table 9.2 Cross Reference Table 9.3 Listing 10.0 Some Techniques 11.0 Updates & Error Reporting page -3- 3.0 GENERAL 3.1 Assemblers These assemblers are updated versions of the original, two pass Motorola 8 bit uC/uP free ware cross assemblers. The assemblers are named as* where '*' is any of 0,1,4,5,9 or 11. On MS-DOS systems, the assemblers have the extension .EXE. Other systems do not have extensions. Example: AS11 Amiga or MAC 68HC11 cross assembler AS11.EXE MS-DOS 68HC11 cross assembler Amiga versions have companion *.info files where * is here as5, as11 etc. The .info files are for WorkBench visibility. Amiga versions may also include scripts and companion *.info files titled "Assemble 68HC11" e.g. which endow the assemblers with extended WorkBench selection of source code files. This manual, updates and other documentation have the extension *.doc on all systems. *.doc files are linked to system ASCII readers at GUI (graphic user interface) level on the MAC and Amiga. (WorkBench is the Amiga GUI super application program analogous to MAC DeskTop.) See section 8 for host OS specifics. The file Update.doc (if any) contains enhancement descriptions. 3.2 Command Line Format and Options The following pertains to MS-DOS and Amiga systems. The MAC does not have a command line user interface. The command line looks like this : as* file1 [file2] ... [ - option1 option2 ...] Where: as* is one of the assemblers mentioned above fileis an assembler source code file name complete with path (if not in current directory) in the host DOS format option is a UNIX like assembler option or command file1, file2, file are command line files as opposed to include files (there are subtle differences). One or more spaces separates as* from file1, file1 from file2 etc. and file from the minus sign preceding option1 and option 1 from option2 etc. At least one assembler source code file is required. Options are, of course, not required. page -4- file may have the extension *.asm on all systems. Any other extension acceptable to the host DOS is also permitted. The file files are assembled together with file1[.asm] as if they were all one file (no linking is performed and all symbols are global) to make file1.S19, a Motorola S record output in the default directory. Source code files are left intact. file must be in "flat ASCII", i.e. must contain only alphanumeric, tab and end of line characters and must not contain formatting characters other than tab. Many word processors will not produce a flat ASCII file even using a "text only" store or ASCII conversion option. Form feeds and ANSI console control characters will probably be present. Acceptable editors available on many systems include EMACS, MEMACS, VEDIT, vii (UNIX), ED (UNIX & AmigaDOS), EDIT (AmigaDOS), EDLIN (MS-DOS) and the integrated editor in many MS-DOS, MAC and Amiga languages such as C, Compiled BASIC, FORTRAN etc. There are many others. This is not a recommendation for any. Example: as5 BlackBox Serial -l cre This command assembles files "BlackBox" and "Serial" using the 6805 cross assembler with an output listing and a cross reference table producing S record "BlackBox.S19" or "BLACKBOX.S19". The assemblers accept options from the command line. These options are the following: l enable output listing. nol disable output listing (default). cre generate cross reference table. s generate a symbol table. c enable cycle count. noc disable cycle count. crlf enable (non MS-DOS systems) nnf number include files contiguous with command line files p50 page break approximately every 50 lines Command line options may not be combined as they may sometimes be in UNIX. There is only one minus sign. Listings, tables, error messages and warning messages are all directed to std.out (standard output) which may vary between systems but is usually the CRT console. Printed or file output typically must use "indirection" as defined on that system. See section 8. page -5- 3.3 Compatibility with Previous Versions The cross assemblers will accept source code files written for the original cross assembler porting to the "IBM PC" (MS-DOS systems) on 4/13/87 providing that the files are supplied as command line arguments as shown above. An "end" statement must be supplied as the last executable pseudo- op to be used as an include file. A file so modified may be used with either the original or this version provided no further changes are made. ("End" is an ignored pseudo-op in the original.) Source code written using the added features in this version are not compatible with the original. 3.4 Compatibility between Host DOS Systems and Support Equipment MAC and Amiga versions of these cross assemblers will accept source files originating on MS-DOS machines. MS-DOS versions will not accept source code originating on MAC or Amigas without modification. The end of line character on MS-DOS machines is or $0D$0A. The end of line character on the Amiga and MAC is or $0A only. The MAC and Amiga versions search for both MS-DOS and their own EOL character. You may use the search and replace features of the editors mentioned above (except the embedded language editors) to replace EOLs for cross system compatibility. Consult your manual for search and replace and "quote" character. Some PROM burners, simulators and ROM manufacturers will not accept S1 records with a EOL character. Use option -crlf to change the S record output only to MS-DOS EOL format if using the MAC or Amiga. Other output remains in the host (D)OS format. 4.0 ASSEMBLER SOURCE CODE FORMAT The general source code format is: [