Re: Trivia Question




\\\o///annabee wrote:
> På 4 Jan 2006 08:14:02 -0800, skrev randyhyde@xxxxxxxxxxxxx
> <randyhyde@xxxxxxxxxxxxx>:
>
> >
> > \\\o///annabee wrote:
> >
> >> Who need that? Someone dealing with writing a compiler!
> > Or a debugger. Or maybe someone really wants to *change* one of the
> > register values on return (and, therefore, needs to poke a value into
> > the stack frame where the value for that register is sitting).
> >
> > Make all the excuses for your ignorance that you like, but, yes,
> > assembly programmers *should* know about this stuff.
>
> I disagree. This is the kind of stuff that is trivial to enquery once you
> written
> about as much code as I have. You know, the stack may seem strange at
> first, but the
> fact that it grows to lesser adresses, is not really THAT hard to figure
> out.

???
First you say that people don't need to know this. Then you seem to be
confused about what the question actually was as what you've posted has
nothing to do with the original question.

>
> Its just that I never needed to know.

And that lack of knowledge means that you cannot take advantage of this
information when it would be useful. This is what I meant by
"ignorance".



> There a million things I never needed to know, and even more that I will
> never need.

No doubt. But the more you do know, the better the position you'll be
in to recognize when that information is *applicable* to your current
problem, rather than hacking out a different, and less elegant,
solution.


> But this doesn't make it impossible to wrote FULL PEs in assembly, quite
> the oposite.

This has nothing to do with writing PEs. Indeed, the whole concept is
independent of the executable file format in which the PUSHA/PUSHAD
instruction appears. You are simply over your head on this one and
you're making stuff up so that you don't look quite so stupid. Allow me
to give you a hint: when you don't have a clue what you're talking
about, don't post (unless, of course, it's a question). Trying to cover
up your ignorance with additional nonsensical posts just makes you look
worse.


>
> You are actually probably scaring beginners by providing too much info at
> once.

???
Where would this be?
I guess you've completely missed the whole point of HLA? Leveraging
people's *existing* HLL knowledge to learn assembly language
programming? This was the big improvement over the 16-bit edition,
which *did* blast people with "too much information at once."

>
> > After all, the
> > point of assembly language is *not* to write HLL-like code in assembly,
>
> The point of assembly is to program the machine.

Funny, I thought that this was the point of *all* programming languages
(HLLs included).

> Its the native language
> ( -es )
> of the machine.

And what does this have to do with anything?
In particular, what does this have to do with the order by which
registers are pushed on the stack for PUSHA/PUSHAD? You're going off
the deep end here.


> To read more into it than that is not fair.

Sure it is. If people are less productive in assembly than in HLLs,
it's *fair* to compare those languages on this basis. Assembly usually
comes up short. But again, please explain what this has to do with
PUSHA/PUSHAD. Sounds like you're trying to change the subject to avoid
attention being drawn to your ignorance about these assembly language
statements.


>
> > but to take advantage of what the machine has to offer. Now, knowing
> > the exact sequence of the registers on the stack isn't something that
> > every programmer ought to have memorized (it's easy enough to look up
> > when you need it, or you can do something like #include( "x86.hhf" );
> > and get symbolic equates for these offsets), but a decent assembly
> > programmer *should* understand why knowing this information may be
> > useful.
>
> Information are rarely useful until needed.

And that information remains useless if you don't know about it. That's
why its a good idea to know things like how PUSHA/PUSHAD work.

> No matter how many manuals,
> how many infos you memorized, this will only be a small help at writing
> programs.

The true hacker's motto. What can I say? You do realize that you're
preaching that ignorance is better than knowledge, right?

> Its not like your memory is the one that moves and inspires you to do
> programming,

Been taking too many drugs, lately?

>
> It is your imagination. Then the language becomes a tool to make that
> thought a
> running application. After working with the needed instructions some
> times, repleatly,
> they tend to stick around in your memory.

Ah, I see, you're following the "Betov philosophy" of only needed to
use 20 or so instructions in an application. You're *not* thinking in
assembly when you do this. And you're *not* taking advantage of the
machine when you do this. And if you don't study the instruction set
and learn what the majority of the instructions do (and their relative
timings), how do you know when to use, say, LODSB and STOSB versus a
MOV and INC/DEC instruction?


> And when you ever discover something that you cannot formulate, you may
> take a look at the
> instruction set for clues. Then, by and by, you build the needed base to
> do what you want.

Well, from the code of your's that I've seen, what normally happens is
that you hack out a solution with a sequence of instructions rather
than taking the time to learn about the one instruction that does it
all. Don't feel bad, this is human nature (and your mentor Rene is a
classic example of someone who follows this philosophy).

>
> > Hopefully, in a few more years, you'll discover why it just
> > might be important to know the order of the registers pushed on the
> > stack by pusha/pushad.
>
> If the situation where important, it will be important. Sure. But for more
> then 2megas
> of written sourcecode, between all my apps, this was never needed.

What you mean to say is that you've never recognized when this would
have been useful.

> So thats why, it is useless info to throw at a beginner, unless he asks
> for it.

Wrong. Most beginners don't even know the question to ask. The fact
that Chuck's little quiz pointed out your ignorance on this subject
makes that abundantly clear in your case. Beginners need to herded in
the right direction. Then their education is far more efficient than if
they simply "wander around in the desert for 40 years" as you seem to
be doing. You do realize, don't you, that most people become *expert*
level assembly programmers when doing it constant for two years. The
fact that you're still calling yourself a "beginner" after all this
time (and the ignorance displayed in many of your posts confirm your
opinion of yourself) suggests that the educational approach you're
using could stand for some improvement. Then again, if you programmed
in Delphi for ten years and still couldn't figure out how to do a
linked list, I suspect than *any* educational approach isn't going to
work well with you.
Cheers,
Randy Hyde

.



Relevant Pages

  • Intro to Programming w/ Machine Language
    ... and I had the instruction decoder look up how each instruction ... and the "screen" watch a section of memory and display ... The registers (I had 5 general-purpose registers, ... effective way of teaching programming, ...
    (comp.programming)
  • Intro to Programming w/ Machine Language
    ... and I had the instruction decoder look up how each instruction ... and the "screen" watch a section of memory and display ... The registers (I had 5 general-purpose registers, ... effective way of teaching programming, ...
    (alt.lang.asm)
  • Re: Programming: Not stressful? Yeah, right...
    ... >> Whoever said programming is a low stress hobby/career has ... >> obviously never attempted to programm in ASM. ... > instructions and registers. ... I find simpler instruction sets far easier and I ...
    (comp.programming)
  • Re: The coming death of all RISC chips.
    ... supporting full instruction decode from RAM, ... opcode up to the new top of the market. ... the the low 8 registers, as those registers do not have the extra ...
    (comp.arch)
  • Ive seen the future...and it works! (was: my view on this assembler is blah)
    ... > though the registers are few. ... And the 64 bit CPU designers ... what my Borland _C++ compiler_ does when you ask for assembly output...it ... out programming with something like BASIC or Pascal, ...
    (alt.lang.asm)