174
Chapter 30. MMIX Dependent Features
30.2. Instruction expansion
When
as
encounters an instruction with an operand that is either not known or does not fit the operand
size of the instruction,
as
(and
ld
) will expand the instruction into a sequence of instructions seman 
tically equivalent to the operand fitting the instruction. Expansion will take place for the following
instructions:
GETA
Expands to a sequence of four instructions:
SETL
,
INCML
,
INCMH
and
INCH
. The operand must
be a multiple of four.
Conditional branches
A branch instruction is turned into a branch with the complemented condition and prediction bit
over five instructions; four instructions setting
$255
to the operand value, which like with
GETA
must be a multiple of four, and a final
GO $255,$255,0
.
PUSHJ
Similar to expansion for conditional branches; four instructions set
$255
to the operand value,
followed by a
PUSHGO $255,$255,0
.
JMP
Similar to conditional branches and
PUSHJ
. The final instruction is
GO $255,$255,0
.
The linker
ld
is expected to shrink these expansions for code assembled with
 relax
(though not
currently implemented).
30.3. Syntax
The assembly syntax is supposed to be upward compatible with that described in Sections 1.3 and 1.4
of
The Art of Computer Programming, Volume 1
. Draft versions of those chapters as well
as other MMIX information is located at http://www cs faculty.stanford.edu/~knuth/mmix news.html.
Most code examples from the mmixal package located there should work unmodified when assembled
and linked as single files, with a few noteworthy exceptions (Section 30.4 Differences to
mmixal
).
Before an instruction is emitted, the current location is aligned to the next four byte boundary. If a
label is defined at the beginning of the line, its value will be the aligned value.
In addition to the traditional hex prefix
0x
, a hexadecimal number can also be specified by the prefix
character
#
.
After all operands to an MMIX instruction or directive have been specified, the rest of the line is
ignored, treated as a comment.
30.3.1. Special Characters
The characters
*
and
#
are line comment characters; each start a comment at the beginning of a line,
but only at the beginning of a line. A
#
prefixes a hexadecimal number if found elsewhere on a line.
Two other characters,
%
and
!
, each start a comment anywhere on the line. Thus you can't use the
modulus
and
not
operators in expressions normally associated with these two characters.
A
;
is a line separator, treated as a new line, so separate instructions can be specified on a single line.






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

canadian web hosting

 

Our partners: PHP: Hypertext Preprocessor Best Web Hosting Java Web Hosting Inexpensive Web Hosting  Jsp Web Hosting

Cheapest Web Hosting Jsp Hosting Cheap Hosting

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved