why sometimes the lea intr not work?
lea eax,works_
while
mov eax,works_
work very well...
lea eax,works_
while
mov eax,works_
work very well...
lea eax, is the correct syntax.
thx...another question...
How to access structure members using register convieniently...
for ex:
struc test
{
.x dd 0
.y dd 0
}
and in a loop I want to do such things:
lea esi,testarray
@@:
add ,5
loop @B
but fasm don't let me do so,I din't find anyway....l to how to solve it? thx in advance...
How to access structure members using register convieniently...
for ex:
struc test
{
.x dd 0
.y dd 0
}
and in a loop I want to do such things:
lea esi,testarray
@@:
add ,5
loop @B
but fasm don't let me do so,I din't find anyway....l to how to solve it? thx in advance...
Documentation shows how can you do it using the virtual directive.
I was also thinking how to allow you to use esi.x and esi.y labels for that purpose, and I have found a small inconsequency in my preprocessor. Then I fixed it and released still as an 1.40 (because it was really very small fix), you can download it now - you know you have the latest version when the date of release in whatsnew.txt is 28-08-2002. The thing I fixed is allowing the struc name to be recognized as symbolic constant. Because symbolic contants in every other location inside the struc macro were recognized, it was logical to allow this also with the main name.
This fix allows you to do the following trick:
It works because of general rule that symbolic constants are replaced after processing the macroinstructions.
This fix allows you to do the following trick:
struc POINT
{
.x dd ?
.y dd ?
}
macro assume reg,struc
{
virtual at reg
local undefined
reg equ undefined
reg struc
restore reg
end virtual
}
assume esi,POINT
mov eax,[esi.x]
mov ebx,[esi.y]
It works because of general rule that symbolic constants are replaced after processing the macroinstructions.
Privalov:
thx very much,I am totally a newbie to fasm,but I found it rather interesting...
good work.!keep on!
thx very much,I am totally a newbie to fasm,but I found it rather interesting...
good work.!keep on!