Hmmm how can I explain C if you have
int a;
int var[100];
a = 2;
var = somevalue;

How would you do that in ASM? In asm you can do this

a dd 0
var dd 0,0,0,0,0,0,0,0,0

but you can't put this

mov ,somevalue

but you can put this

mov ,somevalue

But I need it so that its a variable value. How would I do this?
Posted on 2002-12-07 11:59:01 by CyberGuy
[COLOR=deeppink]; int a;[/COLOR]

a dd ?
[COLOR=deeppink]; int var[100];[/COLOR]
var rd 100
[COLOR=deeppink]; a = 2;[/COLOR]
mov [a], 2
[COLOR=deeppink]; var[a] = somevalue;[/COLOR]
mov eax, [a]
mov [var + eax*4], somevalue
Posted on 2002-12-07 12:24:27 by bitRAKE
Thanks. Why is the *4 necessary though?
Posted on 2002-12-07 12:54:57 by CyberGuy
the computer takes the eax-distance bytewise, but you have dwords (1 dword=4bytes), so you have to multiply with 4
Posted on 2002-12-07 12:57:49 by hartyl