Re: A85: DJNZ


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

Re: A85: DJNZ



>I believe all you would have to do is for the loop also decrease say d
>every time you draw a new point. just load d with a certain number (say
10
>pixels?) befor eyou start and thendo it like this:
>
>	ld d, 10   ; 10 pixels
>top:
>	inc b
>	call_(drawpixel)  ; draws pixel at b,c
>	dec d
>	djnz top
>
>am I correct? i havn't used htis function much myself and not for a 
>while anyway =)

I don't think so!  It uses the B register!  That makes a huge difference!
Since the code above increments B at each loop, then (if your drawpixel
routine doesn't change B), you will get an ENDLESS LOOP when you run it!
Actually, if B is 0 at the start, it will just draw one pixel and exit.
If B has any other value, you'll just have to take out the batteries of
your calculator to continue!


--
Patrick Davidson (ariwsi@juno.com)
Visit my home page!  Stuff for Amiga, TI-85, TI-92, even DOS!
http://www.calweb.com/~kwdavids/patrick/
http://www.toptown.com/hp/ariwsi/


References: