<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://learn.cemetech.net/index.php?action=history&amp;feed=atom&amp;title=Z80%3ADirectives%3AVARLOC</id>
	<title>Z80:Directives:VARLOC - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://learn.cemetech.net/index.php?action=history&amp;feed=atom&amp;title=Z80%3ADirectives%3AVARLOC"/>
	<link rel="alternate" type="text/html" href="http://learn.cemetech.net/index.php?title=Z80:Directives:VARLOC&amp;action=history"/>
	<updated>2026-05-19T09:36:02Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.3</generator>
	<entry>
		<id>http://learn.cemetech.net/index.php?title=Z80:Directives:VARLOC&amp;diff=237&amp;oldid=prev</id>
		<title>Maintenance script: Initial automated import</title>
		<link rel="alternate" type="text/html" href="http://learn.cemetech.net/index.php?title=Z80:Directives:VARLOC&amp;diff=237&amp;oldid=prev"/>
		<updated>2016-02-05T17:42:15Z</updated>

		<summary type="html">&lt;p&gt;Initial automated import&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This directive is to used with the directive [[Z80:Directives:VAR/TVAR/TEMPVAR|var/tvar/tempvar]] to create a bunch of labels which point to variables in areas of memory without you having to manually calculate the offsets in memory yourself.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
    .define safe_ram $CED5&lt;br /&gt;
    .varloc safe_ram, 128 ; We have 128 bytes of safe RAM here&lt;br /&gt;
    .var byte, me_x&lt;br /&gt;
    .var byte, me_y&lt;br /&gt;
    .var word, me_dx&lt;br /&gt;
    .var word, me_dy&lt;br /&gt;
    .var byte, me_s&lt;br /&gt;
&lt;br /&gt;
Each time you use .varloc, you add a new possible area of memory to be used. For example:&lt;br /&gt;
&lt;br /&gt;
    .define safe_ram_1 $CED5&lt;br /&gt;
    .define safe_ram_2 $F000&lt;br /&gt;
    &lt;br /&gt;
    .varloc safe_ram_1, 128 ; 128 bytes here&lt;br /&gt;
    .varloc safe_ram_2, 256 ; 256 bytes here&lt;br /&gt;
    &lt;br /&gt;
    .var 2,   word_test ; Could go in either area&lt;br /&gt;
    .var 204, big_area  ; Has to go in safe_ram_2&lt;br /&gt;
    .var 100, other_big ; Has to go in safe_ram_1, now!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Allowed inputs ===&lt;br /&gt;
&lt;br /&gt;
== Uses ==&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
[[Z80:Directives:VAR/TVAR/TEMPVAR|var/tvar/tempvar]]&lt;br /&gt;
&lt;br /&gt;
{{lowercase}}&lt;br /&gt;
[[Category:Z80 Assembly]]&lt;br /&gt;
[[Category:Z80 Heaven]]&lt;br /&gt;
[[Category:Z80 Directives]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>