176
Chapter 30. MMIX Dependent Features
An example, which sets the label
prev
to the current location, and updates the current location
to eight bytes forward:
prev LOC @+8
When a LOC has a constant as its operand, a symbol
__.MMIX.start..text
or
__.MMIX.start..data
is defined depending on the address as mentioned above. Each such
symbol is interpreted as special by the linker, locating the section at that address. Note that if
multiple files are linked, the first object file with that section will be mapped to that address (not
necessarily the file with the LOC definition).
LOCAL
Example:
LOCAL external_symbol
LOCAL 42
.local asymbol
This directive operation generates a link time assertion that the operand does not correspond to
a global register. The operand is an expression that at link time resolves to a register symbol or
a number. A number is treated as the register having that number. There is one restriction on the
use of this directive: the pseudo directive must be placed in a section with contents, code or data.
IS
The
IS
directive:
asymbol IS an_expression
sets the symbol
asymbol
to
an_expression
. A symbol may not be set more than once using
this directive. Local labels may be set using this directive, for example:
5H IS @+4
GREG
This directive reserves a global register, gives it an initial value and optionally gives it a symbolic
name. Some examples:
areg GREG
breg GREG data_value
GREG data_buffer
.greg creg, another_data_value
The symbolic register name can be used in place of a (non special) register. If a value isn't pro
vided, it defaults to zero. Unless the option
no merge gregs
is specified, non zero registers
allocated with this directive may be eliminated by
as
; another register with the same value used
in its place. Any of the instructions
CSWAP
,
GO
,
LDA
,
LDBU
,
LDB
,
LDHT
,
LDOU
,
LDO
,
LDSF
,
LDTU
,
LDT
,
LDUNC
,
LDVTS
,
LDWU
,
LDW
,
PREGO
,
PRELD
,
PREST
,
PUSHGO
,
STBU
,
STB
,
STCO
,
STHT
,
STOU
,
STSF
,
STTU
,
STT
,
STUNC
,
SYNCD
,
SYNCID
, can have a value nearby an initial value in place of
its second and third operands. Here, "nearby" is defined as within the range 0. . . 255 from the
initial value of such an allocated register.
buffer1 BYTE 0,0,0,0,0
buffer2 BYTE 0,0,0,0,0
...
GREG buffer1
LDOU $42,buffer2
In the example above, the
Y
field of the
LDOUI
instruction (LDOU with a constant Z) will be
replaced with the global register allocated for
buffer1
, and the
Z
field will have the value 5, the
offset from
buffer1
to
buffer2
. The result is equivalent to this code:
footer
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