You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

146 lines
5.9KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- This file documents the GNU Assembler "as".
  4. Copyright (C) 1991-2020 Free Software Foundation, Inc.
  5. Permission is granted to copy, distribute and/or modify this document
  6. under the terms of the GNU Free Documentation License, Version 1.3
  7. or any later version published by the Free Software Foundation;
  8. with no Invariant Sections, with no Front-Cover Texts, and with no
  9. Back-Cover Texts. A copy of the license is included in the
  10. section entitled "GNU Free Documentation License".
  11. -->
  12. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  13. <head>
  14. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  15. <title>M68HC11-Branch (Using as)</title>
  16. <meta name="description" content="M68HC11-Branch (Using as)">
  17. <meta name="keywords" content="M68HC11-Branch (Using as)">
  18. <meta name="resource-type" content="document">
  19. <meta name="distribution" content="global">
  20. <meta name="Generator" content="makeinfo">
  21. <link href="index.html#Top" rel="start" title="Top">
  22. <link href="AS-Index.html#AS-Index" rel="index" title="AS Index">
  23. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  24. <link href="M68HC11_002dopcodes.html#M68HC11_002dopcodes" rel="up" title="M68HC11-opcodes">
  25. <link href="S12Z_002dDependent.html#S12Z_002dDependent" rel="next" title="S12Z-Dependent">
  26. <link href="M68HC11_002dopcodes.html#M68HC11_002dopcodes" rel="prev" title="M68HC11-opcodes">
  27. <style type="text/css">
  28. <!--
  29. a.summary-letter {text-decoration: none}
  30. blockquote.indentedblock {margin-right: 0em}
  31. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  32. blockquote.smallquotation {font-size: smaller}
  33. div.display {margin-left: 3.2em}
  34. div.example {margin-left: 3.2em}
  35. div.lisp {margin-left: 3.2em}
  36. div.smalldisplay {margin-left: 3.2em}
  37. div.smallexample {margin-left: 3.2em}
  38. div.smalllisp {margin-left: 3.2em}
  39. kbd {font-style: oblique}
  40. pre.display {font-family: inherit}
  41. pre.format {font-family: inherit}
  42. pre.menu-comment {font-family: serif}
  43. pre.menu-preformatted {font-family: serif}
  44. pre.smalldisplay {font-family: inherit; font-size: smaller}
  45. pre.smallexample {font-size: smaller}
  46. pre.smallformat {font-family: inherit; font-size: smaller}
  47. pre.smalllisp {font-size: smaller}
  48. span.nolinebreak {white-space: nowrap}
  49. span.roman {font-family: initial; font-weight: normal}
  50. span.sansserif {font-family: sans-serif; font-weight: normal}
  51. ul.no-bullet {list-style: none}
  52. -->
  53. </style>
  54. </head>
  55. <body lang="en">
  56. <a name="M68HC11_002dBranch"></a>
  57. <div class="header">
  58. <p>
  59. Up: <a href="M68HC11_002dopcodes.html#M68HC11_002dopcodes" accesskey="u" rel="up">M68HC11-opcodes</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="AS-Index.html#AS-Index" title="Index" rel="index">Index</a>]</p>
  60. </div>
  61. <hr>
  62. <a name="Branch-Improvement-1"></a>
  63. <h4 class="subsubsection">9.23.6.1 Branch Improvement</h4>
  64. <a name="index-pseudo_002dopcodes_002c-M68HC11"></a>
  65. <a name="index-M68HC11-pseudo_002dopcodes"></a>
  66. <a name="index-branch-improvement_002c-M68HC11"></a>
  67. <a name="index-M68HC11-branch-improvement"></a>
  68. <p>Certain pseudo opcodes are permitted for branch instructions.
  69. They expand to the shortest branch instruction that reach the
  70. target. Generally these mnemonics are made by prepending &lsquo;<samp>j</samp>&rsquo; to
  71. the start of Motorola mnemonic. These pseudo opcodes are not affected
  72. by the &lsquo;<samp>--short-branches</samp>&rsquo; or &lsquo;<samp>--force-long-branches</samp>&rsquo; options.
  73. </p>
  74. <p>The following table summarizes the pseudo-operations.
  75. </p>
  76. <div class="smallexample">
  77. <pre class="smallexample"> Displacement Width
  78. +-------------------------------------------------------------+
  79. | Options |
  80. | --short-branches --force-long-branches |
  81. +--------------------------+----------------------------------+
  82. Op |BYTE WORD | BYTE WORD |
  83. +--------------------------+----------------------------------+
  84. bsr | bsr &lt;pc-rel&gt; &lt;error&gt; | jsr &lt;abs&gt; |
  85. bra | bra &lt;pc-rel&gt; &lt;error&gt; | jmp &lt;abs&gt; |
  86. jbsr | bsr &lt;pc-rel&gt; jsr &lt;abs&gt; | bsr &lt;pc-rel&gt; jsr &lt;abs&gt; |
  87. jbra | bra &lt;pc-rel&gt; jmp &lt;abs&gt; | bra &lt;pc-rel&gt; jmp &lt;abs&gt; |
  88. bXX | bXX &lt;pc-rel&gt; &lt;error&gt; | bNX +3; jmp &lt;abs&gt; |
  89. jbXX | bXX &lt;pc-rel&gt; bNX +3; | bXX &lt;pc-rel&gt; bNX +3; jmp &lt;abs&gt; |
  90. | jmp &lt;abs&gt; | |
  91. +--------------------------+----------------------------------+
  92. XX: condition
  93. NX: negative of condition XX
  94. </pre></div>
  95. <dl compact="compact">
  96. <dt><code>jbsr</code></dt>
  97. <dt><code>jbra</code></dt>
  98. <dd><p>These are the simplest jump pseudo-operations; they always map to one
  99. particular machine instruction, depending on the displacement to the
  100. branch target.
  101. </p>
  102. </dd>
  103. <dt><code>jb<var>XX</var></code></dt>
  104. <dd><p>Here, &lsquo;<samp>jb<var>XX</var></samp>&rsquo; stands for an entire family of pseudo-operations,
  105. where <var>XX</var> is a conditional branch or condition-code test. The full
  106. list of pseudo-ops in this family is:
  107. </p><div class="smallexample">
  108. <pre class="smallexample"> jbcc jbeq jbge jbgt jbhi jbvs jbpl jblo
  109. jbcs jbne jblt jble jbls jbvc jbmi
  110. </pre></div>
  111. <p>For the cases of non-PC relative displacements and long displacements,
  112. <code>as</code> issues a longer code fragment in terms of
  113. <var>NX</var>, the opposite condition to <var>XX</var>. For example, for the
  114. non-PC relative case:
  115. </p><div class="smallexample">
  116. <pre class="smallexample"> jb<var>XX</var> foo
  117. </pre></div>
  118. <p>gives
  119. </p><div class="smallexample">
  120. <pre class="smallexample"> b<var>NX</var>s oof
  121. jmp foo
  122. oof:
  123. </pre></div>
  124. </dd>
  125. </dl>
  126. </body>
  127. </html>