blob: 59946855cab392d0d0064b11247a3434fe9e4bd3 [file] [log] [blame]
<html lang="en">
<head>
<title>NDS32-Ops - 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="NDS32-Syntax.html#NDS32-Syntax" title="NDS32 Syntax">
<link rel="prev" href="NDS32_002dRegs.html#NDS32_002dRegs" title="NDS32-Regs">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
This file documents the GNU Assembler "as".
Copyright (C) 1991-2019 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="NDS32-Ops"></a>
<a name="NDS32_002dOps"></a>
<p>
Previous:&nbsp;<a rel="previous" accesskey="p" href="NDS32_002dRegs.html#NDS32_002dRegs">NDS32-Regs</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="NDS32-Syntax.html#NDS32-Syntax">NDS32 Syntax</a>
<hr>
</div>
<h5 class="subsubsection">9.30.2.3 Pseudo Instructions</h5>
<dl>
<dt><code>li rt5,imm32</code><dd>load 32-bit integer into register rt5. &lsquo;<samp><span class="samp">sethi rt5,hi20(imm32)</span></samp>&rsquo; and then
&lsquo;<samp><span class="samp">ori rt5,reg,lo12(imm32)</span></samp>&rsquo;.
<br><dt><code>la rt5,var</code><dd>Load 32-bit address of var into register rt5. &lsquo;<samp><span class="samp">sethi rt5,hi20(var)</span></samp>&rsquo; and
then &lsquo;<samp><span class="samp">ori reg,rt5,lo12(var)</span></samp>&rsquo;
<br><dt><code>l.[bhw] rt5,var</code><dd>Load value of var into register rt5. &lsquo;<samp><span class="samp">sethi $ta,hi20(var)</span></samp>&rsquo; and then
&lsquo;<samp><span class="samp">l[bhw]i rt5,[$ta+lo12(var)]</span></samp>&rsquo;
<br><dt><code>l.[bh]s rt5,var</code><dd>Load value of var into register rt5. &lsquo;<samp><span class="samp">sethi $ta,hi20(var)</span></samp>&rsquo; and then
&lsquo;<samp><span class="samp">l[bh]si rt5,[$ta+lo12(var)]</span></samp>&rsquo;
<br><dt><code>l.[bhw]p rt5,var,inc</code><dd>Load value of var into register rt5 and increment $ta by amount inc.
&lsquo;<samp><span class="samp">la $ta,var</span></samp>&rsquo; and then &lsquo;<samp><span class="samp">l[bhw]i.bi rt5,[$ta],inc</span></samp>&rsquo;
<br><dt><code>l.[bhw]pc rt5,inc</code><dd>Continue loading value of var into register rt5 and increment $ta by amount inc.
&lsquo;<samp><span class="samp">l[bhw]i.bi rt5,[$ta],inc.</span></samp>&rsquo;
<br><dt><code>l.[bh]sp rt5,var,inc</code><dd>Load value of var into register rt5 and increment $ta by amount inc.
&lsquo;<samp><span class="samp">la $ta,var</span></samp>&rsquo; and then &lsquo;<samp><span class="samp">l[bh]si.bi rt5,[$ta],inc</span></samp>&rsquo;
<br><dt><code>l.[bh]spc rt5,inc</code><dd>Continue loading value of var into register rt5 and increment $ta by amount inc.
&lsquo;<samp><span class="samp">l[bh]si.bi rt5,[$ta],inc.</span></samp>&rsquo;
<br><dt><code>s.[bhw] rt5,var</code><dd>Store register rt5 to var.
&lsquo;<samp><span class="samp">sethi $ta,hi20(var)</span></samp>&rsquo; and then &lsquo;<samp><span class="samp">s[bhw]i rt5,[$ta+lo12(var)]</span></samp>&rsquo;
<br><dt><code>s.[bhw]p rt5,var,inc</code><dd>Store register rt5 to var and increment $ta by amount inc.
&lsquo;<samp><span class="samp">la $ta,var</span></samp>&rsquo; and then &lsquo;<samp><span class="samp">s[bhw]i.bi rt5,[$ta],inc</span></samp>&rsquo;
<br><dt><code>s.[bhw]pc rt5,inc</code><dd>Continue storing register rt5 to var and increment $ta by amount inc.
&lsquo;<samp><span class="samp">s[bhw]i.bi rt5,[$ta],inc.</span></samp>&rsquo;
<br><dt><code>not rt5,ra5</code><dd>Alias of &lsquo;<samp><span class="samp">nor rt5,ra5,ra5</span></samp>&rsquo;.
<br><dt><code>neg rt5,ra5</code><dd>Alias of &lsquo;<samp><span class="samp">subri rt5,ra5,0</span></samp>&rsquo;.
<br><dt><code>br rb5</code><dd>Depending on how it is assembled, it is translated into &lsquo;<samp><span class="samp">r5 rb5</span></samp>&rsquo;
or &lsquo;<samp><span class="samp">jr rb5</span></samp>&rsquo;.
<br><dt><code>b label</code><dd>Branch to label depending on how it is assembled, it is translated into
&lsquo;<samp><span class="samp">j8 label</span></samp>&rsquo;, &lsquo;<samp><span class="samp">j label</span></samp>&rsquo;, or "&lsquo;<samp><span class="samp">la $ta,label</span></samp>&rsquo; &lsquo;<samp><span class="samp">br $ta</span></samp>&rsquo;".
<br><dt><code>bral rb5</code><dd>Alias of jral br5 depending on how it is assembled, it is translated
into &lsquo;<samp><span class="samp">jral5 rb5</span></samp>&rsquo; or &lsquo;<samp><span class="samp">jral rb5</span></samp>&rsquo;.
<br><dt><code>bal fname</code><dd>Alias of jal fname depending on how it is assembled, it is translated into
&lsquo;<samp><span class="samp">jal fname</span></samp>&rsquo; or "&lsquo;<samp><span class="samp">la $ta,fname</span></samp>&rsquo; &lsquo;<samp><span class="samp">bral $ta</span></samp>&rsquo;".
<br><dt><code>call fname</code><dd>Call function fname same as &lsquo;<samp><span class="samp">jal fname</span></samp>&rsquo;.
<br><dt><code>move rt5,ra5</code><dd>For 16-bit, this is &lsquo;<samp><span class="samp">mov55 rt5,ra5</span></samp>&rsquo;.
For no 16-bit, this is &lsquo;<samp><span class="samp">ori rt5,ra5,0</span></samp>&rsquo;.
<br><dt><code>move rt5,var</code><dd>This is the same as &lsquo;<samp><span class="samp">l.w rt5,var</span></samp>&rsquo;.
<br><dt><code>move rt5,imm32</code><dd>This is the same as &lsquo;<samp><span class="samp">li rt5,imm32</span></samp>&rsquo;.
<br><dt><code>pushm ra5,rb5</code><dd>Push contents of registers from ra5 to rb5 into stack.
<br><dt><code>push ra5</code><dd>Push content of register ra5 into stack. (same &lsquo;<samp><span class="samp">pushm ra5,ra5</span></samp>&rsquo;).
<br><dt><code>push.d var</code><dd>Push value of double-word variable var into stack.
<br><dt><code>push.w var</code><dd>Push value of word variable var into stack.
<br><dt><code>push.h var</code><dd>Push value of half-word variable var into stack.
<br><dt><code>push.b var</code><dd>Push value of byte variable var into stack.
<br><dt><code>pusha var</code><dd>Push 32-bit address of variable var into stack.
<br><dt><code>pushi imm32</code><dd>Push 32-bit immediate value into stack.
<br><dt><code>popm ra5,rb5</code><dd>Pop top of stack values into registers ra5 to rb5.
<br><dt><code>pop rt5</code><dd>Pop top of stack value into register. (same as &lsquo;<samp><span class="samp">popm rt5,rt5</span></samp>&rsquo;.)
<br><dt><code>pop.d var,ra5</code><dd>Pop value of double-word variable var from stack using register ra5
as 2nd scratch register. (1st is $ta)
<br><dt><code>pop.w var,ra5</code><dd>Pop value of word variable var from stack using register ra5.
<br><dt><code>pop.h var,ra5</code><dd>Pop value of half-word variable var from stack using register ra5.
<br><dt><code>pop.b var,ra5</code><dd>Pop value of byte variable var from stack using register ra5.
</dl>
<!-- Copyright (C) 2012-2019 Free Software Foundation, Inc. -->
<!-- This is part of the GAS manual. -->
<!-- For copying conditions, see the file as.texinfo. -->
<!-- man end -->
</body></html>