Home | History | Annotate | Download | only in opcodes
      1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      2 
      3 <html>
      4 
      5 <head>
      6 <title>binop/lit16</title>
      7 <link rel=stylesheet href="opcode.css">
      8 </head>
      9 
     10 <body>
     11 
     12 <h1>binop/lit16</h1>
     13 
     14 <h2>Purpose</h2>
     15 
     16 <p>
     17 Perform the indicated binary op on the indicated register (first argument) and
     18 literal value (second argument), storing the result in the destination register.
     19 </p>
     20 
     21 <h2>Details</h2>
     22 
     23 <table class="instruc">
     24 <thead>
     25 <tr>
     26   <th>Op &amp; Format</th>
     27   <th>Mnemonic / Syntax</th>
     28   <th>Arguments</th>
     29 </tr>
     30 </thead>
     31 <tbody>
     32 <tr>
     33   <td>d0..d7 22s</td>
     34   <td><i>binop</i>/lit16 vA, vB, #+CCCC<br/>
     35     d0: add-int/lit16<br/>
     36     d1: rsub-int (reverse subtract)<br/>
     37     d2: mul-int/lit16<br/>
     38     d3: div-int/lit16<br/>
     39     d4: rem-int/lit16<br/>
     40     d5: and-int/lit16<br/>
     41     d6: or-int/lit16<br/>
     42     d7: xor-int/lit16
     43   </td>
     44   <td><code>A:</code> destination register (4 bits)<br/>
     45     <code>B:</code> source register (4 bits)<br/>
     46     <code>C:</code> signed int constant (16 bits)</td>
     47 </tr>
     48 </tbody>
     49 </table>
     50 
     51 <h2>Constraints</h2>
     52 
     53 <ul>
     54   <li>
     55     Both A and B must be valid register indices in the current stackframe.
     56   </li>
     57   <li>
     58     Registers vA and vB must be defined. They must both contain integer values.
     59   </li>
     60   <li>
     61     C is an immediate, signed integer constant taken from the instruction stream
     62     (actually this means there are no special requirements for C at all).
     63   </li>
     64 </ul>
     65 
     66 <h2>Behavior</h2>
     67 
     68 <ul>
     69   <li>
     70     The given operation &lt;binop&gt; is performed according to the semantics
     71     specified in table XXX.
     72   </li>
     73   <li>
     74     Argument C is sign-extended to 32 bits before.
     75   </li>
     76   <li>
     77     The result is stored in register vA, that is, vA'=vB &lt;binop&gt; vC.
     78   </li>
     79   <li>
     80     As usual, neighboring registers might get undefined, if vA was part of a
     81     register pair originally.
     82   </li>
     83 </ul>
     84 
     85 <h2>Exceptions</h2>
     86 
     87 <ul>
     88   <li>
     89     ArithmeticException if an error occurs during the instruction.
     90   </li>
     91 </ul>
     92 
     93 </body>
     94 </html>
     95