<html lang="en"> <head> <title>M68HC11-Branch - Using as</title> <meta http-equiv="Content-Type" content="text/html"> <meta name="description" content="Using as"> <meta name="generator" content="makeinfo 4.13"> <link title="Top" rel="start" href="index.html#Top"> <link rel="up" href="M68HC11_002dopcodes.html#M68HC11_002dopcodes" title="M68HC11-opcodes"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <!-- This file documents the GNU Assembler "as". Copyright (C) 1991-2015 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''. --> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } --></style> </head> <body> <div class="node"> <a name="M68HC11-Branch"></a> <a name="M68HC11_002dBranch"></a> <p> Up: <a rel="up" accesskey="u" href="M68HC11_002dopcodes.html#M68HC11_002dopcodes">M68HC11-opcodes</a> <hr> </div> <h5 class="subsubsection">9.24.6.1 Branch Improvement</h5> <p><a name="index-pseudo_002dopcodes_002c-M68HC11-1444"></a><a name="index-M68HC11-pseudo_002dopcodes-1445"></a><a name="index-branch-improvement_002c-M68HC11-1446"></a><a name="index-M68HC11-branch-improvement-1447"></a> Certain pseudo opcodes are permitted for branch instructions. They expand to the shortest branch instruction that reach the target. Generally these mnemonics are made by prepending ‘<samp><span class="samp">j</span></samp>’ to the start of Motorola mnemonic. These pseudo opcodes are not affected by the ‘<samp><span class="samp">--short-branches</span></samp>’ or ‘<samp><span class="samp">--force-long-branches</span></samp>’ options. <p>The following table summarizes the pseudo-operations. <pre class="smallexample"> Displacement Width +-------------------------------------------------------------+ | Options | | --short-branches --force-long-branches | +--------------------------+----------------------------------+ Op |BYTE WORD | BYTE WORD | +--------------------------+----------------------------------+ bsr | bsr <pc-rel> <error> | jsr <abs> | bra | bra <pc-rel> <error> | jmp <abs> | jbsr | bsr <pc-rel> jsr <abs> | bsr <pc-rel> jsr <abs> | jbra | bra <pc-rel> jmp <abs> | bra <pc-rel> jmp <abs> | bXX | bXX <pc-rel> <error> | bNX +3; jmp <abs> | jbXX | bXX <pc-rel> bNX +3; | bXX <pc-rel> bNX +3; jmp <abs> | | jmp <abs> | | +--------------------------+----------------------------------+ XX: condition NX: negative of condition XX </pre> <dl> <dt><code>jbsr</code><dt><code>jbra</code><dd>These are the simplest jump pseudo-operations; they always map to one particular machine instruction, depending on the displacement to the branch target. <br><dt><code>jb</code><var>XX</var><dd>Here, ‘<samp><span class="samp">jb</span><var>XX</var></samp>’ stands for an entire family of pseudo-operations, where <var>XX</var> is a conditional branch or condition-code test. The full list of pseudo-ops in this family is: <pre class="smallexample"> jbcc jbeq jbge jbgt jbhi jbvs jbpl jblo jbcs jbne jblt jble jbls jbvc jbmi </pre> <p>For the cases of non-PC relative displacements and long displacements, <code>as</code> issues a longer code fragment in terms of <var>NX</var>, the opposite condition to <var>XX</var>. For example, for the non-PC relative case: <pre class="smallexample"> jb<var>XX</var> foo </pre> <p>gives <pre class="smallexample"> b<var>NX</var>s oof jmp foo oof: </pre> </dl> <!-- Copyright (C) 2013-2015 Free Software Foundation, Inc. --> <!-- Contributed by Imagination Technologies Ltd. --> <!-- This is part of the GAS manual. --> <!-- For copying conditions, see the file as.texinfo. --> <!-- man end --> </body></html>