Re: RosAsm injects extra bytes into your data



Betov wrote:
> randyhyde@xxxxxxxxxxxxx écrivait news:1114614296.538830.235740
> @f14g2000cwb.googlegroups.com:

>
> > The point of my "idea" is rather than injecting all these padding
bytes
> > to align things, why not rearrange all the declarations to
*minimize*
> > the wasted space while maintaining the alignment the user requests.
>
> Because this would be unusable, for the Programmer.
>
> (The ones who have already written a bit of Assembly
> will probably understand without explanations... :)

Can you explain? I don't see why.

>
>
> > RosAsm simply injects extra alignment bytes between separate
> > declaration sections (even if the programmer does *not* explicitly
> > request them, which is bad).
>
> In RosAsm Syntax, for Datas, "[]" means
>
> * "Let us Declare a Set of Data"
>
> * "Let us Align this set of Data on a 4 boudary.
>
> In case when the Programmer does not want of an
> Alignement between two Blocks of Data, he writes:
>
> [Block1Data: ....]
>
> [<Block2Data: ....]
>
> In case he would want another Alignement, he writes,
> for example:
>
> [<8 Block3Data: ....]
>

Assuming < (and presumably <1 as well) indicates byte algnment, <2
word, <4 dword and <8 qword, do <3 <5 <6 and <7 have meaning?

If they do, then does RosAsm build

[<3 name1: B$ 1 2 3 4 ]
[name2: B$ 1 2 3 ]

as
0 4 8 C...
| 0 0 0 1 | 2 3 4 0 | 1 2 3 . |...

where | indicates a dword boundary and 0 the pad byte? What is the
value for the pad? Are the offsets of name1 and name2 3 and 8
respectively? Do name1 and name2 have associated lengths for use in
macros (name1 length would be 4; name2 would be 3)? Can the user
specify a macro value for the alignment, as in

[<xalign name1: 1 2 3 4 ]

where xalign is a macro variable? Can the current assembler location be
moved backwards over the declare? For instance

[name1: 1 2 3 4 ]
# move origin back 2 bytes (for example, org *-2 in other assemblers)
# the RosAsm syntax for this I don't know
[< name2: 5 6 ]

which builds

| 1 2 5 6 |

Lots of questions I know.

--
Regards
Alex McDonald

.



Relevant Pages

  • Re: Optimizing Static Variable Layout
    ... placement of variables in RosAsm. ... They probably wouldn't expect these two declarations to consume eight ... alignment to be dword-aligned. ... Injecting extra padding ...
    (alt.lang.asm)
  • Re: RosAsm Team is Still Making Excuses
    ... And that's what RosAsm is doing. ... By default, it wastes space. ... variables or the alignment is off. ... larger than dword). ...
    (alt.lang.asm)
  • Re: RosAsm Team is Still Making Excuses
    ... documentation I posted in the thread on alignment. ... override the default (so they can do whatever they want on a K3, ... align objects whose size is < m bytes on an m-byte boundary. ... his claims in the RosAsm manual that this is done for speed ...
    (alt.lang.asm)
  • Re: Alignment
    ... I believe I mentioned that alignment within a cache line is not ... HLA v2.0 is being designed to help with this problem. ... declarations to guarantee the desired alignment, ...
    (alt.lang.asm)