I'm essentially trying to do the following:
macro specialprocedure label, flags=0 {
labeldef equ label
section '.rodata' data readable
proc_labeldef: ;The 'labeldef' here needs to be replaced
db 0xA1
db flags
labeldef: ;This works properly - labeldef is replaced with what is passed to the macro.
section '.text' code readable executable
;code follows
}
specialprocedure do_the_thing, 0
xchg eax, eax ;do some super important work!
ret
_main:
mov ax, [proc_do_the_thing]
push ax
call do_the_thing
ret
I can't figure out how to replace only part of the label name with what I pass to the macro as an argument. In GAS, for example, the macro would look like this:
.macro specialprocedure label, flags=0
.rodata
.globl proc_\label
proc_label:
.byte 0xA1
.byte flags
.globl \label
label:
section '.text' code readable executable
;code follows
.endm
Is this possible in FASM? Doing the same as I would in GAS, it ends up placing, for example, 'proc_ do_the_thing:' on the line. Notice the extra space, which causes it not to compile.