flat assembler
Message board for the users of flat assembler.

Index > Windows > Few questions of syntax questions

Author
Thread Post new topic Reply to topic
StakFallT



Joined: 19 Jan 2006
Posts: 50
StakFallT 26 Jan 2006, 13:42
1a) How does one fill in values during declartion (more specifically the sizeof parameter) with this
LCDBITMAPINFO BITMAPINFOHEADER

I tried LCDBITMAPINFO BITMAPINFOHEADER <$ - BITMAPINFOHEADER, ...>
but it didn't like that...
1b) Is there a sizeof function besides $ - <object type> and can it be used during the declaration of objects in the different data sections of one's code where generally most of the variables are declared and/or initialized?

2a) What's the fasm equivalent to the MASM statement
imul edx,RandSeed,08088405H ?
2b) Where does imul store the value in the above line, edx or eax?

-- StakFallT
Post 26 Jan 2006, 13:42
View user's profile Send private message Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 26 Jan 2006, 14:18
1a)
Code:
some_structure:
...
end_of_structure
some_structure.size=$-some_structure
;OR
sizeof.some_structure=$-some_structure
    

1b)
NO - only macros that do the same as 1a

2a)
Code:
imul edx,[RandSeed],08088405H
    


2b)
EDX
Post 26 Jan 2006, 14:18
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8359
Location: Kraków, Poland
Tomasz Grysztar 26 Jan 2006, 17:14
As for the 1a, it think it was rather this that he wanted:
Code:
LCDBITMAPINFO BITMAPINFOHEADER sizeof.BITMAPINFOHEADER    

which sets up [LCDBITMAPINFO.biSize] with value sizeof.BITMAPINFOHEADER.
Post 26 Jan 2006, 17:14
View user's profile Send private message Visit poster's website Reply with quote
RedGhost



Joined: 18 May 2005
Posts: 443
Location: BC, Canada
RedGhost 27 Jan 2006, 03:03
Tomasz Grysztar wrote:
As for the 1a, it think it was rather this that he wanted:
Code:
LCDBITMAPINFO BITMAPINFOHEADER sizeof.BITMAPINFOHEADER    

which sets up [LCDBITMAPINFO.biSize] with value sizeof.BITMAPINFOHEADER.


didn't know fasm could dynamically initiate struct members like that on declaration (is there anything this damn assembler cant do yet Surprised)

...
i tend to just write out the structures manually and do what Madis suggested, like i needed a PROCESSENTRY32 structure last night but only two of the parameters

Code:
_PROCESSENTRY32:
    dd _PROCESSENTRY32.size ;initialize .dwSize (required)
    dd ?
    .th32ProcessID dd ?
    rd 6
    .szExeFile rb 260 ;MAX_PATH
    _PROCESSENTRY32.size = $-_PROCESSENTRY32
    


and i would just reference _PROCESSENTRY32.whatever, but that style isnt very dynamic

_________________
redghost.ca
Post 27 Jan 2006, 03:03
View user's profile Send private message AIM Address MSN Messenger 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.