Re: A83: Routine Help, Clearing Section of Graph Buffer... =P
[Prev][Next][Index][Thread]
Re: A83: Routine Help, Clearing Section of Graph Buffer... =P
>Whats wrong with this short routine...? =P I want to be able to clear
the
>first 8 Bytes of Every line of the Graph Buffer, and avoid affecting
the last
>4 Bytes on every line. This freezes, but does not crash, my calc for
some
>reason. I do not see the problem... :\ I would like some assistence
here
>please, thanks... =P
>
>--Jason K.
>
>Erase_Board:
> ld hl, PLOTSSCREEN
> ld de, 5
> ld bc, 63
>Erase_Loop_1:
> push bc
> ld b, 8
>Erase_Loop_2:
> ld (hl), 0
> inc hl
> DJNZ Erase_Loop_2
> pop bc
> add hl, de
> DJNZ Erase_Loop_1
> ret
Shouldn't it be "ld de,4". 8+5=13... so your routine is writing to an
area past PLOTSSCREEN causing a crash.
Also shouldn't it be "ld b,64" instead of "ld bc,63", I don't know
maybe 63 is right, but you should use an 8 bit register.
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com