Re: Question about jumps
- From: "randyhyde@xxxxxxxxxxxxx" <randyhyde@xxxxxxxxxxxxx>
- Date: 27 Aug 2006 15:45:22 -0700
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
.
- Follow-Ups:
- Re: Question about jumps
- From: Betov
- Re: Question about jumps
- From: Frank Kotler
- Re: Question about jumps
- References:
- Question about jumps
- From: Markus Pitha
- Re: Question about jumps
- From: rhyde
- Re: Question about jumps
- From: Markus Pitha
- Re: Question about jumps
- From: rhyde
- Re: Question about jumps
- From: Herbert Kleebauer
- Question about jumps
- Prev by Date: Re: explanation of an assembly code
- Next by Date: Re: Question about jumps
- Previous by thread: Re: Question about jumps
- Next by thread: Re: Question about jumps
- Index(es):
Relevant Pages
|