M32R Directives - Red Hat ENTERPRISE LINUX 4 - USING AS Using Manual

Gnu assembler
Hide thumbs Also See for ENTERPRISE LINUX 4 - USING AS:
Table of Contents

Advertisement

Chapter 25. M32R Dependent Features
-Wuh
This is a shorter synonym for the -warn-unmatched-high option.
-Wnuh
This is a shorter synonym for the -no-warn-unmatched-high option.

25.2. M32R Directives

The Renease M32R version of
low
expression
The
directive computes the value of its expression and places the lower 16-bits of the result
low
into the immediate-field of the instruction. For example:
or3
r0, r0, #low(0x12345678) ; compute r0 = r0 | 0x5678
add3, r0, r0, #low(fred)
high
expression
The
directive computes the value of its expression and places the upper 16-bits of the result
high
into the immediate-field of the instruction. For example:
seth
r0, #high(0x12345678) ; compute r0 = 0x12340000
seth, r0, #high(fred)
shigh
expression
The
directive is very similar to the
shigh
pression and places the upper 16-bits of the result into the immediate-field of the instruction. The
difference is that
shigh
number, and if so it assumes that a borrow will occur from the upper-16 bits. To compensate for
this the
directive pre-biases the upper 16 bit value by adding one to it. For example:
shigh
For example:
seth
r0, #shigh(0x12345678) ; compute r0 = 0x12340000
seth
r0, #shigh(0x00008000) ; compute r0 = 0x00010000
In the second example the lower 16-bits are 0x8000. If these are treated as a signed value and sign
extended to 32-bits then the value becomes 0xffff8000. If this value is then added to 0x00010000
then the result is 0x00008000.
This behaviour is to allow for the different semantics of the
instruction treats its 16-bit immediate argument as unsigned whereas the
immediate as a signed value. So for example:
seth
r0, #shigh(0x00008000)
add3
r0, r0, #low(0x00008000)
Produces the correct result in r0, whereas:
seth
r0, #shigh(0x00008000)
or3
r0, r0, #low(0x00008000)
Stores 0xffff8000 into r0.
Note - the
directive does not know where in the assembly source code the lower 16-bits
shigh
of the value are going set, so it cannot check to make sure that an
rather than an
add3
are used.
has a few architecture specific directives:
as
; compute r0 = r0 + low 16-bits of address of fred
; compute r0 = upper 16-bits of address of fred
high
also checks to see if the lower 16-bits could be interpreted as a signed
instruction. It is up to the programmer to make sure that correct directives
directive. It also computes the value of its ex-
and
or3
add3
instruction is being used
or3
147
instructions. The
or3
treats its 16-bit
add3

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ENTERPRISE LINUX 4 - USING AS and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Enterprise linux 4

Table of Contents