Re: A83: Question about compares.


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

Re: A83: Question about compares.




Well, you can put anything between the cp and whatever that doesn't
affect the system flags (z&nz, c&nc, pe, po, m, any more?).  Only CALL
and JP can use it though.

>I have a question about 'compare' and 'conditional jumps'... Am I 
>right to
>beleive that the one line after a 'cp' is read for that statement? 
>Also, does
>it ONLY have to be jump, either 'jp' or 'jr' ?  For example, would 
>this code
>be ASM Legal...?
>
>	...	
>	ld a, (value)	; I'm going to compare to test what's in 
>(value)...
>	cp 1			; If the cp was zero, this Next 
>ONE line would be exec?
>	ld b, 10		; But if "cp 1" was nz, dont carry out 
>THIS line?
>	cp 2			; But if the value WAS '1', THIS 
>line wouldnt be tested, 
>	ld b, 12		; and THIS line would Not be carried 
>out?
>	...
>
>Am I wrong to think this, and just kinda messed up, or is this 
>possible...?
>I hope I dont have to do a different label in each compare just to do 
>one "ld
>b"
>command for each... someone clarify me on this please, thanx... =)
>
>																--Jason 
>K.
>

_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]