Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <p>
- <span style="color:#ff0000"><b>OPCODE</b></span>(6b),
- <span style="color:#ff6600"><b>FORMAT</b></span>(1b),
- <span style="color:#009900"><b>IS_LITERAL</b></span>(1b),
- <span style="color:#339999"><b>SOURCE</b></span>(4b),
- <span style="color:#3333ff"><b>DESTINATION</b></span>(4b),
- <span style="color:#cc33cc"><b>DATA</b></span>(16b).
- </p>
- <p>This structure allows for easy hand-assembly, as the only nybble sharing is between the opcode and format. For example, <tt>MOVD FR:1, DR:2;</tt> assembles to
- <span style="color:#ff0000">0</span><span style="color:#ff6600">0</span><span style="color:#339999">1</span><span style="color:#3333ff">2</span><span style="color:#cc33cc">0000</span>.</p>
- The <span style="color:#339999"><b>SOURCE</b></span> and
- <span style="color:#3333ff"><b>DESTINATION</b></span> nybbles
- are identical; they are laid out as a single bit representing
- the type of the item followed by three bits for the register number.<br>
- <ul>
- <li><b>0</b> <i>000</i> - <b>0</b> <i>111</i> Are arithmetic registers 0 - 7, as specified in H3.1.</li>
- <li><b>1</b> <i>001</i> - <b>1</b> <i>111</i> Are index registers, 1 - 7, as specified in H3.2.</li>
- <li><b>1</b> <i>000</i> Is an invalid index register, and is used to indicate that the <span style="color:#cc33cc"><b>DATA</b></span> member is used.</li>
- </ul>
- <p>The <span style="color:#cc33cc"><b>DATA</b></span> field is sixteen
- bits, and is only used as described in the points above. If the
- <span style="color:#009900"><b>IS_LITERAL</b></span> bit is set, all sixteen bits of the
- <span style="color:#cc33cc"><b>DATA</b></span> member are used as the literal,
- and the value can range from -32768 to 32767 as per specification H4. If the
- <span style="color:#009900"><b>IS_LITERAL</b></span> bit is not set, then the
- <span style="color:#cc33cc"><b>DATA</b></span> member is broken into an indexed
- address; the first nybble gives the index register, or zero for none, and the next
- three nybbles denote the address. Should the size of the memory for the machine grow,
- a bit can be removed from the first nybble and given to the second.</p>
- An illustration of the breakdown of this format is given in the following table:
- <table>
- <tr>
- <th>Format</th>
- <td colspan="6"><span style="color:#ff0000"><b>OPCODE</b></span> </td>
- <td colspan="1"><span style="color:#ff6600"><b>FORMAT</b></span> </td>
- <td colspan="1"><span style="color:#009900"><b>IS_LITERAL</b></span> </td>
- <td colspan="4"><span style="color:#339999"><b>SOURCE</b></span> </td>
- <td colspan="4"><span style="color:#3333ff"><b>DESTINATION</b></span> </td>
- <td colspan="16><span style="color:#cc33cc"><b>DATA</b></span> </td>
- </tr>
- <tr>
- <th rowspan="2">Memory</th>
- <td colspan="6">OP Code</td>
- <td colspan="2">Format</td>
- <td colspan="1">Index?</td>
- <td colspan="3">Register</td>
- <td colspan="1">Index?</td>
- <td colspan="3">Register</td>
- <td colspan="3">IXR</td>
- <td colspan="12">Memory address</td>
- </tr>
- <tr>
- <td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td>
- <td>0</td><td>0</td>
- <td>1</td><td>0</td><td>0</td><td>0</td>
- <td>0</td><td>0</td><td>0</td><td>0</td>
- <td>0</td><td>0</td><td>0</td><td>0</td>
- <td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td>
- </tr>
- <tr>
- <th rowspan="2">Literal</th>
- <td colspan="6">OP Code</td>
- <td colspan="2">Format</td>
- <td colspan="1">Index?</td>
- <td colspan="3">Register</td>
- <td colspan="1">Index?</td>
- <td colspan="3">Register</td>
- <td colspan="16">Literal</td>
- </tr>
- <tr>
- <td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td>
- <td>0</td><td>1</td>
- <td>1</td><td>0</td><td>0</td><td>0</td>
- <td>0</td><td>0</td><td>0</td><td>0</td>
- <td>0</td><td>0</td><td>0</td><td>0</td>
- <td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td>
- </tr>
- <tr>
- <th rowspan="2">HLT/DMP</th>
- <td colspan="6">OP Code</td>
- <td colspan="2">Format</td>
- <td colspan="4">Unused</td>
- <td colspan="4">Unused</td>
- <td colspan="16">Literal</td>
- </tr>
- <tr>
- <td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td>
- <td>0</td><td>1</td>
- <td>0</td><td>0</td><td>0</td><td>0</td>
- <td>0</td><td>0</td><td>0</td><td>0</td>
- <td>0</td><td>0</td><td>0</td><td>0</td>
- <td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td>
- </tr>
- <tr>
- <th rowspan="2">Memory - Memory</th>
- <td colspan="6">OP Code</td>
- <td colspan="2">Format</td>
- <td colspan="1">Index?</td>
- <td colspan="3">Register</td>
- <td colspan="1">Index?</td>
- <td colspan="3">Register</td>
- <td colspan="16">Literal</td>
- </tr>
- <tr>
- <td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td>
- <td>1</td><td>0</td>
- <td>1</td><td>0</td><td>0</td><td>0</td>
- <td>0</td><td>0</td><td>0</td><td>0</td>
- <td>0</td><td>0</td><td>0</td><td>0</td>
- <td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td>
- </tr>
- </table>
- Combinations that can not be used in the above formats include the following:<br>
- <ul>
- <li>Indexed memory with memory: FM,DM,DX; <i>or</i> FM,FX,DM<br></li>
- <li>Indexed memory with indexed memory: FM,FX,DM,DX;</li>
- <li>Literal and indexed memory: FL,DM,DX;</li>
- <li>Dual-destination transfers: FR,DR,DX; <i>or</i> FM,DR,DX<br></li>
- </ul>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement