flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > push 16777215 doesnt compile

Author
Thread Post new topic Reply to topic
wisepenguin



Joined: 30 Mar 2005
Posts: 129
wisepenguin
fasm 1.66 dated 14 june

push 16777215
causes "value out of range".

the intel manual states "Push sign-extended imm32."
im still quite rubbish at asm but doesnt this mean i
can have any positive (or negative) number up to 2 ^ 31 ? as bit 32
is sign bit.

i tested this in MASM and it compiles successfully.
Post 26 Jun 2006, 17:22
View user's profile Send private message Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2140
Location: Estonia
Madis731
I think that you are in 16-bit mode and you are trying to push a 32-bit value. Are you sure there isn't an error in your code?
Code:
use32
push 16777215
use16
    

should work fine for you though
Code:
push dword 16777215
    

would be more elegant
Post 26 Jun 2006, 17:29
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
wisepenguin



Joined: 30 Mar 2005
Posts: 129
wisepenguin
it was the use32, thankyou. it slipped my mind to check that.

it was because the whole source file was simply that instruction
and nothing more. im just seeing what the byte values of
an assembled instruction are.
Post 26 Jun 2006, 17:34
View user's profile Send private message Reply with quote
okasvi



Joined: 18 Aug 2005
Posts: 382
Location: Finland
okasvi
Code:
pushd 16777215    


^ could be used too I think.
Post 26 Jun 2006, 21:08
View user's profile Send private message MSN Messenger 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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.