home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.cbm
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!nucsrl!ddsw1!dattier
- From: dattier@ddsw1.mcs.com (DWT)
- Subject: Re: 2 Q's: BMI & SAVE@
- Message-ID: <C17oCK.2D9@ddsw1.mcs.com>
- Date: Thu, 21 Jan 1993 15:57:56 GMT
- References: <15JAN199303143085@pavo.concordia.ca> <C0xI7E.428@ddsw1.mcs.com>
- Organization: Contributor Account at ddsw1, Chicago, Illinois 60657
- Keywords: oops
- Lines: 21
-
- I wrote in <C0xI7E.428@ddsw1.mcs.com>:
-
- | BPL and BMI are for the rarely-used signed arithmetic, and +128 through +255
- | are considered negative (because they mean -128 through -1) and -129 through
- | -255 show up as positive (because the evaluate to 127 through 0). BMI should
- | be perfectly fine for testing (1) whether BIT found bit 7 set, (2) when a re-
- | gister is decremented from 0 to 255, or (3) when one is incremented from 127
- | to 128.
-
- Stephen Krauth confirmed my guess about why Butterfield had warned against
- using BMI, but I see I made a small goof: -255 is the same as 1. -256 is
- the same as 0. Any result from 0 to 127 or from -256 through -129 will clear
- the N flag, causing BPL to branch and BMI not to branch. Any result from
- 128 through 255 or from -128 through -1 will set the N flag, causing BMI to
- branch and BPL not to. BMI works after CMP or SBC as a neophyte might expect
- only if the minuend and the subtrahead differ by less than 128, and for that
- matter, the same applies to BPL. BCC and BCS respectively are more likely to
- mean what the programmer wants.
-
- David W. Tamkin Box 59297 Northtown Station, Illinois 60659-0297
- dattier@ddsw1.mcs.com CompuServe: 73720,1570 MCI Mail: 426-1818
-