flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > virtual at reg & push?

Author
Thread Post new topic Reply to topic
wht36



Joined: 18 Sep 2005
Posts: 106
wht36 21 May 2011, 13:36
Hi, the code below gives "error: invalid value." rather than assembling pushd ebp (although pushd [var1] is correctly assembled into pushd [ebp]). Why is this so?
Code:
pushd var1

virtual at ebp
var1 dd ?
var2 dd ?
var3 dd ?
end virtual

    

As an aside, "pushd ebp+3" actually assembles without error. I thought I discovered a new use of push until I realise it is actually assembled into "pushd ebp, pushd 3"...
Post 21 May 2011, 13:36
View user's profile Send private message Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc 21 May 2011, 14:41
Code:
virtual at ebp
var1 dd ?
var2 dd ? 
var3 dd ?
end virtual
    

is equivalent to
Code:
label var1 dword at ebp
label var2 dword at ebp+4
label var3 dword at ebp+8
    

So I assume, because register-based labels are the special case. I find such behaviour reasonable, because even if pushd var1 was allowed, then pushd var2 would not work anyway. This seems to be not so consistent as the current behaviour.
Post 21 May 2011, 14:41
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.