News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Useful technique? "internal call"

Started by NoCforMe, April 10, 2025, 02:01:21 PM

Previous topic - Next topic

NoCforMe

Quote from: zedd151 on April 11, 2025, 05:03:08 AMI don't write funny code like that anymore though. Just buggy code.  :joking:
What, no self-modifying code for you? What's the fun in that?
Assembly language programming should be fun. That's why I do it.

jj2007

Quote from: NoCforMe on April 11, 2025, 06:51:48 AMUnless you're doing some kind of INVOKE there ...

You can pass params using good ol' push push call ;-)

Quote from: NoCforMe on April 11, 2025, 06:51:48 AMWhy would you use RET n instead of just plain RET?

RET is a macro, RETN is an instruction.

With ret, you get an epilogue there, which you can suppress with OPTION EPILOGUE:NONE - but its messy *)

No epilogue with retn, but check if you passed parameters on the stack:
retn   ; no paras passed
retn 4 ; one para passed
etc

*) Imagine you are using your own prologue/epilogue macros. So before each "internal ret", you put epilogue:none, ok. But afterwards you need an epilogue:MyFancyEpilogue... otherwise you are in serious trouble.