Re: RosAsm injects extra bytes into your data



Betov wrote:
> "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?
>
> :)

If that means being critical of your famously off-target posts, then
yes. I'm certainly not in your manner, for you have none.

>
> > 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.

Name one that doesn't include adding data. Your equates aren't up to
the task. Enlighten me, how do you do this?

MyLastData equ *

I seem to remember you claimed to write code for IBM 360s. The BAL
syntax should ring a few bells for you if its true. Plus, there's the
small issue of the bug; the stosd runs over an extra byte.

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

That's what the entire discussion in this thread is about.

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

Actually, I was wrong. It runs over by a byte. And structures are what
the entire discussion in this thread is about.

>
>
> > . 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.

Name one that allows you to declare the end of this structure, sorry,
data area without declaring some "Dummy Pointer" as well. None of them
appears to be up to the task; the documentation doesn't help. Your
equates look suspiciously like symbolic substitution.

>
>
> > 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.

Come on, get with the plan, Betov. Dummy data? Since when did an
assembler that can control every bit and byte in the PE need dummy
data? How is this enlightening for the novice? It's bad code, period.

>
>
> > Unless I'm missing something,
>
> Oh! I am afraid you miss everything... :)

What in particular? Have you posted some better code in some other
thread in another ng?

>
>
> > 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.
>

Eh? Then what are these 11 bytes? A random placement of data? Are you
suggesting that MyLastData isn't 7 bytes beyond ByteData? Just in case
you forgot what you wrote;

[ByteData: B§ ? ? ? ? ? ? ? MyLastData: D§ ?]

RosAsm is a mighty strange assembler if that isn't a 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.
>

That's what the entire discussion in this thread has been about.

>
> > [... BlaBla... and so on... ]
>
> Therefore my initial answer, That was rally the most
> appropriated one:
>
> Yep!
>
> :))
>
> Betov.
>
> http://rosasm.org >

You'd be better served if you "appropriated" better code for your
posts. As you're clearly an assembler novice, I would recommend HLA as
a good starting point.

--
Regards
Alex McDonald

.


Quantcast