flat assembler
Message board for the users of flat assembler.

Index > Main > push byte

Author
Thread Post new topic Reply to topic
VelcroMan



Joined: 14 Feb 2010
Posts: 7
Location: Sweden
VelcroMan 09 Oct 2010, 09:12
How do i push a single byte?
Something like:
Code:
push byte 0    


Is it enough with:
Code:
push 0    


Or do i need to specify the size somehow?


Last edited by VelcroMan on 09 Oct 2010, 09:29; edited 1 time in total
Post 09 Oct 2010, 09:12
View user's profile Send private message MSN Messenger Reply with quote
edemko



Joined: 18 Jul 2009
Posts: 549
edemko 09 Oct 2010, 09:17
Post 09 Oct 2010, 09:17
View user's profile Send private message Reply with quote
VelcroMan



Joined: 14 Feb 2010
Posts: 7
Location: Sweden
VelcroMan 09 Oct 2010, 09:30
edemko wrote:
http://board.flatassembler.net/topic.php?t=11696&start=9


So this would "push" exactly a byte?
Code:
lea esp, [esp-1]
mov byte[esp], byte_value    
Post 09 Oct 2010, 09:30
View user's profile Send private message MSN Messenger Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1154
ManOfSteel 09 Oct 2010, 09:34
Why would you want to do this in a 32-bit based architecture?

Clear the dword register or memory location and move your byte into it (or simply movzx), then push the dword into the stack.
Post 09 Oct 2010, 09:34
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1900
DOS386 14 Oct 2010, 03:23
FAQ: http://board.flatassembler.net/topic.php?t=6597

PS: today I moved 1'000'000'000 threads from Main into other subforums
Post 14 Oct 2010, 03:23
View user's profile Send private message Reply with quote
edemko



Joined: 18 Jul 2009
Posts: 549
edemko 14 Oct 2010, 03:55
DOS386 wrote:

PS: today I moved 1'000'000'000 threads from Main into other subforums

Shocked Wink
Post 14 Oct 2010, 03:55
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.