flat assembler
Message board for the users of flat assembler.

Index > Main > Question about data variables.

Author
Thread Post new topic Reply to topic
Overflowz



Joined: 03 Sep 2010
Posts: 1046
Overflowz
Hello everyone, I have problem here.. I saw here topic which 1 guy posted and I though about it because it's really useful but compiler shows errors. Here's what I mean:
Code:
format PE GUI 4.0
include 'WIN32A.INC'
entry main
section '.data' data readable writeable
fbyte db "Hello",0x20
sbyte db "World!",0
result db fbyte,sbyte
section '.text' code readable executable
proc main
invoke MessageBox,0,result,result,MB_OK
ret
endp
section '.idata' import data readable
library user32,'user32.dll'
include 'API\USER32.INC'    

why result variable can't define those two variables as one ?
Post 22 Apr 2011, 22:02
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
because it has to be a dword pointer...and you have to access the 2nd string pointer by adding 4 (size of dword in this case)
Post 22 Apr 2011, 22:24
View user's profile Send private message Reply with quote
Overflowz



Joined: 03 Sep 2010
Posts: 1046
Overflowz
typedef
Ohh... Didn't though that. My bad sorry ^^
Post 22 Apr 2011, 22:39
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-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.