as: MMIX-mmixal

1 
1 9.28.4 Differences to 'mmixal'
1 ------------------------------
1 
1 The binutils 'as' and 'ld' combination has a few differences in function
1 compared to 'mmixal' (⇒mmixsite).
1 
11    The replacement of a symbol with a GREG-allocated register (⇒
 GREG-base) is not handled the exactly same way in 'as' as in 'mmixal'.
1 This is apparent in the 'mmixal' example file 'inout.mms', where
1 different registers with different offsets, eventually yielding the same
1 address, are used in the first instruction.  This type of difference
1 should however not affect the function of any program unless it has
1 specific assumptions about the allocated register number.
1 
1    Line numbers (in the 'mmo' object format) are currently not
1 supported.
1 
1    Expression operator precedence is not that of mmixal: operator
1 precedence is that of the C programming language.  It's recommended to
1 use parentheses to explicitly specify wanted operator precedence
1 whenever more than one type of operators are used.
1 
1    The serialize unary operator '&', the fractional division operator
1 '//', the logical not operator '!' and the modulus operator '%' are not
1 available.
1 
1    Symbols are not global by default, unless the option
1 '--globalize-symbols' is passed.  Use the '.global' directive to
1 globalize symbols (⇒Global).
1 
1    Operand syntax is a bit stricter with 'as' than 'mmixal'.  For
1 example, you can't say 'addu 1,2,3', instead you must write 'addu
1 $1,$2,3'.
1 
1    You can't LOC to a lower address than those already visited (i.e.,
1 "backwards").
1 
1    A LOC directive must come before any emitted code.
1 
1    Predefined symbols are visible as file-local symbols after use.  (In
1 the ELF file, that is--the linked mmo file has no notion of a file-local
1 symbol.)
1 
1    Some mapping of constant expressions to sections in LOC expressions
1 is attempted, but that functionality is easily confused and should be
1 avoided unless compatibility with 'mmixal' is required.  A LOC
1 expression to '0x2000000000000000' or higher, maps to the '.data'
11 section and lower addresses map to the '.text' section (⇒
 MMIX-loc).
1 
1    The code and data areas are each contiguous.  Sparse programs with
1 far-away LOC directives will take up the same amount of space as a
1 contiguous program with zeros filled in the gaps between the LOC
1 directives.  If you need sparse programs, you might try and get the
1 wanted effect with a linker script and splitting up the code parts into
1 sections (⇒Section).  Assembly code for this, to be compatible
1 with 'mmixal', would look something like:
1       .if 0
1       LOC away_expression
1       .else
1       .section away,"ax"
1       .fi
1    'as' will not execute the LOC directive and 'mmixal' ignores the
1 lines with '.'.  This construct can be used generally to help
1 compatibility.
1 
1    Symbols can't be defined twice-not even to the same value.
1 
1    Instruction mnemonics are recognized case-insensitive, though the
1 'IS' and 'GREG' pseudo-operations must be specified in upper-case
1 characters.
1 
1    There's no unicode support.
1 
1    The following is a list of programs in 'mmix.tar.gz', available at
1 <http://www-cs-faculty.stanford.edu/~knuth/mmix-news.html>, last checked
1 with the version dated 2001-08-25 (md5sum
1 c393470cfc86fac040487d22d2bf0172) that assemble with 'mmixal' but do not
1 assemble with 'as':
1 
1 'silly.mms'
1      LOC to a previous address.
1 'sim.mms'
1      Redefines symbol 'Done'.
1 'test.mms'
1      Uses the serial operator '&'.
1