Re: A83: CP with register DE?


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

Re: A83: CP with register DE?




I did some expirementation and can tell you that _convop1 DOES put the
value of op1 into a... Try the following code and it proves it, and as I
studied the src of my "dasm"ed rom I can see why... anyway here is the
way to prove it... Using a controlled value in op2

This will never ret:

loop:
	ld a, 20	; \
	call _setxxop1	; |--- This is the equivalent to _getk
	call _op1toop2	; /
	xor a		;Notice that I make a=0
	call _op2toop1
	call _convop1
	cp 22
	ret z
	jp loop

This will ret every time:
loop:
	ld a, 22	; \
	call _setxxop1	; |--- This is the equivalent to _getk
	call _op1toop2	; /
	xor a		; Notice I make a=0
	call _op2toop1
	call _convop1
	cp 22
	ret z
	jp loop

By that, I can tell you that it clearly DOES put op1 into a, and that
isn't just imho... it is a fact!

AtmaZ@aol.com wrote:
> 
> << This works because CP compairs to a, not with a.  So, when you do cp 22, it
>  checks to see if a=22. >>
> 
> I know how CP works.  But what I tried to say here is that _convop1 does NOT
> stick OP1 in A...so how the heck does CP find the value?
> 
> --David

-- 
Scott "_Wrath_" Dial
homosapian@geocities.com
ICQ#3608935
http://www.geocities.com/~homosapian/


References: