<?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%3AVAR%2FTVAR%2FTEMPVAR</id>
	<title>Z80:Directives:VAR/TVAR/TEMPVAR - 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%3AVAR%2FTVAR%2FTEMPVAR"/>
	<link rel="alternate" type="text/html" href="http://learn.cemetech.net/index.php?title=Z80:Directives:VAR/TVAR/TEMPVAR&amp;action=history"/>
	<updated>2026-05-19T08:53:38Z</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:VAR/TVAR/TEMPVAR&amp;diff=239&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:VAR/TVAR/TEMPVAR&amp;diff=239&amp;oldid=prev"/>
		<updated>2016-02-05T17:46:42Z</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 is another way to declare a label, designed to make adding variables which point to some location of safe RAM easier. The size argument is in bytes - 1 declares a byte, 2 a word, 324 a 324 byte region. The name is just any old label name (local label rules still apply!)&lt;br /&gt;
&lt;br /&gt;
Available types are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!! Type !! Description !! Size !! Castable !! Definable &lt;br /&gt;
|-&lt;br /&gt;
| byte || Signed byte || 1 || Yes || Yes &lt;br /&gt;
|-&lt;br /&gt;
| ubyte || Unsigned byte || 1 || Yes || Yes &lt;br /&gt;
|-&lt;br /&gt;
| asc || ASCII character || 1 || Yes || Yes &lt;br /&gt;
|-&lt;br /&gt;
| word || Signed word || 2 || Yes || Yes &lt;br /&gt;
|-&lt;br /&gt;
| uword || Unsigned word || 2 || Yes || Yes &lt;br /&gt;
|-&lt;br /&gt;
| int || Signed integer || 4 || Yes || Yes &lt;br /&gt;
|-&lt;br /&gt;
| uint || Unsigned integer|| 4 || Yes || Yes &lt;br /&gt;
|-&lt;br /&gt;
| fpX.Y || Signed fixed-point number|| Variable || Yes || Yes &lt;br /&gt;
|-&lt;br /&gt;
| ufpX.Y || Unsigned fixed-point number || Variable || Yes || Yes &lt;br /&gt;
|-&lt;br /&gt;
| tifloat || TI floating-point number|| 9 || No || Yes &lt;br /&gt;
|-&lt;br /&gt;
| Any Structure|| User-defined structure|| Variable || || &lt;br /&gt;
|}&lt;br /&gt;
	&lt;br /&gt;
You can also declare instances of structures (see the [[Z80:Directives:STRUCT/ENDSTRUCT|struct/endstruct]] for more information).&lt;br /&gt;
&lt;br /&gt;
Fixed-point variables are sized depending on which values you specify for X and Y. For example, fp8.8 is a 16-bit fixed point number, with 8 bits for the integer part and 8 bits for the fractional part. fp16.8 would have 16 bits in the integer part and 8 in the fractional part, 24-bits (3 bytes) total.&lt;br /&gt;
&lt;br /&gt;
Variables defined using .tempvar or .tvar are designed for temporary variables. Temporary variables defined in one module can potentially overwrite temporary variables defined in another module (as long as the modules do not overlap - for example, if one module is a child of the other).&lt;br /&gt;
&lt;br /&gt;
You can declare an array of variables using square brackets and a size - for example:&lt;br /&gt;
&lt;br /&gt;
    .var fp8.8[256], TrigTable&lt;br /&gt;
&lt;br /&gt;
This would declare an variable 512 bytes in size (fp8.8 would be 2 bytes per variable).&lt;br /&gt;
&lt;br /&gt;
See [[Z80:Directives:VARLOC|varloc]] for examples.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
    .var size|type, name&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:STRUCT/ENDSTRUCT|struct/endstruct]]&lt;br /&gt;
[[Z80:Directives:VARLOC|varloc]]&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>