Is it possible to make variable virtual base
for example
virtual at esp+espFix ; like define analog vs equ
ofn OPENFILENAME
end virtual
...
espFix=0
...
espFix=espFix+4
mov [ofn.hInstance],eax
it is not problem to add adder manualy.
Even more that could be achieved via macro
but may be there a way to got variable base to virtual in "out-of-the-box" way?
macro varvirtual definition& {
match =at addr, definition \{
macro @virtual@ name,def,val& \\{
local ..var
..var def val
define name ..var+addr \\}
macro endv \\{
purge label,@virtual@,endv
restruc db,du,dw,dp,dd,dt,dq
restruc rb,rw,rp,rd,rt,rq
end virtual \\}
macro label def \\{ match . type,def> \\\{ @virtual@ .,label,<type \\\} \\}
struc db [val] \\{ \common @virtual@ .,db,val \\}
struc du [val] \\{ \common @virtual@ .,du,val \\}
struc dw [val] \\{ \common @virtual@ .,dw,val \\}
struc dp [val] \\{ \common @virtual@ .,dp,val \\}
struc dd [val] \\{ \common @virtual@ .,dd,val \\}
struc dt [val] \\{ \common @virtual@ .,dt,val \\}
struc dq [val] \\{ \common @virtual@ .,dq,val \\}
struc rb cnt \\{ @virtual@ .,rb cnt, \\}
struc rw cnt \\{ @virtual@ .,rw cnt, \\}
struc rp cnt \\{ @virtual@ .,rp cnt, \\}
struc rd cnt \\{ @virtual@ .,rd cnt, \\}
struc rt cnt \\{ @virtual@ .,rt cnt, \\}
struc rq cnt \\{ @virtual@ .,rq cnt, \\}
virtual at 0 \} }
test:
varvirtual at var
A dd ?
endv
var = 0
db A dup 0 ; produce 0 bytes
var = var+3
db A dup 0 ; produce 3 bytes