News:

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

INVOKE with 16-bit parameters in 32-bit programs

Started by Broken Sword, September 28, 2005, 02:02:58 PM

Previous topic - Next topic

Ratch

Robert,

Quote
Ya, shure, operand-size prefix can override the default operand size, I've noticed it in my first post ("Prefix 66h is missed for push 0. Why?"). "depends only on" phrase was my little mistake :)

     Of course, that is the purpose for the prefix.  Once is it coded, the CPU will obey it.  PUSH will always sign extend a byte value to a DWORD in 32-bit mode.  Therefore, PUSH 0 (6A 00), will PUSH a DWORD.  If you want to PUSH a WORD, use PUSHW 0 (66 6a 00). This is shown in my example code posted earlier.  Ratch