home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Interactive Guide / c-cplusplus-interactive-guide.iso / c_ref / csource3 / 149_01 / a685.doc < prev    next >
Text File  |  1989-01-13  |  45KB  |  1,240 lines

  1. /*
  2.     HEADER:        CUG149;
  3.     TITLE:        6801 Cross-Assembler (Portable);
  4.     FILENAME:    A685.DOC;
  5.     VERSION:    0.3;
  6.     DATE:        08/27/1988;
  7.  
  8.     DESCRIPTION:    "This program lets you use your computer to assemble
  9.             code for the Motorola 6805 family microprocessors.
  10.             The program is written in portable C rather than BDS
  11.             C.  All assembler features are supported except
  12.             relocation, linkage, and macros.";
  13.  
  14.     KEYWORDS:    Software Development, Assemblers, Cross-Assemblers,
  15.             Motorola, MC6805;
  16.  
  17.     SEE-ALSO:    CUG113, 6800 Cross-Assembler;
  18.  
  19.     SYSTEM:        CP/M-80, CP/M-86, HP-UX, MSDOS, PCDOS, QNIX;
  20.     COMPILERS:    Aztec C86, Aztec CII, CI-C86, Eco-C, Eco-C88, HP-UX,
  21.             Lattice C, Microsoft C,    QNIX C;
  22.  
  23.     WARNINGS:    "This program has compiled successfully on 2 UNIX
  24.             compilers, 5 MSDOS compilers, and 2 CP/M compilers.
  25.             A port to BDS C would be extremely difficult, but see
  26.             volume CUG113.  A port to Toolworks C is untried."
  27.  
  28.     AUTHORS:    William C. Colley III;
  29. */
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.                          6805 Cross-Assembler (Portable)
  46.  
  47.  
  48.                                    Version 0.3
  49.  
  50.  
  51.                     Copyright (c) 1985 William C. Colley, III
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.                             The manual such as it is.
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.         Legal Note:    This package may be used for any commercial or 
  71.                        non-commercial purpose.  It may be copied and 
  72.                        distributed freely provided that any fee charged 
  73.                        by the distributor of the copy does not exceed the 
  74.                        sum of:  1) the cost of the media the copy is 
  75.                        written on,  2) any required costs of shipping the 
  76.                        copy, and  3) a nominal handling fee.  Any other 
  77.                        distribution requires the written permission of 
  78.                        the author.  Also, the author's copyright notices 
  79.                        shall not be removed from the program source, the 
  80.                        program object, or the program documentation.
  81.  
  82.  
  83.  
  84.                                 Table of Contents
  85.  
  86.         1.0  How to Use the Cross-Assembler Package ..................  3
  87.         2.0  Format of Cross-Assembler Source Lines ..................  4
  88.              2.1  Labels .............................................  5
  89.              2.2  Numeric Constants ..................................  5
  90.              2.3  String Constants ...................................  6
  91.              2.4  Expressions ........................................  6
  92.         3.0  Machine Opcodes .........................................  7
  93.              3.1  Opcodes -- Control Instructions ....................  7
  94.              3.2  Opcodes -- Branch Instructions .....................  8
  95.              3.3  Opcodes -- Bit Manipulation Instructions ...........  8
  96.              3.4  Opcodes -- Read-Modify-Write Instructions ..........  8
  97.              3.5  Opcodes -- Register/Memory Instructions ............  8
  98.              3.6  Opcodes -- Synonyms ................................  9
  99.              3.7  Opcodes -- Direct Addressing .......................  9
  100.         4.0  Pseudo Opcodes ..........................................  9
  101.              4.1  Pseudo-ops -- END .................................. 10
  102.              4.2  Pseudo-ops -- EQU .................................. 10
  103.              4.3  Pseudo-ops -- FCB .................................. 10
  104.              4.4  Pseudo-ops -- FCC .................................. 10
  105.              4.5  Pseudo-ops -- FDB .................................. 11
  106.              4.6  Pseudo-ops -- IF, ELSE, ENDIF ...................... 11
  107.              4.7  Pseudo-ops -- INCL ................................. 12
  108.              4.8  Pseudo-ops -- ORG .................................. 12
  109.              4.9  Pseudo-ops -- PAGE ................................. 13
  110.              4.10 Pseudo-ops -- RMB .................................. 13
  111.              4.11 Pseudo-ops -- SET .................................. 13
  112.              4.12 Pseudo-ops -- TITLE ................................ 13
  113.         5.0  Assembly Errors ......................................... 14
  114.              5.1  Error * -- Illegal or Missing Statement ............ 14
  115.              5.2  Error ( -- Parenthesis Imbalance ................... 14
  116.              5.3  Error " -- Missing Quotation Mark .................. 14
  117.              5.4  Error A -- Illegal Addressing Mode ................. 14
  118.              5.5  Error B -- Branch Target Too Distant ............... 15
  119.              5.6  Error D -- Illegal Digit ........................... 15
  120.              5.7  Error E -- Illegal Expression ...................... 15
  121.              5.8  Error I -- IF-ENDIF Imbalance ...................... 15
  122.              5.9  Error L -- Illegal Label ........................... 15
  123.              5.10 Error M -- Multiply Defined Label .................. 16
  124.              5.11 Error O -- Illegal Opcode .......................... 16
  125.              5.12 Error P -- Phasing Error ........................... 16
  126.              5.13 Error S -- Illegal Syntax .......................... 16
  127.              5.14 Error T -- Too Many Arguments ...................... 16
  128.              5.15 Error U -- Undefined Label ......................... 16
  129.              5.16 Error V -- Illegal Value ........................... 17
  130.         6.0  Warning Messages ........................................ 17
  131.              6.1  Warning -- Illegal Option Ignored .................. 17
  132.              6.2  Warning -- -l Option Ignored -- No File Name ....... 17
  133.              6.3  Warning -- -o Option Ignored -- No File Name ....... 17
  134.              6.4  Warning -- Extra Source File Ignored ............... 17
  135.              6.5  Warning -- Extra Listing File Ignored .............. 18
  136.              6.6  Warning -- Extra Object File Ignored ............... 18
  137.  
  138.  
  139.  
  140.  
  141.                                         1
  142.  
  143.  
  144.  
  145.         7.0  Fatal Error Messages .................................... 18
  146.              7.1  Fatal Error -- No Source File Specified ............ 18
  147.              7.2  Fatal Error -- Source File Did Not Open ............ 18
  148.              7.3  Fatal Error -- Listing File Did Not Open ........... 18
  149.              7.4  Fatal Error -- Object File Did Not Open ............ 18
  150.              7.5  Fatal Error -- Error Reading Source File ........... 18
  151.              7.6  Fatal Error -- Disk or Directory Full .............. 18
  152.              7.7  Fatal Error -- File Stack Overflow ................. 19
  153.              7.8  Fatal Error -- If Stack Overflow ................... 19
  154.              7.9  Fatal Error -- Too Many Symbols .................... 19
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.                                         2
  203.  
  204.  
  205.  
  206.         1.0  How to Use the Cross-Assembler Package
  207.  
  208.              First, the question, "What does a cross-assembler do?" needs 
  209.         to be addressed as there is considerable confusion on this point.  
  210.         A cross-assembler is just like any other assembler except that it 
  211.         runs on some CPU other than the one for which it assembles code.  
  212.         For example, this package assembles 6805 source code into 6805 
  213.         object code, but it runs on an 8080, a Z-80, an 8088, or whatever 
  214.         other CPU you happen to have a C compiler for.  The reason that 
  215.         cross-assemblers are useful is that you probably already have a 
  216.         CPU with memory, disk drives, a text editor, an operating system, 
  217.         and all sorts of hard-to-build or expensive facilities on hand.  
  218.         A cross-assembler allows you to use these facilites to develop 
  219.         code for a 6805.
  220.  
  221.         This program requires one input file (your 6805 source code) and 
  222.         zero to two output files (the listing and the object).  The input 
  223.         file MUST be specified, or the assembler will bomb on a fatal 
  224.         error.  The listing and object files are optional.  If no listing 
  225.         file is specified, no listing is generated, and if no object file 
  226.