⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 m68k-branch.html

📁 gcc手册
💻 HTML
字号:
<html lang="en">

<head>

<title>Using as</title>

<meta http-equiv="Content-Type" content="text/html">

<meta name="description" content="Using as">

<meta name="generator" content="makeinfo 4.3">

<link href="http://www.gnu.org/software/texinfo/" rel="generator-home">

</head>

<body>

<div class="node">

<p>

Node:<a name="M68K-Branch">M68K-Branch</a>,

Next:<a rel="next" accesskey="n" href="M68K-Chars.html#M68K-Chars">M68K-Chars</a>,

Up:<a rel="up" accesskey="u" href="M68K-opcodes.html#M68K-opcodes">M68K-opcodes</a>

<hr><br>

</div>



<h5 class="subsection">Branch Improvement</h5>



   <p>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 substituting <code>j</code> for

<code>b</code> at the start of a Motorola mnemonic.



   <p>The following table summarizes the pseudo-operations.  A <code>*</code> flags

cases that are more fully described after the table:



<pre class="smallexample">               Displacement

               +------------------------------------------------------------

               |                68020           68000/10, not PC-relative OK

     Pseudo-Op |BYTE    WORD    LONG            ABSOLUTE LONG JUMP    **

               +------------------------------------------------------------

          jbsr |bsrs    bsrw    bsrl            jsr

           jra |bras    braw    bral            jmp

     *     jXX |bXXs    bXXw    bXXl            bNXs;jmp

     *    dbXX | N/A    dbXXw   dbXX;bras;bral  dbXX;bras;jmp

          fjXX | N/A    fbXXw   fbXXl            N/A

     

     XX: condition

     NX: negative of condition XX

     

     </pre>

   <div align="center"><code>*</code>--see full description below</div>

<div align="center"><code>**</code>--this expansion mode is disallowed by <code>--pcrel</code></div>

     <dl>

<dt><code>jbsr</code>

     <dd><dt><code>jra</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.  This instruction will be a byte or word branch is that

is sufficient.  Otherwise, a long branch will be emitted if available. 

If no long branches are available and the <code>--pcrel</code> option is not

given, an absolute long jump will be emitted instead.  If no long

branches are available, the <code>--pcrel</code> option is given, and a word

branch cannot reach the target, an error message is generated.



     <p>In addition to standard branch operands, <code>as</code> allows these

pseudo-operations to have all operands that are allowed for jsr and jmp,

substituting these instructions if the operand given is not valid for a

branch instruction.



     <br><dt><code>j</code><var>XX</var><code></code>

     <dd>Here, <code>j</code><var>XX</var><code></code> 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">           jhi   jls   jcc   jcs   jne   jeq   jvc

           jvs   jpl   jmi   jge   jlt   jgt   jle

          </pre>



     <p>Usually, each of these pseudo-operations expands to a single branch

instruction.  However, if a word branch is not sufficient, no long branches

are available, and the <code>--pcrel</code> option is not given, <code>as</code>

issues a longer code fragment in terms of <var>NX</var>, the opposite condition

to <var>XX</var>.  For example, under these conditions:

     <pre class="smallexample">              j<var>XX</var> foo

          </pre>

     gives

     <pre class="smallexample">               b<var>NX</var>s oof

               jmp foo

           oof:

          </pre>



     <br><dt><code>db</code><var>XX</var><code></code>

     <dd>The full family of pseudo-operations covered here is

     <pre class="smallexample">           dbhi   dbls   dbcc   dbcs   dbne   dbeq   dbvc

           dbvs   dbpl   dbmi   dbge   dblt   dbgt   dble

           dbf    dbra   dbt

          </pre>



     <p>Motorola <code>db</code><var>XX</var><code></code> instructions allow word displacements only.  When

a word displacement is sufficient, each of these pseudo-operations expands

to the corresponding Motorola instruction.  When a word displacement is not

sufficient and long branches are available, when the source reads

<code>db</code><var>XX</var><code> foo</code>, <code>as</code> emits

     <pre class="smallexample">               db<var>XX</var> oo1

               bras oo2

           oo1:bral foo

           oo2:

          </pre>



     <p>If, however, long branches are not available and the <code>--pcrel</code> option is

not given, <code>as</code> emits

     <pre class="smallexample">               db<var>XX</var> oo1

               bras oo2

           oo1:jmp foo

           oo2:

          </pre>



     <br><dt><code>fj</code><var>XX</var><code></code>

     <dd>This family includes

     <pre class="smallexample">           fjne   fjeq   fjge   fjlt   fjgt   fjle   fjf

           fjt    fjgl   fjgle  fjnge  fjngl  fjngle fjngt

           fjnle  fjnlt  fjoge  fjogl  fjogt  fjole  fjolt

           fjor   fjseq  fjsf   fjsne  fjst   fjueq  fjuge

           fjugt  fjule  fjult  fjun

          </pre>



     <p>Each of these pseudo-operations always expands to a single Motorola

coprocessor branch instruction, word or long.  All Motorola coprocessor

branch instructions allow both word and long displacements.



</dl>



   </body></html>



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -