flat assembler
Message board for the users of flat assembler.

Index > Main > push x or pushd x?

Author
Thread Post new topic Reply to topic
thecf



Joined: 23 Dec 2006
Posts: 23
thecf
Whats the difference between using pushd x and just push x?
Post 06 Oct 2007, 21:39
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
"pushd" is not a instruction. It is a macro.
Post 06 Oct 2007, 21:57
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Mr_Silent



Joined: 25 Apr 2006
Posts: 30
Mr_Silent
vid wrote:
"pushd" is not a instruction. It is a macro.

Code:
pushd 5
    

...compiles without any includes or macro definitions Smile
Post 06 Oct 2007, 22:12
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
you are right, sorry. Didn't know about this.

THen, a I understand it, "pushd" is short form for "push dword" - it autamatically assumes operand is 32bit. Let me know if I am wrong.
Post 06 Oct 2007, 22:16
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
http://flatassembler.net/docs.php?article=manual#1.2.6

Quote:
Immediate value as an operand for push instruction without a size operator is by default treated as a word value if assembler is in 16-bit mode and as a double word value if assembler is in 32-bit mode, shorter 8-bit form of this instruction is used if possible, word or dword size operator forces the push instruction to be generated in longer form for specified size. pushw and pushd mnemonics force assembler to generate 16-bit or 32-bit code without forcing it to use the longer form of instruction.
Post 06 Oct 2007, 22:28
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-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.