flat assembler
Message board for the users of flat assembler.

Index > Windows > store global address to local

Author
Thread Post new topic Reply to topic
swight



Joined: 02 Aug 2008
Posts: 4
swight 07 Aug 2008, 04:39
I have an array of ObjectData defined as a global called DotArray and a local called Size defined as a POINT. using ebx as an index. getint returns a random in eax.

For some reason the code below would work if I left the address in the register but as soon as it is moved to the local it no longer works. I think this may have something to do with a segment change from what I can see in OllyDebug(which I am still learning how to use). is there any way I can get around this. I would like to be able to free up the register for use in other places.
Code:
          lea     eax,[DotArray+ObjectData.x]
          mov     [Size.x],eax
          lea     eax,[DotArray+ObjectData.y]
          mov     [Size.y],eax
          stdcall getint,230
          mov     [Size.x+ebx*8],eax

          stdcall getint,230
          mov    [Size.y+ebx*8],eax  


    
Post 07 Aug 2008, 04:39
View user's profile Send private message Reply with quote
asmcoder



Joined: 02 Jun 2008
Posts: 784
asmcoder 07 Aug 2008, 09:32
[content deleted]
Post 07 Aug 2008, 09:32
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.