home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / PROG / ASSEMBLY / MOTOASMS.ZIP / ASEMBLER.DOC < prev    next >
Encoding:
Text File  |  1989-09-24  |  13.6 KB  |  327 lines

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