flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > [SOLVED] Failing to restore parameters names in custom ENDP |
| Author |
|
|
revolution 03 Mar 2026, 01:38
Two changes needed.
Code: define param@all args ; use "define" to make sure "args" is not substituted with its value & irpv param,param@all ; irpv will iterate through each layer of the equated values Code: format ELF executable segment executable sys_exit equ 0x01 macro proc name, [args] { common local param@base param@base equ 8 forward define param@all args rept 1 base:param@base \{ args equ [ebp+base] \} param@base equ param@base + 4 common label name push ebp mov ebp,esp } macro endp { irpv param,param@all \{ restore param \} leave ret } retval equ "original" proc exit, retval mov eax, sys_exit mov ebx, retval int 0x80 endp entry $ pushd -1 call exit display retval Code: flat assembler version 1.73.31 (16384 kilobytes memory) original 1 passes, 106 bytes. |
|||
|
|
anbyte 03 Mar 2026, 09:20
Thanks, thats perfect. I also added `restore param@all` in the irpv statement, since creating multiple procs with the same parameter names would error, presumably because of the repeated usage of param@all. Now I'm able to use the same trick for a `uses` syntax :]
|
|||
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2026, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.