Re: [stella] button questions

Subject: Re: [stella] button questions
From: Chris Wilkson <ecwilkso@xxxxxxx>
Date: Tue, 16 Jul 2002 22:37:19 -0400 (EDT)
On 17 Jul 2002 KirkIsrael@xxxxxxxxxxxxx wrote:

> Also, I guess I'm still dumb about the bits...
> if it's just setting D7 of INPT4, can't you still
> use the usual BEQ/BNE, or do you have to use BMI ?
> Doesn't LDAing a D7 value effect Z? (actually, I'm
> really confused,

Yes.  But the Z flag is only set if the previous operation
cleared every bit to a 0.  There's a possibility that bits other
than D7 are set, so BEQ/BNE could fail.  BMI looks only at bit 7
of the result, which is defined as the algebraic SIGN.  Signed
numbers range from -128 to +127.  Bit 7 is a 1 for negative numbers.
It's a 0 for zero and positive numbers.

> 	LDA INPT4
> 	BNE ButtonNotPressed
> 	LDA YPosFromBot
> 	STA COLUBK
> ButtonNotPressed
>
> *always* skips the COLUBK...I mean shouldn't that be zero
> or not zero depending on whether the button is pressed?)

This is a good test.  But see above.  Try replacing BNE with BMI and
it should work.  There's also the possibility that you aren't disabling
the latches.  I'm fuzzy on those details...I'd have to look them up.
But I'm sure someone else can help.

-Chris

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


Current Thread