Re: [stella] BMI & BPL question

Subject: Re: [stella] BMI & BPL question
From: Chris Wilkson <cwilkson@xxxxxxxxxxxxxxxx>
Date: Mon, 29 Jun 1998 19:23:41 -0700 (PDT)
> To check D6 you can use either of these...
> 
>     lda CXP0FB
>     bit #0
>     bvs D6set

But the BIT instruction doesn't support immediate addressing.
(what a stupid thing to leave out!!!)  So how does this work?

Oh.  I see what you're doing.  If my understanding of the BIT
instruction is correct, then it performs a logical AND of the
accumulator and the operand and sets the Z flag accordingly.
But it also copies bits 6 and 7 of the operand into the V and N
flags respectively.  If this is correct, then simply changing
the addressing mode would achieve the intended effect:

	bit CXP0FB	; moves bits 6 and 7 to the status register
	bvs D6set	; checks bit 6 of CXP0FB
	bmi	D7set	; checks bit 7 of CXP0FB

-Chris


--
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/stella.html

Current Thread