flat assembler
Message board for the users of flat assembler.
Index
> Windows > Why not INCREMET VALUE |
Author |
|
Everhest 25 Jan 2009, 10:35
Hi. In this function not increment value:
Code: proc Manager.New inc [dm.count] stdcall MemoryInit, [id.array.heap], sizeof.ITEM_DOWNLOAD mov ecx, id.array.point mov [ecx], eax thread_create: xor eax, eax invoke CreateThread, eax, 1024*1024*32, ThreadFun, eax, eax, id.thread mov [id.thread], eax .if eax = 0 invoke GetLastError stdcall ErrorMessage, eax .endif copy_points: cld mov esi, id.array imul edi, [dm.count], 8 add edi, dm.items movsd movsd copy_data: mov eax, [dm.count] mov [id.id], eax stdcall MemoryCopy, [id.array.point], id, sizeof.ITEM_DOWNLOAD ret endp Please help me!!!
_________________ Forgive for my bad english, I from russia... |
|||||||||||
25 Jan 2009, 10:35 |
|
revolution 25 Jan 2009, 10:41
What doesn't increment? Is it dm.count that doesn't increment?
|
|||
25 Jan 2009, 10:41 |
|
Everhest 25 Jan 2009, 11:01
Yes, of course dm.count, if call of my proc ShowDword, dm.count to see not increment!!!
|
|||
25 Jan 2009, 11:01 |
|
Everhest 25 Jan 2009, 12:09
hm... yes... i'm must moved 2 dword in pointers on address items.point
thank you! |
|||
25 Jan 2009, 12:09 |
|
Everhest 25 Jan 2009, 12:30
So it is correct?
Code: cld mov esi, id.array imul ecx, [dm.count], 8 lea edi, [dm.items] add [edi], ecx movsd movsd |
|||
25 Jan 2009, 12:30 |
|
revolution 25 Jan 2009, 12:34
Your current setup mean that you are copying data into a dm structure but the structure is not large enough to hold all of your data so you start to overwrite whatever comes after the dm.item member.
I think you should consider using a different way to store your array. Maybe you can try using a linked list. Just store the head of the list in the dm structure and then allocate each new item dynamically with each one linking to the next. |
|||
25 Jan 2009, 12:34 |
|
Everhest 25 Jan 2009, 12:45
Ok... Thank you!
|
|||
25 Jan 2009, 12:45 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.