Re: A85: 16 bit registers...


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

Re: A85: 16 bit registers...





Here's probably the quickest, smallest way to do this:

loop:
; loop stuff here
dec bc
ld a, b
or c
jr nz, loop

On Tue, 29 Dec 1998, Michael Turitzin wrote:

> 
> 
> I'm VERY new(about 2 days) to ti-85 assembly code, so excuse this newbie
> question.  I'm trying to check if a 16 bit register( bc ) is 0, but I can't
> find a way to do it other than checking b and then c for 0 values.  "dec"
> seems to only set z if the register is 8 bit, and most everything else I can
> find that sets this value uses A and needs an 8 bit register as the
> "parameter".  This is the code I am currently using:
> 
>  dec      bc
>  ld       a, 0
>  cp       b
>  jr       nz, FlashLoop
>  cp       c
>  jr       nz, FlashLoop
>  jr       MainLoop
> 
> Is there a better way of checking for a zero value in bc?
> 
> MaNiAc
> 
> 

 from the Dark Side of the Moon...
			              /\       ________________
			  -----------/  \======================
          			    /____\     ----------------
   Erik Huizing
   ehuizing@ucalgary.ca
   http://www.ucalgary.ca/~ehuizing


References: