shithub: rgbds

ref: 97a31c8fc07e419b783cc2610251acb4856adc43
dir: /doc/asm/rs.htm/

View raw version
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>xAsm RSSET, RSRESET, RB, RW</title>
        <link rel="stylesheet" type="text/css" href="../style.css">
</head>
<body>
<h1>RSSET, RERESET, RB, RW</h1>
<p>The <dfn>RS</dfn> group of commands is a handy way of defining structures:</p>
<pre>              RSRESET
str_pStuff    RW   1
str_tData     RB   256
str_bCount    RB   1
str_SIZEOF    RB   0</pre>
<p>The example defines four <a href="equ.htm">equated</a> symbols:</p>
<table>
	<caption>Defined symbols</caption>
<thead>
<tr>
	<th scope="col">Name</th>
	<th scope="col">Value</th>
</tr>
</thead>
<tr>
	<td>str_pStuff</td>
	<td>0</td>
</tr>
<tr>
	<td>str_tData</td>
	<td>2</td>
</tr>
<tr>
	<td>str_bCount</td>
	<td>258</td>
</tr>
<tr>
	<td>str_SIZEOF</td>
	<td>259</td>
</tr>
</table>
<p>There are four commands in the RS group of commands:</p>
<table>
	<caption>RS related commands</caption>
<thead>
<tr>
	<th scope="col">Command</th>
	<th scope="col">Meaning</th>
</tr>
</thead>
<tr>
	<td>RSRESET</td>
	<td>Resets the <a href="presym.htm">_RS</a> counter to zero</td>
</tr>
<tr>
	<td>RSSET <i>constexpr</i></td>
	<td>Sets the <a href="presym.htm">_RS</a> counter to <i>constexpr</i></td>
</tr>
<tr>
	<td>RB <i>constexpr</i></td>
	<td>Sets the preceding symbol to <a href="presym.htm">_RS</a> and adds <i>constexpr</i> to _RS</td>
</tr>
<tr>
	<td>RW <i>constexpr</i></td>
	<td>Sets the preceding symbol to <a href="presym.htm">_RS</a> and adds <i>constexpr*2</i> to _RS</td>
</tr>
</table>
<p>Note that a colon (:) following the symbol-name is not allowed. RS symbols can be exported and imported. They don't change their value during the link process.</p>
<h1>See also:</h1>
<ul>
<li><a href="expr_int.htm">Integer and Boolean expressions</a>
</ul>
<hr>
<p>Last updated 21 June 1997 by <a href="mailto:[email protected]">Carsten Sorensen</a></p>
</body>
</html>