flat assembler
Message board for the users of flat assembler.

Index > Windows > getting invalid operand

Author
Thread Post new topic Reply to topic
mzneo



Joined: 20 Aug 2008
Posts: 8
mzneo 31 Aug 2008, 19:24
Code:
dwSourceFile dd ?
dwLogFile dd ?


section '.code' code executable readable writeable
start:
      invoke _getmainargs,argc,argv,env,0
      add esp,32
      cmp [argc],3
      jne error
      mov esi,[argv]
      mov dwSourceFile,dword [esi+4]
      mov dwLogFile,dword[esi+8] 
    


i am getting invalid operand @
Code:
mov dwSourceFile,dword [esi+4]
    


i tired changing that but still i am getting the error message
Post 31 Aug 2008, 19:24
View user's profile Send private message Reply with quote
Alphonso



Joined: 16 Jan 2007
Posts: 295
Alphonso 31 Aug 2008, 20:36
1. You need brackets [dwSourceFile]

2. You cannot move memory to memory, use a register, something like
Code:
mov eax,[esi+4]
mov [dwSourceFile],eax
;or
push [esi+4]
pop [dwSourceFile]    

3. Move your dwSourceFile dd ? , preferably into a data section
Post 31 Aug 2008, 20:36
View user's profile Send private message Reply with quote
mzneo



Joined: 20 Aug 2008
Posts: 8
mzneo 01 Sep 2008, 06:12
I made the change and its working fine , thanks Alphonso

dwSource was in data section , just pasted part of code Smile
Post 01 Sep 2008, 06:12
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.