The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Farabi on May 31, 2010, 01:13:13 AM

Title: Short integer
Post by: 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?
Title: Re: Short integer
Post by: clive on May 31, 2010, 02:09:18 AM
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
Title: Re: Short integer
Post by: Farabi on May 31, 2010, 02:24:24 AM
Okay thanks.