XASM.DOC

(58 KB) Pobierz
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
                                      XASM
    
                                Cross Assemblers
    
                                  Users Guide
    
    
    
    
    
                                  Release 2.2
    
                               Revised 03-Jan-94
    
    
    
    
    
                       Copyright 1983-1994 Dave Dunfield
                              All rights reserved
    XASM Cross Assemblers                                            Page: 1


    1. INTRODUCTION
    
          This complete XASM package contains cross assemblers  for  several
       popular microprocessors, as well as a number of utility programs:
    
            asm00       - 6800 Assembler
            asm01       - 6801/6802 Assembler
            asm02       - 6502 Assembler
            asm05       - 6805 Assembler
            asm08       - 68HC08 Assember
            asm09       - 6809 Assembler
            asm11       - 68HC11 Assembler
            asm16       - 68HC16 Assembler
            asm51       - 8051/8052 Assembler (also 803x, 873x, 875x)
            asm85       - 8085 Assembler (also 8080, Z80)
            asm86       - 8086 Assembler
            asm96       - 8096 Assembler
            hexfmt      - HEX file manipulator
            macro       - Macro pre-processor
            cref        - Cross reference utility
            psource     - Porting source generator
            int2xasm    - Convert "Intel" style source to XASM style
            xasm2int    - Convert XASM style source in "Intel" style
    
          The XASM "package" (software and  documentation)  is  copyrighted,
       and may not be re-distributed without my written permission.  If  you
       find XASM useful, please help me continue to support and  enhance  it
       by ordering the complete package using the order form in the enclosed
       CATALOG file.
    
          XASM is provided on an "as is" basis,  with  no  warranty  of  any
       kind. In no event shall the author be liable for any damages  arising
       from its use or distribution.
    
          Throughout this document, angle braces ('<>') are used to indicate
       operands for which a value must  be  supplied  by  the  user.  Square
       braces ('[]') are used to identify operands which are optional.
    XASM Cross Assemblers                                            Page: 2


    2. ASSEMBLERS
    
          All of the cross assemblers read a source file (.ASM), and produce
       a code  file  (.HEX)  containing  either  MOTOROLA  or  INTEL  format
       ASCII-HEX download records. A optional listing file (.LST)  may  also
       be produced.
    
       2.1 Using the assemblers
    
             Any assembler is invoked by entering its name  at  the  command
          prompt, in the following format:
    
                           ASMxx <filename> [options]
    
             The <filename> operand is the name of the file to be assembled,
          it is assumed to have the extension ".ASM" if none is supplied.
    
             Unless otherwise specified, the code produced by the  assembler
          is written to a file  with  the  name  '<filename>.HEX',  and  the
          listing is written to a file with the name '<filename>.LST'.
    
          2.1.1 Command line options
    
                The following options may be specified on the command  line,
             following the <filename> operand:
    
             -C - [C]ase sensitive
    
                     Causes the assembler  to  make  a  distinction  between
                  upper and lower case characters in symbol  names,  thereby
                  allowing you to have multiple symbol  names  which  differ
                  only in case. If this options is not used,  the  assembler
                  will ignore such case differences,  and  assume  that  the
                  symbols are the same. NOTE: When using this  options,  you
                  must enter any register names in UPPER case.
    
             C=<filename> - Specify [C]ode file
    
                     This option allows you to specify the file to which the
                  output code is written. If no  extension  is  supplied  as
                  part of <filename>, it defaults to ".HEX".
    
             -F - Generate [F]ull listing
    
                     Causes the assembler to output a full source listing to
                  the '.LST' file. By default, only lines containing  errors
                  are written to the listing file.
    
             -I - Generate [I]ntel format HEX file
    
                     Causes the assembler to output the code to  the  '.HEX'
                  file in INTEL hex format. By default the code  is  written
                  to the file in MOTOROLA hex format.
    XASM Cross Assemblers                                            Page: 3


             L=<filename> - Specify [L]isting file
    
                     This option allows you to specify the file to which the
                  listing is written. If no extension is supplied as part of
                  <filename>, it defaults to ".LST".
    
             O=<value> - [O]ptimization (ASM00,01,02,05,08,09,11,16 and 96)
    
                     This option allows you to set a limit  to  the  maximum
                  number of optimization passes  which  the  assembler  will
                  perform while attempting to minimize code size and resolve
                  forward  referenced  symbols.  If  a  symbol  can  not  be
                  resolved within  this  many  passes,  the  assembler  will
                  terminate with an error message.
    
                     You may specify between 0 and 127  optimization  passes
                  to be run, with  0  being  a  special  case  in  which  no
                  optimization  is  performed.  Without  optimization,   all
                  non-specified memory references  and  offsets  default  to
                  their largest form, and forward references in EQU, ORG, or
                  RMB statements will not work. The code generated will  not
                  be optimal, but assembly time is reduced. This feature  is
                  most useful when initialy testing and debugging a program.
    
                     The default number of optimization passes allowed is 3.
    
             P=<length> - Set page length
    
                     This options specifies the number of lines  which  will
                  be printed on each page. The default number of  lines  per
                  page is 60.
    
             -Q - [Q]uiet mode
    
                     Causes  the  assembler  to  be  quiet,  inhibiting  the
                  display of the progress messages.
    
             -S - Generate [S]ymbol table
    
                     Causes the assembler to sort  and  display  the  symbol
                  table at the end of the  listing  file.  By  default,  the
                  symbol table is not displayed.
    
             -T - Output to [T]erminal
    
                     Causes the assembler  to  output  the  listing  to  the
                  terminal, (via stdout) instead of the usual '.LST' file.
    
        W=<width> - Set page width
    
                This options control the number of  columns  which  will  be
             used for the printing of  page  titles  and  the  symbol  table
             listing. Default page width is 80 columns.
    XASM Cross Assemblers                                            Page: 4


       2.2 Redirecting the listing file
    
             When the listing file is directed to the terminal with the '-t'
          option on the command line, it is displayed through  the  standard
          output file, allowing it to be redirected to a  printer  etc.  via
          the shell '>' redirection  operator  (EG:  ASMxx  filename  -f  -t
          >LPT1:). The progress messages ('First pass...'  etc)  are  output
          through stderr, and will therefore  not  be  redirected  with  the
          listing.
    
       2.3 Source file format
    
             The assembly source input lines are in the following format:
    
                '<label>  <instruction>  <operands>  <comment>'
    
             Labels must begin in column one, and must be separated from the
          instruction field by at least one blank or tab character.
    
             If the an instruction or directive requires operands, then  the
          operand field is required, and is separated from  the  instruction
          by at least one blank or tab.
    
             The optional comment field is delimited from the operand  field
          by at least one blank or tab, and is  ignored  by  the  assembler.
          Blanks or tabs within  the  operand  field  are  allowed  only  if
          contained within the delimiters of a character  string,  otherwise
          they will be interpreted as the end of the operand field.
    
             Any lines beginning with a '*'  character  is  column  one  are
          considered to  be  a  comments,  and  are  not  processed  by  the
          assembler.
    XASM Cross Assemblers                                            Page: 5


       2.4 Expressions
    
             When an 8 or 16 bit value is  required  as  an  operand  to  an
          assembler directive ...
Zgłoś jeśli naruszono regulamin