<?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%3AFloating-Point_Variables</id>
	<title>Z80:Floating-Point Variables - 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%3AFloating-Point_Variables"/>
	<link rel="alternate" type="text/html" href="http://learn.cemetech.net/index.php?title=Z80:Floating-Point_Variables&amp;action=history"/>
	<updated>2026-05-28T18:39:55Z</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:Floating-Point_Variables&amp;diff=74&amp;oldid=prev</id>
		<title>KermMartian: Adjusted lowercase z80</title>
		<link rel="alternate" type="text/html" href="http://learn.cemetech.net/index.php?title=Z80:Floating-Point_Variables&amp;diff=74&amp;oldid=prev"/>
		<updated>2016-02-03T21:00:49Z</updated>

		<summary type="html">&lt;p&gt;Adjusted lowercase z80&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 21:00, 3 February 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;It&#039;s great to be able to do integer math, but at some point, the limitations of 8/16-bit math won&#039;t meet your program&#039;s needs, especially for programs dealing with math/science (it is a calculator, after all). So how does TI perform that fancy math? The answer is with floating point variables. Each floating point variable (Op1, Op2, ... Op6) is a 9-bytes section of RAM used by the OS to perform operations. In this section, we will learn how to interface with these variables.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;= Introduction =&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;It&#039;s great to be able to do integer math, but at some point, the limitations of 8/16-bit math won&#039;t meet your program&#039;s needs, especially for programs dealing with math/science (it is a calculator, after all). So how does TI perform that fancy math? The answer is with floating point variables. Each floating point variable (Op1,Op2,...Op6) is a 9-bytes section of RAM used by the OS to perform operations. In this section, we will learn how to interface with these variables.&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Variable Structure =&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Variable Structure =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l134&quot;&gt;Line 134:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 130:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For the full list of floating point ROM calls, see&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For the full list of floating point ROM calls, see&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;http://wikiti.brandonw.net/index.php?title=Category:83Plus:BCALLs:By_Name:FP_Math&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;http://wikiti.brandonw.net/index.php?title=Category:83Plus:BCALLs:By_Name:FP_Math&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{lowercase}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Z80 Assembly]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Z80 Heaven]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>KermMartian</name></author>
	</entry>
	<entry>
		<id>http://learn.cemetech.net/index.php?title=Z80:Floating-Point_Variables&amp;diff=34&amp;oldid=prev</id>
		<title>KermMartian: Created page with &quot;  = Introduction =  It&#039;s great to be able to do integer math, but at some point, the limitations of 8/16-bit math won&#039;t meet your program&#039;s needs, especially for programs deal...&quot;</title>
		<link rel="alternate" type="text/html" href="http://learn.cemetech.net/index.php?title=Z80:Floating-Point_Variables&amp;diff=34&amp;oldid=prev"/>
		<updated>2016-02-03T16:12:42Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;  = Introduction =  It&amp;#039;s great to be able to do integer math, but at some point, the limitations of 8/16-bit math won&amp;#039;t meet your program&amp;#039;s needs, especially for programs deal...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s great to be able to do integer math, but at some point, the limitations of 8/16-bit math won&amp;#039;t meet your program&amp;#039;s needs, especially for programs dealing with math/science (it is a calculator, after all). So how does TI perform that fancy math? The answer is with floating point variables. Each floating point variable (Op1,Op2,...Op6) is a 9-bytes section of RAM used by the OS to perform operations. In this section, we will learn how to interface with these variables.&lt;br /&gt;
&lt;br /&gt;
= Variable Structure =&lt;br /&gt;
&lt;br /&gt;
Because the floating point variables are 9 bytes, their must be a standard layout for processing them in an 8-bit processor. It is as such:&lt;br /&gt;
&lt;br /&gt;
== Byte 0: Type ==&lt;br /&gt;
&lt;br /&gt;
This is for all the &amp;quot;definitions&amp;quot; of what&amp;#039;s contained in the variable. Floating point variables are used for more than just math, they are also used to reference objects (programs, real/complex vars, matrices, etc.). So, this byte defines what is being looked at.&lt;br /&gt;
&lt;br /&gt;
Bit 0-4: Object type&lt;br /&gt;
Bit 5/6: Not used?&lt;br /&gt;
Bit 7: Sign. 1 = negative, 0 = positive&lt;br /&gt;
&lt;br /&gt;
The object type is a 5-bit that has been pre-defined by the OS. Here&amp;#039;s a table of known definitions and their equates. Chances are you&amp;#039;ll never use most of these, and some of these should never be used.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!! Objects !! Equate !! Notes&lt;br /&gt;
|-&lt;br /&gt;
|| RealObj || $00 || Real number&lt;br /&gt;
|-&lt;br /&gt;
|| ListObj  || $01 || Real List&lt;br /&gt;
|-&lt;br /&gt;
|| MatObj  || $02 || Matrix&lt;br /&gt;
|-&lt;br /&gt;
|| EquObj || $03 || Equation (Y=...)&lt;br /&gt;
|-&lt;br /&gt;
|| StrngObj || $04 || String&lt;br /&gt;
|-&lt;br /&gt;
|| ProgObj   || $05 || Program&lt;br /&gt;
|-&lt;br /&gt;
|| ProtProgObj  || $06 || Protected Program&lt;br /&gt;
|-&lt;br /&gt;
|| PictObj  || $07 || Picture&lt;br /&gt;
|-&lt;br /&gt;
|| GDBObj  || $08 || Graphical Database&lt;br /&gt;
|-&lt;br /&gt;
|| UnknownObj || $09 || ?&lt;br /&gt;
|-&lt;br /&gt;
|| UnknownEquObj || $0A || ?&lt;br /&gt;
|-&lt;br /&gt;
|| NewEquObj || $0B || ?&lt;br /&gt;
|-&lt;br /&gt;
|| CplxObj  || $0C || Complex Number&lt;br /&gt;
|-&lt;br /&gt;
|| CListObj  || $0D || Complex List&lt;br /&gt;
|-&lt;br /&gt;
|| UndefObj  ||  $0E || ?&lt;br /&gt;
|-&lt;br /&gt;
|| WindowObj  ||  $0F || ?&lt;br /&gt;
|-&lt;br /&gt;
|| ZStoObj || $10 || ?&lt;br /&gt;
|-&lt;br /&gt;
|| TblRngObj  || $11 || ?&lt;br /&gt;
|-&lt;br /&gt;
|| LCDObj  ||  $12 || ?&lt;br /&gt;
|-&lt;br /&gt;
|| BackupObj  ||  $13 || ?&lt;br /&gt;
|-&lt;br /&gt;
|| AppObj	|| $14 || application, only used in menus/link&lt;br /&gt;
|-&lt;br /&gt;
|| AppVarObj ||  $15 || application variable&lt;br /&gt;
|-&lt;br /&gt;
|| TempProgObj ||  $16 || program, home deletes when finished&lt;br /&gt;
|-&lt;br /&gt;
|| GroupObj  || $17 || group&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Depending on the type of object held, the rest of the objects are used differently. Below we will explore the most common objects.&lt;br /&gt;
&lt;br /&gt;
== Real Objects ==&lt;br /&gt;
&lt;br /&gt;
=== Byte 1: Exponent ===&lt;br /&gt;
&lt;br /&gt;
This holds the exponent of the object. The byte is treated as a signed 8-bit integer, except in a strange fashion. $80 is zero, $81-$FF are positive exponents ($81 = 1, $FF = 127), and $00-$7F are negative exponents ($00 = -128, $7F = -1).&lt;br /&gt;
&lt;br /&gt;
=== Byte 2-8: Data ===&lt;br /&gt;
&lt;br /&gt;
The rest of the bytes are used to hold the data. Each nibble represents the &amp;quot;decimal&amp;quot; digit. The value is treated in scientific notation.&lt;br /&gt;
&lt;br /&gt;
Ex.: $00,$80,$31,$41,$59,$26,$54,$00 represents a real value 3.14159265400&lt;br /&gt;
&lt;br /&gt;
== Complex Objects ==&lt;br /&gt;
&lt;br /&gt;
Complex objects take up two floating point variables. The first one is the real part, and the second one (immediately following) is the complex part. Both must contain the complex object token. For data structuring, see above (real objects).&lt;br /&gt;
&lt;br /&gt;
Ex.:&lt;br /&gt;
$0C, $7E, $22, $09, $78, $47, $30, $00, $00  ;OP1 0.0220978473 - 0.0012565562i&lt;br /&gt;
$8C, $7D, $12, $56, $55, $62, $00, $00, $00  ;OP2&lt;br /&gt;
&lt;br /&gt;
== List Objects (Complex &amp;amp; Real) ==&lt;br /&gt;
&lt;br /&gt;
=== Byte 1: List Token ===&lt;br /&gt;
&lt;br /&gt;
This holds the list token, tVarLst = $5D.&lt;br /&gt;
&lt;br /&gt;
=== Byte 2-7: Name ===&lt;br /&gt;
&lt;br /&gt;
Holds the list name. This is either Null-terminating, or limited to 5 characters.&lt;br /&gt;
&lt;br /&gt;
Ex.:&lt;br /&gt;
.db $01,$5D,&amp;quot;HELLO&amp;quot;    ; Real list with name HELLO&lt;br /&gt;
.db $0D,$5D,tL1,0          ; Complex list with name L1 (token)&lt;br /&gt;
&lt;br /&gt;
=== Byte 8: Unused ===&lt;br /&gt;
&lt;br /&gt;
I believe this is unused, but to be safe you might want to set this to 0 if your list is 5 characters long.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Program Objects (Protected/Unprotected) ==&lt;br /&gt;
&lt;br /&gt;
Bytes 1-8 contain a null-terminating string with the name of the program, or if using all 8 characters, the null character can be omitted.&lt;br /&gt;
&lt;br /&gt;
== Matrix Objects ==&lt;br /&gt;
&lt;br /&gt;
Byte 1 always contains tVarMat = $5C. This is because the matrix token is 2 bytes. Byte 2 contains one of the tokens tMatA = $00 to tMatJ = $09. Byte 3 is always 0, and the rest can be undefined.&lt;br /&gt;
&lt;br /&gt;
== String Objects ==&lt;br /&gt;
&lt;br /&gt;
Like matrices, byte 1 contains the first string token tVarStrng = $AA. Byte 2 contains a token tStr1 = $00 to tStr0 = $09. Byte 3 must be 0, and the rest can be undefined.&lt;br /&gt;
&lt;br /&gt;
== Picture Objects ==&lt;br /&gt;
&lt;br /&gt;
Similar to matrices/strings. The first byte is tVarPict = $60, and the second bytes contains tPic1 = $00 through tPic0 = $09.&lt;br /&gt;
&lt;br /&gt;
= ROM Calls =&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;ve tried doing anything with floating point math on your own, you&amp;#039;d probably figured out that it&amp;#039;s not easy to do math on a 9-byte variable when your CPU can only work with 8/16 at a time. And TI has also written all the code necessary for floating point arithmetic. All we need to do is plug in the inputs and let the outputs pour forth.&lt;br /&gt;
&lt;br /&gt;
For the full list of floating point ROM calls, see&lt;br /&gt;
http://wikiti.brandonw.net/index.php?title=Category:83Plus:BCALLs:By_Name:FP_Math&lt;/div&gt;</summary>
		<author><name>KermMartian</name></author>
	</entry>
</feed>