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)?
Posted on 2001-01-05 01:37:00 by Sooze
Huh?
Posted on 2001-01-05 02:42:00 by Ernie
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?
Posted on 2001-01-05 03:03:00 by Sooze
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.
Posted on 2001-01-05 03:24:00 by Racso