A83: Question about compares.


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

A83: Question about compares.




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.