flat assembler
Message board for the users of flat assembler.

Index > Main > Is it possible to get rsp+8 directly?

Author
Thread Post new topic Reply to topic
moveax41h



Joined: 18 Feb 2018
Posts: 59
moveax41h 03 Dec 2019, 06:13
I am trying to perform:
Code:
mov rsi, rsp+8
    


But I get an error about extra characters on the line. If I do mov rsi, [rsp+8] this does not have the desired effect. But if I do:

Code:
mov rsi, rsp
add rsi, 8
    


That gives me the desired effect. Must I do that or is there a way to achieve this in one line?

_________________
-moveax41h
Post 03 Dec 2019, 06:13
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20590
Location: In your JS exploiting you and your system
revolution 03 Dec 2019, 06:14
Yes.
Code:
lea rsi,[rsp+8]    
Post 03 Dec 2019, 06:14
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8376
Location: Kraków, Poland
Tomasz Grysztar 03 Dec 2019, 08:28
As a coincidence, I have just mentioned this as an incidental remark in the latest part of my elementary tutorial.
Post 03 Dec 2019, 08:28
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.