hi again folks :-D
i have this proc using a Tabs array wich is using a scale method

TS struct
lpHwnd dd ?
index dd ?
lptext dd ?
lpnull dd ?
TS ends

ChangeTab proc index:DWORD
mov ebx,offset Tabs
mov eax,sizeof TS
mov ecx,index
push Tabs[ecx*eax].TS.lpHwnd
pop eax
invoke SetFocus,eax
invoke SendMessage,hTab,TCM_SETCURSEL,index,0

ChangeTab endp

but i guess the "ecx*eax" or "index*eax" cant be used for scaling !
is there another method to it just like in the proc ?
thanks! :)
Posted on 2005-01-22 15:47:55 by GR33d
Lol, no, you have to do this:

ChangeTab proc index:DWORD
mov eax,Index
push 0
push eax
shl eax,4
push [Tabs+eax].TS.lpHwnd
call SetFocus
push hTab
call SendMessage
ChangeTab endp
Posted on 2005-01-22 16:13:02 by Sephiroth3
ok ok
i got it
now i have this "array" :


lets i wanna remove the item array[3], wich is "x", and have this result :


all further itens are decresead by 1....

how can i do that ?
Posted on 2005-01-22 16:49:57 by GR33d
You would have to copy the 4th element over the 3rd element, 5th over 4th etc etc using a loop.
Posted on 2005-01-22 18:54:17 by roticv
like this ? :

m2m macro arg1,arg2
push arg2
pop arg1
mov ecx,index
mov eax,ecx
shl eax,4
m2m Tabs[eax-4].TS.lpHwnd,Tabs[eax].TS.lpHwnd
dec Tabs[eax-4].TS.index
m2m Tabs[eax-4].TS.index, Tabs[eax].TS.index
m2m Tabs[eax-4].TS.lptext,Tabs[eax].TS.lptext
m2m Tabs[eax-4].TS.lpnull,Tabs[eax].TS.lpnull
inc ecx
.UNTIL ecx==total

the code above just wont work!
i dont get it :?
Posted on 2005-01-22 20:01:34 by GR33d
The code does not work because you specified wrong struct size. Just read it yourself.
		m2m Tabs[eax-4].TS.lpHwnd,Tabs[eax].TS.lpHwnd

Where do you think Tabs.TS.lpHwnd is going?
It is copied to Tabs.TS.lpnull. That cannot work at all.
Side note: If your struct size gets large or total size of the array tail is large, consider rep movs.
Posted on 2005-01-22 21:13:57 by Starless
As a side note, if you need ecx*eax as an index, you could always use:

imul ecx,ecx,eax

and then use the resulting ecx as the index.

Posted on 2005-01-22 22:30:06 by Raymond
Remember how the complex addressing modes work. Using a LOCAL means starting the address with . There is an opcode for Intel where you can use an offset from the data section so if you have a table you can use,

mov [table+eax*4], edx

Keep in mind that for whatever notation you are going to use that addressing reduces down to the complex addressing modes. Normally a structure member is a memory operand so it should be treated like one.
Posted on 2005-01-23 05:31:42 by hutch--