Re: Question about jumps
- From: Herbert Kleebauer <klee@xxxxxxxxx>
- Date: Sun, 27 Aug 2006 22:59:58 +0200
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?
#macro uToEnglish( unsVal, NumberCase );
#if( unsVal >= 20 )
#if( unsVal mod 10 <> 0 )
#if( NumberCase )
Tens[unsVal div 10] + "-" + @lowercase( Ones[unsVal mod 10], 0)
If unsVal=-1 or unsVal=0xffffffff is then ( unsVal >= 20 ) true or false?
What is (unsVal mod n) for n<0
If unsVal=-1 or unsVal=0xffffffff what is then [unsVal div 10]
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.
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?
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.
The problem I'm seeing in your posts, though, is *typical* of students
trying to cover too much material at once. While I certainly encourage
you to learn as much as you can from as many sources as possible, it's
pretty clear that you're suffering from the "information overload"
problem (too many new ideas coming at you from too many directions)
that led me to develop the pedagogy (teaching method) I used in AoA/32.
As I see it, the most beginner problems are not problems with
the CPU instructions 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). 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. For learning assembly programming
you neither need macros nor include files nor linking to libraries.
.
- Follow-Ups:
- Re: Question about jumps
- From: randyhyde@xxxxxxxxxxxxx
- 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
- Question about jumps
- Prev by Date: Re: Question about jumps
- Next by Date: explanation of an assembly code
- Previous by thread: Re: Question about jumps
- Next by thread: Re: Question about jumps
- Index(es):
Relevant Pages
|