flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Overclick 01 Nov 2022, 15:38
Very simple
Variant 1: Code: macro MyMacro { .code Inc [myval] .data myval dd 0 .bss myv rd 10 } Variant 2: Code: macro MyMacro { match =.code,cuRRentSection \{Inc [myval] \} match =.data,cuRRentSection \{myval dd 0 \} match =.bss,cuRRentSection \{myv rd 10 \} } Variant 3: Stream to place you want. All variants works for known supermacro in the list ![]() |
|||
![]() |
|
Roman 01 Nov 2022, 18:22
Not work variant2
With SECTION '.data' DATA READABLE WRITEABLE executable Ida pro not show Inc [myval] |
|||
![]() |
|
Overclick 01 Nov 2022, 19:03
Oh you are right. Data label not expanded yet.
Try this trick for example: Code: macro MyMacro { match =.code,cuRRentSection \{ if 0 myval dd ? end if Inc [myval] \} match =.data,cuRRentSection \{myval dd 0 \} match =.bss,cuRRentSection \{myv rd 10 \} } But anyway the first variant can completely cover any needs, just use extended subsections like .dataonce |
|||
![]() |
|
Overclick 01 Nov 2022, 21:23
Something wrong with that "match", need some time/electricity to find why.
The best solution at the moment to use Variant 1 like this: Code: macro MyMacro { ..dataonce myval, myval dd 0 ..bssonce myv, myv rd 10 Inc [myval] } ... then you use the macro in .code section only and it will place that data in correct sections ... .code MyMacro |
|||
![]() |
|
Overclick 02 Nov 2022, 07:25
OMG Variant 2 was working just fine. All you need is to use your macro in each section manually as you asked for:
Code: .bss MyMacro .data MyMacro .code MyMacro Am working on addon for this sort of use. |
|||
![]() |
|
Overclick 02 Nov 2022, 09:23
Ok addon is ready
Code: macro .endcurrent { } macro .current arg { .endcurrent if 0 match =arg,cuRRentSection \{ end if if 1 \} purge .endcurrent macro .endcurrent \{ end if purge .endcurrent macro .endcurrent \\{ \\} \} } How to use: Code: macro MyMacro { .current .data myval dd 13 .current .code Inc [myval] .current .bss myv rd 10 .endcurrent } ... .bss MyMacro .data MyMacro .code MyMacro |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.