Hi, I found interesting problem: You can't use idata inside another idata. In my case i am creating string table with multiple usage of macro (not one with multiple argument).
Problem can be reduced to following.
macro idata arg
{
__IData equ __IData, ;add one ',' to __IData, initial "__IData" before ','s will be used to call macro
macro __IDataBlock ;begin macro (or overload old one) which holds data inside "idata" block
arg
}
;include all "idata"-defined blocks
macro IncludeIData
{
macro __IData dummy,[n] ;create macro which will be invoked, [n] makes sure macro's forward will
\{ ;be preprocessed for each ',' added to __IData
\forward
align 4
__IDataBlock ;use the macro with data
purge __IDataBlock ;and remove it so previous macro becomes avilable
\}
match I, __IData \{ I \} ;and now unroll __IData macro (just "__IData" wouldn't do, replaced equate isn't
;preprocessed anymore and so it wouldn't beheave as macro usage)
purge __IData ;__Idata macro is not needed anymore
}
idata{
dd _name
idata \{
_name db 'jerry lee lewis',0
\}
dd _name2
idata \{
_name2 db 'freddie fingers lee',0
\}
}
IncludeIData
I want to get something like this:
dd _name
dd _name2
_name db "jerry lee lewis"
_name2 db "freddie fingers lee"