shithub: rgbds

ref: 34656f9e5dcbeb5ca36dc812141ddd7a233da43d
dir: /doc/asm/equs.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 EQUS</title>
        <link rel="stylesheet" type="text/css" href="../style.css">
</head>
<body>
<h1>EQUS</h1>
<p>EQUS is used to define string-symbols. Wherever the assembler meets a string symbol its name is replaced with its value. If you are familiar with C you can think of it as the same as #define.</p>
<pre>COUNTREG EQUS "[hl+]"
          
         ld   a,COUNTREG</pre>
<p>(Note that : following the label-name is not allowed.)</p>
<p>This will be interpreted as:</p>
<pre>         ld   a,[hl+]</pre>
<p>String-symbols can also be used to define small one-line macros:</p>
<pre>PUSHA    EQUS "push af\npush bc\npush de\npush hl\n"</pre>
<p>Note that a colon (:) following the label-name is not allowed. String equates can't be exported or imported.</p>
<h1>See also:</h1>
<ul>
	<li><a href="expr_str.htm">String expressions, functions and formatting</a>
</ul>
<hr>
<p>Last updated 21 June 1997 by <a href="mailto:[email protected]">Carsten Sorensen</a></p>
</body>
</html>