Re: RIP relative adresses
- From: "cr88192" <cr88192@xxxxxxxxxxxxxxxxxx>
- Date: Sat, 28 Apr 2007 17:02:23 +1000
"Wolfgang Kern" <nowhere@xxxxxxxxxxx> wrote in message
news:f0uclv$9k4$5@xxxxxxxxxxxxxxxxxxxxxxxx
"cr88192" wrote:
just figured, maybe a few people can offer comments here:
some assemblers apparently make RIP-relative addressing the default in
long-mode, and others making absolute the default.
for example, in many assemblers:
mov rax, [foo]
...
foo dq 0x0123456789ABCDEF
handles this by making 'foo' by default accessed via a RIP-relative
address.
I'd consider this as a wrong interpretation.
RIP adressing is a special mode,
even the 05/0d defaults to RIP on certain instructions,
So any mov rax,[mem] should result in:
A1 xx xx xx xx xx xx xx xx ;absolute 64 bit
temporarily forgot about that form...
while only mov anyreg,[rip] should produce
8B "05/0D"... ;which then act with RIP-realative addressing
I think your way is the correct one.
ok.
well, there are 2 major ways to do it:
rel is the default;
abs is the default.
did a slight tweak, for now, rel is the default, abs is explicit.
of course, if it really mattered, could just make it a settable flag.
__
wolfgang
.
- References:
- RFC: RIP relative adresses
- From: cr88192
- Re: RIP relative adresses
- From: Wolfgang Kern
- RFC: RIP relative adresses
- Prev by Date: Re: Where, oh where, is Frank
- Next by Date: Re: duplicate ops (Re: updated assembler)
- Previous by thread: Re: RIP relative adresses
- Index(es):
Relevant Pages
|