Re: Question about jumps




Herbert Kleebauer wrote:
rhyde@xxxxxxxxxx wrote:

I'm assuming you already know how to use an IF statement. That means
when you see an IF statement in HLA, you're going to need very little
explanation as to how to use it in a program.

Are you sure?

[ridiculous example snipped]



Nothing is clear with your HL statements. If you had used CPU instructions
(div/idiv branch-higher-same / branch-greater-equal) everything would
be clear.

Perhaps to you, as you already know the machine instructions. They are
not clear at all to someone who has neither learned those instructions
nor has mastered the assembly language programming paradigm. And this
is your big failing when claiming people can learn assembly by simply
reading the manufacturer's literature -- it does *not* teach the
assembly language programming paradigm. And that's the hard part.
That's why working with HLL-like statements (and your example, as best
I could tell, was using macros and conditional assembly; two subjects
unrelated to the current discussion).

concentrate on the *important* things, like what a MOV instruction does
and how to use ADD, AND, SUB, and so on, without being distracted with
issues like how flags are set by each of these instructions.

Why do you need an IF (or a conditional branch) to explain and use
MOV, ADD, AND, SUB instructions?

Oh, because doing meaningful programs that demonstrate the *use* of
these statements in a reasonable setting (as opposed to simply teaching
the semantics of the instructions themselves, which is trivial),
generally involves conditional statements, loops, and stuff like that.
Once you get beyond "hello world", and well before you can teach the
students about conditional statements, it's nice to be able to write
code using something beyond straight-line sequences of instructions.



Later on,
once you're comfortable with the simplified set of instructions, you
can learn about condition codes (flags). Then you can learn about
conditional jump instructions.

Yes, but until this time you also need no IF or other HL statement.

How long have you been teaching assembly language?
How many students have you taught?
I thought so. Try actually teaching a course that packs all this
information into 10 weeks and then come back and see if you still
believe this.



As I see it, the most beginner problems are not problems with
the CPU instructions

That is correct. Learning the *semantics* of most individual machine
instructions (at least the ones you'll learn in a typical assembly
course) is fairly trivial.

but with the programming tools (to set the
correct path and use the proper options) and the assembler
directives (which has nothing to do CPU instructions).

In *most* cases, the student has already learned the majority of the
tools they'll need (editors, compilers, linkers, and the development
cycle) in a previous course. In the case of the courses I've taught,
the main thing the students learn in this area are a handful of
cmd.exe/shell commands. Running the actual assembler is fairly trivial.
I mean, how long does it take to learn that

hla <pgmname>

compiles the specified program name to an executable?

In my courses, the students covered all this stuff in the first couple
of hours in the first week's laboratory.

And all
these problems could easily be avoided by using an assembler
which is a single program which reads the source file and directly
writes the executable and listing.

You mean, like HLA?
Again, "hla helloword" is all it takes to go from source file to
executable.


For learning assembly programming
you neither need macros nor include files nor linking to libraries.

You don't *need* this stuff to learn assembly, but it *sure* makes
learning assembly a whole lot more efficient. This was patently true
even *before* I developed HLA and the HLA Standard Library. Having
library code so students could print the results of their computation
lets them write code *far* earlier in the course than if you make them
wait until they are capable of writing such code themselves.

Cheers,
Randy Hyde

.



Relevant Pages

  • Re: Helpful Practical Uses of Conditional Assembly
    ... But the argument doesn't apply to HLA because the functions ... an assembler needs to be *extremely* powerful. ... Herbert may think that forcing students to write "Hello World" ... instructions rather than futzing around writing "string print ...
    (alt.lang.asm)
  • Re: Why I stop attacking HLA
    ... To me using instructions like cmp and the basic jcc is pure logic, ... You can always *push* one subject ... You should not explain so many instructions without giving students the ... > past when using MASM or some other x86 assembler. ...
    (alt.lang.asm)
  • Re: HLA History
    ... can run ancient apps is no reason to teach students ... It shows that HLA was designed to be very powerful, ... >> in order to allow me to write intricate macros like the ... You want an assembler that uses a 68K-like ...
    (alt.lang.asm)
  • Re: Ten years later
    ... instructions. ... As you have to explicitly call HLA stdlib routines, ... That has nothing to do with the assembler, ... but macros aren't at all bound to PROC and stack frames. ...
    (alt.lang.asm)
  • Re: Helpful Practical Uses of Conditional Assembly
    ... but that's the point of HLA. ... The HLA students got much farther along in the 10 weeks ... > HLA per year versus how many learn MASM? ... is going to loathe switching to a different assembler and having to ...
    (alt.lang.asm)