NO

Author Topic: Macros for quick procedure definition  (Read 3001 times)

Offline Vortex

  • Member
  • *
  • Posts: 865
    • http://www.vortex.masmcode.com
Macros for quick procedure definition
« on: March 18, 2024, 07:54:20 PM »
Hello,

Here are some macros for quick procedure definition. The PROCX macro sets automatically the PARMAREA value :

Code: [Select]
PROCX MACRO functionname:REQ,args:VARARG

fname TEXTEQU functionname

    functionname PROC args PARMAREA=16*QWORD

ENDM

ENDPX MACRO

    fname ENDP

ENDM

The maximum number of parameters which is 16 by default can be modified easily.

An example :

Code: [Select]
PROCX start

LOCAL hModule:QWORD

    invoke  GetModuleHandle,NULL
    mov     hModule,rax
    invoke  DialogBoxParam,hModule,\
            ADDR Resource,NULL,ADDR DlgProc,NULL
    invoke  ExitProcess,rax

ENDPX
Code it... That's all...