mov eax,RFileSize
mov LRFileSize,eax
PrintDec eax
mov edi,pMemoryR
lea ebp,KeyTable

mov ecx,0
@SRWloop:

mov eax,ecx
shl eax,1
xor ebx,ebx
mov bh,byte ptr ;raw
mov bl,byte ptr ;col

xor eax,eax
xchg al,bh
mov dx,COL*4
mul dx
shl bx,2
add eax,ebx


mov ebx,dword ptr
inc ebx
mov ,ebx

mov eax,ecx
PrintDec eax
shl eax,1
inc eax
inc ecx
cmp eax,LRFileSize
jbe @SRWloop




PLS help i'm :confused:


K i have noticed that LRFileSize variable is changing during the loop, but why, could it be becoues LRFileSize is LOCAL and i was using ebp or edi registers ? btw i pushed and poped it befor and after the loop
Posted on 2002-12-25 17:22:37 by drakoforma
Well without knowing more one thought is that PrintDec is messing up the value of eax & ecx.
Posted on 2002-12-25 17:44:56 by Eóin

Well without knowing more one thought is that PrintDec is messing up the value of eax & ecx.



No i do not think so becouse the problem is that the value of LOCAL variable is chenging during the loop
PrintDec do not mess with the registers it is debuger macro so it would be funny:tongue:
Posted on 2002-12-25 17:51:00 by drakoforma
The EAX value is not increased properly. It will always step over 1 number,
counter starts at 1, and increases like this ,3,5,7,9. So that would defitnly
cause the loop problem.
[color=sienna]mov eax,ecx

shl eax,1 ;-<Remove
inc eax
inc ecx
cmp eax,5
jbe @SRWloop[/color]

Does this code reside in a procedure? Does it recieve any parameters?
YES? then your code modifies the stack frame. "mov ,ebx".
Since EBP == ESP in the stack frame setup for a procedure.

BTW: Get a good debugger, then you can sort these things out pretty
fast. And you dont have to wait for someone to answer. :alright:
Posted on 2002-12-25 17:53:43 by natas
1. Eax is 3 5 7 so i use jbe not jnz and this is not a problem


;mov ebx,7
;mov eax,0
;mov ecx,0

;@loopapa:
;inc ecx
;mov eax,ecx
;shl eax,1
;inc eax
;PrintDec eax
;cmp eax,ebx
;jbe @loopapa

this works fine

2. i Pushed ebp and edi befor and poped it after the loop so i thought that this is enought.

So pls just answer me directly where the adres of LOCAL variable is stored ?

3. Any good Debugers ?
Posted on 2002-12-25 18:10:20 by drakoforma
1. Eax is 3 5 7 so i use jbe not jnz and this is not a problem
Well you are comparing the value to another value("cmp eax,ebx"). Depends on how accurate/optimized the loop needs to be.


LOCAL variables are stored in the EBP register. A good free debugger is
the OllyDbg: http://home.t-online.de/home/Ollydbg/
Posted on 2002-12-25 18:15:42 by natas
The problem may be that u explicitely use ebp in your proc. This can be done, but then you cant use local variables because ebp is used as a pointer to these vars. The entry to a function with 4 local dword vars defined looks like:

push ebp
mov ebp, esp
sub esp, 4*4 ; makes room for 4 local dwords
...

now inside the proc the vars can be accessed with , ...


So better use esi than ebp in your proc
Posted on 2002-12-25 18:24:10 by japheth
thx ppl wrx xra now:)
Posted on 2002-12-25 18:29:43 by drakoforma