This repository has been archived on 2022-08-01. You can view files and clone it, but cannot push or open issues or pull requests.
150ASM-Emulator/doc/html/emulator_8h.html

742 lines
35 KiB
HTML
Raw Permalink Normal View History

2020-06-23 21:56:38 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>SCC.150 Assembler Emulator: /home/rumperuu/Documents/University/University Work/SCC.150 Digital Systems/Coursework/unr-C/SCC.150 Assembler Emulator/source/emulator.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">SCC.150 Assembler Emulator
</div>
<div id="projectbrief">A compiler for a simple assembler language</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>Globals</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_b2f33c71d4aa5e7af42a1ca61ff5af1b.html">source</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">emulator.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;stdio.h&gt;</code><br/>
<code>#include &lt;stdlib.h&gt;</code><br/>
<code>#include &lt;stdbool.h&gt;</code><br/>
</div>
<p><a href="emulator_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:aad2f1b717992001ef1934f168b316e70"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aad2f1b717992001ef1934f168b316e70"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>MAX_PROG_LEN</b>&#160;&#160;&#160;99</td></tr>
<tr class="separator:aad2f1b717992001ef1934f168b316e70"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a09a3b394b8602092d58347b791158062"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a09a3b394b8602092d58347b791158062"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>MAX_LINE_LEN</b>&#160;&#160;&#160;80</td></tr>
<tr class="separator:a09a3b394b8602092d58347b791158062"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa7be7b66f5e5c14463a0f09790fbfbd5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa7be7b66f5e5c14463a0f09790fbfbd5"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>MAX_OPCODE</b>&#160;&#160;&#160;10</td></tr>
<tr class="separator:aa7be7b66f5e5c14463a0f09790fbfbd5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af79ab75f761ab93113eeca724d809ce4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af79ab75f761ab93113eeca724d809ce4"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>MAX_REGISTER</b>&#160;&#160;&#160;4</td></tr>
<tr class="separator:af79ab75f761ab93113eeca724d809ce4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1b05dbe077d74072fcaa03bf2940af64"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1b05dbe077d74072fcaa03bf2940af64"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>OPCODE_LENGTH</b>&#160;&#160;&#160;3</td></tr>
<tr class="separator:a1b05dbe077d74072fcaa03bf2940af64"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a25f40fb7595d797ba48b360ceb962387"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a25f40fb7595d797ba48b360ceb962387"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>ARG_LENGTH</b>&#160;&#160;&#160;4</td></tr>
<tr class="separator:a25f40fb7595d797ba48b360ceb962387"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abb0ffe51f3d9eb582eca011b61ba76fb"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abb0ffe51f3d9eb582eca011b61ba76fb"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>OPCODE</b>&#160;&#160;&#160;0</td></tr>
<tr class="separator:abb0ffe51f3d9eb582eca011b61ba76fb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6e9f80720a3b58c16d87ad9fed8147f3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6e9f80720a3b58c16d87ad9fed8147f3"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>ARG1</b>&#160;&#160;&#160;1</td></tr>
<tr class="separator:a6e9f80720a3b58c16d87ad9fed8147f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0f928d4a2f0889f390fdd9efab797dad"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0f928d4a2f0889f390fdd9efab797dad"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>ARG2</b>&#160;&#160;&#160;2</td></tr>
<tr class="separator:a0f928d4a2f0889f390fdd9efab797dad"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a00e5e1b7c08d6368342756805800133b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#a00e5e1b7c08d6368342756805800133b">opcodeNOP</a> (char *opcode, char *arg1, char *arg2)</td></tr>
<tr class="separator:a00e5e1b7c08d6368342756805800133b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5d6aac425624196dcd0d278760270d00"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#a5d6aac425624196dcd0d278760270d00">opcodeSET</a> (char *opcode, char *arg1, char *arg2)</td></tr>
<tr class="separator:a5d6aac425624196dcd0d278760270d00"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a434bd1e8b4e45503586891e565138b84"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#a434bd1e8b4e45503586891e565138b84">opcodeAND</a> (char *opcode, char *arg1, char *arg2)</td></tr>
<tr class="separator:a434bd1e8b4e45503586891e565138b84"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a54c12a24203abe192fe4f727ea9ffe60"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#a54c12a24203abe192fe4f727ea9ffe60">opcodeOR</a> (char *opcode, char *arg1, char *arg2)</td></tr>
<tr class="separator:a54c12a24203abe192fe4f727ea9ffe60"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a501fe22548fd568d37522ba76ff2c1e7"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#a501fe22548fd568d37522ba76ff2c1e7">opcodeADD</a> (char *opcode, char *arg1, char *arg2)</td></tr>
<tr class="separator:a501fe22548fd568d37522ba76ff2c1e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3ead6beddb4488ab700a81968e30e11c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#a3ead6beddb4488ab700a81968e30e11c">opcodeSUB</a> (char *opcode, char *arg1, char *arg2)</td></tr>
<tr class="separator:a3ead6beddb4488ab700a81968e30e11c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3cdb2ee632bc1b19d885c26b044d76ae"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#a3cdb2ee632bc1b19d885c26b044d76ae">opcodeSHL</a> (char *opcode, char *arg1, char *arg2)</td></tr>
<tr class="separator:a3cdb2ee632bc1b19d885c26b044d76ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6f1fa1ff65a606afddb458fcd64449cf"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#a6f1fa1ff65a606afddb458fcd64449cf">opcodeSHR</a> (char *opcode, char *arg1, char *arg2)</td></tr>
<tr class="separator:a6f1fa1ff65a606afddb458fcd64449cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a734105640ec0f0c1e6dc8c5384b2d1d0"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#a734105640ec0f0c1e6dc8c5384b2d1d0">opcodeJMP</a> (char *opcode, char *arg1, char *arg2)</td></tr>
<tr class="separator:a734105640ec0f0c1e6dc8c5384b2d1d0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeb406b3428b5429249ab2c7e3d7bcc3c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#aeb406b3428b5429249ab2c7e3d7bcc3c">opcodePRT</a> (char *opcode, char *arg1, char *arg2)</td></tr>
<tr class="separator:aeb406b3428b5429249ab2c7e3d7bcc3c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae7178313a4254c62afc060814ebca038"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#ae7178313a4254c62afc060814ebca038">getArg2</a> (char *arg2)</td></tr>
<tr class="separator:ae7178313a4254c62afc060814ebca038"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a40c9c476ef53a0c955d3e633b54d2bd2"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#a40c9c476ef53a0c955d3e633b54d2bd2">isValid</a> (char *opcode, char *arg1, char *arg2)</td></tr>
<tr class="separator:a40c9c476ef53a0c955d3e633b54d2bd2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6b5c26779c71916073e7b8f9debea56d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#a6b5c26779c71916073e7b8f9debea56d">execInstruction</a> (char *instruction)</td></tr>
<tr class="separator:a6b5c26779c71916073e7b8f9debea56d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2bbc98d3653ad65ad12757dfa7bdfdd4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#a2bbc98d3653ad65ad12757dfa7bdfdd4">execProgram</a> ()</td></tr>
<tr class="separator:a2bbc98d3653ad65ad12757dfa7bdfdd4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d30edda62d5695ffaa3b62121d4bf98"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#a3d30edda62d5695ffaa3b62121d4bf98">loadProgram</a> ()</td></tr>
<tr class="separator:a3d30edda62d5695ffaa3b62121d4bf98"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><dl class="section author"><dt>Author</dt><dd>Ben Goldsworthy (rumps) <a href="#" onclick="location.href='mai'+'lto:'+'bgo'+'ld'+'swo'+'rt'+'hy9'+'6@'+'gma'+'il'+'.co'+'m'; return false;">bgold<span style="display: none;">.nosp@m.</span>swor<span style="display: none;">.nosp@m.</span>thy96<span style="display: none;">.nosp@m.</span>@gma<span style="display: none;">.nosp@m.</span>il.co<span style="display: none;">.nosp@m.</span>m</a> </dd></dl>
<dl class="section version"><dt>Version</dt><dd>1.0</dd></dl>
<h1><a class="anchor" id="LICENSE"></a>
LICENSE</h1>
<p>This file is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.</p>
<p>This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p>
<p>You should have received a copy of the GNU General Public License along with this program. If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.</p>
<h1><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h1>
<p>Header file for <code><a class="el" href="emulator_8c.html">emulator.c</a></code>. </p>
</div><h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a6b5c26779c71916073e7b8f9debea56d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int execInstruction </td>
<td>(</td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>instruction</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Executes an instruction.</p>
<p>Tests the validity of an instruction (and whether or not it's a comment), and if the line passes, calls the appropriate function.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">instruction</td><td>the instruction to test </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on failure </dd></dl>
</div>
</div>
<a class="anchor" id="a2bbc98d3653ad65ad12757dfa7bdfdd4"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int execProgram </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Executes an the program.</p>
<p>Runs <code>execInstruction</code> on each line of the program in turn.</p>
<dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on failure </dd></dl>
</div>
</div>
<a class="anchor" id="ae7178313a4254c62afc060814ebca038"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int getArg2 </td>
<td>(</td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>arg2</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>A function to return the value in the second argument of an instruction.</p>
<p>Returns either the value in the indicated register or, as the instruction is parsed as a string, the integer value given. <code><a class="el" href="mystring_8c.html#a70913f883a62585fb8fe025aa1e56749">mystrncmp()</a></code> is used over <code><a class="el" href="mystring_8c.html#a3dab99f21a63ee803be3e9344efda0a0">mystrcmp()</a></code> because there tends to be dodgy C string magic tacked on to the end of the args.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">arg2</td><td>the value to parse </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>an integer </dd></dl>
</div>
</div>
<a class="anchor" id="a40c9c476ef53a0c955d3e633b54d2bd2"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool isValid </td>
<td>(</td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>opcode</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>arg1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>arg2</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Tests if an instruction is valid.</p>
<p>Tests that the opcode is valid and that the registers are also.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
<tr><td class="paramname">arg2</td><td>the second argument (not applicable for <code>PRT</code>) </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the string is valid, <code>false</code> if it is not </dd></dl>
</div>
</div>
<a class="anchor" id="a3d30edda62d5695ffaa3b62121d4bf98"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int loadProgram </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Loads a program.</p>
<p>Loads the program file and reads each line into an array.</p>
<dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on failure </dd></dl>
</div>
</div>
<a class="anchor" id="a501fe22548fd568d37522ba76ff2c1e7"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int opcodeADD </td>
<td>(</td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>opcode</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>arg1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>arg2</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>A function to handle the <code>ADD</code> opcode</p>
<p>Performs addition on the values in <code>arg1</code> and <code>arg2</code>, storing the result in <code>arg1</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
<tr><td class="paramname">arg2</td><td>the second argument </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
</div>
</div>
<a class="anchor" id="a434bd1e8b4e45503586891e565138b84"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int opcodeAND </td>
<td>(</td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>opcode</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>arg1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>arg2</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>A function to handle the <code>AND</code> opcode</p>
<p>Performs a bitwise AND on the values in <code>arg1</code> and <code>arg2</code>, storing the result in <code>arg1</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
<tr><td class="paramname">arg2</td><td>the second argument </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
</div>
</div>
<a class="anchor" id="a734105640ec0f0c1e6dc8c5384b2d1d0"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int opcodeJMP </td>
<td>(</td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>opcode</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>arg1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>arg2</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>A function to handle the <code>JMP</code> opcode</p>
<p>If <code>REGX</code> contains 0, jumps to the line indicated by <code>arg1</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
<tr><td class="paramname">arg2</td><td>the second argument (not applicable for <code>JMP</code>) </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
</div>
</div>
<a class="anchor" id="a00e5e1b7c08d6368342756805800133b"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int opcodeNOP </td>
<td>(</td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>opcode</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>arg1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>arg2</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>A function to handle the <code>NOP</code> opcode</p>
<p>Increments the instruction pointer <code>INSP</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
<tr><td class="paramname">arg1</td><td>the first argument (not applicable for <code>NOP</code>) </td></tr>
<tr><td class="paramname">arg2</td><td>the second argument (not applicable for <code>NOP</code>) </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
</div>
</div>
<a class="anchor" id="a54c12a24203abe192fe4f727ea9ffe60"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int opcodeOR </td>
<td>(</td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>opcode</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>arg1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>arg2</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>A function to handle the <code>OR</code> opcode</p>
<p>Performs a bitwise OR on the values in <code>arg1</code> and <code>arg2</code>, storing the result in <code>arg1</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
<tr><td class="paramname">arg2</td><td>the second argument </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
</div>
</div>
<a class="anchor" id="aeb406b3428b5429249ab2c7e3d7bcc3c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int opcodePRT </td>
<td>(</td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>opcode</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>arg1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>arg2</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>A function to handle the <code>PRT</code> opcode</p>
<p>Prints the value in the register indicated in <code>arg1</code>, or the integer value specified.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
<tr><td class="paramname">arg2</td><td>the second argument (not applicable for <code>PRT</code>) </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
</div>
</div>
<a class="anchor" id="a5d6aac425624196dcd0d278760270d00"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int opcodeSET </td>
<td>(</td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>opcode</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>arg1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>arg2</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>A function to handle the <code>SET</code> opcode</p>
<p>Gets the value of either the register or integer set in <code>arg2</code> and places it in the register indicated by <code>arg1</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
<tr><td class="paramname">arg2</td><td>the second argument </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
</div>
</div>
<a class="anchor" id="a3cdb2ee632bc1b19d885c26b044d76ae"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int opcodeSHL </td>
<td>(</td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>opcode</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>arg1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>arg2</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>A function to handle the <code>SHL</code> opcode</p>
<p>Performs a bitwise shift left on the value in <code>arg1</code>, storing the result in <code>arg1</code>. The number of shifts is specified in <code>arg2</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
<tr><td class="paramname">arg2</td><td>the second argument </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
</div>
</div>
<a class="anchor" id="a6f1fa1ff65a606afddb458fcd64449cf"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int opcodeSHR </td>
<td>(</td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>opcode</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>arg1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>arg2</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>A function to handle the <code>SHR</code> opcode</p>
<p>Performs a bitwise shift right on the value in <code>arg1</code>, storing the result in <code>arg1</code>. The number of shifts is specified in <code>arg2</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
<tr><td class="paramname">arg2</td><td>the second argument </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
</div>
</div>
<a class="anchor" id="a3ead6beddb4488ab700a81968e30e11c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int opcodeSUB </td>
<td>(</td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>opcode</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>arg1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>arg2</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>A function to handle the <code>SUB</code> opcode</p>
<p>Subtracts the value in <code>arg2</code> from the value in <code>arg1</code>, storing the result in <code>arg1</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
<tr><td class="paramname">arg2</td><td>the second argument </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue May 19 2015 20:34:54 for SCC.150 Assembler Emulator by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>