Re: [stella] BMI & BPL questions

Subject: Re: [stella] BMI & BPL questions
From: emooney@xxxxxxxxxxxxxxxx (Erik Mooney)
Date: Tue, 30 Jun 1998 02:16:07 GMT
>In COMPUTE!'s book _Machine Language For Beginners_, Richard Mansfield 
>warns against ever using BMI and BPL.  To justify this ban, Mr. Mansfield 
>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."
>(page 75 in my edition)
[snip]
>Is this some episode of the X-Files that I missed, or is Mansfield just 
>worried that these two instructions are too complicated for the beginner 
>to use?  Or something far more sinister...  ;)  And what's with the crazy 
>reversed joystick movement?  Tune in next time...

Not sure what's wrong with your code, but Mansfield just doesn't feel like
explaining the technical workings of BMI and BPL.  They both just use the
sign bit - the counterintuitive parts are that BPL will branch even if the
previous result was *zero*, despite the fact that zero isn't positive.  And
BMI will branch if the top bit of the previous result was set, which can
happen pretty easily with an overflow - 70 + 70 counts as negative.

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

Current Thread