News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Short integer

Started by Farabi, May 31, 2010, 01:13:13 AM

Previous topic - Next topic

Farabi

If One of the function parameter need an short integer, does it mean I need to pass the address to the stack or the 32-bit value?
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

clive

Quote from: Farabi on May 31, 2010, 01:13:13 AM
If One of the function parameter need an short integer, does it mean I need to pass the address to the stack or the 32-bit value?

Yes, you would pass it as 32-bit value to maintain stack alignment, same with 8-bit. The high order bits shouldn't matter, depends on the subroutine, I'd clear them if I where you. Use MOVZX EAX,xxx; PUSH EAX

See how INVOKE deals with subroutines with BYTE and WORD parameters defined in PROTO
It could be a random act of randomness. Those happen a lot as well.

Farabi

Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"