flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Structure of Structures |
Author |
|
vid 24 Nov 2005, 17:56
i personaly prefer: polygon rd 100*sizeof.POINTS :]
|
|||
24 Nov 2005, 17:56 |
|
decard 24 Nov 2005, 17:58
you meant
polygon rb 100*sizeof.POINTS right? |
|||
24 Nov 2005, 17:58 |
|
vid 24 Nov 2005, 18:23
oh, error, i meant
Code: polygon label dword rb 100*sizeof.POINTS we don't want type-cast always |
|||
24 Nov 2005, 18:23 |
|
Hypnos 24 Nov 2005, 20:44
ok thx...but how do you initialize polygon with the value of 3 points for example? (polygon rb 3*sizeof.POINTS )
I think it's not possible this way...according to the FAQ Quote: The other solution can be used when array doesn't have to be initialized and your data structure has the fixed size - like the ones defined with the struct macro (the struct defines the constant holding the size of structure with the name created by attaching sizeof. before the name of structure). Then you can easily calculate how much space the array needs and just reserve this amount of bytes: |
|||
24 Nov 2005, 20:44 |
|
vid 24 Nov 2005, 22:39
no, RB means reserve bytes, eg. with uninitialized value. They aren't really defined, they are reserved. If they are placed at the end of executable, then they won't even appear in file, they will only stay marked somewhere in header.
|
|||
24 Nov 2005, 22:39 |
|
Hypnos 24 Nov 2005, 22:52
So...how can i do?
How can i initialize all my points? i don't want to write sth like this : struct POLYGON point1 POINTS point2 POINTS ... point100 POINTS ends poly POLYGON <1,1>, <2,1>,......,<5,8> Maybe sth like this (like in the FAQ) : Polygon: rept 100 { local s s POINTS } but then...how do i initialize the points, what's the right syntax? |
|||
24 Nov 2005, 22:52 |
|
Reverend 26 Nov 2005, 23:06
Code: struc POLY count { . POINT rb (count-1)*sizeof.POINT } ; USAGE: polygon_with_10_corners POLY 10 EDIT: And the version with initialized points: Code: struc POLY [value] { common ..poly_flag equ false forward if ..poly_flag eq false . POINT value ..poly_flag equ true else local ..label ..label POINT value end if } ; USAGE: polygon_with_10_corners POLY <1,1>, <2,2>, <3,3>, <4,4>, <5,5>, <6,6>, <7,7>, <8,8>, <9,9>, <10,10> |
|||
26 Nov 2005, 23:06 |
|
Hypnos 27 Nov 2005, 10:46
ohhh thanks a lot!!! It finally works that's great...
Cya |
|||
27 Nov 2005, 10:46 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.