as: MMIX-Pseudos
1
1 9.28.3.4 Assembler Directives
1 .............................
1
1 'LOC'
1
1 The 'LOC' directive sets the current location to the value of the
1 operand field, which may include changing sections. If the operand
1 is a constant, the section is set to either '.data' if the value is
1 '0x2000000000000000' or larger, else it is set to '.text'. Within
1 a section, the current location may only be changed to
1 monotonically higher addresses. A LOC expression must be a
1 previously defined symbol or a "pure" constant.
1
1 An example, which sets the label PREV to the current location, and
1 updates the current location to eight bytes forward:
1 prev LOC @+8
1
1 When a LOC has a constant as its operand, a symbol
1 '__.MMIX.start..text' or '__.MMIX.start..data' is defined depending
1 on the address as mentioned above. Each such symbol is interpreted
1 as special by the linker, locating the section at that address.
1 Note that if multiple files are linked, the first object file with
1 that section will be mapped to that address (not necessarily the
1 file with the LOC definition).
1
1 'LOCAL'
1
1 Example:
1 LOCAL external_symbol
1 LOCAL 42
1 .local asymbol
1
1 This directive-operation generates a link-time assertion that the
1 operand does not correspond to a global register. The operand is
1 an expression that at link-time resolves to a register symbol or a
1 number. A number is treated as the register having that number.
1 There is one restriction on the use of this directive: the
1 pseudo-directive must be placed in a section with contents, code or
1 data.
1
1 'IS'
1
1 The 'IS' directive:
1 asymbol IS an_expression
1 sets the symbol 'asymbol' to 'an_expression'. A symbol may not be
1 set more than once using this directive. Local labels may be set
1 using this directive, for example:
1 5H IS @+4
1
1 'GREG'
1
1 This directive reserves a global register, gives it an initial
1 value and optionally gives it a symbolic name. Some examples:
1
1 areg GREG
1 breg GREG data_value
1 GREG data_buffer
1 .greg creg, another_data_value
1
1 The symbolic register name can be used in place of a (non-special)
1 register. If a value isn't provided, it defaults to zero. Unless
1 the option '--no-merge-gregs' is specified, non-zero registers
1 allocated with this directive may be eliminated by 'as'; another
1 register with the same value used in its place. Any of the
1 instructions 'CSWAP', 'GO', 'LDA', 'LDBU', 'LDB', 'LDHT', 'LDOU',
1 'LDO', 'LDSF', 'LDTU', 'LDT', 'LDUNC', 'LDVTS', 'LDWU', 'LDW',
1 'PREGO', 'PRELD', 'PREST', 'PUSHGO', 'STBU', 'STB', 'STCO', 'STHT',
1 'STOU', 'STSF', 'STTU', 'STT', 'STUNC', 'SYNCD', 'SYNCID', can have
1 a value nearby an initial value in place of its second and third
1 operands. Here, "nearby" is defined as within the range 0...255
1 from the initial value of such an allocated register.
1
1 buffer1 BYTE 0,0,0,0,0
1 buffer2 BYTE 0,0,0,0,0
1 ...
1 GREG buffer1
1 LDOU $42,buffer2
1 In the example above, the 'Y' field of the 'LDOUI' instruction
1 (LDOU with a constant Z) will be replaced with the global register
1 allocated for 'buffer1', and the 'Z' field will have the value 5,
1 the offset from 'buffer1' to 'buffer2'. The result is equivalent
1 to this code:
1 buffer1 BYTE 0,0,0,0,0
1 buffer2 BYTE 0,0,0,0,0
1 ...
1 tmpreg GREG buffer1
1 LDOU $42,tmpreg,(buffer2-buffer1)
1
1 Global registers allocated with this directive are allocated in
1 order higher-to-lower within a file. Other than that, the exact
1 order of register allocation and elimination is undefined. For
1 example, the order is undefined when more than one file with such
1 directives are linked together. With the options '-x' and
1 '--linker-allocated-gregs', 'GREG' directives for two-operand cases
1 like the one mentioned above can be omitted. Sufficient global
1 registers will then be allocated by the linker.
1
1 'BYTE'
1
1 The 'BYTE' directive takes a series of operands separated by a
1 comma. If an operand is a string (⇒Strings), each character
1 of that string is emitted as a byte. Other operands must be
1 constant expressions without forward references, in the range
1 0...255. If you need operands having expressions with forward
1 references, use '.byte' (⇒Byte). An operand can be omitted,
1 defaulting to a zero value.
1
1 'WYDE'
1 'TETRA'
1 'OCTA'
1
1 The directives 'WYDE', 'TETRA' and 'OCTA' emit constants of two,
1 four and eight bytes size respectively. Before anything else
1 happens for the directive, the current location is aligned to the
1 respective constant-size boundary. If a label is defined at the
1 beginning of the line, its value will be that after the alignment.
1 A single operand can be omitted, defaulting to a zero value emitted
11 for the directive. Operands can be expressed as strings (⇒
Strings), in which case each character in the string is emitted
1 as a separate constant of the size indicated by the directive.
1
1 'PREFIX'
1
1 The 'PREFIX' directive sets a symbol name prefix to be prepended to
1 all symbols (except local symbols, ⇒MMIX-Symbols), that are
1 not prefixed with ':', until the next 'PREFIX' directive. Such
1 prefixes accumulate. For example,
1 PREFIX a
1 PREFIX b
1 c IS 0
1 defines a symbol 'abc' with the value 0.
1
1 'BSPEC'
1 'ESPEC'
1
1 A pair of 'BSPEC' and 'ESPEC' directives delimit a section of
1 special contents (without specified semantics). Example:
1 BSPEC 42
1 TETRA 1,2,3
1 ESPEC
1 The single operand to 'BSPEC' must be number in the range 0...255.
1 The 'BSPEC' number 80 is used by the GNU binutils implementation.
1