Re: A83: djnz


[Prev][Next][Index][Thread]

Re: A83: djnz




djnz stands for decrement and jump if not 0 in other words
first you load how many times you want to loop for into b.  ex. ld b,20
then you put in what you want it to do while it loops.  ex. inc a
then you put djnz (lable goes here) for were you want it to go back to and
loop again.
after the djnz statment is where the rest of the prgram goes.  Make sure to
state b, or else it may crash.

ex.
test:
        ld b,22
loop:
        ld a,(test)
        inc a
        ld (test),a  
        djnz loop


rest of program

                                        Hope this helps
                                            Michael


At 06:04 PM 6/6/98 EDT, you wrote:
>
>what's djnz do?
>
>


Follow-Ups: