flat assembler
Message board for the users of flat assembler.

Index > Linux > Linux 64-bit. Why is this out-of-range?

Author
Thread Post new topic Reply to topic
system error



Joined: 01 Sep 2013
Posts: 670
system error 28 Oct 2014, 08:51
I tried this simple code
Code:
format ELF64 executable

mov     rdi,[m]
and     rdi,7FFFFFFFFh ;error: value out of range
call    exit

m dq 56    

Am I missing something here?
Post 28 Oct 2014, 08:51
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 28 Oct 2014, 08:58
The x86 instructions can't encode the constant 2^35-1 with the AND.

You can use "mov rax,0x7ffffffff" and "and rdi,rax".

Or did you mean 2^31-1 i.e. 0x7fffffff?
Post 28 Oct 2014, 08:58
View user's profile Send private message Visit poster's website Reply with quote
system error



Joined: 01 Sep 2013
Posts: 670
system error 28 Oct 2014, 09:12
revolution wrote:
The x86 instructions can't encode the constant 2^35-1 with the AND.
You can use "mov rax,0x7ffffffff" and "and rdi,rax".

Ok. That helps.
Plus, probably no such thing as AND R64,IMM64 in 64-bit mode anyway.

p/s: Server is too slow. I don't know, could be my internet quota limit as well.
Post 28 Oct 2014, 09:12
View user's profile Send private message 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.