cmp eax,1
je @@1
...
@@1:
Funtion,OFFSET var1
jmp endselect
@@2:
Funtion,OFFSET var2
jmp endselect
...
How can I replace # part with the current index
ex. Function,OFFSET var(index)?
Huh?
Is there a way to replace the var1,var2,var3.. with var(#)
(If the #=1 then the variable would be var1)? How would it be written for masm?
It would probably be easier and faster to use a lookup table. Ie:
.data
VariableTable dd offset var1, offset var2, ...
...
dec eax ; Make it 0 based
mov eax,
mov Function,eax
That way, there's no need for all those checks. Don't forget, if you do it this way, any gaps (like if you don't have a value 3 or 4 set), you have to omit them in your lookup table as well.