home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 1: Collection A / 17Bit_Collection_A.iso / files / 73.dms / 73.adf / asm.doc < prev    next >
Text File  |  2008-06-02  |  11KB  |  369 lines

  1.  
  2.  
  3.  
  4.         asm(1.1), an AmigaDOS compatible 68010 assembler
  5.            Deviations from AmigaDOS manual
  6.               Copyright (c) 1986
  7.              Douglas J Leavitt Jr.
  8.              3005 OFW #2, Venice CA, 90291
  9.              Usenet: sdcrdcf!ism780c!dougl
  10.             Suggested contribution: $25-$50
  11.  
  12.  
  13.  
  14.  
  15.     Intro
  16.  
  17.     This paper describes the functions and capabilities available
  18.     with  the  asm(1.1) macro  assembler.  The  asm  assembler is
  19.     designed  to be a 68010  macro assembler  that is  compatible
  20.     with  the  assembler  described in  the AmigaDOS Manual, from
  21.     Commodore-Amiga Inc., and Bantam Computer Books.
  22.  
  23.     Because  this assembler  tries to be as compatible as possible
  24.     with the AmigaDOS  assembler,  only  the deviations  from that
  25.     manual will be discussed here.  At  some  later point in time,
  26.     a totally new manual may be written.
  27.  
  28.     The asm(1.1)  assembler  was designed with three principles in
  29.     mind.
  30.  
  31.         1.  An assembler that is available to everyone.
  32.  
  33.         2.  An assembler capable of  assembling  any currently
  34.             available assembly language written for the Amiga.
  35.  
  36.         3.  An assembler  with  more  power  than is available
  37.             in the standard AmigaDOS macro assembler.
  38.  
  39.     The first  goal  of has  been  met by  making this assembler a
  40.     shareware product.  By making this assembler shareware product
  41.     it is hoped  that it's  availability  will become  widespread,
  42.     providing a general increase in Amiga software, and ultimately
  43.     providing  a better  Amiga  environment  for all people.  This
  44.     assembler  is  intended  as  the  first  part  of an  entire C
  45.     compilation  system  that  will  eventually  be  provided as a
  46.     shareware system for all Amiga users.
  47.  
  48.     This  paper is  organized in the same sections as the AmigaDOS
  49.     assembler manual chapter.
  50.  
  51.     Deviations from The AmigaDOS Manual Chapter 3
  52.  
  53.     3.1 Introduction to the 68000/68010 Microchip
  54.  
  55.     This assembler is capable of  compiling  the new  instructions
  56.     that are available with the 68010.  This means  that three new
  57.     registers and three new instructions are available. These are:
  58.  
  59.         1.  sfc, dfc, vbr registers, and
  60.         2.  movec, movec.l
  61.         3.  moves.b, moves.w, moves.l
  62.         4.  rtd instructions
  63.  
  64.     This assembler is also capable of determining whether a branch
  65.     may  be generated  in the 8 or 16 bit form automatically.  The
  66.     way that this is accomplished, is by using a  jcc instruction.
  67.     For example, if the assembler encounters a jne instruction, it
  68.     will automatically determine if it can  generate a bne.s or if
  69.     must generate a bne instruction.
  70.  
  71.     3.2 Calling asm(1.1)
  72.  
  73.     For the most part asm(1.1) tries to be as flexible as possible
  74.     whenever possible.  The assembler does not  require a specific
  75.     command line argument order.  The current legal arguments are:
  76.  
  77.         asm [options] assembly_file [options]
  78.  
  79.         options:
  80.         ?      - Display command line format
  81.         -q      - Silent mode (copyright notice not shown)
  82.         -l file      - Generate listing file
  83.         -h file      - Include header file
  84.         -o file      - Output file name
  85.         -i incl      - Add include list to searching
  86.         -v file      - Gererate errors to verification file
  87.  
  88.     The -c flag does not currently exist with this  release of the
  89.     assembler.  These  options  are expected  to appear in a later
  90.     release.
  91.  
  92.     3.3.2.3
  93.  
  94.     This  assembler  is capable  of accepting either upper case or
  95.     lower case opcodes.  Whenever  an  instruction is  encountered
  96.     without a size specifier, word sized opcodes are assumed.
  97.  
  98.     Whenever the opcode field contains a local label that has been
  99.     defined to be an absolute constant, asm(1.1) will generate the
  100.     equivalent of a dc.w whose value is  the value  of the  label.
  101.  
  102.     Opcodes may not currently start in  the first  character of an
  103.     assembly line.  Asm(1.1) is not capable of determining whether
  104.     an opcode starting in the first character  position is a label
  105.     or an opcode.
  106.  
  107.     3.3.2.4
  108.  
  109.     The restriction of not allowing whitespace characters,  blanks
  110.     and tabs, between operands has been removed.
  111.  
  112.     3.3.2.5
  113.  
  114.     If a comment immediately  follows a  zero operand  instruction
  115.     and the comment  starts  with a  word  rather  than a  comment
  116.     delimiter such as ';',  the word  will be  taken as a  symbol.
  117.     This is not currently  seen as a  problem because  the comment
  118.     character ';' may  always be placed  immediately  after a zero
  119.     operand instruction.
  120.  
  121.     3.4.1
  122.  
  123.     All expression calculations are in signed 32 bit  calculations
  124.     which are then truncated if necessary.
  125.  
  126.     3.4.3
  127.  
  128.     A symbol  is a  string of up to  64 characters.   The  special
  129.     symbol '.' has the value of the current program counter.  This
  130.     symbol is equivalent to '*'. The symbol '*' does exist in this
  131.     assembler.  The '.' symbol  has been  provided because of it's
  132.     significance in many other assembly languages.
  133.  
  134.     3.4.4
  135.  
  136.     When a hex constant is being parsed, the characters 'a'-'f' as
  137.     well as 'A'-'F' are legal values for the numbers 10-15.
  138.  
  139.     Ascii literals are normally contained in single quotes "'".
  140.  
  141.     Ascii strings are legal operands in many assembler directives.
  142.     An ascii string is very similar to a C type string.  An  ascii
  143.     string is a sequence of ascii  characters  contained in double
  144.     quotes.  The following sequences exist in strings:
  145.  
  146.         1.  \r    - carraige return
  147.         2.  \n    - newline
  148.         3.  \t    - tab character
  149.         4.  \f    - formfeed
  150.         5.  \b    - backspace
  151.         6.  \\    - backslash
  152.         7.  \07 - \ followed by 1-3 octal characters generates
  153.               the desired 8 bit character sequence.
  154.  
  155.     Double quoted strings will work with any operand that requires
  156.     a string. Single quoted strings will work for those directives
  157.     that document it as such.  These directives, ifc/ifnc,  accept
  158.     both singly or doubly quoted strings and treat  them the same.
  159.  
  160.     3.5
  161.  
  162.     Absolute  short  addresses  are  denoted by  appending  a '.w'
  163.     suffix to the address.  The '.l' suffix  may also  be appended
  164.     to a long absolute address.
  165.  
  166.     The REG directive does not currently exist in this  assembler,
  167.     however it is possible to specify by name a list of  registers
  168.     that will be saved in a movem instruction other than a  simple
  169.     immediate value constant.  The following operand form is legal
  170.     for the movem instruction:
  171.  
  172.         register_name[|register_name[|register_name...]]
  173.     An example:
  174.         movem.l    d7|d6|d5|a4|a3,-(sp)
  175.  
  176.     The asm(1.1) assembler will generate the correct mask for  all
  177.     legal addressing modes, predecrement included.
  178.  
  179.     3.6
  180.  
  181.     The Asm(1.1) release of the assembler has been updated so that
  182.     all "I", "A", and "M" variants now exist.
  183.  
  184.     3.7
  185.  
  186.     As many directives as  possible  have been  supported  in this
  187.     assembler.  This section describes the current limitations and
  188.     additions to the existing assembler directives.
  189.  
  190.     The following directives are not currently  supported  in this
  191.     version of the assembler.  They are accepted, however they are
  192.     ignored.
  193.  
  194.         1.  offset
  195.         2.  rorg
  196.         3.  reg
  197.  
  198.     The following directives are supported in this assembler,  but
  199.     do not exist in the standard Amiga macro assembler.
  200.  
  201.         1.  text, code, data, bss
  202.         2.  global, globl
  203.         3.  comm
  204.         4.  even, align
  205.         5.  ascii, asciz
  206.         6.  else
  207.  
  208.     Assembler Control Directives
  209.  
  210.     SECTION
  211.  
  212.     The  section directive  currently  supports  only 3  sections.
  213.     These sections are one each of CODE, DATA, and BSS.   Each  of
  214.     these sections may share a common section name, or they may be
  215.     unnamed, which is the default.
  216.  
  217.     TEXT, CODE
  218.  
  219.     These directives change the current section to become the code
  220.     section.  Neither directive takes an operand, and the  section
  221.     name is assumed to the current section name.
  222.  
  223.     DATA
  224.  
  225.     This  directive change the current  section to become the data
  226.     section.  This  directive does  not take an operand,  and  the
  227.     section    name is assumed to the current section name.
  228.  
  229.     BSS
  230.  
  231.     This  directive change the current  section to become the  bss
  232.     section.  This  directive does  not take an operand,  and  the
  233.     section    name is assumed to the current section name.
  234.  
  235.     Data Definition Directives
  236.  
  237.     COMM
  238.  
  239.     This directive has the following form:
  240.  
  241.         COMM    symbol,N
  242.  
  243.     This directive  places the given symbol into  the BSS  section
  244.     with a size of N.  N is a constant expression that defines the
  245.     size of the symbol in byte units.
  246.  
  247.     ASCII
  248.  
  249.     This directive has the following form:
  250.  
  251.     [<label>]    ASCII    string
  252.  
  253.     This directive generates N bytes of data.  The  generated data
  254.     is a set of ascii bytes whose  values are  represented  in the
  255.     given  string.  A  NUL  ('\0')  termination  character is  NOT 
  256.     generated with this directive.  N is the number of  characters
  257.     that exist in the string.
  258.  
  259.     ASCIZ
  260.  
  261.     This directive has the following form:
  262.  
  263.     [<label>]    ASCIZ    string
  264.  
  265.     This directive generates N+1 bytes of data. The generated data
  266.     is a set of ascii bytes whose  values are  represented  in the
  267.     given string.  A NUL ('\0') termination character is generated
  268.     with this directive.  N is the number of characters that exist
  269.     in the string.
  270.  
  271.     Listing Control Directives
  272.  
  273.     LLEN
  274.  
  275.     This directive will accept and check the legal values, however
  276.     the changed value is ignored.
  277.  
  278.     PLEN
  279.  
  280.     This directive now has a default of 66 lines per page.
  281.  
  282.     TTL
  283.  
  284.     The program  title  may be  up to  64 characters  long in this
  285.     directive.
  286.  
  287.     Conditional Assembly Directives
  288.  
  289.     ELSE
  290.  
  291.     This  directive  changes  the  true/false   condition  of  the
  292.     currently active if directive.  This directive does  not  have
  293.     arguments.  Else directives may be nested just like other ifxx
  294.     directives.  When else directives are nested, the current else
  295.     pertains to the most recent open if directive.
  296.  
  297.     Alignment Directives
  298.  
  299.     EVEN
  300.  
  301.     This directive aligns the current section on an even  boundary
  302.     by generating 0 or 1 zero bytes of data.
  303.  
  304.     ALIGN
  305.  
  306.     This directive has the following form:
  307.  
  308.         ALIGN    N
  309.  
  310.     This directive aligns the current section on a mod N boundary.
  311.     0 to N-1 bytes of  zero  data  will be  generated to  properly
  312.     change the alignment as requested.
  313.  
  314.     External Symbols
  315.  
  316.     GLOBAL, GLOBL
  317.  
  318.     These directives have the following form:
  319.  
  320.         GLOBAL    symbol1[,symbol2[,symbol3...]]
  321.         or
  322.         GLOBL    symbol1[,symbol2[,symbol3...]]
  323.  
  324.     These directives take one or more labels, and  generate  each
  325.     label as an  externally  defined  symbol.   These  directives 
  326.     perform the same functionality as  XREF and  XDEF,  but  have
  327.     provided for compatibility with other assemblers.
  328.  
  329.     Other Differences
  330.  
  331.     The following is a list of  other known  differences  between
  332.     this assembler, and the AmigaDOS macro assembler document.
  333.  
  334.         1.  An assembly  line may  be up to 128 characters in
  335.             length.
  336.  
  337.         2.  There may be up to 8 different  levels of  nested
  338.             includes.
  339.  
  340.         3.  Macro  expansion  allows  for  up to  24 separate
  341.             macro arguments.
  342.  
  343.         4.  Up to 8 different include paths may exist in each
  344.             assembly.
  345.  
  346.         5.  Conditional assemblies may be nested 16 deep.
  347.  
  348.         6.  Macro expansions may be nested 16 deep.
  349.  
  350.         7.  There is currently a maximum limit on the  number
  351.             of ifd/ifnd directives.  That limit is  currently
  352.             a total of 512 ifd and ifnd directives.
  353.  
  354.  
  355.     Acknowledgements
  356.  
  357.     Amiga, AmigaDOS, and Alink
  358.         Are trademarks of Commodore-Amiga, Inc.
  359.  
  360.     The AmigaDOS Manual
  361.         is  printed by Bantam computer Book,  and is Copyright
  362.         (c) 1986 Commodore Capital, Inc.
  363.  
  364.     68000/68010/68020/68030/68881/Motorola
  365.         Are trademarks of Motorola Microsystems, Inc.
  366.  
  367.     Unix
  368.         Is a trademark of AT&T.
  369.