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