|
Subject: Re: [stella] BMI & BPL questions From: "Andrew Davie" <adavie@xxxxxxxxxxxxxxxxx> Date: Tue, 30 Jun 1998 08:17:37 +1000 |
>writes, "The reasons for this are exotic. We don't need to go into them.
> Just be warned that BPL and BMI, which sound so logical and useful, are
>not. They can fail you and neither one lives up to its name."
What a load of rubbish!!! They are two quite useful instructions.
The only ones I almost never used were BVS and BVC
>> lda CXP0FB ; this byte holds the collision registers for Player
>> ; Zero and the playfield (D7) and P0 and the ball (D6)
>>
>> asl
>> bcs joycheck ; if D7=1 there is a collision and gravity should be
>> ; negated. (The guy's standing on the floor)
>> ;bmi joycheck
If you simply want to check D7
lda CXP0FB
bmi joycheck ;(D7 = 1?)
if you shift and THEN do a BMI, you're actually checking D6, which is now in
D7 :) By using a shift and BCS, you're rolling D7 into C and then branching
based upon C.
If you wanted to check D6, you couldn't do this...
lda CXP0FB
bvc D6clear
The reason is that, whilst the sign flag is set correctly by the load, the V
flag is not. One of the reasons I find V branching quite uncommonly used.
To check D6 you can use either of these...
lda CXP0FB
bit #0
bvs D6set
or
lda CXP0FB
asl
bmi D6set
Cheers
A
--
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/stella.html
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [stella] BMI & BPL questions, Erik Mooney | Thread | Re: [stella] BMI & BPL question, Chris Wilkson |
| [stella] BMI & BPL questions, Ruffin Bailey | Date | Re: [stella] BMI & BPL questions, Erik Mooney |
| Month |