datadef@directives equ db,dw,du,dd,dp,dq,dt
datarsv@directives equ rb,rw,rd,rp,rq,rt
def.rb equ db
def.rw equ dw
def.rd equ dd
def.rp equ dp
def.rq equ dq
def.rt equ dt
;==============================================================
macro set var,value {var equ value }
;==============================================================
macro virtual@overridedefs [datadef] {
struc datadef [val:?] \{ \common
\local ..anonimous
..anonimous datadef val
match any,@virtbase \\{ define . ..anonimous + any \\} \} }
;==============================================================
macro virtual@overridersvs [datadef] {
match ddd,def.#datadef \{
struc datadef count \\{ \\common
\\local ..anonimous
..anonimous ddd count dup (?)
match any,@virtbase \\\{ define . ..anonimous + any \\\} \\} \} }
;==============================================================
macro virtual@restoredefs [datadef] { restruc datadef }
;==============================================================
macro extendvirtual {
macro virtual statement& \{
match ,statement \\{
\\local ..anonimous
label ..anonimous
@virtbase equ ..anonimous \\}
match =at base,statement \\{
@virtbase equ base \\}
match any,datadef@directives \\{ virtual@overridedefs any \\}
match any,datarsv@directives \\{ virtual@overridersvs any \\}
virtual at 0 \}
macro endv \{
virtual@restoredefs datadef@directives,datarsv@directives
restore @virtbase
end virtual \} }
@virtbase equ
; use case: ========================
extendvirtual
virtual at 0+fixer
a dd ?
b db 6
endv; end virtual
use32
fixer = 5
mov eax,[a] ;a is 5, and dword size specifier stored in a
display 'a=',a+'0',13,10,'b=',b+'0',13,10; must show a=5,b=9
fixer = 3
mov al,[b] ;b is 7, and byte size specifier stored in b
display 'a=',a+'0',13,10,'b=',b+'0'; must show a=3,b=7
only 1 minus, such virtual blocks must be ended with endv not end virtual
Sad. - I guess when something is realized via existing macrosyntax there is no chance for feature to became built in in sometime future.
But here is some limitations within such blocks: labels via keyword label are not realized in that realization & labels via ":" are unrealizable at all.