flat assembler
Message board for the users of flat assembler.

Index > Main > Pentium ALU doesn't like ESP :)

Author
Thread Post new topic Reply to topic
AlexP



Joined: 14 Nov 2007
Posts: 561
Location: Out the window. Yes, that one.
AlexP 28 Mar 2008, 21:22
Maybe most people know this, but I tried using ESP as a memory operand *4 for a table lookup, and I get a FASM error... Apparently you can't use ESP in this manner, thought I'd point out that funny little thing in my day.
Post 28 Mar 2008, 21:22
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20453
Location: In your JS exploiting you and your system
revolution 29 Mar 2008, 02:59
Yes, ESP cannot be used as an index register. It doesn't make sense to use your stack pointer as an index offest anyway so why do you want it?
Post 29 Mar 2008, 02:59
View user's profile Send private message Visit poster's website Reply with quote
Xorpd!



Joined: 21 Dec 2006
Posts: 161
Xorpd! 30 Mar 2008, 23:47
Yes, the SIB byte encodings that would otherwise index ESP, xx100xxx, instead mean 'no index'. You can encode R12 as an index, however because the processor combines the REX byte with the SIB byte to determine the index register. Encoding of R13 as a base is somewhat awkward because of what happens to its little brother RBP. As a consequence of their exceptional encodings, I simply avoid using RSP, RBP, R12, and R13 for addressing.
Post 30 Mar 2008, 23:47
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.