flat assembler
Message board for the users of flat assembler.

Index > Main > [eax + Constant]

Author
Thread Post new topic Reply to topic
bot



Joined: 06 Dec 2008
Posts: 3
bot 08 Dec 2008, 04:35
Can anyone tell me what exactly goes on when I do:

mov [eax + 4], dword -1

I don't quite understand why FASM allows you to do eax+4, is this code expanded to something else? To elaborate, I am asking at what stage the +4 is applied, because I don't understand how it would do it during assembly-time.
Post 08 Dec 2008, 04:35
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 08 Dec 2008, 07:55
bot,

When in doubt, RTFM. Wink
Intel SDM clearly states that [eax]+disp8 is valid memory reference in 32-bit addressing mode (which in 16-bit code segment requires 0x67 address-size prefix).
Post 08 Dec 2008, 07:55
View user's profile Send private message Reply with quote
lsa



Joined: 10 Aug 2006
Posts: 17
Location: Denmark
lsa 08 Dec 2008, 22:07
Said in another way: The processor execution stage.
The processor loads the value of eax and adds 4 to this, which becomes the address to store the value (-1).
Post 08 Dec 2008, 22:07
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.