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