home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / cbm / 5573 < prev    next >
Encoding:
Text File  |  1993-01-21  |  1.6 KB  |  33 lines

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