Masm32 SDK description, downloads and other helpful links
Started by Vortex, April 10, 2014, 04:38:23 AM
QuoteAdded new option /Fl to produce a list file. See the help file for more information. Added operators SECTIONREL and IMAGEREL. Added instructions for BMI1, BMI2, LZCNT, TZCNT, RTM, and AVX2. Added prefix XACQUIRE and XRELEASE. Added type OWORD and YWORD as (maybe better) aliases for XMMWORD and YMMWORD, respectively. Added support for user-defined prologue and epilogue macros.
.386.model flat,stdcalloption casemap:noneMessageBoxA PROTO :DWORD,:DWORD,:DWORD,:DWORDMessageBox EQU <MessageBoxA>ExitProcess PROTO :DWORDtestproc PROTO :DWORD,:DWORDMB_OK EQU 0.datacapt db 'Hello',0message db 'This is a test',0.codestart: invoke testproc,ADDR message,ADDR capt invoke ExitProcess,0OPTION PROLOGUE:NONE OPTION EPILOGUE:NONE testproc PROC _msg:DWORD,_title:DWORD invoke MessageBox,0,DWORD PTR [esp+12],\ DWORD PTR [esp+12],MB_OK retn 2*4testproc ENDPOPTION PROLOGUE:PrologueDef OPTION EPILOGUE:EpilogueDefEND start
Quote from: Vortex on April 17, 2014, 03:44:41 AMYou need to specify the retn instruction instead of ret to balance manually the stack.
QuoteIt's a "known feature" - use retn or retf instead of ret in this case (no epilogue). I use ret as a kind of pseudo instruction: it triggers the emission of epilogue code plus a ret instruction when needed, so when "no epilogue" is set you get no ret instruction either. I looked at improving this, but it was just too much work (at least for this version).
QuoteTransfers program control to a return address located on the top of the stack. The address is usually placed on the stack by a CALL instruction, and the return is made to the instruction that follows the CALL instruction.The optional source operand specifies the number of stack bytes to be released after the return address is popped; the default is none. This operand can be used to release parameters from the stack that were passed to the called procedure and are no longer needed.
QuoteAdded POASM type SQWORD (and sqword)