home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD2.bin / bbs / dev / struct-1.0.lha / Struct / Phx / PhxAss.doc next >
Encoding:
Text File  |  1993-08-29  |  32.6 KB  |  984 lines

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