flat assembler
Message board for the users of flat assembler.

Index > Main > long operands

Author
Thread Post new topic Reply to topic
b1528932



Joined: 21 May 2010
Posts: 287
b1528932
I couldnt find it in manuals, they dont cover it.

1. when operant is promoted to 64 bits by default?
for example, mov rax,moffset64, mov reg,imm. anything more?

2. in RIP relative addressing address is 32 bits. its sign or zero extended to 64?

3. in absolute addressing zero or sign extended?
Post 02 Aug 2010, 11:24
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17720
Location: In your JS exploiting you and your system
revolution
b1528932 wrote:
I couldnt find it in manuals, they dont cover it.
Hmm?
b1528932 wrote:
1. when operant is promoted to 64 bits by default?
for example, mov rax,moffset64, mov reg,imm. anything more?
Probably not.
b1528932 wrote:
2. in RIP relative addressing address is 32 bits. its sign or zero extended to 64?

3. in absolute addressing zero or sign extended?
Intel® 64 and IA-32 Architectures
Software Developer’s Manual
Volume 1:
Basic Architecture

3.7.5.1 Specifying an Offset in 64-Bit Mode
Post 02 Aug 2010, 11:36
View user's profile Send private message Visit poster's website Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 977
Location: Czechoslovakia
MazeGen
b1528932 wrote:
I couldnt find it in manuals, they dont cover it.

They do.

b1528932 wrote:
1. when operant is promoted to 64 bits by default?
for example, mov rax,moffset64, mov reg,imm. anything more?

In mov rax, moffset, only the moffset is 64-bit by default (because the address size is 64 bits by default). RAX is promoted by REX.W.
As for mov reg, imm (B8-BF), it is 32-bit by default. Use REX.W to get mov reg64, imm64.

The Intel manual writes:
Quote:
In 64-bit mode, two groups of instructions have a default operand size of 64 bits (do not need a REX prefix for this operand size). These are:

* Near branches
* All instructions, except far branches, that implicitly reference the RSP


MOD: please move this topic to Main.
Post 03 Aug 2010, 08:16
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.