flat assembler
Message board for the users of flat assembler.

Index > Windows > Array help

Author
Thread Post new topic Reply to topic
strind



Joined: 20 Apr 2010
Posts: 4
strind
I'd like to port some of my C++ to assembly.

How would I go about setting up and accessing an array?

I'm looking to convert something like
Code:
    
string username[3] = {"Mat","Com","Dod"};
int usernumber[3] = {1009, 516, 71};
    


Any array tutorial or help would be appreciated!
Post 21 Apr 2010, 00:07
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17247
Location: In your JS exploiting you and your system
revolution
Code:
usernames:
 db 'Mat',0
 db 'Com',0
 db 'Dod',0

usernumbers:
 dd 1009
 dd 516
 dd 71

mov ecx,1 ;array index
lea eax,[ecx*4+usernames] ;pointer to 'Com'
mov edx,[ecx*4+usernumbers] ;516    
Post 21 Apr 2010, 00:32
View user's profile Send private message Visit poster's website Reply with quote
strind



Joined: 20 Apr 2010
Posts: 4
strind
Thanks! I also found info at the following sites:
*http://pages.cs.wisc.edu/~cs354-1/onyourown/arrays.html
*http://cs.colgate.edu/faculty/nevison/cs201web/lectureNotes/arraysandpointers.ppt
*http://highered.mcgraw-hill.com/sites/dl/free/0072467509/104652/PattPatelCh16.ppt

Are they anymore example packages for fasm other than the one included? MASM has well over 90 examples while fasm barely has 10.
Post 21 Apr 2010, 22:47
View user's profile Send private message Reply with quote
strind



Joined: 20 Apr 2010
Posts: 4
strind
Also, could someone point me to an example or put up some code as to how to use SetDlgItemText in assembly...I see some examples for GetDlgItemText.
Post 21 Apr 2010, 23:05
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
strind,

Google invoke SetDlgItemText search shows Iczelion's tutorial (not directly about SetDlgItemText, but uses a lot of them) link as a first result. Isn't it faster than waiting for answers here?
Post 22 Apr 2010, 05:20
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17247
Location: In your JS exploiting you and your system
revolution
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for life.

Google is your friend.
Post 22 Apr 2010, 06:34
View user's profile Send private message Visit poster's website 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.

Powered by rwasa.