Pelles C forum

Assembly language => Assembly discussions => Topic started by: Vortex on March 18, 2024, 07:54:20 PM

Title: Macros for quick procedure definition
Post by: Vortex 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 :

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.

EDIT : PARMAREA does not impose a limit of 16 parameters.

An example :

PROCX start

LOCAL hModule:QWORD

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

ENDPX
Title: Re: Macros for quick procedure definition
Post by: HellOfMice on December 06, 2024, 06:28:32 PM
Windows 11 antivirus does not allow to download the zip file!
Title: Re: Macros for quick procedure definition
Post by: Vortex on December 07, 2024, 09:26:38 AM
Hello Philippe,

Could you try another browser?

By the way, no need to use any macro to omit the parameter type QWORD. This one works fine :

DlgProc PROC hWnd,uMsg,wParam,lParam PARMAREA=4*QWORD
Title: Re: Macros for quick procedure definition
Post by: HellOfMice on December 07, 2024, 09:32:31 AM
I had the same problem with a zip file that I posted and wanted to get.
In fact I added an exception in the antivirus parameter (MS antimalware)
Do you know where I could find a Boyer-Moore function in asm?


Philippe
Title: Re: Macros for quick procedure definition
Post by: Vortex on December 07, 2024, 09:36:40 AM
Hello Philippe,

Here are some links :

https://forum.pellesc.de/index.php?topic=10121.0

https://forum.pellesc.de/index.php?topic=2311.0
Title: Re: Macros for quick procedure definition
Post by: HellOfMice on December 07, 2024, 09:44:31 AM
There is a long time I wanted to make a software with search capabilities but never did it. Today if I have not this function I can't continue.
Thank you Vortex


Philippe
Title: Re: Macros for quick procedure definition
Post by: Vortex on December 13, 2024, 11:17:17 AM
Hello Philippe,

QuoteI had the same problem with a zip file that I posted and wanted to get.
In fact I added an exception in the antivirus parameter (MS antimalware)

If you are using Windows 10\11 , curl does the job to download a file :

curl -R http://address.ext/file.zip -o file.zip
Title: Re: Macros for quick procedure definition
Post by: HellOfMice on December 13, 2024, 09:19:17 PM
Some time ago  sed Curl buy now I din't think to it.


Thank You :D :D :D :D :D :D :D