flat assembler
Message board for the users of flat assembler.
Index
> Main > sizeof |
Author |
|
shaolin007 01 Jun 2005, 18:14
is there one in FASM like the C language?
|
|||
01 Jun 2005, 18:14 |
|
Barf 01 Jun 2005, 18:48
try to check in winapi documentation. If you haven`t it mail me: barf@o2.pl, i will send it you. I won`t post it here because it has 10MB.
|
|||
01 Jun 2005, 18:48 |
|
shaolin007 01 Jun 2005, 19:05
Sorry, I meant is there a way to calculate the size of a structure like
Code: sizeof(my_struct) in FASM like in the C language? |
|||
01 Jun 2005, 19:05 |
|
Torrey 01 Jun 2005, 19:14
Sometimes I do this:
Code: struc my_struct { .variable1 dd ? .variable2 dd ? .variable3 dd ? .variable4 dd ? .variable5 dd ? .size = $-.variable1 } |
|||
01 Jun 2005, 19:14 |
|
decard 01 Jun 2005, 19:43
yes
You can also declare structures this way: Code: struct my_struct .variable1 dd ? .variable2 dd ? .variable3 dd ? .variable4 dd ? .variable5 dd ? ends This will automatically define sizeof.my_struct that will contain structure's size. You have to include standard macro library (win32a.inc) of course. |
|||
01 Jun 2005, 19:43 |
|
shaolin007 01 Jun 2005, 20:26
decard wrote: yes Ok so I can lets say Code: mov [wndclass.cbsize], sizeof.wndclass then? |
|||
01 Jun 2005, 20:26 |
|
decard 01 Jun 2005, 21:12
yes
|
|||
01 Jun 2005, 21:12 |
|
shaolin007 01 Jun 2005, 23:28
Hmmm it didn't work and I have the win32a.inc included. Any suggestions?
|
|||
01 Jun 2005, 23:28 |
|
beppe85 02 Jun 2005, 03:10
What fasm returns to you(error description)?
|
|||
02 Jun 2005, 03:10 |
|
revolution 02 Jun 2005, 03:48
The structure names are defined in upper case:
Code: wndclass WNDCLASS mov [wndclass.cbsize], sizeof.WNDCLASS |
|||
02 Jun 2005, 03:48 |
|
veach1 02 Jun 2005, 06:23
And what about "sizeof" not for structures but for variables?
|
|||
02 Jun 2005, 06:23 |
|
shaolin007 02 Jun 2005, 12:13
revolution wrote: The structure names are defined in upper case: Thankyou very much that worked. |
|||
02 Jun 2005, 12:13 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.