Projects > Poasm

Poasm Version 8.00.0

(1/2) > >>

Vortex:
Poasm Version 8.00.0 can be obtained with the latest Pelles C development toolset.

Pelle's announcement :


--- Quote ---    Added 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.

--- End quote ---

http://www.smorgasbordet.com/pellesc/download.htm

Gunther:
Good news, Erol.  :t

Gunther

Vortex:
Prologue \ epilogue macros turned off :


--- Code: ---.386
.model flat,stdcall
option casemap:none

MessageBoxA PROTO :DWORD,:DWORD,:DWORD,:DWORD
MessageBox  EQU <MessageBoxA>
ExitProcess PROTO :DWORD

testproc    PROTO :DWORD,:DWORD

MB_OK       EQU 0

.data

capt        db 'Hello',0
message     db 'This is a test',0

.code

start:

    invoke  testproc,ADDR message,ADDR capt

    invoke  ExitProcess,0

OPTION 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*4

testproc ENDP

OPTION PROLOGUE:PrologueDef
OPTION EPILOGUE:EpilogueDef

END start
--- End code ---

You need to specify the retn instruction instead of ret to balance manually the stack.

Gunther:
Hi Erol,


--- Quote from: Vortex on April 17, 2014, 03:44:41 AM ---You need to specify the retn instruction instead of ret to balance manually the stack.

--- End quote ---

it's a bit like the Pascal convention. The callee has to clean up the stack.

Gunther

jj2007:
Actually, it's a bit worse: ret doesn't insert any code. So you definitely need to insert retn X yourself.

Navigation

[0] Message Index

[#] Next page

Go to full version