[Coco] Branch Instruction Summary
Sean Conner
sean at conman.org
Tue Jul 22 20:30:40 EDT 2025
It was thus said that the Great Allen Huffman via Coco once stated:
> On Jul 22, 2025, at 1:16 PM, John Mark Mobley via Coco <coco at maltedmedia.com> wrote:
> >
> > All,
> >
> > See attached. I hope the attachment works.
>
> I feel this would be very useful to me, with a bit more explaining. I have
> never really visualized how some of these other OP codes work with setting
> carry or Z or whatever. I know this is all embedded in the OP code
> references and such, and maybe I would understand it today, but I sure
> didn’t back in 1984.
Here's the chart I found. Plain text, and it (to me) explains when to use
what branches:
+-----------------------------------------------------------------------+
| 6809 BRANCH INSTRUCTIONS |
+-------------+-----------------------------+---------------------------+
| Instruction | Description | Condition Formula |
+-------------+-----------------------------+---------------------------+
| BCC/BHS | Higher Or Same | XC |
| BCS/BLO | Lower | C |
| BHI | Higher | XC*XZ |
| BLS | Lower Or Same | C + Z |
| BNE | Not Equal | XZ |
| BEQ | Equal | Z |
| BGE | Greater Or Equal (Signed) | N*V + XN*XV |
| BLT | Less Than (Signed) | N*XV + XN*V |
| BGT | Greater Than (Signed) | N*V*XZ + XN*XV*XZ |
| BLE | Less Than Or Equal (Signed) | Z + N*XV + XN*V |
| BPL | Plus (Positive) | XN |
| BMI | Minus (Negative) | N |
| BVC | Overflow Clear | XV |
| BVS | Overflow Set | V |
| BRA | Always | 1 |
| BRN | Never | 0 |
+-------------+-----------------------------+---------------------------+
The top four branches are unsigned. I don't even look at the condition
formula (but it was handy when writing my own emulator---here X means NOT).
-spc
More information about the Coco
mailing list