Re: RosAsm injects extra bytes into your data



"Alex McDonald" <alex_mcd@xxxxxxxxxxxxxxx> écrivait
news:1114637202.496310.136620@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:

> As a coding style, this is pretty ropey. There are several assumptions
> the novice programmer that wrote this has made in the above code. A
> sense of humour is required when reading it, that's for sure.

You are an ass-hole in the Randall Hyde manner,
aren't you?

:)

> In no particular order;

In the order you'd like... :)


> . The label MyLastData points to the _start_ of 4 bytes at the end of
> the structure, not the end. MyLastData - MyFirstData is 4 bytes short
> of the length.

Maybe, with a fresh new brain, you could understand that
MyLastData is a Dummy Pointer, in the example, and that
there are several different ways for doing this.

Also, there is no 'Structure', here... :)


> . The while end_while depends on a less-than test. The last four bytes
> will not be cleared.

Same as above.


> . OK, so fix the two problems above (and I'm not sure that you can in
> RosAsm because of a lack of equate support).

RosAsm support 4 Types of Equates, ass-hole.


> Now the structure must be
> a multiple of dwords in length if you use stosd, otherwise you'll
> overrun the structure.

This is why there is a dummy Data, in the example.


> Unless I'm missing something,

Oh! I am afraid you miss everything... :)


> your structure is
> a byte short of dword alignment; there are 7 bytes prior to MyLastData.
> MyLastData is not dword aligned.

There is no Structure.


> . As this isn't properly a structure (it has no enforced coherence;
> it's a collection of structures), moving anything out from between the
> MyFirstData and MyLastData won't get cleared and the programmer will
> not get a warning. Why would anyone do that? Because it's not clear
> this is a single structure.

There is no Structure.


> [... BlaBla... and so on... ]

Therefore my initial answer, That was rally the most
appropriated one:

Yep!

:))

Betov.

http://rosasm.org >




.