aboutsummaryrefslogtreecommitdiff
path: root/gas/doc
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>1997-09-09 23:54:40 +0000
committerNick Clifton <nickc@redhat.com>1997-09-09 23:54:40 +0000
commit73a0402821e8a5b0e5efb368e301695ab17c9715 (patch)
tree7905c056ab7bf99773b87e2c71e8cd54ed17c3a0 /gas/doc
parentb303e1053f974a89139da7388c8a0d8461cbb7b2 (diff)
downloadgdb-73a0402821e8a5b0e5efb368e301695ab17c9715.zip
gdb-73a0402821e8a5b0e5efb368e301695ab17c9715.tar.gz
gdb-73a0402821e8a5b0e5efb368e301695ab17c9715.tar.bz2
Correcte dscription of hi() reloc prefix. Added description of hi0() reloc prefix.
Diffstat (limited to 'gas/doc')
-rw-r--r--gas/doc/c-v850.texi28
1 files changed, 25 insertions, 3 deletions
diff --git a/gas/doc/c-v850.texi b/gas/doc/c-v850.texi
index 7c20435..b17fc36 100644
--- a/gas/doc/c-v850.texi
+++ b/gas/doc/c-v850.texi
@@ -249,12 +249,12 @@ such code with code assembled for other processors.
@table @code
-@cindex @code{hi} pseudo-op, V850
-@item hi()
+@cindex @code{hi0} pseudo-op, V850
+@item hi0()
Computes the higher 16 bits of the given expression and stores it into
the immediate operand field of the given instruction. For example:
- @samp{mulhi hi(here - there), r5, r6}
+ @samp{mulhi hi0(here - there), r5, r6}
computes the difference between the address of labels 'here' and
'there', takes the upper 16 bits of this difference, shifts it down 16
@@ -272,6 +272,28 @@ computes the difference between the address of labels 'here' and
'there', takes the lower 16 bits of this difference and adds it to
register 5, putting the result into register 6.
+@cindex @code{hi} pseudo-op, V850
+@item hi()
+Computes the higher 16 bits of the given expression and then adds the
+value of the most significant bit of the lower 16 bits of the expression
+and stores the result into the immediate operand field of the given
+instruction. For example the following code can be used to compute the
+address of the label 'here' and store it into register 6:
+
+ @samp{movhi hi(here), r0, r6}
+ @samp{movea lo(here), r6, r6}
+
+The reason for this special behaviour is that movea performs a sign
+extention on its immediate operand. So for example if the address of
+'here' was 0xFFFFFFFF then without the special behaviour of the hi()
+pseudo-op the movhi instruction would put 0xFFFF0000 into r6, then the
+movea instruction would takes its immediate operand, 0xFFFF, sign extend
+it to 32 bits, 0xFFFFFFFF, and then add it into r6 giving 0xFFFEFFFF
+which is wrong (the fifth nibble is E). With the hi() pseudo op adding
+in the top bit of the lo() pseudo op, the movhi instruction actually
+stores 0 into r6 (0xFFFF + 1 = 0x0000), so that the movea instruction
+stores 0xFFFFFFFF into r6 - the right value.
+
@c start-santize-v850e
@cindex @code{hilo} pseudo-op, V850
@item hilo()