flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > bug report: push reg + const

Author
Thread Post new topic Reply to topic
daluca



Joined: 05 Nov 2005
Posts: 86
daluca 23 Aug 2007, 15:47
Code:

mov eax,var1
push eax   ;offset of var1
push eax + 4  ;offset of var2?
...
...
...
var1 dd 0
var2 dd 0

    


push eax + 4 is assembled as push eax, push 4
I think is confusing to allow this combination.
Post 23 Aug 2007, 15:47
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 23 Aug 2007, 16:38
I'm almost sure it was discussed already. It is not a bug but a feature. The problem is that "+4" and "+ 4" are the same and that is OK but sometimes is confusing as you said. Things like "push eax + edx" are not allowed since the unary operator can't be applied to registers.
Post 23 Aug 2007, 16:38
View user's profile Send private message Reply with quote
nocona



Joined: 04 Aug 2007
Posts: 35
nocona 25 Aug 2007, 04:04
fasm's push instruction allows repetition of operand seperated with space(s). So [i]push eax + 4[/b] is actually
Code:
push eax
push +4
    
Post 25 Aug 2007, 04:04
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.