Chapter 21. 80386 Dependent Features
131
AT&T:
%gs:foo
; Intel
gs:foo
This selects the contents of the variable
foo
with section register
section
being
%gs
.
Absolute (as opposed to PC relative) call and jump operands must be prefixed with
*
. If no
*
is
specified,
as
always chooses PC relative addressing for jump/call labels.
Any instruction that has a memory operand, but no register operand, must specify its size (byte, word,
long, or quadruple) with an instruction mnemonic suffix (
b
,
w
,
l
or
q
, respectively).
The x86 64 architecture adds an RIP (instruction pointer relative) addressing. This addressing mode
is specified by using
rip
as a base register. Only constant offsets are valid. For example:
AT&T:
1234(%rip)
, Intel:
[rip + 1234]
Points to the address 1234 bytes past the end of the current instruction.
AT&T:
symbol(%rip)
, Intel:
[rip + symbol]
Points to the
symbol
in RIP relative way, this is shorter than the default absolute addressing.
Other addressing modes remain unchanged in x86 64 architecture, except registers used are 64 bit
instead of 32 bit.
21.7. Handling of Jump Instructions
Jump instructions are always optimized to use the smallest possible displacements. This is accom 
plished by using byte (8 bit) displacement jumps whenever the target is sufficiently close. If a byte
displacement is insufficient a long displacement is used. We do not support word (16 bit) displace 
ment jumps in 32 bit mode (i.e. prefixing the jump instruction with the
data16
instruction prefix),
since the 80386 insists upon masking
%eip
to 16 bits after the word displacement is added. (See also
Section 21.12 Specifying CPU Architecture)
Note that the
jcxz
,
jecxz
,
loop
,
loopz
,
loope
,
loopnz
and
loopne
instructions only come in
byte displacements, so that if you use these instructions (
gcc
does not use them) you may get an
error message (and incorrect code). The AT&T 80386 assembler tries to get around this problem by
expanding
jcxz foo
to
jcxz cx_zero
jmp cx_nonzero
cx_zero: jmp foo
cx_nonzero:
21.8. Floating Point
All 80387 floating point types except packed BCD are supported. (BCD support may be added without
much difficulty). These data types are 16 , 32 , and 64  bit integers, and single (32 bit), double (64 
bit), and extended (80 bit) precision floating point. Each supported type has an instruction mnemonic
suffix and a constructor associated with it. Instruction mnemonic suffixes specify the operand's data
type. Constructors build these data types into memory.
Floating point constructors are
.float
or
.single
,
.double
, and
.tfloat
for 32 , 64 , and
80 bit formats. These correspond to instruction mnemonic suffixes
s
,
l
, and
t
.
t
stands for 80 bit
(ten byte) real. The 80387 only supports this format via the
fldt
(load 80 bit real to stack top) and
fstpt
(store 80 bit real and pop stack) instructions.






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