You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
104 lines
4.9 KiB
HTML
104 lines
4.9 KiB
HTML
<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.7">
|
|
<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, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002,
|
|
2006, 2007 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.1
|
|
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''.
|
|
|
|
man end-->
|
|
<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; }
|
|
--></style>
|
|
</head>
|
|
<body>
|
|
<div class="node">
|
|
<p>
|
|
<a name="M68HC11_002dBranch"></a>Up: <a rel="up" accesskey="u" href="M68HC11_002dopcodes.html#M68HC11_002dopcodes">M68HC11-opcodes</a>
|
|
<hr><br>
|
|
</div>
|
|
|
|
<h5 class="subsubsection">9.21.6.1 Branch Improvement</h5>
|
|
|
|
<p><a name="index-pseudo_002dopcodes_002c-M68HC11-1189"></a><a name="index-M68HC11-pseudo_002dopcodes-1190"></a><a name="index-branch-improvement_002c-M68HC11-1191"></a><a name="index-M68HC11-branch-improvement-1192"></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 <span class="samp">j</span> to
|
|
the start of Motorola mnemonic. These pseudo opcodes are not affected
|
|
by the <span class="samp">--short-branches</span> or <span class="samp">--force-long-branches</span> 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, <span class="samp">jb</span><var>XX</var> 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 1991, 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001, -->
|
|
<!-- 2002, 2003, 2004 -->
|
|
<!-- Free Software Foundation, Inc. -->
|
|
<!-- This is part of the GAS manual. -->
|
|
<!-- For copying conditions, see the file as.texinfo. -->
|
|
</body></html>
|
|
|