Re: Question about jumps



rhyde wrote:
Do you plan on stopping before getting very far?

No, not at all.

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. Therefore, you can
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.

I know exactly what you mean but otherwise I think it's good to
understand how the flags work with the jump commands together,
e.g. important for branching.

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's right, but I think the best way (for me) to learn a programming
language is "learning by doing" and reading the complementary information
additionally or new information first and making the tryings afterwards.

that led me to develop the pedagogy (teaching method) I used in AoA/32.
If you didn't realize this, I taught assembly language using MASM (see
AoA/16) for *many* years before I even dreamed up the concept of HLA and
the pedagogy I use in AoA/32. I constantly saw in my students the same
thing I'm seeing with you -- the need to understand too many concepts
all at once in order to get through a particular unit early on in the
course.

Maybe in my case it's not that heavy. You are surely right that one needs
to know many concepts at once, and I'm sure you know what you're
talking about due to your teaching experience, but I have already some
electronic knowledge due to my first education, I know C and Perl and now
while my second education in an other technical school, I visit almost
every day in the evening, I have to learn Java and C#, so it shouldn't be
a real problem for me to learn everything together instead of step by
step. And that's what worked for me pretty well every time. In doing so I
make notes of important things on paper to have this important information
every time at hand as long as I don't know it by heart.

But by the time you finish the book, you'll know *far* more assembly
language than if you'd taken another approach.

But if I learn almost everything in HLA style, I don't think I will be
able to decipher something like that that easily (Ok I didn't browse to
your whole book yet, so my opinion is more subjective than objective):

push cx
push dx
shl ax,4
mov cx,ax ;cycle 16 bits [randomness] times
get_true_rnd_loop:
mov al,06h ;latch counter 0 for word read
cli
out 43h,al ;post request to timer control port
jmp $+2 ;IO delay (JMP to next instruction)
in al,40h ;read LSB of timer count
xor dl,al ;XOR-on LSB
jmp $+2 ;IO delay (JMP to next instruction)
in al,40h ;read MSB of timer count
sti
xor dl,al ;XOR-on MSB
rol dx,1 ;scroll rnd # for uniform randomness
dec cx
jnz short get_true_rnd_loop ;DEC CX+JNZ is usually faster than LOOP
mov ax,dx ;return ax: true random number
pop dx
pop cx
ret

(I found that "random number generator" on the net, but it doesn't work
yet due to an out of memory error. Maybe I'll find the error out soon)


Regards,
Markus

.



Relevant Pages

  • Re: The Case Against RosAsm (#2)
    ... Yes, in the manuals (indeed, note: ... "The 80x86 Instruction Set in HLA" chapter of the "HLA reference ... The stdout.put Macro ...
    (alt.lang.asm)
  • Re: wanna do something nerdy and cool?
    ... | areas where efficiency and compactness are a priority. ... | inefficiently and someone responded with a more efficient HLA routine. ... | the WHILE loop. ... | already have the DEC instruction which is capable of setting the Zero ...
    (alt.lang.asm)
  • Re: A sample RosAsm macro (actually a whole set)
    ... inline AT&T syntax I think you're confusing HLA for..."eax" is called ... instruction at all...this is something people who oppose "data typing" ...
    (alt.lang.asm)
  • Re: Low(er) level assembly with Hydes AoA and HLA
    ... >> I learned assembly using Randall Hyde's AoA book and HLA compiler. ... > A few remarks to your code (I don't know HLA syntax, ... > This 3 instruction can be replaced by one: ...
    (alt.lang.asm)
  • Re: The excellent HLA LIB
    ... JMP put_w_win;LF CR ... no extra varables for the two states of a single bit and ... if you're going to make comments about the quality of HLA ... source code, it makes a lot of sense for you to *first learn HLA* and ...
    (alt.lang.asm)