home *** CD-ROM | disk | FTP | other *** search
/ The Unsorted BBS Collection / thegreatunsorted.tar / thegreatunsorted / programming / asm_programming / 6800.ZIP / ASMB.DOC < prev   
Text File  |  1989-04-23  |  9KB  |  270 lines

  1.  
  2.  
  3.           The IBM PC 6800/01/04/05/09/11 cross assemblers
  4.  
  5.  
  6. GENERAL
  7.     The assemblers are named as*.exe where '*' is  any
  8.     of 0,1,h1,4,5,9 or 11 depending on which one you're using.  Command
  9.     line arguments specify the filenames to assemble.
  10.  
  11.     The assemblers accept options from the command line to be
  12.     included in the assembly.  These options are the following:
  13.  
  14.         l       enable output listing.
  15.         nol    disable output listing (default).
  16.         cre    generate cross reference table.
  17.         s       generate a symbol table.
  18.         c       enable cycle count.
  19.         noc    disable cycle count.
  20.  
  21.     The command line looks like this :
  22.  
  23.            as* file1 file2 ... [ - option1 option2 ...]
  24.  
  25.     If this method of passing commands to the assembler is
  26.     used rather than the OPT pseudo op code, a space should
  27.     separate the minus sign from the last file name and the
  28.     first option.  Example:
  29.  
  30.        as5 program -l cre
  31.  
  32.     This command assembles file 'program' with an output
  33.     listing and a cross reference table.
  34.  
  35.     The `S1' formatted object file is placed in file
  36.     `filename.S19', the listing and error messages are
  37.     written to  the standard output.  If multiple files are
  38.     assembled, the 'S1' file will be placed under the first
  39.     file's name.S19.
  40.  
  41.     The listing file contains the address and bytes assembled for each
  42.     line of input followed by the original input line (unchanged, but
  43.     moved over to the right some).    If an input line causes more than 6
  44.     bytes to be output (e.g. a long FCC directive), additional bytes
  45.     (up to 64) are listed on succeding lines with no address preceding
  46.     them.
  47.  
  48.     Equates cause the value of the expression to replace the address
  49.     field in the listing.
  50.  
  51.     Equates that have forward references cause Phasing Errors in Pass
  52.     2.
  53.  
  54.     Expressions may consist of symbols, constants or the character    '*'
  55.     (denoting the current value of the program counter) joined together
  56.     by one of the operators: +-*/%&|^.  The operators are the same as
  57.     in C:
  58.  
  59.         +    add
  60.         -    subtract
  61.         *    multiply
  62.         /    divide
  63.         %    remainder after division
  64.         &    bitwise and
  65.         |    bitwise or
  66.         ^    bitwise exclusive-or
  67.  
  68.     Expressions are evaluated left to right and there is no provision
  69.     for parenthesized expressions.    Arithmetic is carried out in signed
  70.     twos-complement integer precision (16 bits on the IBM PC)
  71.  
  72.     Constants are constructed with the same syntax as the Motorola MDOS
  73.     assembler:
  74.  
  75.         '       followed by ASCII character
  76.         $    followed by hexadecimal constant
  77.         @    followed by octal constant
  78.         %    followed by binary constant
  79.         digit    decimal constant
  80.  
  81. ERRORS
  82.  
  83.     Error diagnostics are placed in the listing file just before the
  84.     line containing the error.  Format of the error line is:
  85.  
  86.         Line_number: Description of error
  87.             or
  88.         Line_number: Warning --- Description of error
  89.  
  90.     Errors of the first type in pass one  cause  cancellation  of  pass
  91.     two.  Warnings    do  not  cause    cancellation of pass two but should
  92.     cause you to wonder where they came from.
  93.  
  94.     Error messages are meant to be self-explanatory.
  95.  
  96.     If more than one file is being assembled, the  file  name  precedes
  97.     the error:
  98.  
  99.         File_name,Line_number: Description of error
  100.  
  101.     Finally, some errors are classed as fatal and  cause  an  immediate
  102.     termination  of  the assembly.    Generally these errors occur when a
  103.     temporary file cannot be created or is lost  during  the  assembly.
  104.     Consult your local guru if this happens.
  105.  
  106.  
  107. DIFFERENCES
  108.  
  109.     For indexed addressing, the comma is required before the  register;
  110.     `inc x' and `inc ,x' are not the same.
  111.  
  112.         Macros are not supported.  (try M4 or M6)
  113.  
  114.     The force size operators ('>' and  '<')  are  implemented  for  all
  115.     assemblers.
  116.  
  117.         The only pseudo-ops supported are:
  118.  
  119.             ORG    Origin
  120.             FCC    Form Constant Character
  121.             FDB    Form Double Byte
  122.             FCB    Form Constant Byte
  123.             EQU    Equate
  124.             RMB    Reserve Memory Block
  125.             BSZ    Block Store Zeros
  126.             ZMB    Zero Memory Bytes
  127.             FILL    Fill memory with constant
  128.             PAGE    Page eject
  129.             OPT    Options.
  130.  
  131.         The OPT pseudo-op allows the following operands:
  132.  
  133.             nol    Turn off output listing
  134.             l    Turn on output listing (default)
  135.             noc    Disable cycle counts in listing (default)
  136.             c    Enable cycle counts in listing (clear total cycles)
  137.             contc    Re-enable cycle counts (don't clear total cycles)
  138.             cre    Enable printing of a cross reference table
  139.             s    generate a symbol table
  140.  
  141.         Some of the more common pseudo-ops are not present:
  142.  
  143.             SPC    Use blank lines instead
  144.             END    The assembly ends when there is no more input
  145.             TTL    use `pr' to get headings and page numbers
  146.             NAM[E]    Did you ever use this one anyway?
  147.  
  148.         The above 4 pseudo-ops are recognized, but ignored.
  149.  
  150.         ZMB (Zero Memory Bytes) is equivalent to BSZ (Block Store  Zeroes).
  151.         FILL can be used to initialize memory to something other than zero:
  152.         FILL val,nbytes.
  153.  
  154. TARGET MACHINE SPECIFICS
  155.  
  156.  (as0)    6800:    Use for 6802 and 6808 too.
  157.  
  158.  (as1)    6801:    You could use this one for  the  6800  and  avoid
  159.         LSRD, ASLD, PULX, ABX, PSHX, MUL, SUBD, ADDD, LDD
  160.         and STD.
  161.  
  162.  (as4)    6804:    The symbols 'a', 'x' and 'y'  are  predefined  as
  163.         $FF, $80 and $81 respectively.    Also  defined  as
  164.         'A',   'X'   and   'Y'.    Because  of  the  6804
  165.         architecture, this means that 'clr x'  will  work
  166.         since  the  x register is just a memory location.
  167.         To  use  short-direct  addressing,   the   symbol
  168.         involved  must    not  be a forward reference (i.e.
  169.         undefined) and must be in the range $80-$83.
  170.  
  171.         Remember  that    bytes  assembled  in  the   range
  172.         $10-$7F  will go into the data space; There is no
  173.         program space ROM for these locations.
  174.  
  175.         The syntax for Register indirect addressing is as
  176.         follows:
  177.               menmonic [<x>or<y>]
  178.         an example is:
  179.                 lda [x]
  180.         the comma ',' is not allowed.
  181.  
  182.         The MVI instruction (move immediate) has its own
  183.         format :
  184.  
  185.              mvi address,#data   where address is
  186.            an 8-bit address in page zero, and data is
  187.            the value to be written to specified location.
  188.  
  189.  (as5)    6805:    There is no 'opt cmos' pseudo, so be careful  not
  190.         to use STOP or WAIT in a program that is destined
  191.         for  an  NMOS  version    of  the  6805.     The  MUL
  192.         instruction   should   also  be  avoided  on  all
  193.         versions of the 6805 except the C4.  Cycle  times
  194.         are for the NMOS versions.
  195.  
  196.  (as9)    6809:    The SETDP pseudo-op is not implemented.
  197.         Use the '>' and '<` operators to force the size of
  198.         operands.
  199.  
  200.             For compatibility, CPX is equal to CMPX.
  201.  
  202.  (as11) 68HC11: Bit manipulation operands are separated by  blanks  instead
  203.         of commas since the 'HC11 has bit manipulation instructions
  204.         that operate on indexed addresses.
  205.  
  206.  
  207.  
  208.  
  209.  
  210. DETAILS
  211.     Symbol:  A string of  characters  with    a  non-initial    digit.    The
  212.         string of characters may be from the set:
  213.  
  214.                [a-z][A-Z]_.[0-9]$
  215.  
  216.         ( . and _ count as non-digits ).  The `$' counts as a digit
  217.         to   avoid   confusion    with  hexadecimal  constants.    All
  218.         characters of a symbol    are  significant,  with  upper    and
  219.         lower  case  characters being distinct.  The maximum number
  220.         of characters in a symbol is currently set at 15.
  221.  
  222.         The symbol table has room for  at  least  2000    symbols  of
  223.         length 8 characters or less.
  224.  
  225.     Label:    A symbol starting in the first column is a  label  and    may
  226.         optionally  be    ended  with a ':'.  A label may appear on a
  227.         line by itself and is then interpreted as:
  228.  
  229.             Label    EQU    *
  230.  
  231.     Mnemonic:  A symbol preceded by at least one whitespace  character.
  232.         Upper  case characters in this field are converted to lower
  233.         case before being checked as a legal mnemonic.    Thus `nop',
  234.         `NOP' and even `NoP' are recognized as the same mnemonic.
  235.  
  236.         Note that register names that sometimes appear at  the    end
  237.         of  a  mnemonic (e.g. nega or stu) must not be separated by
  238.         any  whitespace  characters.   Thus  `clra'   means   clear
  239.         accumulator A, but that `clr a' means clear memory location
  240.         `a'.
  241.  
  242.     Operand:  Follows mnemonic, separated by at  least  one  whitespace
  243.         character.   The   contents   of   the     operand  field  is
  244.         interpreted by each instruction.
  245.  
  246.     Whitespace: A blank or a tab
  247.  
  248.     Comment:  Any text after all operands for  a  given  mnemonic  have
  249.         been  processed or, a line beginning with '*' up to the end
  250.         of line or, an empty line.
  251.  
  252.     Continuations:    If a line ends with a backslash (\) then  the  next
  253.         line  is  fetched  and    added to the end of the first line.
  254.         This continues until a line is seen which doesn't end in  \
  255.         or  until  MAXBUF characters have been collected (MAXBUF >=
  256.         256 ).
  257.  
  258. FILES
  259.     filename.S19    S-record output file
  260.     STDOUT        listing and errors (use redirection for listing file)
  261.     Fwd_refs    Temporary file for forward references.
  262.  
  263. IMPLEMENTATION NOTES
  264.     This is a classic 2-pass assembler.  Pass 1 establishes the  symbol
  265.     table and pass 2 generates the code.
  266.  
  267.                             12/11/84 E.J.Rupp
  268.  
  269.     This version of the cross assemblers ported to the IBM PC 4/13/87
  270.