flat assembler
Message board for the users of flat assembler.

Index > Main > struggling with some C to FASM

Author
Thread Post new topic Reply to topic
moriman



Joined: 01 Apr 2006
Posts: 55
Location: Northern Ireland
moriman 18 Jun 2006, 16:32
Hi,

Just a quickie Shocked

Code:
int statwidths[] = {100, -1}
SendMessage(hStatus,
          SB_SETPARTS,
          sizeof(statwidths)/sizeof(int),
          (LPARAM)statwidths);
    


The 2nd line I partially converted as

Code:
invoke SendMessage, [hStatus], SB_SETPARTS, ????, [statwidths]
    


How do I convert the above 2 lines to asm?


many thanks

mori
Post 18 Jun 2006, 16:32
View user's profile Send private message Reply with quote
r22



Joined: 27 Dec 2004
Posts: 805
r22 18 Jun 2006, 23:54
int statwidths[] = {100, -1}
SendMessage(hStatus,
SB_SETPARTS,
sizeof(statwidths)/sizeof(int),
(LPARAM)statwidths);

Code:
.data
statwidth dd 100, -1
.code
push statwidths ;;address of the array [statwidths] would give 100
push 2 ;;length of statwidth in ints assuming int is 32bit could be 16
push SB_SETPARTS ;;constant
push dword[hStatus] ;;value of hStatus
call SendMessage
    
Post 18 Jun 2006, 23:54
View user's profile Send private message AIM Address Yahoo Messenger Reply with quote
moriman



Joined: 01 Apr 2006
Posts: 55
Location: Northern Ireland
moriman 19 Jun 2006, 00:40
Quote:

.data
statwidth dd 100, -1


hmmmm.
I thought that would have been...

.data
statwidth dd 100 dup -1

Oh well Embarassed

Thanks r22
Post 19 Jun 2006, 00:40
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.