home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / amiga / programm / 18310 < prev    next >
Encoding:
Text File  |  1993-01-07  |  1.8 KB  |  37 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: sparky!uunet!usc!elroy.jpl.nasa.gov!jato!jdickson
  3. From: jdickson@jato.jpl.nasa.gov (Jeff Dickson)
  4. Subject: Re: 680x0 Branch Instructions?
  5. Message-ID: <1993Jan7.211810.21995@jato.jpl.nasa.gov>
  6. Organization: Jet Propulsion Laboratory
  7. References: <1993Jan7.184445.25823@fcom.cc.utah.edu>
  8. Date: Thu, 7 Jan 1993 21:18:10 GMT
  9. Lines: 26
  10.  
  11. In article <1993Jan7.184445.25823@fcom.cc.utah.edu> val@news.ccutah.edu (Val Kartchner) writes:
  12. >I program in 680x0 assembly language from time to time.  I will soon be
  13. >programming some routines in assembly language again soon.  I need help
  14. >on the meaning and practical usage of the less common branch instructions.
  15. >I know what the eight common ones do.  (BRA, BSB, BLS, BLE, BEQ, BNE, BGE,
  16. >BGT)  I think that four of the others are used for branches based on
  17. >unsigned compares, but I'm not sure which ones.  (BCS, BCC, BPL, BMI?)
  18. >What practical use are the other four branch instructions?
  19. >
  20. >Would an assembly guru be willing to confirm this usage and/or correct it
  21. >as well as provide practical examples (short) of using all of the branch
  22. >instructions? (C-like pseudo-code is prefered, but Pascal-like would be
  23. >fine.)
  24. >
  25.  
  26. BPL and BMI determine if the branch condition is true based on the state of
  27. the MSB of the data register or memory location being tested. Sometimes I
  28. use them or their equivilents BGE and BLT respectively. BCS and BCC are
  29. useful if you wish to know if the LSB of a data register is set or cleared
  30. for example. The LSR instruction shifts the LSB into both the carry and extend
  31. status bits. If the LSB of D0 was set, then after LSR #1,D0 BCS would apply.
  32. If instead it was clear, then BCC would apply. These are just examples. I'm
  33. sure there are many other uses for these instructions. 
  34.  
  35. Jeff
  36.  
  37.