home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d9xx / d906 / phxass.lha / PhxAss / PhxAss.doc < prev    next >
Text File  |  1993-08-28  |  36KB  |  1,036 lines

  1. last change: 93-07-25
  2.  
  3.              ********************************
  4.              *                    *
  5.              *       P h x A s s      V 3.xx    *
  6.              *                    *
  7.              *        MC680x0/68851/6888x     *
  8.              *          Macro Assembler        *
  9.              *                    *
  10.              *      Written by Frank Wille    *
  11.              *                    *
  12.              ********************************
  13.  
  14.  
  15.  
  16. Preface
  17. =======
  18.  
  19. PhxAss V3.xx is SHAREWARE and © copyright 1993 by Frank Wille. Commercial
  20. usage of this program, without a written permission of the author, is strictly
  21. forbidden!
  22.  
  23. PhxAss V3.00 supports all instructions and addressing modes of the following
  24. Motorola processors:  68000,68010,68020,68030,68040,68851,68881,68882
  25. I have completely rewritten huge parts of the source-code, e.g. the whole
  26. addressing mode recognition and the specific code for all instructions.
  27. Because of new searching algorithms the assembling is 15-45% (!) faster as
  28. with version V2.x. On my 7 MHz 68010 A1000 I have measured nearly 25000
  29. lines per minute.
  30. This program is SHAREWARE. So if you like it, please send me 25 DM or 15$ to
  31. become a registered user. In return you will get the newest updates.
  32.  
  33.  
  34.  
  35. Modifications to PhxAss V2.xx
  36. =============================
  37.  
  38. Register symbols (EQUR) must be declared before they are used. This enables a
  39. faster addressing mode recognition.
  40.  
  41. There are some new optimizations possible. The optimize-flags which can be
  42. specified behind the -n option or after the OPT directive have completely
  43. changed (see "Assembler Options").
  44.  
  45. If you have enabled the small-code model, all jumps which are referencing
  46. external symbols are converted to PC-relative instead of long branch.
  47.  
  48. The '*'-symbol contains the address of the current instruction. For example
  49.  'bra *+10' would branch to the location ten bytes behind the 'bra'-opcode.
  50.  
  51. New directives: FPU, PMMU, CODE_C, CODE_F, DATA_C, DATA_F, BSS_C, BSS_F and
  52. INCDIR.
  53.  
  54. Already mentioned above: The instructions and addressing modes of 68020-68040,
  55. 68851(PMMU) and 6888x(FPCP) are completely supported. You can use Motorola's
  56. new addressing mode style even in the 68000 mode (e.g MOVE (4,A5),D0 ).
  57.  
  58. The new addressing mode recognition has no difficulties with parentheses '()'
  59. instead of brackets '[]' to indicate a term. An operand like
  60.  
  61.  -([x|y]*z)+6([addr+2,A4,regxy*QSIZE],[outerdisp+$100<<(1+3)]),((abc-xyz)+2,A3)
  62.  
  63. would cause no problems.
  64.  
  65. PhxAss enables floating-point numbers to be used with the 6888x (FPCP)
  66. instructions. For example:     fmove.d  #3.1415926536,fp7
  67. moves the double-precision number pi to the FPCP register seven.
  68.  
  69. Note: Ensure that your LIBS: directory contains the 'mathieeedoubbas.library'.
  70.  
  71. Since V3.10 PhxAss is able to optimize forward-branches, which are coming
  72. into their 8/16-bit range by optimzation of the subsequent code. As a result,
  73. other forward-branches could come into range and are also optimized, and so
  74. on.
  75.  
  76. V3.30:
  77. o Symbols which are preceded by a '.' will be regarded as local symbols too.
  78. o A special version of PhxAss is available, which is not limited to the
  79.   maximum number of 65535 lines.
  80.  
  81.  
  82.  
  83. Bug fixes since V2.11
  84. =====================
  85.  
  86. o Some instructions had generated a wrong error, e.g. TRAP and STOP generated
  87.   'Assembly aborted' instead of 'Out of range'.
  88. o 'move.l  #xxxx,-(a0)' produced an illegal opcode.
  89. o If someone writes a program without first opening a section with CODE/CSEG,
  90.   SECTION or an initial label, all labels got wrong values.
  91. o In some cases the equates file let PhxAss crash.
  92. o A XDEF for a symbol which was already declared in another section would
  93.   add this symbol to the external-hunk of the section currently active.
  94. o Jump to Branch optimization did not check the addressing mode of the
  95.   JMP/JSR instruction. It simply optimized all modes.
  96. o A long branch to the next instruction was incorrectly optimized to $6x00.
  97. o Bcc.B was not recognized as a short branch. PhxAss accepted only Bcc.S.
  98. o The CNOP directive had disabled all optimizing in its section.
  99. o The 'Word at odd address'-error crashed PhxAss sometimes.
  100. o INITNEAR was useless in the absolute mode.
  101.  
  102. Bug fixes since V3.00
  103. =====================
  104.  
  105. o TRACKDISK now really works.
  106. o The 68020 addressing-mode ([Rn]) was assembled with a wrong size in pass one.
  107. o The near-data range was incorrectly limited to 32k in object files.
  108. o The formatted text-output should also work on OS2.xx/3.xx now.
  109. o MOVE USP,An , MOVES and MOVEP produced incorrect code.
  110. o GLOBAL and BSS had destroyed the MSW-bits of the BSS-hunk type ($000003eb).
  111. o CNOP definitely bug-free (I hope).
  112. o References on "\@"-labels behind another macro nesting were impossible.
  113. o "\@" only allowed 999 macro calls (now it's unlimited).
  114. o Some extended adressing modes had made some problems:
  115.   ([..],Rn.s|*x,od) and ([PC..    got a wrong size in pass one,
  116.   ([BaseDisp])    generated an error and    (bd,An/PC,Xn) (where bd is outside of
  117.   the normal 8-bit range) crashed PhxAss.
  118. o FETOXM1 was forgotten (in my Reference Manual too).
  119. o TAB-Codes within strings could not be expanded.
  120.  
  121.  
  122.  
  123. Starting PhxAss
  124. ===============
  125.  
  126. Start the assembler by entering the command line:
  127.  
  128.    PhxAss [<-options>] <filename> [<-options>]
  129.  
  130. where [<-options>] specify optional parameters and <filename> is the name of
  131. the file to be assembled. If no extension in <filename> is given, the assembler
  132. assumes ".asm" for being the extension. Some options cannot be specified before
  133. the file name (see "Assembler Options").
  134. <filename> must be the name of an assembler source code file. The source code
  135. must be an ASCII text file where each line ends with a linefeed ($0a) character
  136. (the format, which all Amiga editors generate). TAB-codes ($09) are allowed.
  137. When the assenbler is running, it can be stopped at any time with CTRL-C.
  138.  
  139.  
  140.  
  141. Assembler Options
  142. =================
  143.  
  144. The following assembler options are supported by PhxAss V3.xx :
  145.  
  146. -o<filename>        Defines the name of the output file. If not specified,
  147.             PhxAss takes the source code's filename and replaces
  148.             its extension with ".o" .
  149.  
  150. -d            The names of all global labels of each section are
  151.             written to symbol data blocks. A debugger can use
  152.             these names instead of addresses.
  153.  
  154. -a            Enable auto-align for DC.x directives. All DC.W, DC.L,
  155.             etc. directives in the code will be automatically
  156.             aligned to word-boundaries.
  157.  
  158. -s<symname>[=value]    Predefines a symbol by SET directive. If the value is
  159.             missing, the symbol will be set to 1.
  160.  
  161. -e[<filename>]        Generates an equates file. If <filename> is missing,
  162.             the name of the source code with extension ".equ" will
  163.             be used. Cannot be specified before the name of the
  164.             source code.
  165.  
  166. -l[<filename>]        Generates a listing file. If <filename> is missing, the
  167.             name of the source code with extension ".lst" will be
  168.             used. Cannot be specified before the name of the source
  169.             code.
  170.  
  171. -x            Includes a reference list of all global symbols in the
  172.             listing file. If no listing file was opened, this
  173.             option will cause an error.
  174.  
  175. -p[<lines>]        Sets the page length for equates and listing files.
  176.             If <lines> isn't specified or set to zero, no form.
  177.             feed ($0c) characters will be generated. The default
  178.             value is 60 lines.
  179.  
  180. -q            Quiet mode. The assembler makes no outputs until an
  181.             error occurs.
  182.  
  183. -i<path1>[,<path2>..]    Defines one or more include-paths which will be used
  184.             by the INCLUDE and INCBIN directives.
  185.  
  186. -h<name1>[,<name2>..]    Defines one or more INCLUDE directives at the top of
  187.             the source code.
  188.  
  189. -mf            Forces the whole code to use the large code and large
  190.             data model. NEAR directives within the source code
  191.             will be ignored.
  192.  
  193. -mn[<areg>][,<secnum>]    Forces the whole code to use the small data model.
  194.    or       [,S...]    <areg> (default: 4) specifies the number of the
  195.             address register which will be used as pointer to the
  196.             small data section. Only the registers A2-A6 can be
  197.             used. <secnum> is the number of the section which will
  198.             be the small data section (defaults to 0).
  199.             If a string, starting with a 'S' (f.ex. "SmallData"),
  200.             is specified instead of the section number, all Data
  201.             and Bss sections will be treated as a whole small data
  202.             section. They are coalesced by calling the linker with
  203.             the small data option.
  204.  
  205. -mc            Forces the whole code to use the small code model.
  206.             All JSR and JMP instructions which are referencing
  207.             external symbols are converted to PC-relative jumps.
  208.  
  209. -n[<Flags>]        Sets the optimize flags. The following characters can
  210.             be specified after '-n':
  211.  
  212.             N (Normal)
  213.                Standard optimizations:
  214.                clr.l -> moveq #0, move.l -> moveq,
  215.                link.l(68020) -> link.w, adda/suba -> lea
  216.                ($xxxx).L -> ($xx).W,  0(An) -> (An)
  217.  
  218.             R (Relative)
  219.                ($xxxx) -> xx(PC)
  220.  
  221.             Q (Quick)
  222.                Conversions to addq/subq
  223.  
  224.             B (Branches)
  225.                Bcc.l(68020) -> Bcc.w -> Bcc.b, jmp/jsr -> bra/bsr
  226.  
  227.             T (Total branch optimization)
  228.                Bcc.l(68020) -> Bcc.w -> Bcc.b (forward branches)
  229.                Only active if 'B' is also selected.
  230.                WARNING! If you use this option together with a
  231.                listing file, then you can't rely on the line-
  232.                addresses.
  233.  
  234.             L (Logical Shifts)
  235.                lsl #1,Dn -> add Dn,Dn
  236.                lsl.w/b #2,Dn -> add Dn,Dn add Dn,Dn
  237.  
  238.             P (PEA/LEA conversion)
  239.                move.l #x,An -> lea x,An
  240.                     -> lea x(PC),An / lea x.w,An
  241.                move.l #x,-(SP) -> pea x -> pea x(PC) / pea x.w
  242.  
  243.             S (Special, e.g. Read-Modify-Write operations)
  244.                pea 0 -> clr.l -(SP)
  245.                add/sub #0,An or lea 0(An),An ->  (remove)
  246.                The following are not recommendable for a MC68000
  247.                accessing hardware registers:
  248.                move #0,<ea> -> clr <ea>
  249.                move.b #-1,<ea> -> st <ea>
  250.  
  251.             M (MOVEM)
  252.                movem Rn,<ea> -> move Rn,<ea>
  253.                movem ,<ea> -> (remove)
  254.  
  255.             There are two short cuts:
  256.    *            Selects all standard optimizations & T (-nnrqbt).
  257.    !            Enables all optimizations possible (-nnrqbtlpsm).
  258.             -n without parameters will forbid any optimizing.
  259.             If -n is not specified the assembler uses standard
  260.             optimization (-nnrqb).
  261.  
  262.  
  263.  
  264. Programmer Information
  265. ======================
  266.  
  267.  
  268. 1. Comments
  269.  
  270. Comments start with a ';' or with a '*'.  The text which follows after the
  271. operand field is also a comment and doesn't need ';' or '*'.
  272. Example:
  273.      ; Comment text
  274.       moveq   #0,d0
  275.      ** This is a comment too **
  276.       nop                  ; comment
  277.       add.l   d0,d0           comment after operand field
  278.  
  279. If no operand field is given, e.g. after the NOP instruction, the comment must
  280. be preceded by a ';'. The example above without a semicolon after the NOP
  281. would make the assembler to treat 'comment' as its operand.
  282.  
  283.  
  284. 2. Labels
  285.  
  286. Labels must start in the first column of a line. The colon at the label's end
  287. is optional.
  288. Example:
  289.      Label:   moveq   #0,d0
  290.  
  291. Local labels have a '$' suffixed or are preceded by a '.' (since V3.30). They
  292. are only valid between two global labels.
  293. Example:
  294.      Global1: add.w    d0,d1
  295.           beq.s    local1$
  296.           bpl.s    .local2
  297.           rts
  298.      local1$: moveq    #-1,d0
  299.      .local2: rts
  300.      Global2:
  301.  
  302. The length for global and local labels is unlimited. Valid characters for the
  303. labels are: 'a'-'z', 'A'-'Z', '0'-'9' and '_' . The first character can be a
  304. '.', but global labels cannot start with a digit.
  305.  
  306.  
  307. 3. Executable M68000 instructions
  308.  
  309. They have the general format:
  310.      label      operation   operands
  311.  
  312. PhxAss recognizes all operations found in Motorola's M68000PM/AD Programmer's
  313. Reference Manual and all of the common additions and short forms like BHS
  314. instead of BCC, BLO instead of BCS, MOVE instead of MOVEA, ADD instead of
  315. ADDI, etc. . In the current version all MC68000,68010,68020,68030,68040,
  316. 68851,68881 and 68882 instructions are completely supported.
  317. The operand field consists of one to four (68851) operands seperated by a
  318. comma with no imbedded spaces.
  319.  
  320.  
  321. 4. Expressions
  322.  
  323. Expressions consist of symbols and constants. Symbols can be absolute,
  324. relocatable or external. The arithmetic operations supported by PhxAss are
  325. (from highest to lowest precedence) :
  326.  
  327.  ~    not (unary)     -    negation (unary)
  328.  <<   shift left     >>   shift right
  329.  *    multiplication     /    division               //   modulo
  330.  &    and         |    or ('!' also allowed)    ^    exclusive or
  331.  -    subtraction     +    addition
  332.  ( )  parentheses   or [ ]    brackets
  333.  
  334. For absolute symbols and constants (which are absolute too), all arithmetic
  335. operations are allowed.
  336. If relocatables or externals occur in the expression, only subtraction and
  337. addition is possible with some restrictions:
  338.  
  339.    reloc - abs        extern - abs         reloc - reloc
  340.    reloc + abs        extern + abs         abs + reloc      abs + extern
  341.  
  342. are defined, the others are illegal.
  343.  
  344. There are six types of constants:
  345. Hexadecimal, preceded by a '$', consists of '0'-'9' and 'A'-'F' (or 'a'-'f')
  346. Decimal, consists of '0'-'9'
  347. Float, has the format [+/-][integer][.fraction][E[+/-]exponent]
  348. Octal, preceded by a '@', consists of '0'-'7'
  349. Binary, preceded by a '%', consists of '0' and '1'
  350. String, embedded by ' or ", consists of one to four characters.
  351.  
  352. Note: The 68030/68851 instruction PMOVE uses double long (8 bytes) size for
  353. moving to the registers CRP,SRP and DRP. For this operation-size only
  354. hexadecimal constants are currently supported.
  355.  
  356. The character '\' is an escape-symbol, which can generate the following codes:
  357.    \\     the '\'-character itself
  358.    \'    character #39 (single quote)
  359.    \"    character #34 (quote)
  360.    \0     character #0  (string terminator)
  361.    \n     character #10 (line feed)
  362.    \f     character #12 (formular feed)
  363.    \b     character #8  (backspace)
  364.    \t     character #9  (tabulator)
  365.    \r     character #13 (carriage return)
  366.  
  367.  
  368. 5. Directives
  369.  
  370. The following paragraphs describe all directives that are supported by the
  371. assembler.
  372.  
  373. EQU
  374.      symbol   equ       <expression>
  375.      symbol   =       <expression>
  376.       The expression will be assigned to the symbol.
  377.  
  378. EQU.x
  379.      symbol   equ.x    <float symbol or constant>
  380.      symbol   =.x       <float symbol or constant>
  381.       An equate with the extension .d,.f,.p,.s or .x will assign the value
  382.       of a floating-point expression to the symbol. No arithmetic operations
  383.       are allowed with floating-point. The expression must be a constant or
  384.       another floating-point symbol.
  385.  
  386. EQUR
  387.      symbol   equr       <register>
  388.       This directive assigns a register (D0-D7,A0-A7 or SP) to the symbol.
  389.       Since V3.00 a register symbol must be declared before it is used.
  390.  
  391. REG
  392.      symbol   reg       <register list>
  393.       This directive assigns the value of the register list to the symbol.
  394.       Valid register lists contain several register names (see EQUR)
  395.       separated by the '/' character. The '-' character defines a range of
  396.       registers. The following are valid register lists:
  397.      a1/a3-a5/d0/d2/d4
  398.      a2-a6/d0-d7
  399.  
  400. SET
  401.      symbol   set       <absolute expression>
  402.       This directive assigns the value of the expression to the symbol. No
  403.       relocatables or externals are allowed within the expression. A symbol
  404.       defined by a SET directive may change its value by another SET.
  405.       There are some set-symbols which are defined by PhxAss:
  406.       _PHXASS_      set       1
  407.       _VERSION_   set       version<<16+revision
  408.       According to the connected processor and co-processor PhxAss will set
  409.       _MC68000_, _MC68010_, _MC68020_ and  _MC68881_. The symbols _MC68030_,
  410.       _MC68040, and __MC68882_ will only be created when OS2/3.x is present.
  411.       NARG is zero outside a macro. Within a macro NARG is set to the number
  412.       of specified arguments.
  413.  
  414. TTL
  415.           ttl       <name>
  416.       This directive sets the name of the object file unit which the assembler
  417.       will generate. By default, no name will be set (length 0).
  418.  
  419.  
  420. LIST
  421.       The following source code will be written to the listing file.
  422.  
  423. NOLIST
  424.       The following source code will not be written to the listing file.
  425.  
  426. OPT
  427.           opt       <optimize flags>
  428.       Changes optimization. For a listing of all optimize flags, see "Assembler
  429.       Options".
  430.  
  431. MACRO, ENDM
  432.      symbol   macro
  433.           ...text...
  434.           endm
  435.           macro    symbol
  436.           ...text...
  437.           endm
  438.       This directive assigns a macro to the symbol. The symbol may appear on
  439.       the left or the right side of the directive. The text between the MACRO
  440.       and ENDM directives will be inserted into the source code when the
  441.       assembler discovers the symbol. When calling the macro, up to nine
  442.       arguments, separated by a comma, can be specified in the operand field.
  443.       They are referenced in the macro text as '\1' through '\9'. '\0' is
  444.       reserved for the extension of the macro symbol. Example:
  445.      bhs      macro
  446.           bcc.\0   \1
  447.           endm
  448.       This macro can be called by:    bhs.s     label
  449.       ".s" will be assigned to \0 and "label" will be assigned to \1.
  450.       A "\@" within the macro is replaced by text of the form "nnn", where
  451.       nnn is a unique three-digit number for each macro call. Labels within a
  452.       macro should consist of "\@", because defining labels twice is illegal.
  453.  
  454. MEXIT
  455.       Upon encountering this directive within a macro, the assembler scans for
  456.       the ENDM directive and leaves the macro.
  457.  
  458. END
  459.       In pass one the assembler ignores the rest of the source code and starts
  460.       pass two. In pass two the assembler closes all files and terminates.
  461.       By default the assembler terminates at end of file.
  462.  
  463. FAIL
  464.       The assembler displays the error "69 Assembly aborted !" and terminates.
  465.  
  466. ECHO
  467.           echo       <string>
  468.       The assembler echoes the string. If <string> isn't specified, only a
  469.       newline is echoed.
  470.  
  471. MACHINE
  472.           machine  <processor-number>
  473.       This directive sets the processor-type for which the code will be
  474.       generated. Valid processor-numbers are:
  475.       68000, 68010, 68020, 68030, 68040
  476.  
  477. FPU
  478.           fpu [<cpID>]
  479.       This directive enables code generation for a MC68881/68882 coprocessor.
  480.       By default the <cpID> is set to one, which should be the correct ID for
  481.       most systems using a floating point coprocessor.
  482.       Never set <cpID> to zero, because this is the constant ID for a PMMU.
  483.       If you have set the processor-type to 68040 you should not use this
  484.       directive.
  485.  
  486. PMMU
  487.       This directive enables code generation for a MC68851 Paged Memory
  488.       Management Unit. PMMU only makes sense if you have set the processor-
  489.       type to '68020'.
  490.  
  491. SECTION
  492.           section  <name>[,<type>[,<memflag>]]
  493.       The following code will be placed in the section named <name>. There
  494.       are three section types: CODE, DATA and BSS. CODE contains the executable
  495.       M68000 instructions, DATA contains initialized data and BSS contains un-
  496.       initialized data (set to zero before the program is started). By default
  497.       <type> is set to CODE. The section will be loaded to the memory indicated
  498.       by the <memflag> argument. This can be FAST or CHIP. By default the
  499.       section will be loaded to the memory with the highest priority.
  500.       Creating a section lets the assembler change into relocatable mode. In
  501.       this mode the following directives are illegal:
  502.       org, load, file, trackdisk
  503.  
  504. CODE, CSEG
  505.       These directives correspond to:  section    "CODE",code
  506.  
  507. DATA, DSEG
  508.       These directives correspond to:  section    "DATA",data
  509.  
  510. CODE_C, CODE_F, DATA_C, DATA_F, BSS_C, BSS_F
  511.       See CODE, DATA or BSS. In addition a memflag will be set, which causes
  512.       the section to be loaded to FAST (xxx_F) or to CHIP (xxx_C).
  513.  
  514. BSS (1)
  515.       This directive corresponds to:   section    "BSS",bss
  516.  
  517. BSS (2)
  518.           bss       symbol,<size>
  519.       BSS with arguments does not start a section. It defines a symbol to be
  520.       in the BSS-section, reserves <size> bytes in this section and assigns
  521.       the address of the first byte to the symbol.
  522.  
  523. GLOBAL
  524.           global   symbol,<size>
  525.       This directive does the same as BSS symbol,<size>. In addition GLOBAL
  526.       will declare the symbol as XDEF (ext_def).
  527.  
  528. INCDIR
  529.           incdir   <path1>[,<path2>,...]
  530.       This directive does the same like the -i option (see Assembler Options).
  531.  
  532. INCLUDE
  533.           include  <filename>
  534.       This directive causes PhxAss to suspend the assembly of the current
  535.       file and to assemble the file named <filename>. When done, the assembler
  536.       continues assembling the original file.
  537.       If PhxAss can't find the include file, it first searches within the
  538.       include directory defined by the environment variable PHXASSINC. Then
  539.       it searches within the include directories defined by INCDIR and the
  540.       -i assembler option (see "Assembler Options").
  541.  
  542. INCBIN
  543.           incbin   <filename>
  544.       This directive causes the assembler to include a binary file into the
  545.       current section (f.ex. graphics, samples or trigonometrical tables).
  546.       The assembler searches in the same include directories like INCLUDE.
  547.  
  548. XREF
  549.           xref       symbol1[,symbol2,...]
  550.       This directive tells the assembler that the specified symbols are
  551.       externally defined and will be inserted by the linker.
  552.  
  553. NREF
  554.           nref       symbol1[,symbol2,...]
  555.       This directive does the same like XREF, but the assembler is forced to
  556.       use these symbols as small-data relocatables.
  557.  
  558. XDEF
  559.           xdef       symbol1[,symbol2,...]
  560.       This directive causes the assembler to add the names and values of the
  561.       specified symbols to the external-block of the object file. The linker
  562.       can read the values of these symbols and insert them into other object
  563.       files.
  564.  
  565. PUBLIC
  566.           public   symbol1[,symbol2,...]
  567.       When the specified symbols are defined in the current code, PUBLIC will
  568.       do the same like XDEF. When the symbols are unknown, PUBLIC will do the
  569.       same like XREF.
  570.  
  571. ORG
  572.           org       address
  573.       Defines the origin of the following code and lets the assembler change
  574.       into absolute mode. Since V1.8 several ORG directives are allowed and
  575.       each one can be seen as a new section. The following directives are
  576.       illegal in absolute mode:
  577.       ttl, code, cseg, data, dseg, bss, section, xref, nref, xdef, public.
  578.  
  579. LOAD
  580.           load       address
  581.       After assembly is done, the executable code will be loaded to this
  582.       address. By default the code will be loaded to the address which was
  583.       specified as origin.
  584.  
  585. FILE
  586.           file       <filename>
  587.       After assembly is done, the executable code will be written to the file
  588.       named <filename>.
  589.  
  590. TRACKDISK
  591.           trackdisk <drive>,<startblock>[,<offset>]
  592.       After assembly is done, the executable code will be written directly to
  593.       floppy disk using the 'trackdisk.device'. <drive> is valid from 0 to 3.
  594.       <startblock> is valid from 0 to 1759. <offset>, which is zero by default,
  595.       specifies the byte-offset within a block and is valid from 0 to 511.
  596.  
  597. NEAR
  598.           near       [An[,<secnum> | SmallData]]
  599.       This directive initializes the parameters used by the small-data model.
  600.       NEAR with arguments may appear only once in the whole source code. After
  601.       initializing the small-data model, it can be switched on and off by NEAR
  602.       and FAR without arguments. The first argument, the address-register, is
  603.       valid from A2 to A6 and will be A4 by default. <secnum>, which defaults
  604.       to zero, specifies the number of the section which will be accessed by
  605.       address register indirect with displacement. If <secnum> is a string
  606.       starting with 'S' or 's', all Data and Bss sections will be accessed in
  607.       small-data mode.
  608.           near       code
  609.       If the argument equals to the string "CODE" the assembler activates the
  610.       small-code model.
  611.  
  612. FAR
  613.       This directive turns off the small-data model when active.
  614.  
  615. INITNEAR
  616.       This directive inserts two M68000 instructions into the code which will
  617.       initialize the small-data model depending on the parameters set by the
  618.       NEAR directive. The assembler will generate this code (10 bytes):
  619.           lea       SmallDataBase,An
  620.           lea       32766(An),An
  621.  
  622. DC
  623.      label      dc.x       <value>[,<value>,...]
  624.      label      dc.b       "string"[,...]
  625.       The DC (Define Constant) directive causes one or more fields of memory
  626.       to be allocated and initialized. Each field has the same size, specified
  627.       by the extension of the directive. Each byte, word or longword <value>
  628.       can be an expression and may contain forward references. For floating-
  629.       point values, only constants are allowed. The following extensions are
  630.       valid:
  631.       .B    (1 byte)    Byte          .W    (2 bytes)   Word
  632.       .L    (4 bytes)    Longword      .F    (4 bytes)   Fast Floating Point
  633.       .S    (4 bytes)    Single Precision  .D    (8 bytes)   Double Precision
  634.       .X    (12 bytes)    Ext. Precision      .P    (12 bytes)  Packed BCD
  635.       If the extension is .B, .W or .L several values can be expressed by a
  636.       string, but when using word- or longword-size the string must be aligned.
  637.  
  638. DCB, BLK
  639.      label      dcb.x    <num>[,<fill>]
  640.      label      blk.x    <num>[,<fill>]
  641.       These directives allocate a block of memory having <num> entries. The
  642.       available entry-sizes are the same like above. The block will be
  643.       initialized with <fill> which is assumed to be zero when missing.
  644.  
  645. DS
  646.      label      ds.x       <num>
  647.       This directive allocates a block of memory having <num> entries and
  648.       initializes each field with zero. See DCB, BLK.
  649.  
  650. CNOP
  651.           cnop       <offset>,<align>
  652.       This directive aligns the address of the following code to <align>. Then
  653.       the <offset> is added. Example:      cnop    2,4   . This example would
  654.       align the next address two bytes behind the next longword boundary.
  655.  
  656. EVEN
  657.       This directive equals to    cnop   0,2  which will make the address word-
  658.       aligned.
  659.  
  660. IFcond, ELSE, ENDIF, ENDC
  661.       These directives support conditional assembly. The general form of the
  662.       IF directive is:
  663.           ifcond      <expression> or symbol
  664.           ...
  665.           [else
  666.           ...]
  667.           endc (or endif)
  668.       PhxAss supports the following conditions:
  669.      IFC "string1","string2" compares two strings. This is useful within
  670.                  macros, when the strings contain macro-
  671.                  arguments '\x' .
  672.      IFD/IFND symbol     Tests if the symbol is defined (undefined).
  673.      IFEQ/IFNE <exp>     Tests if <exp> is zero (not zero).
  674.      IFGT/IFLT <exp>     Tests if <exp> is greater (less) than zero.
  675.      IFGE/IFLE <exp>     Tests if <exp> is greater (less) than or
  676.                  equal to zero.
  677.  
  678.  
  679.  
  680. Linker
  681. ======
  682.  
  683. You can use every linker which supports the normal Amiga-DOS object file
  684. format (e.g. BLink). If you want to use the small-data model you will need a
  685. linker which also understands near-reloc hunks ($000003f8), like PhxLnk or
  686. DLink.
  687.  
  688.  
  689.  
  690. Assembler Errors
  691. ================
  692.  
  693. In the current version of PhxAss the following errors can be generated:
  694.  
  695. 01 Out of memory
  696.  
  697. 02 Only ONE source file can be specified
  698.    Example: phxass file1 file2     -> Error 02
  699.  
  700. 03 Listing file option was declared twice
  701.  
  702. 04 Need source file for this option
  703.    Example: phxass -e srcfile    or   phxass -l srcfile     -> Error 04
  704.         phxass srcfile -e    -> ok
  705.  
  706. 05 Equates file option was declared twice
  707.  
  708. 06 Need file name after -o option
  709.  
  710. 07 Need file name after -h option
  711.  
  712. 08 Need directory name after -i option
  713.  
  714. 09 Illegal model. Use F for far or N[2-6][,SecNum] for near
  715.  
  716. 10 Illegal base register for the near-mode
  717.    Valid base registers are: A2-A6
  718.  
  719. 11 Missing source file name
  720.  
  721. 12 File doesn't exist
  722.  
  723. 13 Missing include file name
  724.  
  725. 14 Read error
  726.  
  727. 15 String buffer overflow
  728.    Source code lines are limited to 79 characters.
  729.  
  730. 16 Too many sections
  731.    Maximum is 255 sections.
  732.  
  733. 17 Symbol can't be declared as external
  734.    XDEF can only be used with absolute or relocatable symbols.
  735.  
  736. 18 Symbol was declared twice
  737.  
  738. 19 Unable to declare XREF-symbol
  739.    A symbol, which is defined in the current source code, can't be an external.
  740.  
  741. 20 Illegal opcode extension
  742.    Legal: .b .w .l .s .f .d .x .p
  743.  
  744. 21 Illegal macro parameter
  745.    Possible parameters are: \0 (opcode extension), \1 - \9 and \@
  746.  
  747. 22 Illegal characters in label
  748.    See Labels chapter in Programmer Information.
  749.  
  750. 23 Unknown directive
  751.    The opcode is neither a 680x0-mnemonic nor an assembler directive or macro.
  752.  
  753. 24 Too many parameters for a macro
  754.    Nine parameters ( \1 to \9 ) are possible.
  755.  
  756. 25 Can't open trackdisk.device
  757.  
  758. 26 Argument buffer overflow
  759.    Arguments are limited to 79 chracters.
  760.  
  761. 27 Bad register list
  762.    Valid register lists: d0-d3    d3-d4/a2  d2/d3/a4-a6  a2/a3/a4  d7  a0/d2
  763.  
  764. 28 Missing label
  765.    This directive requires a label.
  766.  
  767. 29 Illegal seperator for a register list
  768.    Valid seperators are '-' and '/'.
  769.  
  770. 30 SET, MACRO, XDEF, XREF and PUBLIC are illegal for a local symbol
  771.  
  772. 31 Not a register (try d0-d7 or a0-a7 or sp)
  773.  
  774. 32 Too many ')'
  775.  
  776. 33 Unknown addressing mode
  777.    See Motorola's "8-/16-/32-bit Microprocessor User's Manual" for a
  778.    description of all addressing modes.
  779.  
  780. 34 Addressing mode not supported
  781.    Example:   move.b  d0,a1  /    move  usp,d2  /  clr.w    (d3)+    -> Error 34
  782.  
  783. 35 Can't use macro in operand
  784.    Macros must be used as opcodes.
  785.  
  786. 36 Undefined symbol
  787.  
  788. 37 Missing register
  789.    Example:   mulu   d0,   -> Error 37
  790.  
  791. 38 Need data-register
  792.  
  793. 39 Need address-register
  794.  
  795. 40 Word at odd address
  796.    Example:   dc.b "Hallo"
  797.           dc.w 0        -> Error 40
  798.    Insert CNOP 0,2 or EVEN after string-constants.
  799.  
  800. 41 Syntax error in operand
  801.  
  802. 42 Relocatability error
  803.    Example:   move.l  label(pc),d0  , where label is not a reloc. and/or label
  804.    is not defined in the current section  -> Error 42
  805.  
  806. 43 Too large distance
  807.    Example:   move.w  50000(a0),d0   -> Error 43
  808.    Too large distance for a displacement by indirect addressing or branches.
  809.    Short branches have a range of +126/-128 bytes. Long branches have a range
  810.    of +32766/-32768 bytes.
  811.  
  812. 44 Displacement expected
  813.    Example:   label: move.l  label(a2),d1   -> Error 44
  814.  
  815. 45 Valid address expected
  816.    A program-address was expected.
  817.  
  818. 46 Missing argument
  819.  
  820. 47 Need numeric symbol
  821.  
  822. 48 Displacement outside of section
  823.    Example:   bra  label   , where label is not defined in the current section
  824.    -> Error 48
  825.  
  826. 49 Only one distance allowed
  827.    Expression can't contain several distances.
  828.    Example:   move.l  #[label1-label2]+[label3-label4],d0   -> Error 49
  829.  
  830. 50 Missing bracket/parenthesis
  831.  
  832. 51 Expression stack overflow
  833.    A maximum of 128 arguments are allowed in one expression.
  834.  
  835. 52 Unable to negate an address
  836. 53 Can't use distance and reloc in the same expression
  837. 54 Can't shift an address
  838. 55 Can't multiply an address
  839. 56 Overflow during multiplication
  840. 57 Can't divide an address
  841. 58 Division by zero
  842. 59 No logical operation allowed on addresses
  843. 60 Need two addresses to make a distance
  844. 61 Unable to sum addresses
  845.  
  846. 62 Write error
  847.  
  848. 63 Alignment error
  849.    Example:   dc.l "XYZ"   -> Error 63
  850.  
  851. 64 Can't subtract a XREF
  852.    Valid operations with externals:  ext + abs ,  abs + ext   and   ext - abs
  853.  
  854. 65 Impossible in absolute mode
  855.    These directive can't be used in absolute mode:
  856.    ttl, code, cseg, data, dseg, bss, section, xref, nref, xdef, public
  857.  
  858. 66 Unknown error (fatal program failure)
  859.    The assembler or its memory was corrupted by a faulty program running at
  860.    the same time.
  861.  
  862. 67 No externals in absolute mode
  863.    See 65.
  864.  
  865. 68 Out of range
  866.    Example:   addq.l  #9,d1   -> Error 68
  867.  
  868. 69 Assembly aborted
  869.    Generated by the FAIL directive.
  870.  
  871. 70 Missing ENDC/ENDIF
  872.  
  873. 71 Missing macro name
  874.  
  875. 72 Missing ENDM
  876.  
  877. 73 Can't define macro within a macro
  878.  
  879. 74 Unexpected ENDM
  880.  
  881. 75 Unexpected ENDC/ENDIF
  882.  
  883. 76 Impossible in relative mode
  884.    These directive can't be used in relative mode: org, file, load, trackdisk.
  885.  
  886. 77 Parameter buffer overflow
  887.    Parameters are limited to 79 characters.
  888.  
  889. 78 Can't open timer.device
  890.  
  891. 79 Unable to create file
  892.    Maybe the destination disk is write-protected.
  893.  
  894. 80 Need listing file to add references
  895.    -x option was specified without the -l option.
  896.  
  897. 81 No address allowed here
  898.    Example:   ds.l label   -> Error 81
  899.  
  900. 82 Illegal characters in symbol
  901.    See error 22.
  902.  
  903. 83 Source code too large (max. 65535 lines)
  904.  
  905. 84 No floating point without mathieeedoubbas.library
  906.    To use floating point symbols, you must have the mathieeedoubbas.library
  907.    in your LIBS: directory.
  908.  
  909. 85 IEEE Double Precision Overflow/Underflow
  910. 86 IEEE Single Precision Overflow/Underflow
  911. 87 Motorola FFP Overflow/Underflow
  912. 88 Incompatible float types
  913. 89 Packed BCD Overflow/Underflow
  914.  
  915. 90 Can't mix LOAD, FILE and TRACKDISK
  916.    Example:   load $70000
  917.           file "mycode"   -> Error 90
  918.  
  919. 91 Near mode not activated
  920.    The near mode must be activated first, before using the INITNEAR directive.
  921.  
  922. 92 Instruction not implemented in your machine
  923.    The instruction exists for another processor, but not for your one. Use
  924.    MACHINE to change processor type.
  925.  
  926. 93 Illegal scale factor
  927.    Example:    move.w  (a1,d2*3)    -> Error 93
  928.    Valid scale factors are:  1, 2, 4 and 8
  929.  
  930. 94 Missing operand
  931.    Example:    move.l  (a0)+        -> Error 94
  932.  
  933.  
  934.  
  935. History
  936. =======
  937.  
  938. After six years of working with assemblers like SEKA, AS (Aztec-C) and A68k,
  939. I decided in December 1991 that I need a new, powerful assembler. First, I had
  940. the idea to buy O.M.A. or Devpac, but I don't like these modern assemblers with
  941. an integrated editor. Other reasons for starting the development of PhxAss were
  942. the chronic lack of money (I'm student) and the possibility to create an
  943. assembler which will satisfy all of my demands.
  944. I completed the first version V1.00 at the 28th of January in 1992. From now
  945. on I used PhxAss to assemble itself (first I used A68k). It took me more than
  946. a year and 23 versions to reach V3.00 (PhxAss was not my only project in this
  947. period).
  948.  
  949. Here is a list of my hardware and literature that enabled the development of
  950. PhxAss:
  951. Hardware:   My good old A1000 (first version from '85) with 68010 CPU,
  952.         2 MB Fast-RAM and a 33 MB Harddisk.
  953.  
  954. Literature: Motorola MC68000/68008/68010/68HC000 8-/16-/32-Bit Microprocessor
  955.         User's Manual (Prentice Hall)
  956.  
  957.         Motorola MC68020 32-Bit Microprocessor User's Manual (Prentice
  958.         Hall)
  959.  
  960.         Motorola MC68881/882 Floating-Point Coprocessor User's Manual
  961.         (Prentice Hall)
  962.  
  963.         Motorola MC68851 Paged Memory Management Unit User's Manual
  964.         (Prentice Hall)
  965.  
  966.         Motorola M68000,MC68020,MC68020,MC68040,MC68851,MC68881/882
  967.         Programmer's Reference Manual (Prentice Hall)
  968.  
  969.         Amiga ROM Kernel Reference Manual: Libraries & Devices (Addison-
  970.         Wesley)
  971.  
  972.         Amiga ROM Kernel Reference Manual: Includes & Autodocs (Addison-
  973.         Wesley)
  974.  
  975.         Amiga Intern (Data Becker)
  976.  
  977.         Amiga Intern Band 2 (Data Becker)
  978.  
  979.  
  980.  
  981. Bugs
  982. ====
  983.  
  984. Known bugs in version V3.30 :
  985.  
  986. o Floating-point symbols defined by the EQU.x directive do not appear in the
  987.   equates file.
  988. o When the instruction xxxx is removed by optimization, PhxAss generates an
  989.   illegal short branch with zero displacement.
  990.       Bcc.s  label
  991.       xxxx
  992.     label:
  993.   This can only happen when you have set the optimize flag 'M' and xxxx is a
  994.   MOVEM without registers or when you have set the 'S'-flag and xxxx is a
  995.   'ADDA/SUBA #0,An' or 'LEA 0(An),An'.
  996. o If you have enabled 'R(elative)'-optimization and the address symbol '*'
  997.   is used in the following form:
  998.       MOVE  *,*+x
  999.   then the source operand will be optimized to PC-relative and the destination
  1000.   operand would access a wrong address.
  1001. o Because of many misprints in Motorola's Programmer's Reference Manual I was
  1002.   forced to estimate the opcodes of some instructions (FSABS and FDABS).
  1003. o The Forward-Branch optimization (T-flag) doesn't change the line-addresses
  1004.   in the listing file.
  1005. o The following lines from the orignial Commodore include file "exec/types.i"
  1006.   can't be assembled and must be changed:
  1007.   \@BITDEF  SET     1<<\3
  1008.         BITDEF0 \1,\2,F_,\@BITDEF
  1009.   change to:
  1010.   BITDEF\@  SET     1<<\3
  1011.         BITDEF0 \1,\2,F_,BITDEF\@
  1012.  
  1013.  
  1014. USERS OF 32-BIT PROCESSORS AND COPROCESSORS:
  1015. Please try to test all specific instructions of your processor and send me
  1016. your bug-reports. In return you will get the newest version.
  1017.  
  1018.  
  1019. If any errors or questions occur, please write to :
  1020.  
  1021.             Frank Wille
  1022.             Auf dem Dreische 45
  1023.             32049 Herford
  1024.             GERMANY
  1025.  
  1026.            __
  1027.           ///
  1028.          ///
  1029.         ///
  1030.    __       ///
  1031.    \\\      ///
  1032.     \\\  ///
  1033.      \\\///
  1034.       \XX/      A M I G A   F O R E V E R  !
  1035.  
  1036.