<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://wikiti.brandonw.net/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wikiti.brandonw.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jim+e</id>
		<title>WikiTI - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wikiti.brandonw.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jim+e"/>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Special:Contributions/Jim_e"/>
		<updated>2026-04-28T16:42:33Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.23.5</generator>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=Talk:83Plus:Ports:08</id>
		<title>Talk:83Plus:Ports:08</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Talk:83Plus:Ports:08"/>
				<updated>2008-01-01T08:25:08Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Interrupts==&lt;br /&gt;
If the link assistant generates interrupts, does that mean that one needs to setup an IM2 interrupt routine to handle them or is there another way to use it? [[User:Saibot84|Saibot84]] 11:49, 27 December 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
:Nope, the 83+SE OS doesn't even seem to bother checking if it generated an interrupt.  I haven't check the 84+ os(that's brandon's job) but I doubt they added any means to specifically support link assist.  You'll need to use IM 2 if the code is running under TI-OS.--[[User:Jim e|Jim e]] 00:25, 1 January 2008 (PST)&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=Talk:83Plus:Ports:09</id>
		<title>Talk:83Plus:Ports:09</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Talk:83Plus:Ports:09"/>
				<updated>2008-01-01T08:20:52Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==84+SE==&lt;br /&gt;
According to the comments section, this port only exists on the 83+SE and 84+. Was the exclusion of the 84+SE intentional? If the answer is unknown, since I have an 84+SE, is there a way I can verify this with my calc w/o crashing it? [[User:Saibot84|Saibot84]] 11:52, 27 December 2007 (PST)&lt;br /&gt;
: Everything except the original 83+ has this link assist. Usually it's split between &amp;quot;the original 83+&amp;quot; and &amp;quot;everything else&amp;quot;, except the clock and USB hardware, which are 84+ and 84+SE only. [[User:Brandonw|Brandonw]] 09:22, 31 December 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
::There was no intention to exclude it, it just seemed obviously included being that the only difference between the 84+ and the 84+SE is the flash chip. Then again, WikiTI doesn't really have anything laid out dictating what hardware each model has. 83+ does have its own inferior  link assist, but its significantly different from this one. --[[User:Jim e|Jim e]] 00:20, 1 January 2008 (PST)&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=Talk:WikiTI_Home</id>
		<title>Talk:WikiTI Home</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Talk:WikiTI_Home"/>
				<updated>2007-09-22T03:50:50Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: Searching&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Discussion =&lt;br /&gt;
What do you think about this wiki?&lt;br /&gt;
&lt;br /&gt;
== More! ==&lt;br /&gt;
&lt;br /&gt;
I think it needs information on more calculators than just the Ti-83+ series, and general assembly information (like a good cathegorized tutorial overview for instance) wouldn't hurt either, I think :)&lt;br /&gt;
&lt;br /&gt;
Timendus&lt;br /&gt;
&lt;br /&gt;
== I hope we can do that soon ==&lt;br /&gt;
&lt;br /&gt;
Just, we don't want to waste time getting it all set up for that and have no one use it. If we see a lot of people milling around here, contributing, then by all means, we'll expand. But one thing we '''DON'T''' want to do is mirror 28 Days. We can link TO it, but we don't want it actually here.&lt;br /&gt;
&lt;br /&gt;
--[[User:AndyJ|AndyJ]] 06:50, 27 Mar 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
== Categories ==&lt;br /&gt;
&lt;br /&gt;
On many pages, there is now a sizable blank space at the top due to several lines of category links.  What, if anything, should we do about this? [[User:FloppusMaximus|FloppusMaximus]] 19:06, 29 Mar 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
== Move them? ==&lt;br /&gt;
&lt;br /&gt;
Move the Category links to the bottom should do it. :) That, or put them all on one line.&lt;br /&gt;
&lt;br /&gt;
--[[User:AndyJ|AndyJ]] 19:07, 29 Mar 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
:Yeah, that sounds like a good idea. :) [[User:FloppusMaximus|FloppusMaximus]] 20:18, 29 Mar 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
:: I think I officially qualify as a robot now.  You can tell I was getting tired towards the end, as I missed the minor-edit button a few times... sorry about that... [[User:FloppusMaximus|FloppusMaximus]] 21:28, 29 Mar 2005 (PST)&lt;br /&gt;
:: Actually, I was going to just mod the php code to fix this bug....keeping the category tags on the top might be a good idea actually. (JasonM)&lt;br /&gt;
:::That might still be a good idea. [[User:FloppusMaximus|FloppusMaximus]] 13:18, 3 Apr 2005 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Caching ==&lt;br /&gt;
&lt;br /&gt;
Is it just me, or are there some serious caching problems here?&lt;br /&gt;
[[User:FloppusMaximus|FloppusMaximus]] 21:32, 1 Apr 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
: In particular?  --[[User:Dan Englender|Dan Englender]] 21:42, 1 Apr 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
:: Ya, the wiki seems to have weird caching problems, especially since it appears the reload the page every time, even if it doesn't get changes. I don't know what's up. --[[User:AndyJ|AndyJ]] 22:35, 1 Apr 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
::: Considering the dynamic nature of a wiki (a page could be edited, at pretty much any time), I wouldn't mind not having it cached. (Though I would personally disable browser caching altogether if firefox would let me... :P ) --[[User:Aquanight|Aquanight]] 22:44, 1 Apr 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
:::: Er... I think I see what you mean... stuff is getting cached when it shouldn't be. (I could've sworn I told firefox to only use 0 KB (aka none) for cache and it's still caching ... argh.) --[[User:Aquanight|Aquanight]] 22:46, 1 Apr 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
::::: I've disabled caching myself as well. Perhaps we should just disable caching altogether? (JasonM)&lt;br /&gt;
&lt;br /&gt;
::::::Caching has been disabled. (JasonM)&lt;br /&gt;
&lt;br /&gt;
::: I found a &amp;quot;Disable Caching&amp;quot; option in Misc. Preferences, if that helps. [[User:Gambit|Gambit]] 00:28, 2 Apr 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
== On Other Calculators ==&lt;br /&gt;
&lt;br /&gt;
Just a random idea I had -- a lot of the ROM calls, RAM addresses, and ports are very similar, if not identical, between the 83 and 83+, and more generally, between all of the Z80 calculators.  For some of them -- [[83Plus:RAM:86D8]] and [[83:RAM:8253]], for instance -- it may be possible to combine the two into a single page, though I'm not sure that would be a good idea, given the potential for confusion.  So here's what I propose instead:&lt;br /&gt;
* For simple things like penRow, we can just have two copies of the page, as there isn't very much to keep synchronized.&lt;br /&gt;
* For more detailed pages such as GetKey, have a brief description with a link -- &amp;quot;This routine waits for the user to press a key and returns it.  It is equivalent to [[83Plus:BCALLs:4972|GetKey]] on the TI-83 Plus.&amp;quot; -- on one page, and the more detailed description on the other.  Not a redirect in this case; I'm talking about a distinct page, which would point out the different call points and RAM addresses; in the case of GetKey, for instance, the address of keyExtend is different and should be noted.&lt;br /&gt;
* In either case, on ''both'' pages, add a new section &amp;quot;On Other Calculators&amp;quot; near the bottom, with appropriate links.  This section serves two purposes: First, it's simply useful information to have available, both for people trying to write cross-platform code, and for those of us who are interested in researching the OS.  Secondly, it would serve as a reminder to editors that there are multiple pages that may need to be updated.&lt;br /&gt;
* It's also important to maintain the distinction between routines/variables/ports that are ''identical'' as opposed to those which merely have related functions.  For example, the widely used GetK routine on the 83 isn't known -- to my knowledge -- on the 73, but GetCSC serves as an adequate substitute in many situations.  This is something that belongs in &amp;quot;See Also,&amp;quot; not in this section.&lt;br /&gt;
* Some templates might be in order here.&lt;br /&gt;
&lt;br /&gt;
[[User:FloppusMaximus|FloppusMaximus]] 18:41, 24 May 2005 (PDT)&lt;br /&gt;
&lt;br /&gt;
:It's not a bad idea.  The only problem is that it makes a lot more work for people who just want to make a simple addition to the wiki.  There's already a fairly high initial barrier (figuring out the templates and categories) to overcome for someone who wants to stroll along and add something to the wiki.  For you and I it wouldn't be a big deal, but I'm worried it's going to dissuade a random person who floats by from adding ErrMemory to 83 Plus, because then 83 (and 86 or 73, if someone decides to start them) will have to be added/changed as well.  --[[User:Dan Englender|Dan Englender]] 10:01, 25 May 2005 (PDT)&lt;br /&gt;
:It might also be cool to hack up the interlanguage features so we can have the nifty language link-box similar to what exists on wikipedia.  --[[User:Dan Englender|Dan Englender]] 12:57, 27 March 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
== Wanted Pages ==&lt;br /&gt;
I decided it was too minor to post as news on the main page, but I modified the [[Special:wantedpages|Wanted Pages]] page so that the threshold is 1 link instead of 2 links.  A *lot* more wanted pages show up now, though there is some junk in the list now too (like fake links from templates).  I figure wanted pages are as good a place as any to start adding, so I'm going to try to make a dent in the list.  Anyone who would like to help is welcome to do so :)  --[[User:Dan Englender|Dan Englender]] 10:06, 25 May 2005 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Not &amp;quot;hardware&amp;quot; specific documents ==&lt;br /&gt;
&lt;br /&gt;
I was so free to edit the artilce over Emulator(s). I also created an article regarding PindurTI. &lt;br /&gt;
&lt;br /&gt;
As I already stated on the MaxCoderz board (http://joepnet.com/hosted/maxcoderz/phpBB2/viewtopic.php?t=1521), I think WikiTI has a lot of potential to collect information about the TI community aswell. Thinks like PindurTI, GrayScale and maybe even information about all the Zelda attempts. In my opinion, people can benefit from that information. --[[User:Kv83|Vincent Junemann]] 15:00, 21 February 2006 (CET)&lt;br /&gt;
:Hehe... Zelda attempts? We really do need a page for that ;) [[User:TD-Linux|TD-Linux]] 09:24, 19 October 2006 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Required logon ==&lt;br /&gt;
&lt;br /&gt;
If the spam is being done by bots, perhaps instead of requiring a log-on, we can require either a log-on or a captcha?  I realize there's additional coding involved, but we've had a fair number of useful contributions by non-logged in contributors, and it would be a shame to scare them off by prospects of account creation or the fact that we can track their activities, or what have you. --[[User:Dan Englender|Dan Englender]] 13:55, 23 Feb 2006 (PST)&lt;br /&gt;
:Agreed, if we can either find a mod for that or code one ourselves. Of course, maybe even a simple &amp;quot;check this box&amp;quot; thing would work if the bots are programmed just to hit mediawiki and not check for stuff... And if a botrunner ever finds it and fixes their bots, we can either just change it or go to a captcha... However, I think most of the legit anon edits were by people who have an account but just didn't notice they weren't logged in at the time. [[User:AndyJ|Andy Janata]] 18:40, 23 Feb 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
== Wiki update ==&lt;br /&gt;
&lt;br /&gt;
Whats this undefined link I see on a lot of the pages?--[[User:Jim e|Jim e]] 06:07, 14 March 2006 (PST)&lt;br /&gt;
:Example? --[[User:Dan Englender|Dan Englender]] 06:12, 14 March 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
::This page has it right under the contents.--[[User:Jim e|Jim e]] 06:18, 14 March 2006 (PST)&lt;br /&gt;
:::I'm not seeing it.  Screen grab? (Also, try clearing your browser's cache in case something's not playing nice between this and the old wiki) --[[User:Dan Englender|Dan Englender]] 06:21, 14 March 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
::::....It's gone now. I guess it was a fluke, but I did get an image before it disappeared, just to prove i'm not crazy.  Pic&lt;br /&gt;
:::::I removed the link to that pic since your domain expired and it was snagged by nice search spammy people. [[User:AndyJ|Andy Janata]] 12:11, 21 July 2007 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Motivation Idea ==&lt;br /&gt;
&lt;br /&gt;
Here's an idea that might spark more interest in WikiTI...&lt;br /&gt;
&lt;br /&gt;
Usually, this stuff occurs on the subconscious level, but what if it was brought out from these depths?  We have this inquisitive.. knowledge.. accumulate thing... and so what if there was a page (or maybe a set of them) that had a list of questions about the unknowns of the TI-OS?  This idea came from this quote:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;In mathematics the art of asking questions is more valuable than solving problems. ~ Georg Cantor&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All questions would be welcome (not sure about programming help oriented ones though), but maybe not all questions would be answerable, and maybe some questions would be better off not being answered.  Other users will fill in the blanks and try to answer the question (because of generosity/competition/whatever).  Concurrently, some users might think that some Q&amp;amp;A sections fit well together and then they will merge these into a wiki page.  It might also be possible for someone to write a wiki page as an answer to a question!&lt;br /&gt;
&lt;br /&gt;
The point of such a page as this is to 'encourage hacking' in its traditional sense, as it were.  As a side effect, it ''might possibly'' help us all (new and old alike) with our hesitancy in editing a page.  Furthermore, I think that this idea will only work if there is a continual asking of questions; otherwise, it will lag and eventually '''fail'''.  Hence, the [[Wikipedia:WP:BB|Be Bold]] slogan of Wikipedia.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
What are the specific differences between GarbageCollect-ing and &amp;quot;Defragmenting...&amp;quot;?&lt;br /&gt;
&lt;br /&gt;
[[User:Brandonw|Brandonw]] and I talked about this on IRC:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;BrandonW&amp;gt; It's a good idea, but I'm not so sure about it working on WikiTI.&lt;br /&gt;
&amp;lt;BrandonW&amp;gt; Maybe the question is elsewhere and the answer can be posted on WikiTI.&lt;br /&gt;
&amp;lt;BrandonW&amp;gt; The answer to every question can be a WikiTI link.&lt;br /&gt;
&amp;lt;BrandonW&amp;gt; That makes WikiTI bigger with more information and people get their questions answered.&lt;br /&gt;
&amp;lt;Gambit_&amp;gt; hmm, asked where?  Is there a central location somewhere where these would be asked?&lt;br /&gt;
&amp;lt;Gambit_&amp;gt; WikiTI subforum in DS, perhaps?&lt;br /&gt;
&amp;lt;BrandonW&amp;gt; It could be hosted anywhere...someplace new.&lt;br /&gt;
&amp;lt;Gambit_&amp;gt; hm&lt;br /&gt;
&amp;lt;BrandonW&amp;gt; Perhaps.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Good or bad?  Thoughts? --[[User:Gambit|Gambit]] 23:55, 10 February 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
: It's a good idea, but I'd rather see a broader page about general requests/wanted pages for the wiki, not just TI-OS related ones. [[User:Guillaumeh|Guillaumeh]] 03:55, 18 February 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
== WikiTI Favicon ==&lt;br /&gt;
&lt;br /&gt;
I was going through WikiTI when I noticed that it lacked a favicon. I don't know what you guys think about favicons, but I think they are an important part of a website's identity. With that thought in mind, I created a favicon for WikiTI. I placed the favicon on a [http://www.freewebs.com/tibasicdev/wikitifavicon.html sample page] available on my site so you guys can see it. I wanted to hear what you guys thought of it, if you had any improvements, and if you would use it. Thanks. --[[User:Burr|Burr]] 12:17, 17 February 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
== Searching ==&lt;br /&gt;
&lt;br /&gt;
Why doesn't searching work well.  If I type &amp;quot;scf&amp;quot; I would expect to get the z80 opcode reference. Or &amp;quot;LCD&amp;quot; brings up nothing pertaining to the LCD. Is it just me or is searching broken somewhat?--[[User:Jim e|Jim e]] 20:50, 21 September 2007 (PDT)&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=83Plus:Ports:00</id>
		<title>83Plus:Ports:00</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=83Plus:Ports:00"/>
				<updated>2007-06-30T14:10:57Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: Little more clarification&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:83Plus:Ports:By_Address|00 - Link]] [[Category:83Plus:Ports:By_Name|Link]]&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
'''Port Number:''' 00h&lt;br /&gt;
&lt;br /&gt;
'''Function:''' Link&lt;br /&gt;
&lt;br /&gt;
This port controls the calculator's serial link port (the standard link port present on the 83+, 83+ SE, 84+ and 84+ SE - do not confuse this with the 84+/84+SE's USB link port).&lt;br /&gt;
&lt;br /&gt;
=== Read Values ===&lt;br /&gt;
* Bits 0 and 1: These bits indicate the state of the link port's two lines. If a bit is set that indicates the line is high, and if it is reset that indicates the line is low. When idle (no transfer in progress, no cable plugged in, etc), both lines are usually high. When a cable is connected on both ends, a line reads high if and only if both ends have set the line high. The line will read low if either calculator sets it low. Bit 0 is the tip and bit 1 is the ring.&lt;br /&gt;
*'''83+ only:''' Bit 2: Set means link receive assist is active.&lt;br /&gt;
*'''83+ only:''' Bit 3: Set when link assist has received a complete byte. The only way to reset this bit is to read [[83Plus:Ports:05|port 5]].&lt;br /&gt;
* Bit 4 and 5: Bits 4 and 5 indicate which lines are pulled low by the calculator (unlike bits 0 and 1 they are not influenced by the other calculator). A 1 bit indicates your calculator is holding the line low. A 0 bit indicates your calculator is not holding the line low. (When both calculators have a 0 bit here, the corresponding line will read 1.) In other words, these bits reflect bits 0 and 1 from the most recent write to this port.&lt;br /&gt;
&lt;br /&gt;
=== Write Values ===&lt;br /&gt;
* Bits 0 and 1: Setting a bit will pull the line low. Resetting a bit will stop holding the line low (allowing it to go high if the other calculator is not holding it low). Remember a low line will read as a bit being reset, but when writing setting a bit brings the line low.&lt;br /&gt;
*'''83+ only:''' Bit 2: Set this bit to enable the link receive assist. After setting this bit, poll port 0 until bit 3 is high, at which point read from [[83Plus:Ports:05|port 5]] to get the byte.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comments ==&lt;br /&gt;
&lt;br /&gt;
=== Ti-OS interference ===&lt;br /&gt;
One thing to keep in mind when writing link port related software is that the Ti-OS checks for silent transfers in the background of input routines. When two calculators are connected and one pulls a line low, the other calculator will respond by pulling the other line low to acknowledge that it has received a bit. Even when the other calculator is running an assembly program that uses the getkey romcall. This phenomenon is known to cause severe headaches for programmers who attempt to write synchronization routines :).&lt;br /&gt;
&lt;br /&gt;
=== Data transfer ===&lt;br /&gt;
Transferring an entire byte requires you to implement some form of protocol. Examples include TI's official linking protocol, and [http://www.ticalc.org/archives/files/fileinfo/277/27718.html Michael Vincent's TachyonLink protocol].&lt;br /&gt;
&lt;br /&gt;
Other useful information on linking in general:&lt;br /&gt;
*  [http://www.ticalc.org/archives/files/fileinfo/247/24750.html TI Link Protocol &amp;amp; File Format Guide]&amp;lt;br&amp;gt;&lt;br /&gt;
*  [http://www.ticalc.org/archives/files/fileinfo/294/29418.html Ti-83 Link Port Tutorial] (note that this deals with the TI-83, not the 83 Plus, where the the hardware is [[83:Ports:00|somewhat different]].)&lt;br /&gt;
*  [http://www.ticalc.org/archives/files/fileinfo/242/24244.html All about the Ti-86 link port]&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
=== Sending/Setting ===&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; ld a,0     ; Set both lines high&lt;br /&gt;
 out (0),a&lt;br /&gt;
&lt;br /&gt;
 ld a,2     ; Set tip high, ring low&lt;br /&gt;
 out (0),a&lt;br /&gt;
&lt;br /&gt;
 ld a,1     ; Set tip low, ring high&lt;br /&gt;
 out (0),a&lt;br /&gt;
&lt;br /&gt;
 ld a,3     ; Set both low&lt;br /&gt;
 out (0),a&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Receiving/Reading ===&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; in a,(0)        ; Get link port value&lt;br /&gt;
&lt;br /&gt;
 bit 0,a         ; Check tip&lt;br /&gt;
 jr z,tip_low&lt;br /&gt;
 jr nz,tip_high&lt;br /&gt;
&lt;br /&gt;
 bit 1,a         ; Check ring&lt;br /&gt;
 jr z,ring_low&lt;br /&gt;
 jr nz,ring_high&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=83Plus:Ports:04</id>
		<title>83Plus:Ports:04</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=83Plus:Ports:04"/>
				<updated>2007-06-27T16:14:09Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: added info for se timers.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:83Plus:Ports:By_Address|04 - Memory Map / Interrupt]] [[Category:83Plus:Ports:By_Name|Memory Map / Interrupt]]&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
'''Port Number:''' 04h&lt;br /&gt;
&lt;br /&gt;
'''Function:''' Interrupting Device Identification and Memory Map Control&lt;br /&gt;
&lt;br /&gt;
This port serves two purposes. When read it indicates the device that triggered an interrupt. When written it sets the memory map mode and hardware timer speed. When an interrupt is triggered, it should be cleared by reseting the corresponding bit in [[83Plus:Ports:03|port 3]].  Otherwise, it will continuously call the interrupt code once interrupts are reenabled with ei.&lt;br /&gt;
&lt;br /&gt;
=== Read Values ===&lt;br /&gt;
* Bits 0~2 and 4~7 are set according to which device triggered the running interrupt.&lt;br /&gt;
** Bit 0: Set if pressing the ON Key triggered the interrupt.&lt;br /&gt;
** Bit 1: Set if the first hardware timer triggered the interrupt.&lt;br /&gt;
** Bit 2: Set if the second hardware timer triggered the interrupt.&lt;br /&gt;
** Bit 4: Link activity generated an interrupt.&lt;br /&gt;
** '''83+SE / 84+ only:''' Bit 5: First crystal timer has expired.&lt;br /&gt;
** '''83+SE / 84+ only:''' Bit 6: Second crystal timer has expired.&lt;br /&gt;
** '''83+SE / 84+ only:''' Bit 7: Third crystal timer has expired.&lt;br /&gt;
* Bit 3 is reset if the ON key is being pressed, set otherwise.&lt;br /&gt;
&lt;br /&gt;
=== Write Values ===&lt;br /&gt;
* Bit 0 reset to select memory map mode 0. In mode 0 the RAM and ROM is mapped to CPU memory as follows:&lt;br /&gt;
** Address 0000h ~ 3FFFh: ROM Page 0&lt;br /&gt;
** Address 4000h ~ 7FFFh: Memory Bank A (Page selected in [[83Plus:Ports:06|Port 06h]])&lt;br /&gt;
** Address 8000h ~ BFFFh: Memory Bank B (Page selected in [[83Plus:Ports:07|Port 07h]])&lt;br /&gt;
** '''83+ Basic''': Address C000h ~ FFFFh: RAM Page 0&lt;br /&gt;
** '''Everything else''': Address C000h ~ FFFFh: Page selected in [[83Plus:Ports:05|Port 05h]]&lt;br /&gt;
* Bit 0 set to select memory map mode 1. In mode 1 the RAM and ROM is mapped to CPU memory as follows:&lt;br /&gt;
** Address 0000h ~ 3FFFh: ROM Page 0&lt;br /&gt;
** Address 4000h ~ 7FFFh: RAM Page 0&lt;br /&gt;
** Address 8000h ~ BFFFh: Memory Bank A (Page selected in [[83Plus:Ports:06|Port 06h]])&lt;br /&gt;
** Address C000h ~ FFFFh: Memory Bank B (Page selected in [[83Plus:Ports:07|Port 07h]])&lt;br /&gt;
* Bits 1 and 2 control the hardware timer frequency. Setting both 0 sets the timer to the fastest speed, and both 1 is the slowest speed. The normal speed is with both bits 1.&lt;br /&gt;
{| width=&amp;quot;90%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;text-align: center&amp;quot;&lt;br /&gt;
|+Frequency (Hz)&lt;br /&gt;
|-&lt;br /&gt;
!&amp;amp;nbsp;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|first timer&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|second timer&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|both enabled&lt;br /&gt;
|-&lt;br /&gt;
!value&lt;br /&gt;
!width=&amp;quot;15%&amp;quot;|83+&lt;br /&gt;
!width=&amp;quot;15%&amp;quot;|83+SE 84+(SE)&lt;br /&gt;
!width=&amp;quot;15%&amp;quot;|83+&lt;br /&gt;
!width=&amp;quot;15%&amp;quot;|83+SE 84+(SE)&lt;br /&gt;
!width=&amp;quot;15%&amp;quot;|83+&lt;br /&gt;
!width=&amp;quot;15%&amp;quot;|83+SE 84+(SE)&lt;br /&gt;
|-&lt;br /&gt;
!00&lt;br /&gt;
|560||512||1120||1024||1680||1536&lt;br /&gt;
|-&lt;br /&gt;
!01&lt;br /&gt;
|248||227.55||497||455.11||746||682.66&lt;br /&gt;
|-&lt;br /&gt;
!10&lt;br /&gt;
|170||146.29||344||292.57||517||438.86&lt;br /&gt;
|-&lt;br /&gt;
!11&lt;br /&gt;
|118||107.79||236||215.58||353||323.37&lt;br /&gt;
|}&lt;br /&gt;
* Bits 4~6 should be 1 on the 83+ and 83+SE, and 0 on the 84+ and 84+SE.&lt;br /&gt;
&lt;br /&gt;
== Comments ==&lt;br /&gt;
The calculator uses mode 0 for normal operation. If you change the memory map mode be sure to change it back before returning control.&lt;br /&gt;
Also, do not switch from mode 0 to mode 1 inside the 4000h ~ 7FFFh range, as it will basically crash the calculator because RAM Page 0 will take over that section and RAM Page 0 cannot execute code.&lt;br /&gt;
&lt;br /&gt;
Interrupt timers may not be independent of the CPU speed for the 83+.  However on the 83+SE, 84+ and 84+SE the standard timers are based on the crystal timer. Timer1 fires at 32768/(64+(80*i))hz, where i is bit 1 and 2 set in port 4, making it 0&amp;lt;=i&amp;lt;=3.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
This example shows successful use of this port, switching to mode 1 and back. Mode 1 is the only way to execute code beyond address C000h on the 83+ Basic.  (Assumes code is running from 4000h (i.e. an application))&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; in a, (7) ;Save current Bank B page because we'll trash it.&lt;br /&gt;
 push af&lt;br /&gt;
 in a,(6) ;Put this app's page into 8000&lt;br /&gt;
 out (7), a&lt;br /&gt;
 jp $ + 4003h ;This will actually jump to the next statement, but in Bank B.&lt;br /&gt;
 ld a, 77h ;Select mode 1 and keep the timer speed at normal...&lt;br /&gt;
 out (4), a ;Now we're in mode 1.&lt;br /&gt;
 ;We're still at 8000h here but we are back in Bank A.&lt;br /&gt;
 ;Now to go back.&lt;br /&gt;
 ld a, 76h ;I could dec a for this example, but...&lt;br /&gt;
 out (4), a ;Back in mode 0 and bank B.&lt;br /&gt;
 jp $ - 3FFDh ;Jump back to bank A.&lt;br /&gt;
 pop af&lt;br /&gt;
 out (7), a ;Restore bank B.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Credits and Contributions ==&lt;br /&gt;
* '''Dan Englender''': Originally documented memory map modes [http://www.detachedsolutions.com/forum/viewtopic.php?p=21593#21593 here]&lt;br /&gt;
* '''Michael Vincent''': For his docs [http://www.michaelv.org/programs/calcs/ports/port4.html here], which helped me figure out the interrupt device bits.&lt;br /&gt;
* '''James Montelongo''': For his docs [http://www.geocities.com/jimm09876/calc/port4.html here] on the hardware timer.&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=83Plus:Ports:30</id>
		<title>83Plus:Ports:30</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=83Plus:Ports:30"/>
				<updated>2007-06-27T15:51:42Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: updated frequencies&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:83Plus:Ports:By_Address|30-38 - Timers]] [[Category:83Plus:Ports:By_Name|Timers]]&lt;br /&gt;
{{SE-Only Port|10}}&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
'''Port Number:''' 30 - 38&lt;br /&gt;
&lt;br /&gt;
'''Function:''' Timers&lt;br /&gt;
On the 83+SE and 84+(SE) there are 3 timers that are independent of each other and each timer is controlled by 3 ports, On/off, Loop control, and the counter itself. They can be used for accurate delay waiting, interrupts that execute at almost any desired frequency, or for just keeping time.&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;40%&amp;quot; cellspacing=&amp;quot;1&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; |&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;808080&amp;quot; | On/Off&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;808080&amp;quot; | Loop Control&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;808080&amp;quot; | Counter&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;808080&amp;quot; | Timer1&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;C0C0C0&amp;quot; | 30&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;C0C0C0&amp;quot; | 31&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;C0C0C0&amp;quot; | 32&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;808080&amp;quot; | Timer2&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;C0C0C0&amp;quot; | 33&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;C0C0C0&amp;quot; | 34&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;C0C0C0&amp;quot; | 35&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;808080&amp;quot; | Timer3&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;C0C0C0&amp;quot; | 36&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;C0C0C0&amp;quot; | 37&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;C0C0C0&amp;quot; | 38&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===On/Off ports:===&lt;br /&gt;
&lt;br /&gt;
The On/Off ports are 30, 33, and 36. These ports control what clock is used for this timer and a divisor(needed since the counter is only 8bit). The upper two bits(6 &amp;amp; 7) tell what clock is being used. 00 if none and the timer is off, 01 for the crystal timer, and 02 for the CPU clock. 03 would suggest a combination of the CPU clock and the crystal timers, but I highly doubt it. Bits 0-5 of the On/Off ports control the divisor. For simplicity, here is a table with the output values next to the the frequencies that would be generated.&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;30%&amp;quot; cellspacing=&amp;quot;1&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;808080&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | Value&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | Frequency&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 00h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | OFF&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | ~&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | ~&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 40h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | 10922.667 Hz (32768/3)&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 41h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | 992.9697 Hz (32768/33)&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 42h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | 99.902 Hz (32768/328)&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 43h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | 9.9993 Hz (32768/3277)&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 44h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | 32768 Hz&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 45h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | 2048 Hz&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 46h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | 128 Hz&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 47h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | 8 Hz&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | ~&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | ~&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 80h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | CPU clock speed&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 81h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | CPU clock / 2&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 82h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | CPU clock / 4&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 84h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | CPU clock / 8&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 88h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | CPU clock / 16&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 90h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | CPU clock / 32&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | A0h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | CPU clock / 64&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Since Silver Edition calculators CPU speed can be adjusted the timers will run at whatever the current CPU speed is(if selected of course).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Loop Control ports:===&lt;br /&gt;
&lt;br /&gt;
The Loop Control ports are 31, 34, and 37.&lt;br /&gt;
&lt;br /&gt;
When bit 0 is set on this port it causes the timer to loop when the counter hits 0.  Once it does, the counter will start back at the value you initially placed in it. To keep it looping from that value, you must output to the loop control port at every loop. If you miss one bit 2 of this port will be set, and the counter will carry to FF continue to count down.&lt;br /&gt;
&lt;br /&gt;
When bit 1 is set this timer will generate an interrupt when the counter hits 0. The interrupt must acknowledge or it will recurse upon EI. Acknowledge it by writing to the Loop control port. Depending on whether you have looping enabled or not, you can start the timer again by write to the counter port.&lt;br /&gt;
&lt;br /&gt;
At this point I want to stress that you must acknowledge the timers whenever the counter reaches zero. Every time the counter hits zero the appropriate bit is set in [[83Plus:Ports:04|port 04h]]. To reset those bits you MUST write to the loop control port, whether you have interrupts enabled or not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Counter ports:===&lt;br /&gt;
&lt;br /&gt;
The Counter ports are 32, 35, and 38.&lt;br /&gt;
&lt;br /&gt;
Once the prior 2 ports have been setup all that is need to activate the timer is to send the desired value you wish to count down from to the counter port. However if you send 0 it will loop no matter what and it will not affect port 4, so keep it above 0.&lt;br /&gt;
&lt;br /&gt;
Also note that you should turn off the timer when you are done, do this by writing 0 to the on/off port and loop control.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Comments ==&lt;br /&gt;
For some reasons the timers do not seem to generate interrupts if the CPU is halt. I can only imagine that this is either a bug in the hardware or that there is more information missing. In any case, if you intend to use the crystal timers to generate an interrupt leave the normal timers on so that you can escape any halt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example Code ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; ;Setup up a timer that waits 2 seconds&lt;br /&gt;
   di&lt;br /&gt;
   ld a,$47      ;8 hz&lt;br /&gt;
   out ($30),a&lt;br /&gt;
   ld a,0        ; no loop, no interrupt&lt;br /&gt;
   out ($31),a&lt;br /&gt;
   ld a,16       ;16 ticks / 8 hz equals 2 seconds&lt;br /&gt;
   out ($32),a&lt;br /&gt;
wait:&lt;br /&gt;
   in a,(4)&lt;br /&gt;
   bit 5,a       ;bit 5 tells if timer 1&lt;br /&gt;
   jr z,wait     ;is done&lt;br /&gt;
   xor a&lt;br /&gt;
   out ($30),a   ;Turn off the timer.&lt;br /&gt;
   out ($31),a&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Credits and Contributions ==&lt;br /&gt;
* '''Michael Vincent''': Documentation found [http://www.michaelv.org/programs/calcs/rtc.txt here].&lt;br /&gt;
* '''James Montelongo''': Documentation found [http://www.geocities.com/jimm09876/calc/timers.html here].&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=Z80_Routines:Graphic:largesprite</id>
		<title>Z80 Routines:Graphic:largesprite</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Z80_Routines:Graphic:largesprite"/>
				<updated>2007-06-25T13:21:54Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: just realized something dumb&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Z80 Routines:Graphic|largesprite]][[Category:Z80 Routines|largesprite]]&lt;br /&gt;
The '''Largesprite''' routine is used to copy the contents of a variable sized sprite to the Graph Buffer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
Here is Joe Wingbermuehle's version, which is the one used in ION. Gbuf must be defined before its use.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
;=======================&lt;br /&gt;
;LargeSprite&lt;br /&gt;
;by Joe Wingbermuehle&lt;br /&gt;
;=======================&lt;br /&gt;
;Does:   Copy a sprite to the gbuf&lt;br /&gt;
;Input:  ix=sprite address, a='x', l='y', b='height' (in pixels), c='width' (in bytes, e.g. 2 would be 16)&lt;br /&gt;
;Output: The sprite is copied to the gbuf&lt;br /&gt;
;-----------------------&lt;br /&gt;
largeSprite:&lt;br /&gt;
   di                                 ;turn interrupts off (we want to use shadow registers)&lt;br /&gt;
   ex   af,af'&lt;br /&gt;
                                      ;exchange af with af'     \&lt;br /&gt;
   ld   a,c                           ;ld c in a (a = 'width')  | for not destroying a ('x')&lt;br /&gt;
   push   af                          ;push a                   |&lt;br /&gt;
      ex   af,af'&lt;br /&gt;
                                      ;exchange back            | and 'width' is now in a' (saved)&lt;br /&gt;
      ld   e,l                        ;e = 'y'&lt;br /&gt;
      ld   h,$00                      ;h =  0&lt;br /&gt;
      ld   d,h                        ;d =  0&lt;br /&gt;
      add   hl,de                     ;'y' *2  \&lt;br /&gt;
      add   hl,de                     ;    *3  | calculate 'y' *12 because 'y' is 'in rows'&lt;br /&gt;
      add   hl,hl                     ;    *6  |   (screen is 12 bytes in length)&lt;br /&gt;
      add   hl,hl                     ;    *12 /&lt;br /&gt;
      ld   e,a                        ;e = 'x'&lt;br /&gt;
      and   $07                       ;and %00000111&lt;br /&gt;
      ld   c,a                        ;last 3 bits in c (amount of bits to shift all bytes)&lt;br /&gt;
      srl   e                         ;e/2   | shifting e ('x') 3 bits to the right&lt;br /&gt;
      srl   e                         ; /4   |   %11111111 becomes %00011111 for example&lt;br /&gt;
      srl   e                         ; /8   /&lt;br /&gt;
      add   hl,de                     ;hl = 'y'; de = 'x' (rounded) | add them&lt;br /&gt;
      ld   de, gbuf                   ;de = the adress of graph buffer&lt;br /&gt;
      add   hl,de                     ;add hl to the adress of the gbuf&lt;br /&gt;
largeSpriteLoop1:&lt;br /&gt;
      push   hl                       ;save adress&lt;br /&gt;
largeSpriteLoop2:&lt;br /&gt;
         ld   d,(ix)                  ;first sprite data in d&lt;br /&gt;
         ld   e,$00                   ;e = 0&lt;br /&gt;
         ld   a,c                     ;a = c (to not destroy c)&lt;br /&gt;
         or   a                       ;is a = 0? (same as cp 0)&lt;br /&gt;
         jr   z,largeSpriteSkip1      ;if theres nothing to shift (a = 0) loop it&lt;br /&gt;
largeSpriteLoop3:&lt;br /&gt;
         srl   d                      ;shift one bit to the right; put the destroyed bit in the carry flag&lt;br /&gt;
         rr   e                       ;put the carry flag in e (%00000000 becomes %10000000 if carry flag = 1)&lt;br /&gt;
         dec   a                      ;decrease counter (with was 'the amount of bits to shift')&lt;br /&gt;
         jr   nz,largeSpriteLoop3     ;if the counter is not 0 loop back&lt;br /&gt;
largeSpriteSkip1:&lt;br /&gt;
         ld   a,(hl)                  ;graphbyte in a&lt;br /&gt;
         xor   d                      ;xor first byte of sprite (that can be changed to 'or d' if you want a OR-routine)&lt;br /&gt;
         ld   (hl),a                  ;back to buffer&lt;br /&gt;
         inc   hl                     ;increase pointer&lt;br /&gt;
         ld   a,(hl)                  ;graphbyte in a&lt;br /&gt;
         xor   e                      ;xor with shifted sprite byte (change to 'or e' for OR-routine)&lt;br /&gt;
         ld   (hl),a                  ;back to buffer&lt;br /&gt;
         inc   ix                     ;increase sprite adress&lt;br /&gt;
         ex   af,af'&lt;br /&gt;
                                      ;exchange af with af' ( a is now the 'width' from the first line)&lt;br /&gt;
         dec   a                      ;decrease 'width'&lt;br /&gt;
         push   af                    ;push the 'width'&lt;br /&gt;
            ex   af,af'&lt;br /&gt;
                                      ;exchange back&lt;br /&gt;
         pop   af                     ;pop the 'width'&lt;br /&gt;
         jr   nz,largeSpriteLoop2     ;if a is not 0 (if a = 0 then we would be done) loop it&lt;br /&gt;
      pop   hl                        ;pop gbuf adress (search the last push hl!)&lt;br /&gt;
   pop   af                           ;pop  | to restore the real 'width'&lt;br /&gt;
   push   af                          ;push /&lt;br /&gt;
      ex   af,af'&lt;br /&gt;
                                      ;af' must be the original 'width' when loop 'largeSpriteLoop1'&lt;br /&gt;
      ld   de,$0C                     ;ld de,12&lt;br /&gt;
      add   hl,de                     ;next line&lt;br /&gt;
      djnz   largeSpriteLoop1         ;if not b = 0 loop (b = height of sprite)&lt;br /&gt;
   pop   af                           ;pop because we dont want a stack problem :)&lt;br /&gt;
   ret                                ;return&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
   ;...&lt;br /&gt;
   ld   l,8   ;y&lt;br /&gt;
   ld   a,16  ;x&lt;br /&gt;
   ld   b,8   ;height&lt;br /&gt;
   ld   c,2   ;width in bytes&lt;br /&gt;
   ld   ix,sprite&lt;br /&gt;
   call largesprite&lt;br /&gt;
   call fastcopy&lt;br /&gt;
   ;...&lt;br /&gt;
sprite:&lt;br /&gt;
   .db %11111111,%11111111&lt;br /&gt;
   .db %10000000,%00000001&lt;br /&gt;
   .db %10000000,%00000001&lt;br /&gt;
   .db %10000000,%00000001&lt;br /&gt;
   .db %10000000,%00000001&lt;br /&gt;
   .db %10000000,%00000001&lt;br /&gt;
   .db %10000000,%00000001&lt;br /&gt;
   .db %11111111,%11111111&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Version without shadow registers ==&lt;br /&gt;
&lt;br /&gt;
by Tijl Coosemans, made for Venus. Compatible with ION's routine. screenBuf must be defined.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
iLargeSprite&lt;br /&gt;
	ld	h,0&lt;br /&gt;
	ld	d,h&lt;br /&gt;
	ld	e,l&lt;br /&gt;
	add	hl,de&lt;br /&gt;
	add	hl,de&lt;br /&gt;
	add	hl,hl&lt;br /&gt;
	add	hl,hl&lt;br /&gt;
	ld	e,a&lt;br /&gt;
	srl	e&lt;br /&gt;
	srl	e&lt;br /&gt;
	srl	e&lt;br /&gt;
	add	hl,de&lt;br /&gt;
	ld	de,screenBuf&lt;br /&gt;
	add	hl,de&lt;br /&gt;
	and	7&lt;br /&gt;
	ld	e,a&lt;br /&gt;
iLargeSpriteLoop1&lt;br /&gt;
	push	bc&lt;br /&gt;
	push	hl&lt;br /&gt;
	ld	b,c&lt;br /&gt;
iLargeSpriteLoop2&lt;br /&gt;
	ld	c,(ix)&lt;br /&gt;
	ld	d,0&lt;br /&gt;
	inc	ix&lt;br /&gt;
	ld	a,e&lt;br /&gt;
	or	a&lt;br /&gt;
	jr	z,iLargeSprite1&lt;br /&gt;
iLargeSpriteLoop3&lt;br /&gt;
	srl	c&lt;br /&gt;
	rr	d&lt;br /&gt;
	dec	a&lt;br /&gt;
	jr	nz,iLargeSpriteLoop3&lt;br /&gt;
iLargeSprite1&lt;br /&gt;
	ld	a,c&lt;br /&gt;
	xor	(hl)&lt;br /&gt;
	ld	(hl),a&lt;br /&gt;
	inc	hl&lt;br /&gt;
	ld	a,d&lt;br /&gt;
	xor	(hl)&lt;br /&gt;
	ld	(hl),a&lt;br /&gt;
	djnz	iLargeSpriteLoop2&lt;br /&gt;
	pop	hl&lt;br /&gt;
	ld	c,12&lt;br /&gt;
	add	hl,bc&lt;br /&gt;
	pop	bc&lt;br /&gt;
	djnz	iLargeSpriteLoop1&lt;br /&gt;
	ret&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Version with Clipping ==&lt;br /&gt;
This is a version that supports clipping the large sprite.  It's considerable larger and requires Self modifying code.  The SMC can be removed without to much difficulty. It has different inputs than ION's.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;;--------------------------------&lt;br /&gt;
;Clip Big Sprite&lt;br /&gt;
;by James Montelongo&lt;br /&gt;
;MAX SIZE: 64x64&lt;br /&gt;
;ix - Sprite&lt;br /&gt;
;b  - height&lt;br /&gt;
;c  - width in bytes&lt;br /&gt;
;d  - x&lt;br /&gt;
;e  - y&lt;br /&gt;
&lt;br /&gt;
ClipBigSprite:&lt;br /&gt;
; Early out, Check if its even remotely on screen&lt;br /&gt;
	ld a,e&lt;br /&gt;
	cp 64&lt;br /&gt;
	ret p&lt;br /&gt;
	add a,b&lt;br /&gt;
	ret m&lt;br /&gt;
	ret z&lt;br /&gt;
	ld a,d&lt;br /&gt;
	cp 96&lt;br /&gt;
	ret p&lt;br /&gt;
	ld a,c&lt;br /&gt;
	add a,a&lt;br /&gt;
	add a,a&lt;br /&gt;
	add a,a&lt;br /&gt;
	add a,d&lt;br /&gt;
	ret m&lt;br /&gt;
	ret z&lt;br /&gt;
&lt;br /&gt;
	ld a,e&lt;br /&gt;
	or a&lt;br /&gt;
	jp p,Check_clip_bottom&lt;br /&gt;
	neg&lt;br /&gt;
	push de&lt;br /&gt;
	ld hl,0&lt;br /&gt;
	ld d,l&lt;br /&gt;
	ld e,a&lt;br /&gt;
	bit 2,c&lt;br /&gt;
	jr z,$+2+1&lt;br /&gt;
	add hl,de&lt;br /&gt;
	add hl,hl	&lt;br /&gt;
	bit 1,c&lt;br /&gt;
	jr z,$+2+1&lt;br /&gt;
	add hl,de&lt;br /&gt;
	add hl,hl	&lt;br /&gt;
	bit 0,c&lt;br /&gt;
	jr z,$+2+1&lt;br /&gt;
	add hl,de&lt;br /&gt;
	pop de&lt;br /&gt;
	ex de,hl&lt;br /&gt;
	add ix,de		;Here you can save the top offset&lt;br /&gt;
	ex de,hl&lt;br /&gt;
	ld e,0&lt;br /&gt;
	neg&lt;br /&gt;
	add a,b&lt;br /&gt;
	ld b,a&lt;br /&gt;
Check_clip_bottom:&lt;br /&gt;
&lt;br /&gt;
	ld a,e&lt;br /&gt;
	add a,b&lt;br /&gt;
	sub 64&lt;br /&gt;
	jp m,Check_clip_Left&lt;br /&gt;
	neg&lt;br /&gt;
	add a,b&lt;br /&gt;
	ld b,a&lt;br /&gt;
Check_clip_Left:&lt;br /&gt;
				; at this point you may want to save b&lt;br /&gt;
	xor a&lt;br /&gt;
	ld (bigskip),a&lt;br /&gt;
	ld a,Clipleftsize &lt;br /&gt;
	ld (Do_Clipleft),a&lt;br /&gt;
	ld a,d&lt;br /&gt;
	or a&lt;br /&gt;
	jp p,Check_clip_right&lt;br /&gt;
	cpl&lt;br /&gt;
	and $F8&lt;br /&gt;
	rra&lt;br /&gt;
	rra&lt;br /&gt;
	rra&lt;br /&gt;
	ex de,hl		;save the clipped left offset&lt;br /&gt;
	ld e,a&lt;br /&gt;
	ld d,0&lt;br /&gt;
	add ix,de&lt;br /&gt;
	ld (bigskip),a&lt;br /&gt;
	ex de,hl&lt;br /&gt;
	inc a&lt;br /&gt;
	neg&lt;br /&gt;
	add a,c&lt;br /&gt;
	ld c,a&lt;br /&gt;
	xor a&lt;br /&gt;
	ld (Do_Clipleft),a&lt;br /&gt;
	ld a,d&lt;br /&gt;
	and $07&lt;br /&gt;
	ld d,a&lt;br /&gt;
Check_clip_right:&lt;br /&gt;
&lt;br /&gt;
	ld a,Cliprightsize &lt;br /&gt;
	ld (Do_Clipright),a&lt;br /&gt;
	ld a,c&lt;br /&gt;
	add a,a&lt;br /&gt;
	add a,a&lt;br /&gt;
	add a,a&lt;br /&gt;
	add a,d&lt;br /&gt;
	sub 96&lt;br /&gt;
	jp m,Check_clip_middle&lt;br /&gt;
	and $F8&lt;br /&gt;
	rra&lt;br /&gt;
	rra&lt;br /&gt;
	rra&lt;br /&gt;
	ld l,a&lt;br /&gt;
	ld a,(bigskip)&lt;br /&gt;
	add a,l&lt;br /&gt;
	inc a&lt;br /&gt;
	ld (bigskip),a&lt;br /&gt;
	neg&lt;br /&gt;
	add a,c&lt;br /&gt;
	ld c,a&lt;br /&gt;
	xor a&lt;br /&gt;
	ld (Do_Clipright),a&lt;br /&gt;
Check_clip_middle:&lt;br /&gt;
				; This is where C should be saved.&lt;br /&gt;
	xor a&lt;br /&gt;
	ld (Do_ClipMiddle),a&lt;br /&gt;
	ld a,c&lt;br /&gt;
	or a&lt;br /&gt;
	jp nz,dontskipmiddle&lt;br /&gt;
	ld a,ClipMiddlesize &lt;br /&gt;
	ld (Do_ClipMiddle),a&lt;br /&gt;
dontskipmiddle:&lt;br /&gt;
	ld l,e&lt;br /&gt;
	ld a,d	&lt;br /&gt;
	ld h,0&lt;br /&gt;
	ld d,h&lt;br /&gt;
	add hl,hl&lt;br /&gt;
	add hl,de&lt;br /&gt;
	add hl,hl&lt;br /&gt;
	add hl,hl&lt;br /&gt;
	ld e,a&lt;br /&gt;
	and $07&lt;br /&gt;
	xor 7&lt;br /&gt;
	ld (BigRot1),a&lt;br /&gt;
	ld (BigRot2),a&lt;br /&gt;
	ld (BigRot3),a&lt;br /&gt;
	add a,a&lt;br /&gt;
	ld (clipbigrot1),a&lt;br /&gt;
	ld a,$ff&lt;br /&gt;
clipbigrot1 = $+1&lt;br /&gt;
	jr $&lt;br /&gt;
	srl a&lt;br /&gt;
	srl a&lt;br /&gt;
	srl a&lt;br /&gt;
	srl a&lt;br /&gt;
	srl a&lt;br /&gt;
	srl a&lt;br /&gt;
	srl a&lt;br /&gt;
	srl e&lt;br /&gt;
	srl e&lt;br /&gt;
	srl e&lt;br /&gt;
	add hl,de&lt;br /&gt;
	ld de,gbuf&lt;br /&gt;
	add hl,de&lt;br /&gt;
				; This is where gbuf offset should be saved.&lt;br /&gt;
	ld d,a&lt;br /&gt;
	cpl&lt;br /&gt;
	ld e,a&lt;br /&gt;
				;masks should be saved to&lt;br /&gt;
BigSpriteRow:&lt;br /&gt;
	push bc&lt;br /&gt;
	push hl&lt;br /&gt;
	ld b,c&lt;br /&gt;
Do_Clipleft = $+1&lt;br /&gt;
	jr Clipleft&lt;br /&gt;
	ld a,(ix)&lt;br /&gt;
	inc ix&lt;br /&gt;
BigRot1 = $+1&lt;br /&gt;
	jr $&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
BigMask0:&lt;br /&gt;
	and e&lt;br /&gt;
	or (hl)&lt;br /&gt;
	ld (hl),a&lt;br /&gt;
Clipleft:&lt;br /&gt;
Clipleftsize = Clipleft-(Do_Clipleft+1)&lt;br /&gt;
&lt;br /&gt;
Do_ClipMiddle = $+1&lt;br /&gt;
	jr $+2&lt;br /&gt;
BigSpriteloop:&lt;br /&gt;
	ld a,(ix)&lt;br /&gt;
	inc ix&lt;br /&gt;
BigRot2 = $+1&lt;br /&gt;
	jr $&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	ld c,a&lt;br /&gt;
BigMask1:&lt;br /&gt;
	and d&lt;br /&gt;
	or (hl)&lt;br /&gt;
	ld (hl),a&lt;br /&gt;
	inc hl&lt;br /&gt;
	ld a,c&lt;br /&gt;
BigMask2:&lt;br /&gt;
	and e&lt;br /&gt;
	or (hl)&lt;br /&gt;
	ld (hl),a&lt;br /&gt;
	djnz BigSpriteloop&lt;br /&gt;
ClipMiddle:&lt;br /&gt;
ClipMiddlesize = ClipMiddle-(Do_ClipMiddle+1)&lt;br /&gt;
&lt;br /&gt;
Do_ClipRight = $+1&lt;br /&gt;
	jr ClipRight&lt;br /&gt;
	ld a,(ix)&lt;br /&gt;
BigRot3 = $+1&lt;br /&gt;
	jr $&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
BigMask3:&lt;br /&gt;
	and d&lt;br /&gt;
	or (hl)&lt;br /&gt;
	ld (hl),a&lt;br /&gt;
ClipRight:&lt;br /&gt;
Cliprightsize = ClipRight-(Do_ClipRight+1)&lt;br /&gt;
	pop hl&lt;br /&gt;
&lt;br /&gt;
	ld bc,12			;width of the screen&lt;br /&gt;
	add hl,bc&lt;br /&gt;
&lt;br /&gt;
bigskip = $+1&lt;br /&gt;
	ld bc,0&lt;br /&gt;
	add ix,bc&lt;br /&gt;
	pop bc&lt;br /&gt;
	djnz BigSpriteRow&lt;br /&gt;
	ret&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=Z80_Routines:Graphic:largesprite</id>
		<title>Z80 Routines:Graphic:largesprite</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Z80_Routines:Graphic:largesprite"/>
				<updated>2007-06-25T13:20:04Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: minor fix...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Z80 Routines:Graphic|largesprite]][[Category:Z80 Routines|largesprite]]&lt;br /&gt;
The '''Largesprite''' routine is used to copy the contents of a variable sized sprite to the Graph Buffer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
Here is Joe Wingbermuehle's version, which is the one used in ION. Gbuf must be defined before its use.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
;=======================&lt;br /&gt;
;LargeSprite&lt;br /&gt;
;by Joe Wingbermuehle&lt;br /&gt;
;=======================&lt;br /&gt;
;Does:   Copy a sprite to the gbuf&lt;br /&gt;
;Input:  ix=sprite address, a='x', l='y', b='height' (in pixels), c='width' (in bytes, e.g. 2 would be 16)&lt;br /&gt;
;Output: The sprite is copied to the gbuf&lt;br /&gt;
;-----------------------&lt;br /&gt;
largeSprite:&lt;br /&gt;
   di                                 ;turn interrupts off (we want to use shadow registers)&lt;br /&gt;
   ex   af,af'&lt;br /&gt;
                                      ;exchange af with af'     \&lt;br /&gt;
   ld   a,c                           ;ld c in a (a = 'width')  | for not destroying a ('x')&lt;br /&gt;
   push   af                          ;push a                   |&lt;br /&gt;
      ex   af,af'&lt;br /&gt;
                                      ;exchange back            | and 'width' is now in a' (saved)&lt;br /&gt;
      ld   e,l                        ;e = 'y'&lt;br /&gt;
      ld   h,$00                      ;h =  0&lt;br /&gt;
      ld   d,h                        ;d =  0&lt;br /&gt;
      add   hl,de                     ;'y' *2  \&lt;br /&gt;
      add   hl,de                     ;    *3  | calculate 'y' *12 because 'y' is 'in rows'&lt;br /&gt;
      add   hl,hl                     ;    *6  |   (screen is 12 bytes in length)&lt;br /&gt;
      add   hl,hl                     ;    *12 /&lt;br /&gt;
      ld   e,a                        ;e = 'x'&lt;br /&gt;
      and   $07                       ;and %00000111&lt;br /&gt;
      ld   c,a                        ;last 3 bits in c (amount of bits to shift all bytes)&lt;br /&gt;
      srl   e                         ;e/2   | shifting e ('x') 3 bits to the right&lt;br /&gt;
      srl   e                         ; /4   |   %11111111 becomes %00011111 for example&lt;br /&gt;
      srl   e                         ; /8   /&lt;br /&gt;
      add   hl,de                     ;hl = 'y'; de = 'x' (rounded) | add them&lt;br /&gt;
      ld   de, gbuf                   ;de = the adress of graph buffer&lt;br /&gt;
      add   hl,de                     ;add hl to the adress of the gbuf&lt;br /&gt;
largeSpriteLoop1:&lt;br /&gt;
      push   hl                       ;save adress&lt;br /&gt;
largeSpriteLoop2:&lt;br /&gt;
         ld   d,(ix)                  ;first sprite data in d&lt;br /&gt;
         ld   e,$00                   ;e = 0&lt;br /&gt;
         ld   a,c                     ;a = c (to not destroy c)&lt;br /&gt;
         or   a                       ;is a = 0? (same as cp 0)&lt;br /&gt;
         jr   z,largeSpriteSkip1      ;if theres nothing to shift (a = 0) loop it&lt;br /&gt;
largeSpriteLoop3:&lt;br /&gt;
         srl   d                      ;shift one bit to the right; put the destroyed bit in the carry flag&lt;br /&gt;
         rr   e                       ;put the carry flag in e (%00000000 becomes %10000000 if carry flag = 1)&lt;br /&gt;
         dec   a                      ;decrease counter (with was 'the amount of bits to shift')&lt;br /&gt;
         jr   nz,largeSpriteLoop3     ;if the counter is not 0 loop back&lt;br /&gt;
largeSpriteSkip1:&lt;br /&gt;
         ld   a,(hl)                  ;graphbyte in a&lt;br /&gt;
         xor   d                      ;xor first byte of sprite (that can be changed to 'or d' if you want a OR-routine)&lt;br /&gt;
         ld   (hl),a                  ;back to buffer&lt;br /&gt;
         inc   hl                     ;increase pointer&lt;br /&gt;
         ld   a,(hl)                  ;graphbyte in a&lt;br /&gt;
         xor   e                      ;xor with shifted sprite byte (change to 'or e' for OR-routine)&lt;br /&gt;
         ld   (hl),a                  ;back to buffer&lt;br /&gt;
         inc   ix                     ;increase sprite adress&lt;br /&gt;
         ex   af,af'&lt;br /&gt;
                                      ;exchange af with af' ( a is now the 'width' from the first line)&lt;br /&gt;
         dec   a                      ;decrease 'width'&lt;br /&gt;
         push   af                    ;push the 'width'&lt;br /&gt;
            ex   af,af'&lt;br /&gt;
                                      ;exchange back&lt;br /&gt;
         pop   af                     ;pop the 'width'&lt;br /&gt;
         jr   nz,largeSpriteLoop2     ;if a is not 0 (if a = 0 then we would be done) loop it&lt;br /&gt;
      pop   hl                        ;pop gbuf adress (search the last push hl!)&lt;br /&gt;
   pop   af                           ;pop  | to restore the real 'width'&lt;br /&gt;
   push   af                          ;push /&lt;br /&gt;
      ex   af,af'&lt;br /&gt;
                                      ;af' must be the original 'width' when loop 'largeSpriteLoop1'&lt;br /&gt;
      ld   de,$0C                     ;ld de,12&lt;br /&gt;
      add   hl,de                     ;next line&lt;br /&gt;
      djnz   largeSpriteLoop1         ;if not b = 0 loop (b = height of sprite)&lt;br /&gt;
   pop   af                           ;pop because we dont want a stack problem :)&lt;br /&gt;
   ret                                ;return&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
   ;...&lt;br /&gt;
   ld   l,8   ;y&lt;br /&gt;
   ld   a,16  ;x&lt;br /&gt;
   ld   b,8   ;height&lt;br /&gt;
   ld   c,2   ;width in bytes&lt;br /&gt;
   ld   ix,sprite&lt;br /&gt;
   call largesprite&lt;br /&gt;
   call fastcopy&lt;br /&gt;
   ;...&lt;br /&gt;
sprite:&lt;br /&gt;
   .db %11111111,%11111111&lt;br /&gt;
   .db %10000000,%00000001&lt;br /&gt;
   .db %10000000,%00000001&lt;br /&gt;
   .db %10000000,%00000001&lt;br /&gt;
   .db %10000000,%00000001&lt;br /&gt;
   .db %10000000,%00000001&lt;br /&gt;
   .db %10000000,%00000001&lt;br /&gt;
   .db %11111111,%11111111&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Version without shadow registers ==&lt;br /&gt;
&lt;br /&gt;
by Tijl Coosemans, made for Venus. Compatible with ION's routine. screenBuf must be defined.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
iLargeSprite&lt;br /&gt;
	ld	h,0&lt;br /&gt;
	ld	d,h&lt;br /&gt;
	ld	e,l&lt;br /&gt;
	add	hl,de&lt;br /&gt;
	add	hl,de&lt;br /&gt;
	add	hl,hl&lt;br /&gt;
	add	hl,hl&lt;br /&gt;
	ld	e,a&lt;br /&gt;
	srl	e&lt;br /&gt;
	srl	e&lt;br /&gt;
	srl	e&lt;br /&gt;
	add	hl,de&lt;br /&gt;
	ld	de,screenBuf&lt;br /&gt;
	add	hl,de&lt;br /&gt;
	and	7&lt;br /&gt;
	ld	e,a&lt;br /&gt;
iLargeSpriteLoop1&lt;br /&gt;
	push	bc&lt;br /&gt;
	push	hl&lt;br /&gt;
	ld	b,c&lt;br /&gt;
iLargeSpriteLoop2&lt;br /&gt;
	ld	c,(ix)&lt;br /&gt;
	ld	d,0&lt;br /&gt;
	inc	ix&lt;br /&gt;
	ld	a,e&lt;br /&gt;
	or	a&lt;br /&gt;
	jr	z,iLargeSprite1&lt;br /&gt;
iLargeSpriteLoop3&lt;br /&gt;
	srl	c&lt;br /&gt;
	rr	d&lt;br /&gt;
	dec	a&lt;br /&gt;
	jr	nz,iLargeSpriteLoop3&lt;br /&gt;
iLargeSprite1&lt;br /&gt;
	ld	a,c&lt;br /&gt;
	xor	(hl)&lt;br /&gt;
	ld	(hl),a&lt;br /&gt;
	inc	hl&lt;br /&gt;
	ld	a,d&lt;br /&gt;
	xor	(hl)&lt;br /&gt;
	ld	(hl),a&lt;br /&gt;
	djnz	iLargeSpriteLoop2&lt;br /&gt;
	pop	hl&lt;br /&gt;
	ld	c,12&lt;br /&gt;
	add	hl,bc&lt;br /&gt;
	pop	bc&lt;br /&gt;
	djnz	iLargeSpriteLoop1&lt;br /&gt;
	ret&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Version with Clipping ==&lt;br /&gt;
This is a version that supports clipping the large sprite.  It's considerable larger and requires Self modifying code.  The SMC can be removed without to much difficulty. It has different inputs than ION's.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;;--------------------------------&lt;br /&gt;
;Clip Big Sprite&lt;br /&gt;
;by James Montelongo&lt;br /&gt;
;MAX SIZE: 64x64&lt;br /&gt;
;ix - Sprite&lt;br /&gt;
;b  - height&lt;br /&gt;
;c  - width in bytes&lt;br /&gt;
;d  - x&lt;br /&gt;
;e  - y&lt;br /&gt;
&lt;br /&gt;
ClipBigSprite:&lt;br /&gt;
; Early out, Check if its even remotely on screen&lt;br /&gt;
	ld a,e&lt;br /&gt;
	cp 64&lt;br /&gt;
	ret p&lt;br /&gt;
	add a,b&lt;br /&gt;
	ret m&lt;br /&gt;
	ret z&lt;br /&gt;
	ld a,d&lt;br /&gt;
	cp 96&lt;br /&gt;
	ret p&lt;br /&gt;
	ld a,c&lt;br /&gt;
	add a,a&lt;br /&gt;
	add a,a&lt;br /&gt;
	add a,a&lt;br /&gt;
	add a,d&lt;br /&gt;
	ret m&lt;br /&gt;
	ret z&lt;br /&gt;
&lt;br /&gt;
	ld a,e&lt;br /&gt;
	or a&lt;br /&gt;
	jp p,Check_clip_bottom&lt;br /&gt;
	neg&lt;br /&gt;
	push de&lt;br /&gt;
	ld hl,0&lt;br /&gt;
	ld d,l&lt;br /&gt;
	ld e,a&lt;br /&gt;
	bit 2,c&lt;br /&gt;
	jr z,$+2+1&lt;br /&gt;
	add hl,de&lt;br /&gt;
	add hl,hl	&lt;br /&gt;
	bit 1,c&lt;br /&gt;
	jr z,$+2+1&lt;br /&gt;
	add hl,de&lt;br /&gt;
	add hl,hl	&lt;br /&gt;
	bit 0,c&lt;br /&gt;
	jr z,$+2+1&lt;br /&gt;
	add hl,de&lt;br /&gt;
	pop de&lt;br /&gt;
	ex de,hl&lt;br /&gt;
	add ix,de		;Here you can save the top offset&lt;br /&gt;
	ex de,hl&lt;br /&gt;
	ld e,0&lt;br /&gt;
	neg&lt;br /&gt;
	add a,b&lt;br /&gt;
	ld b,a&lt;br /&gt;
Check_clip_bottom:&lt;br /&gt;
&lt;br /&gt;
	ld a,e&lt;br /&gt;
	add a,b&lt;br /&gt;
	sub 64&lt;br /&gt;
	jp m,Check_clip_Left&lt;br /&gt;
	neg&lt;br /&gt;
	add a,b&lt;br /&gt;
	ld b,a&lt;br /&gt;
Check_clip_Left:&lt;br /&gt;
				; at this point you may want to save b&lt;br /&gt;
	xor a&lt;br /&gt;
	ld (bigskip),a&lt;br /&gt;
	ld a,Clipleftsize &lt;br /&gt;
	ld (Do_Clipleft),a&lt;br /&gt;
	ld a,d&lt;br /&gt;
	or a&lt;br /&gt;
	jp p,Check_clip_right&lt;br /&gt;
	neg&lt;br /&gt;
	dec a&lt;br /&gt;
	and $F8&lt;br /&gt;
	rra&lt;br /&gt;
	rra&lt;br /&gt;
	rra&lt;br /&gt;
	ex de,hl		;save the clipped left offset&lt;br /&gt;
	ld e,a&lt;br /&gt;
	ld d,0&lt;br /&gt;
	add ix,de&lt;br /&gt;
	ld (bigskip),a&lt;br /&gt;
	ex de,hl&lt;br /&gt;
	inc a&lt;br /&gt;
	neg&lt;br /&gt;
	add a,c&lt;br /&gt;
	ld c,a&lt;br /&gt;
	xor a&lt;br /&gt;
	ld (Do_Clipleft),a&lt;br /&gt;
	ld a,d&lt;br /&gt;
	and $07&lt;br /&gt;
	ld d,a&lt;br /&gt;
Check_clip_right:&lt;br /&gt;
&lt;br /&gt;
	ld a,Cliprightsize &lt;br /&gt;
	ld (Do_Clipright),a&lt;br /&gt;
	ld a,c&lt;br /&gt;
	add a,a&lt;br /&gt;
	add a,a&lt;br /&gt;
	add a,a&lt;br /&gt;
	add a,d&lt;br /&gt;
	sub 96&lt;br /&gt;
	jp m,Check_clip_middle&lt;br /&gt;
	and $F8&lt;br /&gt;
	rra&lt;br /&gt;
	rra&lt;br /&gt;
	rra&lt;br /&gt;
	ld l,a&lt;br /&gt;
	ld a,(bigskip)&lt;br /&gt;
	add a,l&lt;br /&gt;
	inc a&lt;br /&gt;
	ld (bigskip),a&lt;br /&gt;
	neg&lt;br /&gt;
	add a,c&lt;br /&gt;
	ld c,a&lt;br /&gt;
	xor a&lt;br /&gt;
	ld (Do_Clipright),a&lt;br /&gt;
Check_clip_middle:&lt;br /&gt;
				; This is where C should be saved.&lt;br /&gt;
	xor a&lt;br /&gt;
	ld (Do_ClipMiddle),a&lt;br /&gt;
	ld a,c&lt;br /&gt;
	or a&lt;br /&gt;
	jp nz,dontskipmiddle&lt;br /&gt;
	ld a,ClipMiddlesize &lt;br /&gt;
	ld (Do_ClipMiddle),a&lt;br /&gt;
dontskipmiddle:&lt;br /&gt;
	ld l,e&lt;br /&gt;
	ld a,d	&lt;br /&gt;
	ld h,0&lt;br /&gt;
	ld d,h&lt;br /&gt;
	add hl,hl&lt;br /&gt;
	add hl,de&lt;br /&gt;
	add hl,hl&lt;br /&gt;
	add hl,hl&lt;br /&gt;
	ld e,a&lt;br /&gt;
	and $07&lt;br /&gt;
	xor 7&lt;br /&gt;
	ld (BigRot1),a&lt;br /&gt;
	ld (BigRot2),a&lt;br /&gt;
	ld (BigRot3),a&lt;br /&gt;
	add a,a&lt;br /&gt;
	ld (clipbigrot1),a&lt;br /&gt;
	ld a,$ff&lt;br /&gt;
clipbigrot1 = $+1&lt;br /&gt;
	jr $&lt;br /&gt;
	srl a&lt;br /&gt;
	srl a&lt;br /&gt;
	srl a&lt;br /&gt;
	srl a&lt;br /&gt;
	srl a&lt;br /&gt;
	srl a&lt;br /&gt;
	srl a&lt;br /&gt;
	srl e&lt;br /&gt;
	srl e&lt;br /&gt;
	srl e&lt;br /&gt;
	add hl,de&lt;br /&gt;
	ld de,gbuf&lt;br /&gt;
	add hl,de&lt;br /&gt;
				; This is where gbuf offset should be saved.&lt;br /&gt;
	ld d,a&lt;br /&gt;
	cpl&lt;br /&gt;
	ld e,a&lt;br /&gt;
				;masks should be saved to&lt;br /&gt;
BigSpriteRow:&lt;br /&gt;
	push bc&lt;br /&gt;
	push hl&lt;br /&gt;
	ld b,c&lt;br /&gt;
Do_Clipleft = $+1&lt;br /&gt;
	jr Clipleft&lt;br /&gt;
	ld a,(ix)&lt;br /&gt;
	inc ix&lt;br /&gt;
BigRot1 = $+1&lt;br /&gt;
	jr $&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
BigMask0:&lt;br /&gt;
	and e&lt;br /&gt;
	or (hl)&lt;br /&gt;
	ld (hl),a&lt;br /&gt;
Clipleft:&lt;br /&gt;
Clipleftsize = Clipleft-(Do_Clipleft+1)&lt;br /&gt;
&lt;br /&gt;
Do_ClipMiddle = $+1&lt;br /&gt;
	jr $+2&lt;br /&gt;
BigSpriteloop:&lt;br /&gt;
	ld a,(ix)&lt;br /&gt;
	inc ix&lt;br /&gt;
BigRot2 = $+1&lt;br /&gt;
	jr $&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	ld c,a&lt;br /&gt;
BigMask1:&lt;br /&gt;
	and d&lt;br /&gt;
	or (hl)&lt;br /&gt;
	ld (hl),a&lt;br /&gt;
	inc hl&lt;br /&gt;
	ld a,c&lt;br /&gt;
BigMask2:&lt;br /&gt;
	and e&lt;br /&gt;
	or (hl)&lt;br /&gt;
	ld (hl),a&lt;br /&gt;
	djnz BigSpriteloop&lt;br /&gt;
ClipMiddle:&lt;br /&gt;
ClipMiddlesize = ClipMiddle-(Do_ClipMiddle+1)&lt;br /&gt;
&lt;br /&gt;
Do_ClipRight = $+1&lt;br /&gt;
	jr ClipRight&lt;br /&gt;
	ld a,(ix)&lt;br /&gt;
BigRot3 = $+1&lt;br /&gt;
	jr $&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
BigMask3:&lt;br /&gt;
	and d&lt;br /&gt;
	or (hl)&lt;br /&gt;
	ld (hl),a&lt;br /&gt;
ClipRight:&lt;br /&gt;
Cliprightsize = ClipRight-(Do_ClipRight+1)&lt;br /&gt;
	pop hl&lt;br /&gt;
&lt;br /&gt;
	ld bc,12			;width of the screen&lt;br /&gt;
	add hl,bc&lt;br /&gt;
&lt;br /&gt;
bigskip = $+1&lt;br /&gt;
	ld bc,0&lt;br /&gt;
	add ix,bc&lt;br /&gt;
	pop bc&lt;br /&gt;
	djnz BigSpriteRow&lt;br /&gt;
	ret&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=Z80_Routines:Graphic:largesprite</id>
		<title>Z80 Routines:Graphic:largesprite</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Z80_Routines:Graphic:largesprite"/>
				<updated>2007-06-24T18:30:50Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: Adding a clipping large sprite routine.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Z80 Routines:Graphic|largesprite]][[Category:Z80 Routines|largesprite]]&lt;br /&gt;
The '''Largesprite''' routine is used to copy the contents of a variable sized sprite to the Graph Buffer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
Here is Joe Wingbermuehle's version, which is the one used in ION. Gbuf must be defined before its use.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
;=======================&lt;br /&gt;
;LargeSprite&lt;br /&gt;
;by Joe Wingbermuehle&lt;br /&gt;
;=======================&lt;br /&gt;
;Does:   Copy a sprite to the gbuf&lt;br /&gt;
;Input:  ix=sprite address, a='x', l='y', b='height' (in pixels), c='width' (in bytes, e.g. 2 would be 16)&lt;br /&gt;
;Output: The sprite is copied to the gbuf&lt;br /&gt;
;-----------------------&lt;br /&gt;
largeSprite:&lt;br /&gt;
   di                                 ;turn interrupts off (we want to use shadow registers)&lt;br /&gt;
   ex   af,af'&lt;br /&gt;
                                      ;exchange af with af'     \&lt;br /&gt;
   ld   a,c                           ;ld c in a (a = 'width')  | for not destroying a ('x')&lt;br /&gt;
   push   af                          ;push a                   |&lt;br /&gt;
      ex   af,af'&lt;br /&gt;
                                      ;exchange back            | and 'width' is now in a' (saved)&lt;br /&gt;
      ld   e,l                        ;e = 'y'&lt;br /&gt;
      ld   h,$00                      ;h =  0&lt;br /&gt;
      ld   d,h                        ;d =  0&lt;br /&gt;
      add   hl,de                     ;'y' *2  \&lt;br /&gt;
      add   hl,de                     ;    *3  | calculate 'y' *12 because 'y' is 'in rows'&lt;br /&gt;
      add   hl,hl                     ;    *6  |   (screen is 12 bytes in length)&lt;br /&gt;
      add   hl,hl                     ;    *12 /&lt;br /&gt;
      ld   e,a                        ;e = 'x'&lt;br /&gt;
      and   $07                       ;and %00000111&lt;br /&gt;
      ld   c,a                        ;last 3 bits in c (amount of bits to shift all bytes)&lt;br /&gt;
      srl   e                         ;e/2   | shifting e ('x') 3 bits to the right&lt;br /&gt;
      srl   e                         ; /4   |   %11111111 becomes %00011111 for example&lt;br /&gt;
      srl   e                         ; /8   /&lt;br /&gt;
      add   hl,de                     ;hl = 'y'; de = 'x' (rounded) | add them&lt;br /&gt;
      ld   de, gbuf                   ;de = the adress of graph buffer&lt;br /&gt;
      add   hl,de                     ;add hl to the adress of the gbuf&lt;br /&gt;
largeSpriteLoop1:&lt;br /&gt;
      push   hl                       ;save adress&lt;br /&gt;
largeSpriteLoop2:&lt;br /&gt;
         ld   d,(ix)                  ;first sprite data in d&lt;br /&gt;
         ld   e,$00                   ;e = 0&lt;br /&gt;
         ld   a,c                     ;a = c (to not destroy c)&lt;br /&gt;
         or   a                       ;is a = 0? (same as cp 0)&lt;br /&gt;
         jr   z,largeSpriteSkip1      ;if theres nothing to shift (a = 0) loop it&lt;br /&gt;
largeSpriteLoop3:&lt;br /&gt;
         srl   d                      ;shift one bit to the right; put the destroyed bit in the carry flag&lt;br /&gt;
         rr   e                       ;put the carry flag in e (%00000000 becomes %10000000 if carry flag = 1)&lt;br /&gt;
         dec   a                      ;decrease counter (with was 'the amount of bits to shift')&lt;br /&gt;
         jr   nz,largeSpriteLoop3     ;if the counter is not 0 loop back&lt;br /&gt;
largeSpriteSkip1:&lt;br /&gt;
         ld   a,(hl)                  ;graphbyte in a&lt;br /&gt;
         xor   d                      ;xor first byte of sprite (that can be changed to 'or d' if you want a OR-routine)&lt;br /&gt;
         ld   (hl),a                  ;back to buffer&lt;br /&gt;
         inc   hl                     ;increase pointer&lt;br /&gt;
         ld   a,(hl)                  ;graphbyte in a&lt;br /&gt;
         xor   e                      ;xor with shifted sprite byte (change to 'or e' for OR-routine)&lt;br /&gt;
         ld   (hl),a                  ;back to buffer&lt;br /&gt;
         inc   ix                     ;increase sprite adress&lt;br /&gt;
         ex   af,af'&lt;br /&gt;
                                      ;exchange af with af' ( a is now the 'width' from the first line)&lt;br /&gt;
         dec   a                      ;decrease 'width'&lt;br /&gt;
         push   af                    ;push the 'width'&lt;br /&gt;
            ex   af,af'&lt;br /&gt;
                                      ;exchange back&lt;br /&gt;
         pop   af                     ;pop the 'width'&lt;br /&gt;
         jr   nz,largeSpriteLoop2     ;if a is not 0 (if a = 0 then we would be done) loop it&lt;br /&gt;
      pop   hl                        ;pop gbuf adress (search the last push hl!)&lt;br /&gt;
   pop   af                           ;pop  | to restore the real 'width'&lt;br /&gt;
   push   af                          ;push /&lt;br /&gt;
      ex   af,af'&lt;br /&gt;
                                      ;af' must be the original 'width' when loop 'largeSpriteLoop1'&lt;br /&gt;
      ld   de,$0C                     ;ld de,12&lt;br /&gt;
      add   hl,de                     ;next line&lt;br /&gt;
      djnz   largeSpriteLoop1         ;if not b = 0 loop (b = height of sprite)&lt;br /&gt;
   pop   af                           ;pop because we dont want a stack problem :)&lt;br /&gt;
   ret                                ;return&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
   ;...&lt;br /&gt;
   ld   l,8   ;y&lt;br /&gt;
   ld   a,16  ;x&lt;br /&gt;
   ld   b,8   ;height&lt;br /&gt;
   ld   c,2   ;width in bytes&lt;br /&gt;
   ld   ix,sprite&lt;br /&gt;
   call largesprite&lt;br /&gt;
   call fastcopy&lt;br /&gt;
   ;...&lt;br /&gt;
sprite:&lt;br /&gt;
   .db %11111111,%11111111&lt;br /&gt;
   .db %10000000,%00000001&lt;br /&gt;
   .db %10000000,%00000001&lt;br /&gt;
   .db %10000000,%00000001&lt;br /&gt;
   .db %10000000,%00000001&lt;br /&gt;
   .db %10000000,%00000001&lt;br /&gt;
   .db %10000000,%00000001&lt;br /&gt;
   .db %11111111,%11111111&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Version without shadow registers ==&lt;br /&gt;
&lt;br /&gt;
by Tijl Coosemans, made for Venus. Compatible with ION's routine. screenBuf must be defined.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
iLargeSprite&lt;br /&gt;
	ld	h,0&lt;br /&gt;
	ld	d,h&lt;br /&gt;
	ld	e,l&lt;br /&gt;
	add	hl,de&lt;br /&gt;
	add	hl,de&lt;br /&gt;
	add	hl,hl&lt;br /&gt;
	add	hl,hl&lt;br /&gt;
	ld	e,a&lt;br /&gt;
	srl	e&lt;br /&gt;
	srl	e&lt;br /&gt;
	srl	e&lt;br /&gt;
	add	hl,de&lt;br /&gt;
	ld	de,screenBuf&lt;br /&gt;
	add	hl,de&lt;br /&gt;
	and	7&lt;br /&gt;
	ld	e,a&lt;br /&gt;
iLargeSpriteLoop1&lt;br /&gt;
	push	bc&lt;br /&gt;
	push	hl&lt;br /&gt;
	ld	b,c&lt;br /&gt;
iLargeSpriteLoop2&lt;br /&gt;
	ld	c,(ix)&lt;br /&gt;
	ld	d,0&lt;br /&gt;
	inc	ix&lt;br /&gt;
	ld	a,e&lt;br /&gt;
	or	a&lt;br /&gt;
	jr	z,iLargeSprite1&lt;br /&gt;
iLargeSpriteLoop3&lt;br /&gt;
	srl	c&lt;br /&gt;
	rr	d&lt;br /&gt;
	dec	a&lt;br /&gt;
	jr	nz,iLargeSpriteLoop3&lt;br /&gt;
iLargeSprite1&lt;br /&gt;
	ld	a,c&lt;br /&gt;
	xor	(hl)&lt;br /&gt;
	ld	(hl),a&lt;br /&gt;
	inc	hl&lt;br /&gt;
	ld	a,d&lt;br /&gt;
	xor	(hl)&lt;br /&gt;
	ld	(hl),a&lt;br /&gt;
	djnz	iLargeSpriteLoop2&lt;br /&gt;
	pop	hl&lt;br /&gt;
	ld	c,12&lt;br /&gt;
	add	hl,bc&lt;br /&gt;
	pop	bc&lt;br /&gt;
	djnz	iLargeSpriteLoop1&lt;br /&gt;
	ret&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Version with Clipping ==&lt;br /&gt;
This is a version that supports clipping the large sprite.  It's considerable larger and requires Self modifying code.  The SMC can be removed without to much difficulty. It has different inputs than ION's.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;;--------------------------------&lt;br /&gt;
;Clip Big Sprite&lt;br /&gt;
;by James Montelongo&lt;br /&gt;
;MAX SIZE: 64x64&lt;br /&gt;
;ix - Sprite&lt;br /&gt;
;b  - height&lt;br /&gt;
;c  - width in bytes&lt;br /&gt;
;d  - x&lt;br /&gt;
;e  - y&lt;br /&gt;
&lt;br /&gt;
ClipBigSprite:&lt;br /&gt;
; Early out, Check if its even remotely on screen&lt;br /&gt;
	ld a,e&lt;br /&gt;
	cp 64&lt;br /&gt;
	ret p&lt;br /&gt;
	add a,b&lt;br /&gt;
	ret m&lt;br /&gt;
	ret z&lt;br /&gt;
	ld a,d&lt;br /&gt;
	cp 96&lt;br /&gt;
	ret p&lt;br /&gt;
	ld a,c&lt;br /&gt;
	add a,a&lt;br /&gt;
	add a,a&lt;br /&gt;
	add a,a&lt;br /&gt;
	add a,d&lt;br /&gt;
	ret m&lt;br /&gt;
	ret z&lt;br /&gt;
&lt;br /&gt;
	ld a,e&lt;br /&gt;
	or a&lt;br /&gt;
	jp p,Check_clip_bottom&lt;br /&gt;
	neg&lt;br /&gt;
	push de&lt;br /&gt;
	ld hl,0&lt;br /&gt;
	ld d,l&lt;br /&gt;
	ld e,a&lt;br /&gt;
	bit 2,c&lt;br /&gt;
	jr z,$+2+1&lt;br /&gt;
	add hl,de&lt;br /&gt;
	add hl,hl	&lt;br /&gt;
	bit 1,c&lt;br /&gt;
	jr z,$+2+1&lt;br /&gt;
	add hl,de&lt;br /&gt;
	add hl,hl	&lt;br /&gt;
	bit 0,c&lt;br /&gt;
	jr z,$+2+1&lt;br /&gt;
	add hl,de&lt;br /&gt;
	pop de&lt;br /&gt;
	ex de,hl&lt;br /&gt;
	add ix,de		;Here you can save the top offset&lt;br /&gt;
	ex de,hl&lt;br /&gt;
	ld e,0&lt;br /&gt;
	neg&lt;br /&gt;
	add a,b&lt;br /&gt;
	ld b,a&lt;br /&gt;
Check_clip_bottom:&lt;br /&gt;
&lt;br /&gt;
	ld a,e&lt;br /&gt;
	add a,b&lt;br /&gt;
	sub 64&lt;br /&gt;
	jp m,Check_clip_Left&lt;br /&gt;
	neg&lt;br /&gt;
	add a,b&lt;br /&gt;
	ld b,a&lt;br /&gt;
Check_clip_Left:&lt;br /&gt;
				; at this point you may want to save b&lt;br /&gt;
	xor a&lt;br /&gt;
	ld (bigskip),a&lt;br /&gt;
	ld a,Clipleftsize &lt;br /&gt;
	ld (Do_Clipleft),a&lt;br /&gt;
	ld a,d&lt;br /&gt;
	or a&lt;br /&gt;
	jp p,Check_clip_right&lt;br /&gt;
	neg&lt;br /&gt;
	and $F8&lt;br /&gt;
	rra&lt;br /&gt;
	rra&lt;br /&gt;
	rra&lt;br /&gt;
	ex de,hl		;save the clipped left offset&lt;br /&gt;
	ld e,a&lt;br /&gt;
	ld d,0&lt;br /&gt;
	add ix,de&lt;br /&gt;
	ld (bigskip),a&lt;br /&gt;
	ex de,hl&lt;br /&gt;
	inc a&lt;br /&gt;
	neg&lt;br /&gt;
	add a,c&lt;br /&gt;
	ld c,a&lt;br /&gt;
	xor a&lt;br /&gt;
	ld (Do_Clipleft),a&lt;br /&gt;
	ld a,d&lt;br /&gt;
	and $07&lt;br /&gt;
	ld d,a&lt;br /&gt;
Check_clip_right:&lt;br /&gt;
&lt;br /&gt;
	ld a,Cliprightsize &lt;br /&gt;
	ld (Do_Clipright),a&lt;br /&gt;
	ld a,c&lt;br /&gt;
	add a,a&lt;br /&gt;
	add a,a&lt;br /&gt;
	add a,a&lt;br /&gt;
	add a,d&lt;br /&gt;
	sub 96&lt;br /&gt;
	jp m,Check_clip_middle&lt;br /&gt;
	and $F8&lt;br /&gt;
	rra&lt;br /&gt;
	rra&lt;br /&gt;
	rra&lt;br /&gt;
	ld l,a&lt;br /&gt;
	ld a,(bigskip)&lt;br /&gt;
	add a,l&lt;br /&gt;
	inc a&lt;br /&gt;
	ld (bigskip),a&lt;br /&gt;
	neg&lt;br /&gt;
	add a,c&lt;br /&gt;
	ld c,a&lt;br /&gt;
	xor a&lt;br /&gt;
	ld (Do_Clipright),a&lt;br /&gt;
Check_clip_middle:&lt;br /&gt;
				; This is where C should be saved.&lt;br /&gt;
	xor a&lt;br /&gt;
	ld (Do_ClipMiddle),a&lt;br /&gt;
	ld a,c&lt;br /&gt;
	or a&lt;br /&gt;
	jp nz,dontskipmiddle&lt;br /&gt;
	ld a,ClipMiddlesize &lt;br /&gt;
	ld (Do_ClipMiddle),a&lt;br /&gt;
dontskipmiddle:&lt;br /&gt;
	ld l,e&lt;br /&gt;
	ld a,d	&lt;br /&gt;
	ld h,0&lt;br /&gt;
	ld d,h&lt;br /&gt;
	add hl,hl&lt;br /&gt;
	add hl,de&lt;br /&gt;
	add hl,hl&lt;br /&gt;
	add hl,hl&lt;br /&gt;
	ld e,a&lt;br /&gt;
	and $07&lt;br /&gt;
	xor 7&lt;br /&gt;
	ld (BigRot1),a&lt;br /&gt;
	ld (BigRot2),a&lt;br /&gt;
	ld (BigRot3),a&lt;br /&gt;
	add a,a&lt;br /&gt;
	ld (clipbigrot1),a&lt;br /&gt;
	ld a,$ff&lt;br /&gt;
clipbigrot1 = $+1&lt;br /&gt;
	jr $&lt;br /&gt;
	srl a&lt;br /&gt;
	srl a&lt;br /&gt;
	srl a&lt;br /&gt;
	srl a&lt;br /&gt;
	srl a&lt;br /&gt;
	srl a&lt;br /&gt;
	srl a&lt;br /&gt;
	srl e&lt;br /&gt;
	srl e&lt;br /&gt;
	srl e&lt;br /&gt;
	add hl,de&lt;br /&gt;
	ld de,gbuf&lt;br /&gt;
	add hl,de&lt;br /&gt;
				; This is where gbuf offset should be saved.&lt;br /&gt;
	ld d,a&lt;br /&gt;
	cpl&lt;br /&gt;
	ld e,a&lt;br /&gt;
				;masks should be saved to&lt;br /&gt;
BigSpriteRow:&lt;br /&gt;
	push bc&lt;br /&gt;
	push hl&lt;br /&gt;
	ld b,c&lt;br /&gt;
Do_Clipleft = $+1&lt;br /&gt;
	jr Clipleft&lt;br /&gt;
	ld a,(ix)&lt;br /&gt;
	inc ix&lt;br /&gt;
BigRot1 = $+1&lt;br /&gt;
	jr $&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
BigMask0:&lt;br /&gt;
	and e&lt;br /&gt;
	or (hl)&lt;br /&gt;
	ld (hl),a&lt;br /&gt;
Clipleft:&lt;br /&gt;
Clipleftsize = Clipleft-(Do_Clipleft+1)&lt;br /&gt;
&lt;br /&gt;
Do_ClipMiddle = $+1&lt;br /&gt;
	jr $+2&lt;br /&gt;
BigSpriteloop:&lt;br /&gt;
	ld a,(ix)&lt;br /&gt;
	inc ix&lt;br /&gt;
BigRot2 = $+1&lt;br /&gt;
	jr $&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	ld c,a&lt;br /&gt;
BigMask1:&lt;br /&gt;
	and d&lt;br /&gt;
	or (hl)&lt;br /&gt;
	ld (hl),a&lt;br /&gt;
	inc hl&lt;br /&gt;
	ld a,c&lt;br /&gt;
BigMask2:&lt;br /&gt;
	and e&lt;br /&gt;
	or (hl)&lt;br /&gt;
	ld (hl),a&lt;br /&gt;
	djnz BigSpriteloop&lt;br /&gt;
ClipMiddle:&lt;br /&gt;
ClipMiddlesize = ClipMiddle-(Do_ClipMiddle+1)&lt;br /&gt;
&lt;br /&gt;
Do_ClipRight = $+1&lt;br /&gt;
	jr ClipRight&lt;br /&gt;
	ld a,(ix)&lt;br /&gt;
BigRot3 = $+1&lt;br /&gt;
	jr $&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
BigMask3:&lt;br /&gt;
	and d&lt;br /&gt;
	or (hl)&lt;br /&gt;
	ld (hl),a&lt;br /&gt;
ClipRight:&lt;br /&gt;
Cliprightsize = ClipRight-(Do_ClipRight+1)&lt;br /&gt;
	pop hl&lt;br /&gt;
&lt;br /&gt;
	ld bc,12			;width of the screen&lt;br /&gt;
	add hl,bc&lt;br /&gt;
&lt;br /&gt;
bigskip = $+1&lt;br /&gt;
	ld bc,0&lt;br /&gt;
	add ix,bc&lt;br /&gt;
	pop bc&lt;br /&gt;
	djnz BigSpriteRow&lt;br /&gt;
	ret&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=83Plus:BCALLs:42FD</id>
		<title>83Plus:BCALLs:42FD</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=83Plus:BCALLs:42FD"/>
				<updated>2007-06-21T12:40:34Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: Quickly putting a page. Borrowed template from MemChk.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:83Plus:BCALLs:By_Name:Memory|EnoughMem]] [[Category:83Plus:BCALLs:By_Name|EnoughMem]] [[Category:83Plus:BCALLs:By_Address|42FD - EnoughMem]]&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
'''Official Name:''' EnoughMem&lt;br /&gt;
&lt;br /&gt;
'''BCALL Address:''' 42FD&lt;br /&gt;
&lt;br /&gt;
Checks if an imputed amount of RAM is available. This routine will also attempt to free RAM that is taken by temporary variables that have been marked dirty but not yet deleted.&lt;br /&gt;
&lt;br /&gt;
=== Inputs ===&lt;br /&gt;
* HL = amount of RAM to check for being available&lt;br /&gt;
&lt;br /&gt;
=== Outputs ===&lt;br /&gt;
* DE = amount of RAM to check for being available&lt;br /&gt;
* Carry set if there is insufficient RAM available&lt;br /&gt;
&lt;br /&gt;
=== Destroys ===&lt;br /&gt;
* All&lt;br /&gt;
&lt;br /&gt;
== Remarks ==&lt;br /&gt;
No error is generated.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;B_CALL EnoughMem&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=Z80_Routines:Graphic:Fastcopy</id>
		<title>Z80 Routines:Graphic:Fastcopy</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Z80_Routines:Graphic:Fastcopy"/>
				<updated>2007-06-15T03:03:41Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: minor changes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Z80 Routines:Graphic|fastcopy]][[Category:Z80 Routines|fastcopy]]&lt;br /&gt;
__FORCETOC__ &lt;br /&gt;
&lt;br /&gt;
==IonFastcopy==&lt;br /&gt;
'''Warning:''' ''The routines presented below may fail on some calculators due to manufacturing defects. Before using any of the routines below, read the safecopy section below.''&lt;br /&gt;
&lt;br /&gt;
The '''Fastcopy''' routine is used to copy the content of the Graph Buffer to the screen. It concerns all TI-z80 calculators, except TI-85 and TI-86, that has a special RAM area directly mapped to the screen.&lt;br /&gt;
&lt;br /&gt;
Fastcopy is widely used, because the rom call _GrBufCpy waits too long between each output to the LCD driver. Using Fastcopy instead of _GrBufCpy increases significantly the speed of a program if it refreshes often the display (such as a lot of games). Most shells have this routine as built-in (ION, MirageOS, Venus ...).&lt;br /&gt;
&lt;br /&gt;
Here is Joe Wingbermuehle's version, which is the one used in ION.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
;-----&amp;gt; Copy the gbuf to the screen (fast)&lt;br /&gt;
;Input: nothing&lt;br /&gt;
;Output:graph buffer is copied to the screen&lt;br /&gt;
fastCopy:&lt;br /&gt;
 di&lt;br /&gt;
 ld a,$80&lt;br /&gt;
 out ($10),a&lt;br /&gt;
 ld hl,gbuf-12-(-(12*64)+1)&lt;br /&gt;
 ld a,$20&lt;br /&gt;
 ld c,a&lt;br /&gt;
 inc hl&lt;br /&gt;
 dec hl&lt;br /&gt;
fastCopyAgain:&lt;br /&gt;
 ld b,64&lt;br /&gt;
 inc c&lt;br /&gt;
 ld de,-(12*64)+1&lt;br /&gt;
 out ($10),a&lt;br /&gt;
 add hl,de&lt;br /&gt;
 ld de,10&lt;br /&gt;
fastCopyLoop:&lt;br /&gt;
 add hl,de&lt;br /&gt;
 inc hl&lt;br /&gt;
 inc hl&lt;br /&gt;
 inc de&lt;br /&gt;
 ld a,(hl)&lt;br /&gt;
 out ($11),a&lt;br /&gt;
 dec de&lt;br /&gt;
 djnz fastCopyLoop&lt;br /&gt;
 ld a,c&lt;br /&gt;
 cp $2B+1&lt;br /&gt;
 jr nz,fastCopyAgain&lt;br /&gt;
 ret&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Remarks and Improvements==&lt;br /&gt;
* Some instructions in Joe Wingbermuehle's Fastcopy are only there for having enough delay between two outputs to the LCD driver. One can modify Fastcopy to change these useless instructions into instructions that will clear the Graph Buffer at the same time:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
;-----&amp;gt; Copy the gbuf to the screen and clear graph buffer (fast)&lt;br /&gt;
;Input: nothing&lt;br /&gt;
;Output:graph buffer is copied to the screen and subsequently cleared&lt;br /&gt;
fastCopy:&lt;br /&gt;
 di&lt;br /&gt;
 ld a,$80&lt;br /&gt;
 out ($10),a&lt;br /&gt;
 ld hl,gbuf-12-(-(12*64)+1)&lt;br /&gt;
 ld a,$20&lt;br /&gt;
 ld c,a&lt;br /&gt;
 inc hl&lt;br /&gt;
 dec hl&lt;br /&gt;
fastCopyAgain:&lt;br /&gt;
 ld b,64&lt;br /&gt;
 inc c&lt;br /&gt;
 ld de,-(12*64)+1&lt;br /&gt;
 out ($10),a&lt;br /&gt;
 add hl,de&lt;br /&gt;
 ld de,11&lt;br /&gt;
fastCopyLoop:&lt;br /&gt;
 add hl,de&lt;br /&gt;
 inc hl&lt;br /&gt;
 inc de&lt;br /&gt;
 ld a,(hl)&lt;br /&gt;
 ld (hl),0    ; clears the graph buffer at the same time&lt;br /&gt;
 out ($11),a&lt;br /&gt;
 dec de&lt;br /&gt;
 djnz fastCopyLoop&lt;br /&gt;
 ld a,c&lt;br /&gt;
 cp $2B+1&lt;br /&gt;
 jr nz,fastCopyAgain&lt;br /&gt;
 ret&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ld (hl),0''' takes 10 cycles, so we can do with one less '''inc hl''' (6 cycles) and thus load 11 into de instead of 10.&lt;br /&gt;
&lt;br /&gt;
==Safe Copy==&lt;br /&gt;
Many calculators recently manufactured by TI contained a buggy LCD driver, which had different (or varying) delays required to interface with it. Using the fast copy routines above with the LCDs will cause the LCD to display garbled information. However, we can do some additional hardware work to solve this problem, by waiting until we know the LCD is ready to accept a command:&lt;br /&gt;
&lt;br /&gt;
* Bit 7 of Port 10 tells us that the lcd can accept an instruction&lt;br /&gt;
* '''SE Only:''' Bit 1 of Port 2 tells us that how long since the last lcd access&lt;br /&gt;
&lt;br /&gt;
The TI-OS and other apps generally use port 2 but being that bit 7 is sign bit we can use that as faster method of waiting.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
;-----&amp;gt; Copy the gbuf to the screen, guaranteed &lt;br /&gt;
;Input: nothing&lt;br /&gt;
;Output:graph buffer is copied to the screen, no matter the speed settings&lt;br /&gt;
;&lt;br /&gt;
;in f,(c) is an unofficial instruction.&lt;br /&gt;
;It must be noted that you cannot specify any other register. Only f works.&lt;br /&gt;
;You may have to add it in order for the routine to work.&lt;br /&gt;
;if addinstr doesn't work, you may manually insert the opcodes .db 0EDh,070h&lt;br /&gt;
&lt;br /&gt;
 .addinstr IN	F,(C)	70ED	2	NOP	1&lt;br /&gt;
&lt;br /&gt;
SafeCopy:	&lt;br /&gt;
	di                 ;DI is only required if an interrupt will alter the lcd.&lt;br /&gt;
&lt;br /&gt;
	ld hl,PlotSScreen  ;This can be commented out or another entry placed after it&lt;br /&gt;
                           ;so the buffer can be provided by option.&lt;br /&gt;
	ld c,$10&lt;br /&gt;
	ld a,$80&lt;br /&gt;
setrow:&lt;br /&gt;
	in f,(c)&lt;br /&gt;
	jp m,setrow&lt;br /&gt;
	out ($10),a&lt;br /&gt;
	ld de,12&lt;br /&gt;
	ld a,$20&lt;br /&gt;
col:&lt;br /&gt;
	in f,(c)&lt;br /&gt;
	jp m,col&lt;br /&gt;
	out ($10),a&lt;br /&gt;
	push af&lt;br /&gt;
	ld b,64&lt;br /&gt;
row:&lt;br /&gt;
	ld a,(hl)&lt;br /&gt;
rowwait:&lt;br /&gt;
	in f,(c)&lt;br /&gt;
	jp m,rowwait&lt;br /&gt;
	out ($11),a&lt;br /&gt;
	add hl,de&lt;br /&gt;
	djnz row&lt;br /&gt;
	pop af&lt;br /&gt;
	dec h&lt;br /&gt;
	dec h&lt;br /&gt;
	dec h&lt;br /&gt;
	inc hl&lt;br /&gt;
	inc a&lt;br /&gt;
	cp $2c&lt;br /&gt;
	jp nz,col&lt;br /&gt;
	ret&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=Talk:83Plus:Ports:01</id>
		<title>Talk:83Plus:Ports:01</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Talk:83Plus:Ports:01"/>
				<updated>2007-06-02T16:14:09Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: In reply&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==reset needed==&lt;br /&gt;
From my experimentation with PindurTI, it seems to me that it is impossible to poll more than one group without reseting the keyport in betweeen. Being that I have never tested any direct key input routines.  I know the directin routine from MirageOS resets before polling, and LearnAsm28d merely says that one &amp;quot;should&amp;quot; reset the port before switching groups. I hesitate to add this to the comments section without further confirmation. [[User:Saibot84|Saibot84]] 21:48, 1 June 2007 (PDT)&lt;br /&gt;
&lt;br /&gt;
:Well, for one 28days is not the best reference for hardware. And pindur is an emulator, so it has the limitations of the PC hardware and what CoBB was willing to put in.   However, I decided to check this more since some people keep bringing it up.  I have to say my result is not what I expected.  It seems  that it's possible that groups not even being monitored can affect what is read.  I wrote this test program: [http://jim.revsoft.org/code/key.zip Link for download].  It checks the top row and the arrow group.&lt;br /&gt;
&lt;br /&gt;
{| WIDTH=600 BORDER=1 CELLPADDING=1 CELLSPACING=1 STYLE=&amp;quot;page-break-before: always&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;Actually being pressed&amp;lt;/P&amp;gt;&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;Arrow&amp;lt;/P&amp;gt;&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;Top Row&amp;lt;/P&amp;gt;&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;Setting arrow without reset&amp;lt;/P&amp;gt;&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;Both arrow and top row&amp;lt;/P&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;Down&amp;lt;/P&amp;gt;&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;11111110&amp;lt;/P&amp;gt;&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;11111111&amp;lt;/P&amp;gt;&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;11111110&amp;lt;/P&amp;gt;&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;11111110&amp;lt;/P&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;Zoom &amp;amp; Graph&amp;lt;/P&amp;gt;&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;11111111&amp;lt;/P&amp;gt;&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;11111010&amp;lt;/P&amp;gt;&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;11111111&amp;lt;/P&amp;gt;&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;11111010&amp;lt;/P&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;Zoom &amp;amp; Graph &amp;amp; Down&amp;lt;/P&amp;gt;&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;11111010&amp;lt;/P&amp;gt;&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;11111010&amp;lt;/P&amp;gt;&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;11111010&amp;lt;/P&amp;gt;&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;11111010&amp;lt;/P&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;Down &amp;amp; 0 &amp;amp; Sin&amp;lt;/P&amp;gt;&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;11011110&amp;lt;/P&amp;gt;&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;11111111&amp;lt;/P&amp;gt;&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;11011110&amp;lt;/P&amp;gt;&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;11011110&amp;lt;/P&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;Down &amp;amp; sin&amp;lt;/P&amp;gt;&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;11111110&amp;lt;/P&amp;gt;&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;11111111&amp;lt;/P&amp;gt;&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;11111110&amp;lt;/P&amp;gt;&lt;br /&gt;
| WIDTH=120 | &amp;lt;P ALIGN=CENTER&amp;gt;11111110&amp;lt;/P&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It seems to be a bug in hardware, dealing with when multiple keys are being pressed.  It looks like the AND logic doesn't exists as much as we all thought before. Still though TI set the convention of reseting the key port, but they do it following reads, that may have an impact on the results.  Though we still need more confirmation, I tested this with an 83+, 83+SE and 84+SE. --[[User:Jim e|Jim e]] 09:14, 2 June 2007 (PDT)&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=83Plus:Ports:30</id>
		<title>83Plus:Ports:30</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=83Plus:Ports:30"/>
				<updated>2007-06-01T00:48:41Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: So many spelling errors, What moron wrote this?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:83Plus:Ports:By_Address|30-38 - Timers]] [[Category:83Plus:Ports:By_Name|Timers]]&lt;br /&gt;
{{SE-Only Port|10}}&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
'''Port Number:''' 30 - 38&lt;br /&gt;
&lt;br /&gt;
'''Function:''' Timers&lt;br /&gt;
On the 83+SE and 84+(SE) there are 3 timers that are independent of each other and each timer is controlled by 3 ports, On/off, Loop control, and the counter itself. They can be used for accurate delay waiting, interrupts that execute at almost any desired frequency, or for just keeping time.&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;40%&amp;quot; cellspacing=&amp;quot;1&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; |&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;808080&amp;quot; | On/Off&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;808080&amp;quot; | Loop Control&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;808080&amp;quot; | Counter&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;808080&amp;quot; | Timer1&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;C0C0C0&amp;quot; | 30&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;C0C0C0&amp;quot; | 31&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;C0C0C0&amp;quot; | 32&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;808080&amp;quot; | Timer2&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;C0C0C0&amp;quot; | 33&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;C0C0C0&amp;quot; | 34&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;C0C0C0&amp;quot; | 35&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;808080&amp;quot; | Timer3&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;C0C0C0&amp;quot; | 36&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;C0C0C0&amp;quot; | 37&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; bgcolor=&amp;quot;C0C0C0&amp;quot; | 38&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===On/Off ports:===&lt;br /&gt;
&lt;br /&gt;
The On/Off ports are 30, 33, and 36. These ports control what clock is used for this timer and a divisor(needed since the counter is only 8bit). The upper two bits(6 &amp;amp; 7) tell what clock is being used. 00 if none and the timer is off, 01 for the crystal timer, and 02 for the CPU clock. 03 would suggest a combination of the CPU clock and the crystal timers, but I highly doubt it. Bits 0-5 of the On/Off ports control the divisor. For simplicity, here is a table with the output values next to the the frequencies that would be generated.&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;30%&amp;quot; cellspacing=&amp;quot;1&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;808080&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | Value&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | Frequency&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 00h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | OFF&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | ~&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | ~&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 40h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | 10922.67 Hz&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 41h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | 933 Hz&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 42h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | 100 Hz&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 43h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | 10 Hz&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 44h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | 32768 Hz&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 45h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | 2048 Hz&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 46h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | 128 Hz&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 47h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | 8 Hz&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | ~&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | ~&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 80h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | CPU clock speed&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 81h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | CPU clock / 2&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 82h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | CPU clock / 4&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 84h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | CPU clock / 8&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 88h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | CPU clock / 16&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | 90h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | CPU clock / 32&lt;br /&gt;
|- bgcolor=&amp;quot;C0C0C0&amp;quot;&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; | A0h&lt;br /&gt;
| width=&amp;quot;80%&amp;quot; | CPU clock / 64&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Since Silver Edition calculators CPU speed can be adjusted the timers will run at whatever the current CPU speed is(if selected of course).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Loop Control ports:===&lt;br /&gt;
&lt;br /&gt;
The Loop Control ports are 31, 34, and 37.&lt;br /&gt;
&lt;br /&gt;
When bit 0 is set on this port it causes the timer to loop when the counter hits 0.  Once it does, the counter will start back at the value you initially placed in it. To keep it looping from that value, you must output to the loop control port at every loop. If you miss one bit 2 of this port will be set, and the counter will carry to FF continue to count down.&lt;br /&gt;
&lt;br /&gt;
When bit 1 is set this timer will generate an interrupt when the counter hits 0. The interrupt must acknowledge or it will recurse upon EI. Acknowledge it by writing to the Loop control port. Depending on whether you have looping enabled or not, you can start the timer again by write to the counter port.&lt;br /&gt;
&lt;br /&gt;
At this point I want to stress that you must acknowledge the timers whenever the counter reaches zero. Every time the counter hits zero the appropriate bit is set in [[83Plus:Ports:04|port 04h]]. To reset those bits you MUST write to the loop control port, whether you have interrupts enabled or not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Counter ports:===&lt;br /&gt;
&lt;br /&gt;
The Counter ports are 32, 35, and 38.&lt;br /&gt;
&lt;br /&gt;
Once the prior 2 ports have been setup all that is need to activate the timer is to send the desired value you wish to count down from to the counter port. However if you send 0 it will loop no matter what and it will not affect port 4, so keep it above 0.&lt;br /&gt;
&lt;br /&gt;
Also note that you should turn off the timer when you are done, do this by writing 0 to the on/off port and loop control.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Comments ==&lt;br /&gt;
For some reasons the timers do not seem to generate interrupts if the CPU is halt. I can only imagine that this is either a bug in the hardware or that there is more information missing. In any case, if you intend to use the crystal timers to generate an interrupt leave the normal timers on so that you can escape any halt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example Code ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; ;Setup up a timer that waits 2 seconds&lt;br /&gt;
   di&lt;br /&gt;
   ld a,$47      ;8 hz&lt;br /&gt;
   out ($30),a&lt;br /&gt;
   ld a,0        ; no loop, no interrupt&lt;br /&gt;
   out ($31),a&lt;br /&gt;
   ld a,16       ;16 ticks / 8 hz equals 2 seconds&lt;br /&gt;
   out ($32),a&lt;br /&gt;
wait:&lt;br /&gt;
   in a,(4)&lt;br /&gt;
   bit 5,a       ;bit 5 tells if timer 1&lt;br /&gt;
   jr z,wait     ;is done&lt;br /&gt;
   xor a&lt;br /&gt;
   out ($30),a   ;Turn off the timer.&lt;br /&gt;
   out ($31),a&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Credits and Contributions ==&lt;br /&gt;
* '''Michael Vincent''': Documentation found [http://www.michaelv.org/programs/calcs/rtc.txt here].&lt;br /&gt;
* '''James Montelongo''': Documentation found [http://www.geocities.com/jimm09876/calc/timers.html here].&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=83Plus:Ports:03</id>
		<title>83Plus:Ports:03</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=83Plus:Ports:03"/>
				<updated>2007-05-19T18:01:47Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: spelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:83Plus:Ports:By_Address|03 - Interrupt Mask]] [[Category:83Plus:Ports:By_Name|Interrupt Mask]]&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
'''Port Number:''' 03h&lt;br /&gt;
&lt;br /&gt;
'''Function:''' Interrupt Masking Port&lt;br /&gt;
&lt;br /&gt;
This port controls what devices will be allowed to trigger interrupts. When an interrupt is triggered, it should be cleared by reseting the corresponding bit.  Otherwise, it will continuously call the interrupt code once interrupts are reenabled with ei.&lt;br /&gt;
&lt;br /&gt;
=== Read Values ===&lt;br /&gt;
* Bit 0: Set if pressing the ON key will generate an interrupt.&lt;br /&gt;
* Bit 1: Set if the first hardware timer will generate an interrupt (range: 108Hz-512Hz).&lt;br /&gt;
* Bit 2: Set if the second hardware timer will generate an interrupt (range: 216Hz-1024Hz).&lt;br /&gt;
* Bit 4: Set if the linkport will generate an interrupt.&lt;br /&gt;
&lt;br /&gt;
=== Write Values ===&lt;br /&gt;
* Bit 0: Set 1 to enable the ON key. Set 0 acknowledge the interrupt request and/or to disable it.&lt;br /&gt;
* Bit 1: Set 1 to enable the first hardware timer. Set 0 acknowledge the interrupt request and/or to disable it.&lt;br /&gt;
* Bit 2: Set 1 to enable the second hardware timer. Set 0 acknowledge the interrupt request and/or to disable it.&lt;br /&gt;
* Bit 3: Set 0 to put the calculator in low power mode if and only if the Z80 cpu enters the halt state (during the executing of a halt instruction). Set 1 to keep the calculator powered.&lt;br /&gt;
* Bit 4: Set 1 to enable the linkport interrupt. Set 0 acknowledge the interrupt request and/or to disable it. (Does not completely disable the linkport.)&lt;br /&gt;
&lt;br /&gt;
== Comments ==&lt;br /&gt;
* For normal operation, write 0B (00001011) to this port. This will allow the first timer to generate interrupts, and the on key.&lt;br /&gt;
* In low power mode it is known that at least the lcd driver enters standby mode and that the timer hardware has been disabled.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
===Soft Powerdown===&lt;br /&gt;
This example shows how to do a soft powerdown (similar to the auto powerdown) on the calculator.&lt;br /&gt;
This may or may not wipe the LCD screen, so you should first copy its contents to a buffer like saveSScreen and then copy it back afterwards.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; push af&lt;br /&gt;
 ld a, 11h ;Enable linkport, ON key. Disable timer.&lt;br /&gt;
           ;Set low power mode.&lt;br /&gt;
 out (3), a&lt;br /&gt;
 halt      ;Enter low power mode (disabling various devices)&lt;br /&gt;
           ;and wait for an interrupt (either ON key or&lt;br /&gt;
           ;link activity) which will enable all hardware&lt;br /&gt;
           ;devices again.&lt;br /&gt;
 ld a, 0Bh ;Enable ON key, timer. Disable linkport.&lt;br /&gt;
           ;Keep calculator powered.&lt;br /&gt;
 out (3), a&lt;br /&gt;
 pop af&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Simple Interrupt===&lt;br /&gt;
This example will show how to set up the first timer for an interrupt and its use in the [[wikipedia:Interrupt_handler|ISR]].  It will also show beyond just port 3 usage since this port requires more complex interaction for its typical use. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Install_ISR:&lt;br /&gt;
&lt;br /&gt;
;Disabling interrupts prior to installation.&lt;br /&gt;
;This is in case an im 2 interrupt is already running.&lt;br /&gt;
;(MirageOS would present such a case.)&lt;br /&gt;
;&lt;br /&gt;
	di&lt;br /&gt;
&lt;br /&gt;
;A 257 byte vector table(located in StatVars) is &lt;br /&gt;
;filled with the same byte.  This byte will determine &lt;br /&gt;
;the location of the interrupt code's start.&lt;br /&gt;
;If the table is filled with $XY then the code must be&lt;br /&gt;
;located at $XYXY.&lt;br /&gt;
;&lt;br /&gt;
	ld hl,$8B00&lt;br /&gt;
	ld (hl),$8A&lt;br /&gt;
	ld de,$8B01&lt;br /&gt;
	ld bc,256&lt;br /&gt;
	ldir&lt;br /&gt;
&lt;br /&gt;
;The interrupt code is copied to a safe code buffer(StatVars).&lt;br /&gt;
;If the interrupt code is to large, you may alternatively&lt;br /&gt;
;place jp instruction in this code buffer that jumps to your&lt;br /&gt;
;interrupt code. Interrupt code should be located in ram. While&lt;br /&gt;
;nothing physically prevents use of bank4000 area, it is &lt;br /&gt;
;commonly swapped out and so at the very least precautions&lt;br /&gt;
;would be required to use that area.&lt;br /&gt;
;&lt;br /&gt;
	ld hl,Interrupt_Start&lt;br /&gt;
	ld de,$8A8A&lt;br /&gt;
	ld bc,Interrupt_End-Interrupt_Start&lt;br /&gt;
	ldir&lt;br /&gt;
&lt;br /&gt;
;You must designate what hardware will generate an interrupt.&lt;br /&gt;
;For safety, acknowledging any waiting requests may&lt;br /&gt;
;also be done.&lt;br /&gt;
;&lt;br /&gt;
	ld a,%00001000		;Acknowledge and disable&lt;br /&gt;
	out (3),a&lt;br /&gt;
	ld a,%00001010		;Set 1st timer active&lt;br /&gt;
	out (3),a&lt;br /&gt;
	ld a,%00000110		;Slowest frequency, ~110hz&lt;br /&gt;
	out (4),a&lt;br /&gt;
&lt;br /&gt;
;i is the higher byte of the address that points to the&lt;br /&gt;
;vector table.  The lower byte, for all practicality,&lt;br /&gt;
;should be considered random.&lt;br /&gt;
;&lt;br /&gt;
	ld a,$8B&lt;br /&gt;
	ld i,a&lt;br /&gt;
	im 2&lt;br /&gt;
	ei&lt;br /&gt;
	ret&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;This small function simply ends the installed interrupt.&lt;br /&gt;
;This should be done prior to exit, or when it is not safe&lt;br /&gt;
;to have a custom interrupt running.&lt;br /&gt;
;&lt;br /&gt;
Kill_ISR:&lt;br /&gt;
	di&lt;br /&gt;
	im 1&lt;br /&gt;
	ret&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Interrupt_Start:&lt;br /&gt;
	exx&lt;br /&gt;
	ex af,af'&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;- Interrupt Code Here&lt;br /&gt;
;This code should be small and brief.&lt;br /&gt;
;Assuming, that the interrupt is occurring 110 times a second, this &lt;br /&gt;
;code would have to execute in (CPU_Speed / Frequency) tstates&lt;br /&gt;
;ex: 6000000hz / 110hz = ~54545 tstates&lt;br /&gt;
;&lt;br /&gt;
;Failure to execute in that time would result in missing an &lt;br /&gt;
;interrupt request, in other words you would skip interrupts.&lt;br /&gt;
;&lt;br /&gt;
;However using less than that amount of time, but near to it&lt;br /&gt;
;would result in leaving little time for the main code's execution.&lt;br /&gt;
;For example, if the timer generates interrupts every 54545 tstates,&lt;br /&gt;
;and your interrupt code executes in 54000 tstates, you would leave&lt;br /&gt;
;only 545 tstates for your main programs execution in that time slice.&lt;br /&gt;
;The interrupt would take up 99% of the cpu time.&lt;br /&gt;
;(This would be a likely issue in gray scale applications.)&lt;br /&gt;
;&lt;br /&gt;
&lt;br /&gt;
	ld a,%00001000		;Acknowledge and disable&lt;br /&gt;
	out (3),a&lt;br /&gt;
	ld a,%00001010		;Set 1st timer active&lt;br /&gt;
	out (3),a&lt;br /&gt;
	ld a,%00000110		;Slowest frequency, ~110hz&lt;br /&gt;
	out (4),a&lt;br /&gt;
	ex af,af'&lt;br /&gt;
	exx&lt;br /&gt;
	ei&lt;br /&gt;
	ret&lt;br /&gt;
Interrupt_End:&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Credits and Contributions ==&lt;br /&gt;
*'''Michael Vincent''': For documenting [http://www.michaelv.org/programs/calcs/ports/port3.html here] on the interrupt bits.&lt;br /&gt;
*'''James Montelongo''': For documenting the interrupt bits.&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=83Plus:Ports:03</id>
		<title>83Plus:Ports:03</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=83Plus:Ports:03"/>
				<updated>2007-05-19T08:59:56Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: Just noticed I loaded i with the wrong value&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:83Plus:Ports:By_Address|03 - Interrupt Mask]] [[Category:83Plus:Ports:By_Name|Interrupt Mask]]&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
'''Port Number:''' 03h&lt;br /&gt;
&lt;br /&gt;
'''Function:''' Interrupt Masking Port&lt;br /&gt;
&lt;br /&gt;
This port controls what devices will be allowed to trigger interrupts. When an interrupt is triggered, it should be cleared by reseting the corresponding bit.  Otherwise, it will continuously call the interrupt code once interrupts are reenabled with ei.&lt;br /&gt;
&lt;br /&gt;
=== Read Values ===&lt;br /&gt;
* Bit 0: Set if pressing the ON key will generate an interrupt.&lt;br /&gt;
* Bit 1: Set if the first hardware timer will generate an interrupt (range: 108Hz-512Hz).&lt;br /&gt;
* Bit 2: Set if the second hardware timer will generate an interrupt (range: 216Hz-1024Hz).&lt;br /&gt;
* Bit 4: Set if the linkport will generate an interrupt.&lt;br /&gt;
&lt;br /&gt;
=== Write Values ===&lt;br /&gt;
* Bit 0: Set 1 to enable the ON key. Set 0 acknowledge the interrupt request and/or to disable it.&lt;br /&gt;
* Bit 1: Set 1 to enable the first hardware timer. Set 0 acknowledge the interrupt request and/or to disable it.&lt;br /&gt;
* Bit 2: Set 1 to enable the second hardware timer. Set 0 acknowledge the interrupt request and/or to disable it.&lt;br /&gt;
* Bit 3: Set 0 to put the calculator in low power mode if and only if the Z80 cpu enters the halt state (during the executing of a halt instruction). Set 1 to keep the calculator powered.&lt;br /&gt;
* Bit 4: Set 1 to enable the linkport interrupt. Set 0 acknowledge the interrupt request and/or to disable it. (Does not completely disable the linkport.)&lt;br /&gt;
&lt;br /&gt;
== Comments ==&lt;br /&gt;
* For normal operation, write 0B (00001011) to this port. This will allow the first timer to generate interrupts, and the on key.&lt;br /&gt;
* In low power mode it is known that at least the lcd driver enters standby mode and that the timer hardware has been disabled.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
===Soft Powerdown===&lt;br /&gt;
This example shows how to do a soft powerdown (similar to the auto powerdown) on the calculator.&lt;br /&gt;
This may or may not wipe the LCD screen, so you should first copy it's contents to a buffer like saveSScreen and then copy it back afterwards.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; push af&lt;br /&gt;
 ld a, 11h ;Enable linkport, ON key. Disable timer.&lt;br /&gt;
           ;Set low power mode.&lt;br /&gt;
 out (3), a&lt;br /&gt;
 halt      ;Enter low power mode (disabling various devices)&lt;br /&gt;
           ;and wait for an interrupt (either ON key or&lt;br /&gt;
           ;link activity) which will enable all hardware&lt;br /&gt;
           ;devices again.&lt;br /&gt;
 ld a, 0Bh ;Enable ON key, timer. Disable linkport.&lt;br /&gt;
           ;Keep calculator powered.&lt;br /&gt;
 out (3), a&lt;br /&gt;
 pop af&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Simple Interrupt===&lt;br /&gt;
This example will show how to set up the first timer for an interrupt and its use in the [http://en.wikipedia.org/wiki/Interrupt_handler ISR].  It will also show beyond just port 3 usage since this port requires more complex interaction for its typical use. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Install_ISR:&lt;br /&gt;
&lt;br /&gt;
;Disableing interrupts prior to installation.&lt;br /&gt;
;This is in case an im 2 interrupt is already running.&lt;br /&gt;
;(MirageOS would present such a case.)&lt;br /&gt;
;&lt;br /&gt;
	di&lt;br /&gt;
&lt;br /&gt;
;A 257 byte vector table(located in StatVars) is &lt;br /&gt;
;filled with the same byte.  This byte will determine &lt;br /&gt;
;the location of the interrupt code's start.&lt;br /&gt;
;If the table is filled with $XY then the code must be&lt;br /&gt;
;located at $XYXY.&lt;br /&gt;
;&lt;br /&gt;
	ld hl,$8B00&lt;br /&gt;
	ld (hl),$8A&lt;br /&gt;
	ld de,$8B01&lt;br /&gt;
	ld bc,257&lt;br /&gt;
	ldir&lt;br /&gt;
&lt;br /&gt;
;The interrupt code is copied to a safe code buffer(StatVars).&lt;br /&gt;
;If the interrupt code is to large, you may alternatively&lt;br /&gt;
;place jp instruction in this code buffer that jumps to your&lt;br /&gt;
;interrupt code. Interrupt code should be located in ram. While&lt;br /&gt;
;nothing physically prevents use of bank4000 area, it is &lt;br /&gt;
;commonly swapped out and so at the very least precautions&lt;br /&gt;
;would be required to use that area.&lt;br /&gt;
;&lt;br /&gt;
	ld hl,Interupt_Start&lt;br /&gt;
	ld de,$8A8A&lt;br /&gt;
	ld bc,Interupt_End-Interupt_Start&lt;br /&gt;
	ldir&lt;br /&gt;
&lt;br /&gt;
;You must designate what hardware will generate an interrupt.&lt;br /&gt;
;For safety, acknowledging any waiting requests may&lt;br /&gt;
;also be done.&lt;br /&gt;
;&lt;br /&gt;
	ld a,%00001000		;Acknowledge and disable&lt;br /&gt;
	out (3),a&lt;br /&gt;
	ld a,%00001010		;Set 1st timer active&lt;br /&gt;
	out (3),a&lt;br /&gt;
	ld a,%00000110		;Slowest frequency, ~110hz&lt;br /&gt;
	out (4),a&lt;br /&gt;
&lt;br /&gt;
;i is the higher byte of the address that points to the&lt;br /&gt;
;vector table.  The lower byte, for all practicality,&lt;br /&gt;
;should be considered random.&lt;br /&gt;
;&lt;br /&gt;
	ld a,$8B&lt;br /&gt;
	ld i,a&lt;br /&gt;
	im 2&lt;br /&gt;
	ei&lt;br /&gt;
	ret&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;This small function simply ends the installed interrupt.&lt;br /&gt;
;This should be done prior to exit, or when it is not safe&lt;br /&gt;
;to have a custom interrupt running.&lt;br /&gt;
;&lt;br /&gt;
Kill_ISR:&lt;br /&gt;
	di&lt;br /&gt;
	im 1&lt;br /&gt;
	ret&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Interupt_Start:&lt;br /&gt;
	exx&lt;br /&gt;
	ex af,af'&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;- Interrupt Code Here&lt;br /&gt;
;This code should be small and brief.&lt;br /&gt;
;Assuming, that the interrupt is occurring 110 times a second, this &lt;br /&gt;
;code would have to execute in (CPU_Speed / Frequency) tstates&lt;br /&gt;
;ex: 6000000hz / 110hz = ~54545 tstates&lt;br /&gt;
;&lt;br /&gt;
;Failure to execute in that time would result in missing an &lt;br /&gt;
;interrupt request, in other words you would skip interrupts.&lt;br /&gt;
;&lt;br /&gt;
;However using less than that amount of time, but near to it&lt;br /&gt;
;would result in leaving little time for the main code's execution.&lt;br /&gt;
;For example, if the timer generates interrupts every 54545 tstates,&lt;br /&gt;
;and your interrupt code executes in 54000 tstates, you would leave&lt;br /&gt;
;only 545 tstates for your main programs execution in that time slice.&lt;br /&gt;
;The interrupt would take up 99% of the cpu time.&lt;br /&gt;
;(This would be a likely issue in gray scale applications.)&lt;br /&gt;
;&lt;br /&gt;
&lt;br /&gt;
	ld a,%00001000		;Acknowledge and disable&lt;br /&gt;
	out (3),a&lt;br /&gt;
	ld a,%00001010		;Set 1st timer active&lt;br /&gt;
	out (3),a&lt;br /&gt;
	ld a,%00000110		;Slowest frequency, ~110hz&lt;br /&gt;
	out (4),a&lt;br /&gt;
	ex af,af'&lt;br /&gt;
	exx&lt;br /&gt;
	ei&lt;br /&gt;
	ret&lt;br /&gt;
Interupt_End:&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Credits and Contributions ==&lt;br /&gt;
*'''Michael Vincent''': For documenting [http://www.michaelv.org/programs/calcs/ports/port3.html here] on the interrupt bits.&lt;br /&gt;
*'''James Montelongo''': For documenting the interrupt bits.&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=83Plus:Ports:03</id>
		<title>83Plus:Ports:03</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=83Plus:Ports:03"/>
				<updated>2007-05-18T21:39:52Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: Another example, bit more detail in ACKs, removed link to my site since its old and deprecated.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:83Plus:Ports:By_Address|03 - Interrupt Mask]] [[Category:83Plus:Ports:By_Name|Interrupt Mask]]&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
'''Port Number:''' 03h&lt;br /&gt;
&lt;br /&gt;
'''Function:''' Interrupt Masking Port&lt;br /&gt;
&lt;br /&gt;
This port controls what devices will be allowed to trigger interrupts. When an interrupt is triggered, it should be cleared by reseting the corresponding bit.  Otherwise, it will continuously call the interrupt code once interrupts are reenabled with ei.&lt;br /&gt;
&lt;br /&gt;
=== Read Values ===&lt;br /&gt;
* Bit 0: Set if pressing the ON key will generate an interrupt.&lt;br /&gt;
* Bit 1: Set if the first hardware timer will generate an interrupt (range: 108Hz-512Hz).&lt;br /&gt;
* Bit 2: Set if the second hardware timer will generate an interrupt (range: 216Hz-1024Hz).&lt;br /&gt;
* Bit 4: Set if the linkport will generate an interrupt.&lt;br /&gt;
&lt;br /&gt;
=== Write Values ===&lt;br /&gt;
* Bit 0: Set 1 to enable the ON key. Set 0 acknowledge the interrupt request and/or to disable it.&lt;br /&gt;
* Bit 1: Set 1 to enable the first hardware timer. Set 0 acknowledge the interrupt request and/or to disable it.&lt;br /&gt;
* Bit 2: Set 1 to enable the second hardware timer. Set 0 acknowledge the interrupt request and/or to disable it.&lt;br /&gt;
* Bit 3: Set 0 to put the calculator in low power mode if and only if the Z80 cpu enters the halt state (during the executing of a halt instruction). Set 1 to keep the calculator powered.&lt;br /&gt;
* Bit 4: Set 1 to enable the linkport interrupt. Set 0 acknowledge the interrupt request and/or to disable it. (Does not completely disable the linkport.)&lt;br /&gt;
&lt;br /&gt;
== Comments ==&lt;br /&gt;
* For normal operation, write 0B (00001011) to this port. This will allow the first timer to generate interrupts, and the on key.&lt;br /&gt;
* In low power mode it is known that at least the lcd driver enters standby mode and that the timer hardware has been disabled.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
===Soft Powerdown===&lt;br /&gt;
This example shows how to do a soft powerdown (similar to the auto powerdown) on the calculator.&lt;br /&gt;
This may or may not wipe the LCD screen, so you should first copy it's contents to a buffer like saveSScreen and then copy it back afterwards.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; push af&lt;br /&gt;
 ld a, 11h ;Enable linkport, ON key. Disable timer.&lt;br /&gt;
           ;Set low power mode.&lt;br /&gt;
 out (3), a&lt;br /&gt;
 halt      ;Enter low power mode (disabling various devices)&lt;br /&gt;
           ;and wait for an interrupt (either ON key or&lt;br /&gt;
           ;link activity) which will enable all hardware&lt;br /&gt;
           ;devices again.&lt;br /&gt;
 ld a, 0Bh ;Enable ON key, timer. Disable linkport.&lt;br /&gt;
           ;Keep calculator powered.&lt;br /&gt;
 out (3), a&lt;br /&gt;
 pop af&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Simple Interrupt===&lt;br /&gt;
This example will show how to set up the first timer for an interrupt and its use in the [http://en.wikipedia.org/wiki/Interrupt_handler ISR].  It will also show beyond just port 3 usage since this port requires more complex interaction for its typical use. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Install_ISR:&lt;br /&gt;
&lt;br /&gt;
;Disableing interrupts prior to installation.&lt;br /&gt;
;This is in case an im 2 interrupt is already running.&lt;br /&gt;
;(MirageOS would present such a case.)&lt;br /&gt;
;&lt;br /&gt;
	di&lt;br /&gt;
&lt;br /&gt;
;A 257 byte vector table(located in StatVars) is &lt;br /&gt;
;filled with the same byte.  This byte will determine &lt;br /&gt;
;the location of the interrupt code's start.&lt;br /&gt;
;If the table is filled with $XY then the code must be&lt;br /&gt;
;located at $XYXY.&lt;br /&gt;
;&lt;br /&gt;
	ld hl,$8B00&lt;br /&gt;
	ld (hl),$8A&lt;br /&gt;
	ld de,$8B01&lt;br /&gt;
	ld bc,257&lt;br /&gt;
	ldir&lt;br /&gt;
&lt;br /&gt;
;The interrupt code is copied to a safe code buffer(StatVars).&lt;br /&gt;
;If the interrupt code is to large, you may alternatively&lt;br /&gt;
;place jp instruction in this code buffer that jumps to your&lt;br /&gt;
;interrupt code. Interrupt code should be located in ram. While&lt;br /&gt;
;nothing physically prevents use of bank4000 area, it is &lt;br /&gt;
;commonly swapped out and so at the very least precautions&lt;br /&gt;
;would be required to use that area.&lt;br /&gt;
;&lt;br /&gt;
	ld hl,Interupt_Start&lt;br /&gt;
	ld de,$8A8A&lt;br /&gt;
	ld bc,Interupt_End-Interupt_Start&lt;br /&gt;
	ldir&lt;br /&gt;
&lt;br /&gt;
;You must designate what hardware will generate an interrupt.&lt;br /&gt;
;For safety, acknowledging any waiting requests may&lt;br /&gt;
;also be done.&lt;br /&gt;
;&lt;br /&gt;
	ld a,%00001000		;Acknowledge and disable&lt;br /&gt;
	out (3),a&lt;br /&gt;
	ld a,%00001010		;Set 1st timer active&lt;br /&gt;
	out (3),a&lt;br /&gt;
	ld a,%00000110		;Slowest frequency, ~110hz&lt;br /&gt;
	out (4),a&lt;br /&gt;
&lt;br /&gt;
;i is the higher byte of the address that points to the&lt;br /&gt;
;vector table.  The lower byte, for all practicality,&lt;br /&gt;
;should be considered random.&lt;br /&gt;
;&lt;br /&gt;
	ld a,$8A&lt;br /&gt;
	ld i,a&lt;br /&gt;
	im 2&lt;br /&gt;
	ei&lt;br /&gt;
	ret&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;This small function simply ends the installed interrupt.&lt;br /&gt;
;This should be done prior to exit, or when it is not safe&lt;br /&gt;
;to have a custom interrupt running.&lt;br /&gt;
;&lt;br /&gt;
Kill_ISR:&lt;br /&gt;
	di&lt;br /&gt;
	im 1&lt;br /&gt;
	ret&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Interupt_Start:&lt;br /&gt;
	exx&lt;br /&gt;
	ex af,af'&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;- Interrupt Code Here&lt;br /&gt;
;This code should be small and brief.&lt;br /&gt;
;Assuming, that the interrupt is occurring 110 times a second, this &lt;br /&gt;
;code would have to execute in (CPU_Speed / Frequency) tstates&lt;br /&gt;
;ex: 6000000hz / 110hz = ~54545 tstates&lt;br /&gt;
;&lt;br /&gt;
;Failure to execute in that time would result in missing an &lt;br /&gt;
;interrupt request, in other words you would skip interrupts.&lt;br /&gt;
;&lt;br /&gt;
;However using less than that amount of time, but near to it&lt;br /&gt;
;would result in leaving little time for the main code's execution.&lt;br /&gt;
;For example, if the timer generates interrupts every 54545 tstates,&lt;br /&gt;
;and your interrupt code executes in 54000 tstates, you would leave&lt;br /&gt;
;only 545 tstates for your main programs execution in that time slice.&lt;br /&gt;
;The interrupt would take up 99% of the cpu time.&lt;br /&gt;
;(This would be a likely issue in gray scale applications.)&lt;br /&gt;
;&lt;br /&gt;
&lt;br /&gt;
	ld a,%00001000		;Acknowledge and disable&lt;br /&gt;
	out (3),a&lt;br /&gt;
	ld a,%00001010		;Set 1st timer active&lt;br /&gt;
	out (3),a&lt;br /&gt;
	ld a,%00000110		;Slowest frequency, ~110hz&lt;br /&gt;
	out (4),a&lt;br /&gt;
	ex af,af'&lt;br /&gt;
	exx&lt;br /&gt;
	ei&lt;br /&gt;
	ret&lt;br /&gt;
Interupt_End:&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Credits and Contributions ==&lt;br /&gt;
*'''Michael Vincent''': For documenting [http://www.michaelv.org/programs/calcs/ports/port3.html here] on the interrupt bits.&lt;br /&gt;
*'''James Montelongo''': For documenting the interrupt bits.&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=Z80_Routines:Math:Random</id>
		<title>Z80 Routines:Math:Random</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Z80_Routines:Math:Random"/>
				<updated>2007-03-29T06:37:47Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: Minor correction, Why isn't the table of contents showing up?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Z80 Routines:Math|Random]]&lt;br /&gt;
[[Category:Z80 Routines|Random]]&lt;br /&gt;
&lt;br /&gt;
==Ion Random==&lt;br /&gt;
This is based off the tried and true [http://en.wikipedia.org/wiki/PRNG pseudorandom number generator] featured in Ion by Joe Wingbermuehle&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;;-----&amp;gt; Generate a random number&lt;br /&gt;
; ouput a=answer 0&amp;lt;=a&amp;lt;=255&lt;br /&gt;
; all registers are preserved except: af&lt;br /&gt;
random:&lt;br /&gt;
        push    hl&lt;br /&gt;
        push    de&lt;br /&gt;
        ld      hl,(randData)&lt;br /&gt;
        ld      a,r&lt;br /&gt;
        ld      d,a&lt;br /&gt;
        ld      e,(hl)&lt;br /&gt;
        add     hl,de&lt;br /&gt;
        add     a,l&lt;br /&gt;
        xor     h&lt;br /&gt;
        ld      (randData),hl&lt;br /&gt;
        pop     de&lt;br /&gt;
        pop     hl&lt;br /&gt;
        ret&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
randData here must be a 2 byte seed located in ram.  While this is a fast generator, it's generally not considered very good in terms of randomness.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Linear Feedback Shift Register==&lt;br /&gt;
This particular prng is based on [http://en.wikipedia.org/wiki/LFSR Linear feedback shift register].  It uses a 64bit seed and generates 8 new bits at every call. LFSRSeed must be an 8 byte seed located in ram.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;;------LFSR------&lt;br /&gt;
;James Montelongo&lt;br /&gt;
;optimized by Spencer Putt&lt;br /&gt;
;out:&lt;br /&gt;
; a = 8 bit random number&lt;br /&gt;
RandLFSR:&lt;br /&gt;
        ld hl,LFSRSeed+4&lt;br /&gt;
        ld e,(hl)&lt;br /&gt;
        inc hl&lt;br /&gt;
        ld d,(hl)&lt;br /&gt;
        inc hl&lt;br /&gt;
        ld c,(hl)&lt;br /&gt;
        inc hl&lt;br /&gt;
        ld a,(hl)&lt;br /&gt;
        ld b,a&lt;br /&gt;
        rl e \ rl d&lt;br /&gt;
        rl c \ rla&lt;br /&gt;
        rl e \ rl d&lt;br /&gt;
        rl c \ rla&lt;br /&gt;
        rl e \ rl d&lt;br /&gt;
        rl c \ rla&lt;br /&gt;
        ld h,a&lt;br /&gt;
        rl e \ rl d&lt;br /&gt;
        rl c \ rla&lt;br /&gt;
        xor b&lt;br /&gt;
        rl e \ rl d&lt;br /&gt;
        xor h&lt;br /&gt;
        xor c&lt;br /&gt;
        xor d&lt;br /&gt;
        ld hl,LFSRSeed+6&lt;br /&gt;
        ld de,LFSRSeed+7&lt;br /&gt;
        ld bc,7&lt;br /&gt;
        lddr&lt;br /&gt;
        ld (de),a&lt;br /&gt;
        ret&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While this may produces better numbers, it is slower, larger and requires a bigger seed than ionrandom.  Assuming theres is a good seed to start, it should generate ~2^56 bytes before repeating.  However if there is not a good seed(0 for example), then the numbers created will not be adequate.  Unlike Ionrandom and its use of the r register, starting with the same seed the same numbers will be generated. With Ionrandom the code running may have an impact on the number generated. This means this method requires more initialization.&lt;br /&gt;
&lt;br /&gt;
You can initialize with TI-OS's seeds, stored at seed1 and seed2, both are ti-floats but will serve the purpose.&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=Z80_Routines:Math:Random</id>
		<title>Z80 Routines:Math:Random</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Z80_Routines:Math:Random"/>
				<updated>2007-03-29T06:29:23Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: Added some random routines, some please expand on usage and what not.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Z80 Routines:Math|Random]]&lt;br /&gt;
[[Category:Z80 Routines|Random]]&lt;br /&gt;
&lt;br /&gt;
==Ion Random==&lt;br /&gt;
This is based off the tried and true [http://en.wikipedia.org/wiki/PRNG pseudorandom number generator] featured in Ion by Joe Wingbermuehle&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;;-----&amp;gt; Generate a random number&lt;br /&gt;
; ouput a=answer 0&amp;lt;=a&amp;lt;=255&lt;br /&gt;
; all registers are preserved except: af&lt;br /&gt;
random:&lt;br /&gt;
        push    hl&lt;br /&gt;
        push    de&lt;br /&gt;
        ld      hl,(randData)&lt;br /&gt;
        ld      a,r&lt;br /&gt;
        ld      d,a&lt;br /&gt;
        ld      e,(hl)&lt;br /&gt;
        add     hl,de&lt;br /&gt;
        add     a,l&lt;br /&gt;
        xor     h&lt;br /&gt;
        ld      (randData),hl&lt;br /&gt;
        pop     de&lt;br /&gt;
        pop     hl&lt;br /&gt;
        ret&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
randData here must be a 2 byte seed located in ram.  While this is a fast generator, it's generally not considered very good in terms of randomness.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Linear Feedback Shift Register==&lt;br /&gt;
This particular prng is based on [http://en.wikipedia.org/wiki/LFSR Linear feedback shift register].  It uses a 64bit seed and generates 8 new bits at every call. LFSRSeed must be an 8 byte seed located in ram.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;;------LFSR------&lt;br /&gt;
;James Montelongo&lt;br /&gt;
;optimized by Spencer Putt&lt;br /&gt;
;out:&lt;br /&gt;
; a = 8 bit random number&lt;br /&gt;
RandLFSR:&lt;br /&gt;
        ld hl,LFSRSeed+4&lt;br /&gt;
        ld e,(hl)&lt;br /&gt;
        inc hl&lt;br /&gt;
        ld d,(hl)&lt;br /&gt;
        inc hl&lt;br /&gt;
        ld c,(hl)&lt;br /&gt;
        inc hl&lt;br /&gt;
        ld a,(hl)&lt;br /&gt;
        ld b,a&lt;br /&gt;
        rl e \ rl d&lt;br /&gt;
        rl c \ rla&lt;br /&gt;
        rl e \ rl d&lt;br /&gt;
        rl c \ rla&lt;br /&gt;
        rl e \ rl d&lt;br /&gt;
        rl c \ rla&lt;br /&gt;
        ld h,a&lt;br /&gt;
        rl e \ rl d&lt;br /&gt;
        rl c \ rla&lt;br /&gt;
        xor b&lt;br /&gt;
        rl e \ rl d&lt;br /&gt;
        xor h&lt;br /&gt;
        xor c&lt;br /&gt;
        xor d&lt;br /&gt;
        ld hl,LFSRSeed+6&lt;br /&gt;
        ld de,LFSRSeed+7&lt;br /&gt;
        ld bc,7&lt;br /&gt;
        lddr&lt;br /&gt;
        ld (LFSRSeed),a&lt;br /&gt;
        ret&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While this may produces better numbers, it is slower, larger and requires a bigger seed than ionrandom.  Assuming theres is a good seed to start, it should generate ~2^56 bytes before repeating.  However if there is not a good seed(0 for example), then the numbers created will not be adequate.  Unlike Ionrandom and its use of the r register, starting with the same seed the same numbers will be generated. With Ionrandom the code running may have an impact on the number generated. This means this method requires more initialization.&lt;br /&gt;
&lt;br /&gt;
You can initialize with TI-OS's seeds, stored at seed1 and seed2, both are ti-floats but will serve the purpose.&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=Category:Z80_Routines:Math</id>
		<title>Category:Z80 Routines:Math</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Category:Z80_Routines:Math"/>
				<updated>2007-03-29T05:43:48Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: This page hasn't been added...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Z80 Routines|Math Routines]]&lt;br /&gt;
This is the list of all Math routines in WikiTI.&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=Experiments</id>
		<title>Experiments</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Experiments"/>
				<updated>2007-03-24T06:28:06Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: Removed Upgrading ram, this page is for existing experiments&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here is a place for experiments, proof of concepts, surprising stuff made on TI-83(+):&lt;br /&gt;
&lt;br /&gt;
* [http://www.ticalc.org/archives/files/fileinfo/368/36889.html QuadPlayer - Four channel sound] by Benryves : stereo sound with 4 tracks on TI-83(+)&lt;br /&gt;
* [http://www.revsoft.org/phpBB2/viewtopic.php?t=200 8bit/32khz sound] by Jim E on 84+SE.&lt;br /&gt;
* [http://www.ticalc.org/archives/files/fileinfo/341/34172.html 7-level greyscale]&lt;br /&gt;
* [http://clap.timendus.com/ CLAP - Linking more than two calculators]&lt;br /&gt;
* [[3D engines]]&lt;br /&gt;
* [http://wikiti.denglend.net/index.php?title=User:Saibot84 using LCD RAM as temporary RAM (in Nostalgy)]&lt;br /&gt;
&lt;br /&gt;
{{stub}}&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=Talk:Calculator_Documentation</id>
		<title>Talk:Calculator Documentation</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Talk:Calculator_Documentation"/>
				<updated>2007-02-14T07:03:25Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: Descriptions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I changed some headings and moved stuff around a bit. I think it's more logical this way, but I don't mind if you change it back. [[User:Jib|Jib]] 02:37, 5 November 2006 (PST)&lt;br /&gt;
: The only thing that bugs me about it is that there's a &amp;quot;software&amp;quot; heading that includes both PC software (emulators) and calculator software (TIOS Alternatives), not to mention that software documentation is listed under a different heading.  What do you think about:&lt;br /&gt;
 Z80 Calculators&lt;br /&gt;
  TI-83&lt;br /&gt;
   Programming&lt;br /&gt;
    Ports&lt;br /&gt;
    RAM Areas&lt;br /&gt;
    B_CALLs&lt;br /&gt;
    etc&lt;br /&gt;
   Software&lt;br /&gt;
    Calculator Software&lt;br /&gt;
    Emulators&lt;br /&gt;
    Linking Software&lt;br /&gt;
    TIOS Alternatives&lt;br /&gt;
  TI-83 Plus Family&lt;br /&gt;
   Programming&lt;br /&gt;
    etc...&lt;br /&gt;
   Software&lt;br /&gt;
    etc...&lt;br /&gt;
  General Z80 Info&lt;br /&gt;
   Instruction Set&lt;br /&gt;
   etc.&lt;br /&gt;
&lt;br /&gt;
 68k Calculators&lt;br /&gt;
  TI-89/92+&lt;br /&gt;
   Programming&lt;br /&gt;
    etc.&lt;br /&gt;
   Software&lt;br /&gt;
    etc.&lt;br /&gt;
  TI-92&lt;br /&gt;
   etc.&lt;br /&gt;
  General 68k Info&lt;br /&gt;
   Instruction Set&lt;br /&gt;
   etc.&lt;br /&gt;
&lt;br /&gt;
 TI Community&lt;br /&gt;
  History&lt;br /&gt;
  Programming Teams&lt;br /&gt;
  etc.&lt;br /&gt;
&lt;br /&gt;
For example, in that organization, the TI-83 Emulators page would basically just be a list of the emulators compatible with the 83, each of which would have their own separate page.  So the VTI page might be linked from the TI-83 emulators page, the TI-85 emulators page, the TI-89 emulators page, etc.  I like this organization because it makes it clear what calculators everything is applicable to, and it decreases the number of top-level categories.  But maybe it's too complicated or has too many levels.  Thoughts?  --[[User:Dan Englender|Dan Englender]] 09:11, 5 November 2006 (PST)&lt;br /&gt;
:Yeah, it seems like a good idea to me. [[User:Jib|Jib]] 12:35, 5 November 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
== Descriptions ==&lt;br /&gt;
&lt;br /&gt;
I was just made aware that searching doesn't always work so well when looking for certain things.  I think adding little descriptions after each link may help with new user finding things that aren't easy to find using search. I would do this however I have the grammar and spelling skills of a jar of mayonaise.&lt;br /&gt;
&lt;br /&gt;
Also right now the Wiki isn't very friendly to new comers. Perhaps brain storming some ways to improve ease of use is in order.--[[User:Jim e|Jim e]] 23:03, 13 February 2007 (PST)&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=Talk:Z80_Good_Programming_Practices</id>
		<title>Talk:Z80 Good Programming Practices</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Talk:Z80_Good_Programming_Practices"/>
				<updated>2006-12-27T08:29:47Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To be honest this article is questionable in its function, as &amp;quot;good practices&amp;quot; is relative per situation. The examples given are bad examples when to do what is suggested.  Further there isn't much substance here and it's poorly defined what would belong here.  A programming guide would be a better idea than this. --[[User:Jim e|Jim e]] 12:20, 20 September 2006 (PDT)&lt;br /&gt;
:Well I agree that the title may be misleading, but I think that for the most part the content would be ok for a sort of &amp;quot;programming tips&amp;quot; section of a larger programming guide.  In any case, feel free to add/change as you see fit.  --[[User:Dan Englender|Dan Englender]] 12:56, 20 September 2006 (PDT)&lt;br /&gt;
::Yeah, some of the stuff (like the section on lookup tables) should say when it's more efficient to use it and when it's not (with only a few options and sequential numbers, dec a / jp z,X / dec a / jp z,Y... would be more efficient), but the idea is good. --[[User:Burntfuse|burntfuse]] 11:30, 24 September 2006 (PDT)&lt;br /&gt;
&lt;br /&gt;
::I took out the ix think because it was VERY wrong, I don't know why I didn't notice it before. Opcodes were used that didn't exist, the situation  for ix usage was poor and less optimized.  Now without that there is only the LUT thing, I still think this page is pointless.--[[User:Jim e|Jim e]] 00:29, 27 December 2006 (PST)&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=Z80_Good_Programming_Practices</id>
		<title>Z80 Good Programming Practices</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Z80_Good_Programming_Practices"/>
				<updated>2006-12-27T08:26:05Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: Ix thing was painfully wrong, lut code wasn't the best still isn't.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Lookup table ==&lt;br /&gt;
&lt;br /&gt;
If you have a place in your code where a value is tested to choose between a lot of things, like subroutines or data, it can be a good idea to use lookup tables instead of a series of tests. It makes the code more readable, concise and extensible.&lt;br /&gt;
&lt;br /&gt;
In terms optimisation though it should be used when the data is not sequentially ordered or when the objects being pointed to are not the same size.  For example, using LUTs (Look Up Tables) to find a tile in a block of memory that is only tiles would both slower and cost more memory.  Using LUTs to find a particular string would be quicker but would waste more memory than a linear search.  Using LUTs as a jump table to different code blocks located through out a program would be faster and smaller compared to the alternative.&lt;br /&gt;
&lt;br /&gt;
However, if there aren't many jumps and many of the values of a are sequential, it would be more efficient to do something like:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 ld a,(Number)&lt;br /&gt;
 or a&lt;br /&gt;
 jp z,A_is_0&lt;br /&gt;
 dec a&lt;br /&gt;
 jp z,A_is_1&lt;br /&gt;
 dec a&lt;br /&gt;
 jp z,A_is_2&lt;br /&gt;
 sub 2&lt;br /&gt;
 jp z,A_is_4&lt;br /&gt;
 dec a&lt;br /&gt;
 jp z,A_is_5&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;Without&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;With&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 ld a,(SpriteNumber)&lt;br /&gt;
 cp 0&lt;br /&gt;
 jp z,ChooseSprite0&lt;br /&gt;
 cp 1&lt;br /&gt;
 jp z,ChooseSprite1&lt;br /&gt;
 cp 2&lt;br /&gt;
 jp z,ChooseSprite2&lt;br /&gt;
 cp 3&lt;br /&gt;
 jp z,ChooseSprite3&lt;br /&gt;
 cp 4&lt;br /&gt;
 jp z,ChooseSprite4&lt;br /&gt;
 cp 5&lt;br /&gt;
 jp z,ChooseSprite5&lt;br /&gt;
...&lt;br /&gt;
ChooseSprite0&lt;br /&gt;
 ld hl,Sprite0&lt;br /&gt;
 jp DisplaySprite&lt;br /&gt;
ChooseSprite1&lt;br /&gt;
 ld hl,Sprite1&lt;br /&gt;
 jp DisplaySprite&lt;br /&gt;
ChooseSprite2&lt;br /&gt;
 ld hl,Sprite2&lt;br /&gt;
 jp DisplaySprite&lt;br /&gt;
ChooseSprite3&lt;br /&gt;
 ld hl,Sprite3&lt;br /&gt;
 jp DisplaySprite&lt;br /&gt;
ChooseSprite4&lt;br /&gt;
 ld hl,Sprite4&lt;br /&gt;
 jp DisplaySprite&lt;br /&gt;
ChooseSprite5&lt;br /&gt;
 ld hl,Sprite5&lt;br /&gt;
 jp DisplaySprite&lt;br /&gt;
...&lt;br /&gt;
DisplaySprite&lt;br /&gt;
 ld bc,(coordinates)&lt;br /&gt;
 call SpriteRoutine&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 ld a,(SpriteNumber)&lt;br /&gt;
 add a,a   ; a*2 (limits SpriteNumber to 128) &lt;br /&gt;
 ld h,0 &lt;br /&gt;
 ld l,a &lt;br /&gt;
 ld de,SpriteAddressLUT&lt;br /&gt;
 add hl,de&lt;br /&gt;
 ld a,(hl)&lt;br /&gt;
 inc hl&lt;br /&gt;
 ld h,(hl)&lt;br /&gt;
 ld l,a&lt;br /&gt;
 ld bc,(coordinates)&lt;br /&gt;
 jp SpriteRoutine&lt;br /&gt;
...&lt;br /&gt;
SpriteAddressLUT&lt;br /&gt;
 .dw Sprite0&lt;br /&gt;
 .dw Sprite1&lt;br /&gt;
 .dw Sprite2&lt;br /&gt;
 .dw Sprite3&lt;br /&gt;
 .dw Sprite4&lt;br /&gt;
 .dw Sprite5&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And this one :&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;Without&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;With&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 ld a,(MenuChoice)&lt;br /&gt;
 cp 0&lt;br /&gt;
 jp z,Choice0&lt;br /&gt;
 cp 1&lt;br /&gt;
 jp z,Choice1&lt;br /&gt;
 cp 2&lt;br /&gt;
 jp z,Choice2&lt;br /&gt;
 cp 3&lt;br /&gt;
 jp z,Choice3&lt;br /&gt;
 cp 4&lt;br /&gt;
 jp z,Choice4&lt;br /&gt;
 cp 5&lt;br /&gt;
 jp z,Choice5&lt;br /&gt;
 cp 6&lt;br /&gt;
 jp z,Choice6&lt;br /&gt;
 cp 7&lt;br /&gt;
 jp z,Choice7&lt;br /&gt;
...&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 ld a,(MenuChoice)&lt;br /&gt;
 add a,a ; a*2&lt;br /&gt;
 ld h,0&lt;br /&gt;
 ld l,a&lt;br /&gt;
 ld de,CodeBranchLUT&lt;br /&gt;
 add hl,de&lt;br /&gt;
 ld a,(hl)&lt;br /&gt;
 inc hl&lt;br /&gt;
 ld h,(hl)&lt;br /&gt;
 ld l,a&lt;br /&gt;
 jp (hl)&lt;br /&gt;
...&lt;br /&gt;
CodeBranchLUT:&lt;br /&gt;
 .dw Choice0&lt;br /&gt;
 .dw Choice1&lt;br /&gt;
 .dw Choice2&lt;br /&gt;
 .dw Choice3&lt;br /&gt;
 .dw Choice4&lt;br /&gt;
 .dw Choice5&lt;br /&gt;
 .dw Choice6&lt;br /&gt;
 .dw Choice7&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
{{stub}}&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=Z80_Instruction_Set</id>
		<title>Z80 Instruction Set</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Z80_Instruction_Set"/>
				<updated>2006-12-15T20:12:16Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: ld (A),hl &amp;amp; ld hl,(A) were incorrect in timming. Made note about their duplicate opcodes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Reference ==&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
! Instruction !! Opcode !! Time !! S !! Z !! X !! H !! Y !! P !! N !! C !! Effect&lt;br /&gt;
|-&lt;br /&gt;
| adc a,R || &amp;lt;tt&amp;gt;10001rrr&amp;lt;/tt&amp;gt; || 4 || + || + || + || + || + || V || 0 || + || a += R + cf&lt;br /&gt;
|-&lt;br /&gt;
| adc a,J || &amp;lt;tt&amp;gt;11i11101 1000110b&amp;lt;/tt&amp;gt; || 8 || + || + || + || + || + || V || 0 || + || a += J + cf&lt;br /&gt;
|-&lt;br /&gt;
| adc a,N || &amp;lt;tt&amp;gt;11001110 nnnnnnnn&amp;lt;/tt&amp;gt; || 7 || + || + || + || + || + || V || 0 || + || a += N + cf&lt;br /&gt;
|-&lt;br /&gt;
| adc a,(hl) || &amp;lt;tt&amp;gt;10001110&amp;lt;/tt&amp;gt; || 7 || + || + || + || + || + || V || 0 || + || a += (hl) + cf&lt;br /&gt;
|-&lt;br /&gt;
| adc a,(I+D) || &amp;lt;tt&amp;gt;11i11101 10001110 dddddddd&amp;lt;/tt&amp;gt; || 19 || + || + || + || + || + || V || 0 || + || a += (I+D) + cf&lt;br /&gt;
|-&lt;br /&gt;
| adc hl,Q || &amp;lt;tt&amp;gt;11101101 01qq1010&amp;lt;/tt&amp;gt; || 15 || + || + || + || + || + || V || 0 || + || hl += Q + cf&lt;br /&gt;
|-&lt;br /&gt;
| add a,R || &amp;lt;tt&amp;gt;10000rrr&amp;lt;/tt&amp;gt; || 4 || + || + || + || + || + || V || 0 || + || a += R&lt;br /&gt;
|-&lt;br /&gt;
| add a,J || &amp;lt;tt&amp;gt;11i11101 1000010b&amp;lt;/tt&amp;gt; || 8 || + || + || + || + || + || V || 0 || + || a += J&lt;br /&gt;
|-&lt;br /&gt;
| add a,N || &amp;lt;tt&amp;gt;11000110 nnnnnnnn&amp;lt;/tt&amp;gt; || 7 || + || + || + || + || + || V || 0 || + || a += N&lt;br /&gt;
|-&lt;br /&gt;
| add a,(hl) || &amp;lt;tt&amp;gt;10000110&amp;lt;/tt&amp;gt; || 7 || + || + || + || + || + || V || 0 || + || a += (hl)&lt;br /&gt;
|-&lt;br /&gt;
| add a,(I+D) || &amp;lt;tt&amp;gt;11i11101 10000110 dddddddd&amp;lt;/tt&amp;gt; || 19 || + || + || + || + || + || V || 0 || + || a += (I+D)&lt;br /&gt;
|-&lt;br /&gt;
| add hl,Q || &amp;lt;tt&amp;gt;00qq1001&amp;lt;/tt&amp;gt; || 11 || - || - || + || + || + || - || 0 || + || hl += Q&lt;br /&gt;
|-&lt;br /&gt;
| add I,Q || &amp;lt;tt&amp;gt;11i11101 00qq1001&amp;lt;/tt&amp;gt; || 15 || - || - || + || + || + || - || 0 || + || I += Q&lt;br /&gt;
|-&lt;br /&gt;
| and R || &amp;lt;tt&amp;gt;10100rrr&amp;lt;/tt&amp;gt; || 4 || + || + || + || 1 || + || P || 0 || 0 || a := a AND R&lt;br /&gt;
|-&lt;br /&gt;
| and J || &amp;lt;tt&amp;gt;11i11101 1010010b&amp;lt;/tt&amp;gt; || 8 || + || + || + || 1 || + || P || 0 || 0 || a := a AND J&lt;br /&gt;
|-&lt;br /&gt;
| and N || &amp;lt;tt&amp;gt;11100110 nnnnnnnn&amp;lt;/tt&amp;gt; || 7 || + || + || + || 1 || + || P || 0 || 0 || a := a AND N&lt;br /&gt;
|-&lt;br /&gt;
| and (hl) || &amp;lt;tt&amp;gt;10100110&amp;lt;/tt&amp;gt; || 7 || + || + || + || 1 || + || P || 0 || 0 || a := a AND (hl)&lt;br /&gt;
|-&lt;br /&gt;
| and (I+D) || &amp;lt;tt&amp;gt;11i11101 10100110 dddddddd&amp;lt;/tt&amp;gt; || 19 || + || + || + || 1 || + || P || 0 || 0 || a := a AND (I+D)&lt;br /&gt;
|-&lt;br /&gt;
| bit B,R || &amp;lt;tt&amp;gt;11001011 01bbbrrr&amp;lt;/tt&amp;gt; || 8 || + || + || + || 1 || + || P || 0 || - || tmp := R AND [1 &amp;lt;&amp;lt; B]&lt;br /&gt;
|-&lt;br /&gt;
| bit B,(hl) || &amp;lt;tt&amp;gt;11001011 01bbb110&amp;lt;/tt&amp;gt; || 12 || + || + || X || 1 || X || P || 0 || - || tmp := (hl) AND [1 &amp;lt;&amp;lt; B],&amp;lt;br&amp;gt;xf := memptr.13, yf := memptr.11&lt;br /&gt;
|-&lt;br /&gt;
| bit B,(I+D) || &amp;lt;tt&amp;gt;11i11101 11001011 dddddddd 01bbb***&amp;lt;/tt&amp;gt; || 20 || + || + || X || 1 || X || P || 0 || - || tmp := (I+D) AND [1 &amp;lt;&amp;lt; B],&amp;lt;br&amp;gt;xf := [I+D].13, yf := [I+D].11&lt;br /&gt;
|-&lt;br /&gt;
| call A || &amp;lt;tt&amp;gt;11001101 alalalal ahahahah&amp;lt;/tt&amp;gt; || 17 || - || - || - || - || - || - || - || - || sp -= 2, (sp) := pc, pc := A&lt;br /&gt;
|-&lt;br /&gt;
| call C,A || &amp;lt;tt&amp;gt;11ccc100 alalalal ahahahah&amp;lt;/tt&amp;gt; || 17/10 || - || - || - || - || - || - || - || - || if C then sp -= 2, (sp) := pc, pc := A&lt;br /&gt;
|-&lt;br /&gt;
| ccf || &amp;lt;tt&amp;gt;00111111&amp;lt;/tt&amp;gt; || 4 || - || - || A || X || A || - || 0 || X || hf := cf, cf := ~cf&lt;br /&gt;
|-&lt;br /&gt;
| cp R || &amp;lt;tt&amp;gt;10111rrr&amp;lt;/tt&amp;gt; || 4 || + || + || X || + || X || V || 1 || + || tmp := a - R, xf := R.5, yf = R.3&lt;br /&gt;
|-&lt;br /&gt;
| cp J || &amp;lt;tt&amp;gt;11i11101 1011110b&amp;lt;/tt&amp;gt; || 8 || + || + || X || + || X || V || 1 || + || tmp := a - J, xf := J.5, yf = J.3&lt;br /&gt;
|-&lt;br /&gt;
| cp N || &amp;lt;tt&amp;gt;11111110 nnnnnnnn&amp;lt;/tt&amp;gt; || 7 || + || + || X || + || X || V || 1 || + || tmp := a - N, xf := N.5, yf = N.3&lt;br /&gt;
|-&lt;br /&gt;
| cp (hl) || &amp;lt;tt&amp;gt;10111110&amp;lt;/tt&amp;gt; || 7 || + || + || X || + || X || V || 1 || + || tmp := a - (hl), xf := (hl).5, yf = (hl).3&lt;br /&gt;
|-&lt;br /&gt;
| cp (I+D) || &amp;lt;tt&amp;gt;11i11101 10111110 dddddddd&amp;lt;/tt&amp;gt; || 19 || + || + || X || + || X || V || 1 || + || tmp := a - (I+D), xf := (I+D).5, yf = (I+D).3&lt;br /&gt;
|-&lt;br /&gt;
| cpd || &amp;lt;tt&amp;gt;11101101 10101001&amp;lt;/tt&amp;gt; || 16 || + || + || X || + || X || C || 1 || - || tmp := a - (hl) =&amp;gt; flags, bc -= 1, hl -= 1,&amp;lt;br&amp;gt;xf := [tmp - hf].1, yf = [tmp - hf].3&lt;br /&gt;
|-&lt;br /&gt;
| cpdr || &amp;lt;tt&amp;gt;11101101 10111001&amp;lt;/tt&amp;gt; || 21/16 || + || + || X || + || X || C || 1 || - || cpd, if bc &amp;lt;&amp;gt; 0 and nz then pc -= 2&lt;br /&gt;
|-&lt;br /&gt;
| cpi || &amp;lt;tt&amp;gt;11101101 10100001&amp;lt;/tt&amp;gt; || 16 || + || + || X || + || X || C || 1 || - || tmp := a - (hl) =&amp;gt; flags, bc -= 1, hl += 1,&amp;lt;br&amp;gt;xf := [tmp - hf].1, yf = [tmp - hf].3&lt;br /&gt;
|-&lt;br /&gt;
| cpir || &amp;lt;tt&amp;gt;11101101 10110001&amp;lt;/tt&amp;gt; || 21/16 || + || + || X || + || X || C || 1 || - || cpi, if bc &amp;lt;&amp;gt; 0 and nz then pc -= 2&lt;br /&gt;
|-&lt;br /&gt;
| cpl || &amp;lt;tt&amp;gt;00101111&amp;lt;/tt&amp;gt; || 4 || - || - || + || 1 || + || - || 1 || - || a := ~a&lt;br /&gt;
|-&lt;br /&gt;
| daa || &amp;lt;tt&amp;gt;00100111&amp;lt;/tt&amp;gt; || 4 || + || + || + || X || + || P || - || X || tmp := a,&amp;lt;br&amp;gt;if nf then&amp;lt;br&amp;gt;&amp;amp;nbsp;if hf or [a AND 0x0f &amp;gt; 9] then tmp -= 0x06&amp;lt;br&amp;gt;&amp;amp;nbsp;if cf or [a &amp;gt; 0x99] then tmp -= 0x60&amp;lt;br&amp;gt;else&amp;lt;br&amp;gt;&amp;amp;nbsp;if hf or [a AND 0x0f &amp;gt; 9] then tmp += 0x06&amp;lt;br&amp;gt;&amp;amp;nbsp;if cf or [a &amp;gt; 0x99] then tmp += 0x60&amp;lt;br&amp;gt;endif,&amp;lt;br&amp;gt;tmp =&amp;gt; flags, cf := cf OR [a &amp;gt; 0x99],&amp;lt;br&amp;gt;hf := a.4 XOR tmp.4, a := tmp&lt;br /&gt;
|-&lt;br /&gt;
| dec R || &amp;lt;tt&amp;gt;00rrr101&amp;lt;/tt&amp;gt; || 4 || + || + || + || + || + || V || 1 || - || R -= 1&lt;br /&gt;
|-&lt;br /&gt;
| dec J || &amp;lt;tt&amp;gt;11i11101 0010b101&amp;lt;/tt&amp;gt; || 8 || + || + || + || + || + || V || 1 || - || J -= 1&lt;br /&gt;
|-&lt;br /&gt;
| dec (hl) || &amp;lt;tt&amp;gt;00110101&amp;lt;/tt&amp;gt; || 11 || + || + || + || + || + || V || 1 || - || (hl) -= 1&lt;br /&gt;
|-&lt;br /&gt;
| dec (I+D) || &amp;lt;tt&amp;gt;11i11101 00110101 dddddddd&amp;lt;/tt&amp;gt; || 19 || + || + || + || + || + || V || 1 || - || (I+D) -= 1&lt;br /&gt;
|-&lt;br /&gt;
| dec Q || &amp;lt;tt&amp;gt;00qq1011&amp;lt;/tt&amp;gt; || 6 || - || - || - || - || - || - || - || - || Q -= 1&lt;br /&gt;
|-&lt;br /&gt;
| dec I || &amp;lt;tt&amp;gt;11i11101 00101011&amp;lt;/tt&amp;gt; || 10 || - || - || - || - || - || - || - || - || I -= 1&lt;br /&gt;
|-&lt;br /&gt;
| di || &amp;lt;tt&amp;gt;11110011&amp;lt;/tt&amp;gt; || 4 || - || - || - || - || - || - || - || - || iff1 := 0, iff2 := 0&lt;br /&gt;
|-&lt;br /&gt;
| djnz E || &amp;lt;tt&amp;gt;00010000 dddddddd&amp;lt;/tt&amp;gt; || 13/8 || - || - || - || - || - || - || - || - || b -= 1, if b &amp;lt;&amp;gt; 0 then pc := E&lt;br /&gt;
|-&lt;br /&gt;
| ei || &amp;lt;tt&amp;gt;11111011&amp;lt;/tt&amp;gt; || 4 || - || - || - || - || - || - || - || - || iff1 := 1, iff2 := 1 after the next instruction&lt;br /&gt;
|-&lt;br /&gt;
| ex (sp),hl || &amp;lt;tt&amp;gt;11100011&amp;lt;/tt&amp;gt; || 19 || - || - || - || - || - || - || - || - || (sp) &amp;lt;=&amp;gt; hl&lt;br /&gt;
|-&lt;br /&gt;
| ex (sp),I || &amp;lt;tt&amp;gt;11i11101 11100011&amp;lt;/tt&amp;gt; || 23 || - || - || - || - || - || - || - || - || (sp) &amp;lt;=&amp;gt; I&lt;br /&gt;
|-&lt;br /&gt;
| ex af,af' || &amp;lt;tt&amp;gt;00001000&amp;lt;/tt&amp;gt; || 4 || X || X || X || X || X || X || X || X || af &amp;lt;=&amp;gt; af'&lt;br /&gt;
|-&lt;br /&gt;
| ex de,hl || &amp;lt;tt&amp;gt;11101011&amp;lt;/tt&amp;gt; || 4 || - || - || - || - || - || - || - || - || de &amp;lt;=&amp;gt; hl&lt;br /&gt;
|-&lt;br /&gt;
| exx || &amp;lt;tt&amp;gt;11011001&amp;lt;/tt&amp;gt; || 4 || - || - || - || - || - || - || - || - || bc, de, hl &amp;lt;=&amp;gt; bc', de', hl'&lt;br /&gt;
|-&lt;br /&gt;
| halt || &amp;lt;tt&amp;gt;01110110&amp;lt;/tt&amp;gt; || 4 || - || - || - || - || - || - || - || - || wait for interrupt&lt;br /&gt;
|-&lt;br /&gt;
| im 0 || &amp;lt;tt&amp;gt;11101101 01*0*110&amp;lt;/tt&amp;gt; || 8 || - || - || - || - || - || - || - || - || mode 0: execute instruction on bus&lt;br /&gt;
|-&lt;br /&gt;
| im 1 || &amp;lt;tt&amp;gt;11101101 01*10110&amp;lt;/tt&amp;gt; || 8 || - || - || - || - || - || - || - || - || mode 1: execute rst $38&lt;br /&gt;
|-&lt;br /&gt;
| im 2 || &amp;lt;tt&amp;gt;11101101 01*11110&amp;lt;/tt&amp;gt; || 8 || - || - || - || - || - || - || - || - || mode 2: call (i * 256 + byte on bus)&lt;br /&gt;
|-&lt;br /&gt;
| in a,(N) || &amp;lt;tt&amp;gt;11011011 nnnnnnnn&amp;lt;/tt&amp;gt; || 11 || - || - || - || - || - || - || - || - || a := ((N))&lt;br /&gt;
|-&lt;br /&gt;
| in R,(c) || &amp;lt;tt&amp;gt;11101101 01rrr000&amp;lt;/tt&amp;gt; || 12 || + || + || + || 0 || + || P || 0 || - || R := ((c))&lt;br /&gt;
|-&lt;br /&gt;
| in f,(c) || &amp;lt;tt&amp;gt;11101101 01110000&amp;lt;/tt&amp;gt; || 12 || + || + || + || 0 || + || P || 0 || - || tmp := ((c))&lt;br /&gt;
|-&lt;br /&gt;
| inc R || &amp;lt;tt&amp;gt;00rrr100&amp;lt;/tt&amp;gt; || 4 || + || + || + || + || + || V || 0 || - || R += 1&lt;br /&gt;
|-&lt;br /&gt;
| inc J || &amp;lt;tt&amp;gt;11i11101 0010b100&amp;lt;/tt&amp;gt; || 8 || + || + || + || + || + || V || 0 || - || J += 1&lt;br /&gt;
|-&lt;br /&gt;
| inc (hl) || &amp;lt;tt&amp;gt;00110100&amp;lt;/tt&amp;gt; || 11 || + || + || + || + || + || V || 0 || - || (hl) += 1&lt;br /&gt;
|-&lt;br /&gt;
| inc (I+D) || &amp;lt;tt&amp;gt;11i11101 00110100 dddddddd&amp;lt;/tt&amp;gt; || 23 || + || + || + || + || + || V || 0 || - || (I+D) += 1&lt;br /&gt;
|-&lt;br /&gt;
| inc Q || &amp;lt;tt&amp;gt;00qq0011&amp;lt;/tt&amp;gt; || 6 || - || - || - || - || - || - || - || - || Q += 1&lt;br /&gt;
|-&lt;br /&gt;
| inc I || &amp;lt;tt&amp;gt;11i11101 00100011&amp;lt;/tt&amp;gt; || 10 || - || - || - || - || - || - || - || - || I += 1&lt;br /&gt;
|-&lt;br /&gt;
| ind || &amp;lt;tt&amp;gt;11101101 10101010&amp;lt;/tt&amp;gt; || 16 || + || + || + || X || + || X || X || X || tmp := ((c)), (hl) := tmp, hl -= 1,&amp;lt;br&amp;gt;b -= 1 =&amp;gt; flags, nf := tmp.7,&amp;lt;br&amp;gt;tmp2 = tmp + [[c - 1] AND 0xff],&amp;lt;br&amp;gt;pf := parity of [[tmp2 AND 0x07] XOR b],&amp;lt;br&amp;gt;hf := cf := tmp2 &amp;gt; 255&lt;br /&gt;
|-&lt;br /&gt;
| indr || &amp;lt;tt&amp;gt;11101101 10111010&amp;lt;/tt&amp;gt; || 21/16 || + || + || + || X || + || X || X || X || ind, if b &amp;lt;&amp;gt; 0 then pc -= 2&lt;br /&gt;
|-&lt;br /&gt;
| ini || &amp;lt;tt&amp;gt;11101101 10100010&amp;lt;/tt&amp;gt; || 16 || + || + || + || X || + || X || X || X || tmp := ((c)), (hl) := tmp, hl += 1,&amp;lt;br&amp;gt;b -= 1 =&amp;gt; flags, nf := tmp.7,&amp;lt;br&amp;gt;tmp2 := tmp + [[c + 1] AND 0xff],&amp;lt;br&amp;gt;pf := parity of [[tmp2 AND 0x07] XOR b],&amp;lt;br&amp;gt;hf := cf := tmp2 &amp;gt; 255&lt;br /&gt;
|-&lt;br /&gt;
| inir || &amp;lt;tt&amp;gt;11101101 10110010&amp;lt;/tt&amp;gt; || 21/16 || + || + || + || X || + || X || X || X || ini, if b &amp;lt;&amp;gt; 0 then pc -= 2&lt;br /&gt;
|-&lt;br /&gt;
| jp A || &amp;lt;tt&amp;gt;11000011 alalalal ahahahah&amp;lt;/tt&amp;gt; || 10 || - || - || - || - || - || - || - || - || pc := A&lt;br /&gt;
|-&lt;br /&gt;
| jp (hl) || &amp;lt;tt&amp;gt;11101001&amp;lt;/tt&amp;gt; || 4 || - || - || - || - || - || - || - || - || pc := hl&lt;br /&gt;
|-&lt;br /&gt;
| jp (I) || &amp;lt;tt&amp;gt;11i11101 11101001&amp;lt;/tt&amp;gt; || 8 || - || - || - || - || - || - || - || - || pc := I&lt;br /&gt;
|-&lt;br /&gt;
| jp C,A || &amp;lt;tt&amp;gt;11ccc010 alalalal ahahahah&amp;lt;/tt&amp;gt; || 10 || - || - || - || - || - || - || - || - || if C then pc := A&lt;br /&gt;
|-&lt;br /&gt;
| jr E || &amp;lt;tt&amp;gt;00011000 dddddddd&amp;lt;/tt&amp;gt; || 12 || - || - || - || - || - || - || - || - || pc := E&lt;br /&gt;
|-&lt;br /&gt;
| jr nz,E || &amp;lt;tt&amp;gt;00100000 dddddddd&amp;lt;/tt&amp;gt; || 12/7 || - || - || - || - || - || - || - || - || if nz then pc := E&lt;br /&gt;
|-&lt;br /&gt;
| jr z,E || &amp;lt;tt&amp;gt;00101000 dddddddd&amp;lt;/tt&amp;gt; || 12/7 || - || - || - || - || - || - || - || - || if zf then pc := E&lt;br /&gt;
|-&lt;br /&gt;
| jr nc,E || &amp;lt;tt&amp;gt;00110000 dddddddd&amp;lt;/tt&amp;gt; || 12/7 || - || - || - || - || - || - || - || - || if nc then pc := E&lt;br /&gt;
|-&lt;br /&gt;
| jr c,E || &amp;lt;tt&amp;gt;00111000 dddddddd&amp;lt;/tt&amp;gt; || 12/7 || - || - || - || - || - || - || - || - || if cf then pc := E&lt;br /&gt;
|-&lt;br /&gt;
| ld R1,R2 || &amp;lt;tt&amp;gt;01rrrsss&amp;lt;/tt&amp;gt; || 4 || - || - || - || - || - || - || - || - || R1 := R2&lt;br /&gt;
|-&lt;br /&gt;
| ld R,J || &amp;lt;tt&amp;gt;11i11101 01rrr10b&amp;lt;/tt&amp;gt; || 8 || - || - || - || - || - || - || - || - || R := J&lt;br /&gt;
|-&lt;br /&gt;
| ld J,R || &amp;lt;tt&amp;gt;11i11101 0110brrr&amp;lt;/tt&amp;gt; || 8 || - || - || - || - || - || - || - || - || J := R&lt;br /&gt;
|-&lt;br /&gt;
| ld ixh,ixl || &amp;lt;tt&amp;gt;11011101 01100101&amp;lt;/tt&amp;gt; || 8 || - || - || - || - || - || - || - || - || ixh := ixl&lt;br /&gt;
|-&lt;br /&gt;
| ld ixl,ixh || &amp;lt;tt&amp;gt;11011101 01101100&amp;lt;/tt&amp;gt; || 8 || - || - || - || - || - || - || - || - || ixl := ixh&lt;br /&gt;
|-&lt;br /&gt;
| ld iyh,iyl || &amp;lt;tt&amp;gt;11111101 01100101&amp;lt;/tt&amp;gt; || 8 || - || - || - || - || - || - || - || - || iyh := iyl&lt;br /&gt;
|-&lt;br /&gt;
| ld iyl,iyh || &amp;lt;tt&amp;gt;11111101 01101100&amp;lt;/tt&amp;gt; || 8 || - || - || - || - || - || - || - || - || iyl := iyh&lt;br /&gt;
|-&lt;br /&gt;
| ld R,N || &amp;lt;tt&amp;gt;00rrr110 nnnnnnnn&amp;lt;/tt&amp;gt; || 7 || - || - || - || - || - || - || - || - || R := N&lt;br /&gt;
|-&lt;br /&gt;
| ld R,(hl) || &amp;lt;tt&amp;gt;01rrr110&amp;lt;/tt&amp;gt; || 7 || - || - || - || - || - || - || - || - || R := (hl)&lt;br /&gt;
|-&lt;br /&gt;
| ld R,(I+D) || &amp;lt;tt&amp;gt;11i11101 01rrr110 dddddddd&amp;lt;/tt&amp;gt; || 19 || - || - || - || - || - || - || - || - || R := (I+D)&lt;br /&gt;
|-&lt;br /&gt;
| ld (hl),R || &amp;lt;tt&amp;gt;01110rrr&amp;lt;/tt&amp;gt; || 7 || - || - || - || - || - || - || - || - || (hl) := R&lt;br /&gt;
|-&lt;br /&gt;
| ld (hl),N || &amp;lt;tt&amp;gt;00110110 nnnnnnnn&amp;lt;/tt&amp;gt; || 10 || - || - || - || - || - || - || - || - || (hl) := N&lt;br /&gt;
|-&lt;br /&gt;
| ld (I+D),R || &amp;lt;tt&amp;gt;11i11101 01110rrr dddddddd&amp;lt;/tt&amp;gt; || 19 || - || - || - || - || - || - || - || - || (I+D) := R&lt;br /&gt;
|-&lt;br /&gt;
| ld (I+D),N || &amp;lt;tt&amp;gt;11i11101 00110110 dddddddd nnnnnnnn&amp;lt;/tt&amp;gt; || 19 || - || - || - || - || - || - || - || - || (I+D) := N&lt;br /&gt;
|-&lt;br /&gt;
| ld a,(bc) || &amp;lt;tt&amp;gt;00001010&amp;lt;/tt&amp;gt; || 7 || - || - || - || - || - || - || - || - || a := (bc)&lt;br /&gt;
|-&lt;br /&gt;
| ld a,(de) || &amp;lt;tt&amp;gt;00011010&amp;lt;/tt&amp;gt; || 7 || - || - || - || - || - || - || - || - || a := (de)&lt;br /&gt;
|-&lt;br /&gt;
| ld a,(A) || &amp;lt;tt&amp;gt;00111010 alalalal ahahahah&amp;lt;/tt&amp;gt; || 13 || - || - || - || - || - || - || - || - || a := (A)&lt;br /&gt;
|-&lt;br /&gt;
| ld (bc),a || &amp;lt;tt&amp;gt;00000010&amp;lt;/tt&amp;gt; || 7 || - || - || - || - || - || - || - || - || (bc) := a&lt;br /&gt;
|-&lt;br /&gt;
| ld (de),a || &amp;lt;tt&amp;gt;00010010&amp;lt;/tt&amp;gt; || 7 || - || - || - || - || - || - || - || - || (de) := a&lt;br /&gt;
|-&lt;br /&gt;
| ld (A),a || &amp;lt;tt&amp;gt;00110010 alalalal ahahahah&amp;lt;/tt&amp;gt; || 13 || - || - || - || - || - || - || - || - || (A) := a&lt;br /&gt;
|-&lt;br /&gt;
| ld i,a || &amp;lt;tt&amp;gt;11101101 01000111&amp;lt;/tt&amp;gt; || 9 || - || - || - || - || - || - || - || - || i := a&lt;br /&gt;
|-&lt;br /&gt;
| ld r,a || &amp;lt;tt&amp;gt;11101101 01001111&amp;lt;/tt&amp;gt; || 9 || - || - || - || - || - || - || - || - || r := a&lt;br /&gt;
|-&lt;br /&gt;
| ld a,i || &amp;lt;tt&amp;gt;11101101 01010111&amp;lt;/tt&amp;gt; || 9 || + || + || + || 0 || + || X || 0 || - || a := i, pf := iff2&lt;br /&gt;
|-&lt;br /&gt;
| ld a,r || &amp;lt;tt&amp;gt;11101101 01011111&amp;lt;/tt&amp;gt; || 9 || + || + || + || 0 || + || X || 0 || - || a := r, pf := iff2&lt;br /&gt;
|-&lt;br /&gt;
| ld Q,A || &amp;lt;tt&amp;gt;00qq0001 alalalal ahahahah&amp;lt;/tt&amp;gt; || 10 || - || - || - || - || - || - || - || - || Q := A&lt;br /&gt;
|-&lt;br /&gt;
| ld I,A || &amp;lt;tt&amp;gt;11i11101 00100001 alalalal ahahahah&amp;lt;/tt&amp;gt; || 14 || - || - || - || - || - || - || - || - || I := A&lt;br /&gt;
|-&lt;br /&gt;
| ld Q,(A) || &amp;lt;tt&amp;gt;11101101 01qq1011 alalalal ahahahah&amp;lt;/tt&amp;gt; || 20 || - || - || - || - || - || - || - || - || Q := (A) [ld hl,(A) has a faster non-prefixed duplicate, see below.]&lt;br /&gt;
|-&lt;br /&gt;
| ld hl,(A) || &amp;lt;tt&amp;gt;00101010 alalalal ahahahah&amp;lt;/tt&amp;gt; || 16 || - || - || - || - || - || - || - || - || hl := (A)&lt;br /&gt;
|-&lt;br /&gt;
| ld I,(A) || &amp;lt;tt&amp;gt;11i11101 00101010 alalalal ahahahah&amp;lt;/tt&amp;gt; || 20 || - || - || - || - || - || - || - || - || I := (A)&lt;br /&gt;
|-&lt;br /&gt;
| ld (A),Q || &amp;lt;tt&amp;gt;11101101 01qq0011 alalalal ahahahah&amp;lt;/tt&amp;gt; || 20 || - || - || - || - || - || - || - || - || (A) := Q [ld (A),hl has a faster non-prefixed duplicate, see below.]&lt;br /&gt;
|-&lt;br /&gt;
| ld (A),hl || &amp;lt;tt&amp;gt;00100010 alalalal ahahahah&amp;lt;/tt&amp;gt; || 16 || - || - || - || - || - || - || - || - || (A) := hl&lt;br /&gt;
|-&lt;br /&gt;
| ld (A),I || &amp;lt;tt&amp;gt;11i11101 00100010 alalalal ahahahah&amp;lt;/tt&amp;gt; || 20 || - || - || - || - || - || - || - || - || (A) := I&lt;br /&gt;
|-&lt;br /&gt;
| ld sp,hl || &amp;lt;tt&amp;gt;11111001&amp;lt;/tt&amp;gt; || 6 || - || - || - || - || - || - || - || - || sp := hl&lt;br /&gt;
|-&lt;br /&gt;
| ld sp,I || &amp;lt;tt&amp;gt;11i11101 11111001&amp;lt;/tt&amp;gt; || 10 || - || - || - || - || - || - || - || - || sp := I&lt;br /&gt;
|-&lt;br /&gt;
| ldd || &amp;lt;tt&amp;gt;11101101 10101000&amp;lt;/tt&amp;gt; || 16 || - || - || X || 0 || X || C || 0 || - || tmp := (hl), (de) := tmp, de -= 1, hl -= 1,&amp;lt;br&amp;gt;bc -= 1, xf := [tmp + a].1, yf = [tmp + a].3&lt;br /&gt;
|-&lt;br /&gt;
| lddr || &amp;lt;tt&amp;gt;11101101 10111000&amp;lt;/tt&amp;gt; || 21/16 || - || - || X || 0 || X || C || 0 || - || ldd, if bc &amp;lt;&amp;gt; 0 then pc -= 2&lt;br /&gt;
|-&lt;br /&gt;
| ldi || &amp;lt;tt&amp;gt;11101101 10100000&amp;lt;/tt&amp;gt; || 16 || - || - || X || 0 || X || C || 0 || - || tmp := (hl), (de) := tmp, de += 1, hl += 1,&amp;lt;br&amp;gt;bc -= 1, xf := [tmp + a].1, yf = [tmp + a].3&lt;br /&gt;
|-&lt;br /&gt;
| ldir || &amp;lt;tt&amp;gt;11101101 10110000&amp;lt;/tt&amp;gt; || 21/16 || - || - || X || 0 || X || C || 0 || - || ldi, if bc &amp;lt;&amp;gt; 0 then pc -= 2&lt;br /&gt;
|-&lt;br /&gt;
| neg || &amp;lt;tt&amp;gt;11101101 01***100&amp;lt;/tt&amp;gt; || 8 || + || + || + || + || + || V || 1 || + || a := 0 - a&lt;br /&gt;
|-&lt;br /&gt;
| nop || &amp;lt;tt&amp;gt;00000000&amp;lt;/tt&amp;gt; || 4 || - || - || - || - || - || - || - || - || nothing&lt;br /&gt;
|-&lt;br /&gt;
| or R || &amp;lt;tt&amp;gt;10110rrr&amp;lt;/tt&amp;gt; || 4 || + || + || + || 0 || + || P || 0 || 0 || a := a OR R&lt;br /&gt;
|-&lt;br /&gt;
| or J || &amp;lt;tt&amp;gt;11i11101 1011010b&amp;lt;/tt&amp;gt; || 8 || + || + || + || 0 || + || P || 0 || 0 || a := a OR J&lt;br /&gt;
|-&lt;br /&gt;
| or N || &amp;lt;tt&amp;gt;11110110 nnnnnnnn&amp;lt;/tt&amp;gt; || 7 || + || + || + || 0 || + || P || 0 || 0 || a := a OR N&lt;br /&gt;
|-&lt;br /&gt;
| or (hl) || &amp;lt;tt&amp;gt;10110110&amp;lt;/tt&amp;gt; || 7 || + || + || + || 0 || + || P || 0 || 0 || a := a OR (hl)&lt;br /&gt;
|-&lt;br /&gt;
| or (I+D) || &amp;lt;tt&amp;gt;11i11101 10110110 dddddddd&amp;lt;/tt&amp;gt; || 19 || + || + || + || 0 || + || P || 0 || 0 || a := a OR (I+D)&lt;br /&gt;
|-&lt;br /&gt;
| out (N),a || &amp;lt;tt&amp;gt;11010011 nnnnnnnn&amp;lt;/tt&amp;gt; || 11 || - || - || - || - || - || - || - || - || ((N)) := a&lt;br /&gt;
|-&lt;br /&gt;
| out (c),R || &amp;lt;tt&amp;gt;11101101 01rrr001&amp;lt;/tt&amp;gt; || 12 || - || - || - || - || - || - || - || - || ((c)) := R&lt;br /&gt;
|-&lt;br /&gt;
| out (c),0 || &amp;lt;tt&amp;gt;11101101 01110001&amp;lt;/tt&amp;gt; || 12 || - || - || - || - || - || - || - || - || ((c)) := ? (seems to vary with CPU)&lt;br /&gt;
|-&lt;br /&gt;
| outd || &amp;lt;tt&amp;gt;11101101 10101011&amp;lt;/tt&amp;gt; || 16 || + || + || + || X || + || X || X || X || tmp := (hl), ((c)) := tmp, hl -= 1,&amp;lt;br&amp;gt;b -= 1 =&amp;gt; flags, nf := tmp.7, tmp2 = tmp + l,&amp;lt;br&amp;gt;pf := parity of [[tmp2 AND 0x07] XOR b],&amp;lt;br&amp;gt;hf := cf := tmp2 &amp;gt; 255&lt;br /&gt;
|-&lt;br /&gt;
| otdr || &amp;lt;tt&amp;gt;11101101 10111011&amp;lt;/tt&amp;gt; || 21/16 || + || + || + || X || + || X || X || X || outd, if b &amp;lt;&amp;gt; 0 then pc -= 2&lt;br /&gt;
|-&lt;br /&gt;
| outi || &amp;lt;tt&amp;gt;11101101 10100011&amp;lt;/tt&amp;gt; || 16 || + || + || + || X || + || X || X || X || tmp := (hl), ((c)) := tmp, hl += 1,&amp;lt;br&amp;gt;b -= 1 =&amp;gt; flags, nf := tmp.7, tmp2 = tmp + l,&amp;lt;br&amp;gt;pf := parity of [[tmp2 AND 0x07] XOR b],&amp;lt;br&amp;gt;hf := cf := tmp2 &amp;gt; 255&lt;br /&gt;
|-&lt;br /&gt;
| otir || &amp;lt;tt&amp;gt;11101101 10110011&amp;lt;/tt&amp;gt; || 21/16 || + || + || + || X || + || X || X || X || outi, if b &amp;lt;&amp;gt; 0 then pc -= 2&lt;br /&gt;
|-&lt;br /&gt;
| pop P || &amp;lt;tt&amp;gt;11pp0001&amp;lt;/tt&amp;gt; || 10 || - || - || - || - || - || - || - || - || P := (sp), sp += 2&lt;br /&gt;
|-&lt;br /&gt;
| pop I || &amp;lt;tt&amp;gt;11i11101 11100001&amp;lt;/tt&amp;gt; || 14 || - || - || - || - || - || - || - || - || I := (sp), sp += 2&lt;br /&gt;
|-&lt;br /&gt;
| push P || &amp;lt;tt&amp;gt;11pp0101&amp;lt;/tt&amp;gt; || 11 || - || - || - || - || - || - || - || - || sp -= 2, (sp) := P&lt;br /&gt;
|-&lt;br /&gt;
| push I || &amp;lt;tt&amp;gt;11i11101 11100101&amp;lt;/tt&amp;gt; || 15 || - || - || - || - || - || - || - || - || sp -= 2, (sp) := I&lt;br /&gt;
|-&lt;br /&gt;
| res B,R || &amp;lt;tt&amp;gt;11001011 10bbbrrr&amp;lt;/tt&amp;gt; || 8 || - || - || - || - || - || - || - || - || R := R AND ~[1 &amp;lt;&amp;lt; B]&lt;br /&gt;
|-&lt;br /&gt;
| res B,(hl) || &amp;lt;tt&amp;gt;11001011 10bbb110&amp;lt;/tt&amp;gt; || 15 || - || - || - || - || - || - || - || - || (hl) := (hl) AND ~[1 &amp;lt;&amp;lt; B]&lt;br /&gt;
|-&lt;br /&gt;
| res B,(I+D) || &amp;lt;tt&amp;gt;11i11101 11001011 dddddddd 10bbb110&amp;lt;/tt&amp;gt; || 23 || - || - || - || - || - || - || - || - || (I+D) := (I+D) AND ~[1 &amp;lt;&amp;lt; B]&lt;br /&gt;
|-&lt;br /&gt;
| res B,(I+D)-&amp;gt;R || &amp;lt;tt&amp;gt;11i11101 11001011 dddddddd 10bbbrrr&amp;lt;/tt&amp;gt; || 23 || - || - || - || - || - || - || - || - || (I+D) := R := (I+D) AND ~[1 &amp;lt;&amp;lt; B]&lt;br /&gt;
|-&lt;br /&gt;
| ret || &amp;lt;tt&amp;gt;11001001&amp;lt;/tt&amp;gt; || 10 || - || - || - || - || - || - || - || - || pc := (sp), sp += 2&lt;br /&gt;
|-&lt;br /&gt;
| ret C || &amp;lt;tt&amp;gt;11ccc000&amp;lt;/tt&amp;gt; || 11/5 || - || - || - || - || - || - || - || - || if C then pc := (sp), sp += 2&lt;br /&gt;
|-&lt;br /&gt;
| reti || &amp;lt;tt&amp;gt;11101101 01**1101&amp;lt;/tt&amp;gt; || 14 || - || - || - || - || - || - || - || - || pc := (sp), sp += 2, iff1 := iff2&lt;br /&gt;
|-&lt;br /&gt;
| retn || &amp;lt;tt&amp;gt;11101101 01**0101&amp;lt;/tt&amp;gt; || 14 || - || - || - || - || - || - || - || - || pc := (sp), sp += 2, iff1 := iff2&lt;br /&gt;
|-&lt;br /&gt;
| rla || &amp;lt;tt&amp;gt;00010111&amp;lt;/tt&amp;gt; || 4 || - || - || + || 0 || + || - || 0 || X || ocf := cf, cf := a.7, a := [a &amp;lt;&amp;lt; 1] + ocf&lt;br /&gt;
|-&lt;br /&gt;
| rl R || &amp;lt;tt&amp;gt;11001011 00010rrr&amp;lt;/tt&amp;gt; || 8 || + || + || + || 0 || + || P || 0 || X || ocf := cf, cf := R.7, R := [R &amp;lt;&amp;lt; 1] + ocf&lt;br /&gt;
|-&lt;br /&gt;
| rl (hl) || &amp;lt;tt&amp;gt;11001011 00010110&amp;lt;/tt&amp;gt; || 15 || + || + || + || 0 || + || P || 0 || X || ocf := cf, cf := (hl).7, (hl) := [(hl) &amp;lt;&amp;lt; 1] + ocf&lt;br /&gt;
|-&lt;br /&gt;
| rl (I+D) || &amp;lt;tt&amp;gt;11i11101 11001011 dddddddd 00010110&amp;lt;/tt&amp;gt; || 23 || + || + || + || 0 || + || P || 0 || X || ocf := cf, cf := (I+D).7,&amp;lt;br&amp;gt;(I+D) := [(I+D) &amp;lt;&amp;lt; 1] + ocf&lt;br /&gt;
|-&lt;br /&gt;
| rl (I+D)-&amp;gt;R || &amp;lt;tt&amp;gt;11i11101 11001011 dddddddd 00010rrr&amp;lt;/tt&amp;gt; || 23 || + || + || + || 0 || + || P || 0 || X || ocf := cf, cf := (I+D).7,&amp;lt;br&amp;gt;(I+D) := R := [(I+D) &amp;lt;&amp;lt; 1] + ocf&lt;br /&gt;
|-&lt;br /&gt;
| rlca || &amp;lt;tt&amp;gt;00000111&amp;lt;/tt&amp;gt; || 4 || - || - || + || 0 || + || - || 0 || X || cf := a.7, a := [a &amp;lt;&amp;lt; 1] + cf&lt;br /&gt;
|-&lt;br /&gt;
| rlc R || &amp;lt;tt&amp;gt;11001011 00000rrr&amp;lt;/tt&amp;gt; || 8 || + || + || + || 0 || + || P || 0 || X || cf := R.7, R := [R &amp;lt;&amp;lt; 1] + cf&lt;br /&gt;
|-&lt;br /&gt;
| rlc (hl) || &amp;lt;tt&amp;gt;11001011 00000110&amp;lt;/tt&amp;gt; || 15 || + || + || + || 0 || + || P || 0 || X || cf := (hl).7, (hl) := [(hl) &amp;lt;&amp;lt; 1] + cf&lt;br /&gt;
|-&lt;br /&gt;
| rlc (I+D) || &amp;lt;tt&amp;gt;11i11101 11001011 dddddddd 00000110&amp;lt;/tt&amp;gt; || 23 || + || + || + || 0 || + || P || 0 || X || cf := (I+D).7, (I+D) := [(I+D) &amp;lt;&amp;lt; 1] + cf&lt;br /&gt;
|-&lt;br /&gt;
| rlc (I+D)-&amp;gt;R || &amp;lt;tt&amp;gt;11i11101 11001011 dddddddd 00000rrr&amp;lt;/tt&amp;gt; || 23 || + || + || + || 0 || + || P || 0 || X || cf := (I+D).7, (I+D) := R := [(I+D) &amp;lt;&amp;lt; 1] + cf&lt;br /&gt;
|-&lt;br /&gt;
| rld || &amp;lt;tt&amp;gt;11101101 01101111&amp;lt;/tt&amp;gt; || 18 || + || + || + || 0 || + || P || 0 || - || tmp := [(hl) &amp;lt;&amp;lt; 4] + [a AND 0x0f], (hl) := tmp,&amp;lt;br&amp;gt;a := [a AND 0xf0] + [tmp &amp;gt;&amp;gt; 8] =&amp;gt; flags&lt;br /&gt;
|-&lt;br /&gt;
| rra || &amp;lt;tt&amp;gt;00011111&amp;lt;/tt&amp;gt; || 4 || - || - || + || 0 || + || - || 0 || X || ocf := cf, cf := a.0, a := [a &amp;gt;&amp;gt; 1] + [ocf &amp;lt;&amp;lt; 7]&lt;br /&gt;
|-&lt;br /&gt;
| rr R || &amp;lt;tt&amp;gt;11001011 00011rrr&amp;lt;/tt&amp;gt; || 8 || + || + || + || 0 || + || P || 0 || X || ocf := cf, cf := R.0, R := [R &amp;gt;&amp;gt; 1] + [ocf &amp;lt;&amp;lt; 7]&lt;br /&gt;
|-&lt;br /&gt;
| rr (hl) || &amp;lt;tt&amp;gt;11001011 00011110&amp;lt;/tt&amp;gt; || 15 || + || + || + || 0 || + || P || 0 || X || ocf := cf, cf := (hl).0,&amp;lt;br&amp;gt;(hl) := [(hl) &amp;gt;&amp;gt; 1] + [ocf &amp;lt;&amp;lt; 7]&lt;br /&gt;
|-&lt;br /&gt;
| rr (I+D) || &amp;lt;tt&amp;gt;11i11101 11001011 dddddddd 00011110&amp;lt;/tt&amp;gt; || 23 || + || + || + || 0 || + || P || 0 || X || ocf := cf, cf := (I+D).0,&amp;lt;br&amp;gt;(I+D) := [(I+D) &amp;gt;&amp;gt; 1] + [ocf &amp;lt;&amp;lt; 7]&lt;br /&gt;
|-&lt;br /&gt;
| rr (I+D)-&amp;gt;R || &amp;lt;tt&amp;gt;11i11101 11001011 dddddddd 00011rrr&amp;lt;/tt&amp;gt; || 23 || + || + || + || 0 || + || P || 0 || X || ocf := cf, cf := (I+D).0,&amp;lt;br&amp;gt;(I+D) := R := [(I+D) &amp;gt;&amp;gt; 1] + [ocf &amp;lt;&amp;lt; 7]&lt;br /&gt;
|-&lt;br /&gt;
| rrca || &amp;lt;tt&amp;gt;00001111&amp;lt;/tt&amp;gt; || 4 || - || - || + || 0 || + || - || 0 || X || cf := a.0, a := [a &amp;gt;&amp;gt; 1] + [cf &amp;lt;&amp;lt; 7]&lt;br /&gt;
|-&lt;br /&gt;
| rrc R || &amp;lt;tt&amp;gt;11001011 00001rrr&amp;lt;/tt&amp;gt; || 8 || + || + || + || 0 || + || P || 0 || X || cf := R.0, R := [R &amp;gt;&amp;gt; 1] + [cf &amp;lt;&amp;lt; 7]&lt;br /&gt;
|-&lt;br /&gt;
| rrc (hl) || &amp;lt;tt&amp;gt;11001011 00001110&amp;lt;/tt&amp;gt; || 15 || + || + || + || 0 || + || P || 0 || X || cf := (hl).0, (hl) := [(hl) &amp;gt;&amp;gt; 1] + [cf &amp;lt;&amp;lt; 7]&lt;br /&gt;
|-&lt;br /&gt;
| rrc (I+D) || &amp;lt;tt&amp;gt;11i11101 11001011 dddddddd 00001110&amp;lt;/tt&amp;gt; || 23 || + || + || + || 0 || + || P || 0 || X || cf := (I+D).0, (I+D) := [(I+D) &amp;gt;&amp;gt; 1] + [cf &amp;lt;&amp;lt; 7]&lt;br /&gt;
|-&lt;br /&gt;
| rrc (I+D)-&amp;gt;R || &amp;lt;tt&amp;gt;11i11101 11001011 dddddddd 00001rrr&amp;lt;/tt&amp;gt; || 23 || + || + || + || 0 || + || P || 0 || X || cf := (I+D).0,&amp;lt;br&amp;gt;(I+D) := R := [(I+D) &amp;gt;&amp;gt; 1] + [cf &amp;lt;&amp;lt; 7]&lt;br /&gt;
|-&lt;br /&gt;
| rrd || &amp;lt;tt&amp;gt;11101101 01100111&amp;lt;/tt&amp;gt; || 18 || + || + || + || 0 || + || P || 0 || - || tmp := (hl),&amp;lt;br&amp;gt;(hl) := [tmp &amp;gt;&amp;gt; 4] + [[a AND 0x0f] &amp;lt;&amp;lt; 4],&amp;lt;br&amp;gt;a := [a AND 0xf0] + [tmp AND 0x0f] =&amp;gt; flags&lt;br /&gt;
|-&lt;br /&gt;
| rst S || &amp;lt;tt&amp;gt;11sss111&amp;lt;/tt&amp;gt; || 11 || - || - || - || - || - || - || - || - || sp -= 2, (sp) := pc, pc := S&lt;br /&gt;
|-&lt;br /&gt;
| sbc a,R || &amp;lt;tt&amp;gt;10011rrr&amp;lt;/tt&amp;gt; || 4 || + || + || + || + || + || V || 1 || + || a -= R + cf&lt;br /&gt;
|-&lt;br /&gt;
| sbc a,J || &amp;lt;tt&amp;gt;11i11101 1001110b&amp;lt;/tt&amp;gt; || 8 || + || + || + || + || + || V || 1 || + || a -= J + cf&lt;br /&gt;
|-&lt;br /&gt;
| sbc a,N || &amp;lt;tt&amp;gt;11011110 nnnnnnnn&amp;lt;/tt&amp;gt; || 7 || + || + || + || + || + || V || 1 || + || a -= N + cf&lt;br /&gt;
|-&lt;br /&gt;
| sbc a,(hl) || &amp;lt;tt&amp;gt;10011110&amp;lt;/tt&amp;gt; || 7 || + || + || + || + || + || V || 1 || + || a -= (hl) + cf&lt;br /&gt;
|-&lt;br /&gt;
| sbc a,(I+D) || &amp;lt;tt&amp;gt;11i11101 10011110 dddddddd&amp;lt;/tt&amp;gt; || 19 || + || + || + || + || + || V || 1 || + || a -= (I+D) + cf&lt;br /&gt;
|-&lt;br /&gt;
| sbc hl,Q || &amp;lt;tt&amp;gt;11101101 01qq0010&amp;lt;/tt&amp;gt; || 15 || + || + || + || + || + || V || 1 || + || hl -= Q + cf&lt;br /&gt;
|-&lt;br /&gt;
| scf || &amp;lt;tt&amp;gt;00110111&amp;lt;/tt&amp;gt; || 4 || - || - || A || 0 || A || - || 0 || 1 || nothing else&lt;br /&gt;
|-&lt;br /&gt;
| set B,R || &amp;lt;tt&amp;gt;11001011 11bbbrrr&amp;lt;/tt&amp;gt; || 8 || - || - || - || - || - || - || - || - || R := R OR [1 &amp;lt;&amp;lt; B]&lt;br /&gt;
|-&lt;br /&gt;
| set B,(hl) || &amp;lt;tt&amp;gt;11001011 11bbb110&amp;lt;/tt&amp;gt; || 15 || - || - || - || - || - || - || - || - || (hl) := (hl) OR [1 &amp;lt;&amp;lt; B]&lt;br /&gt;
|-&lt;br /&gt;
| set B,(I+D) || &amp;lt;tt&amp;gt;11i11101 11001011 dddddddd 11bbb110&amp;lt;/tt&amp;gt; || 23 || - || - || - || - || - || - || - || - || (I+D) := (I+D) OR [1 &amp;lt;&amp;lt; B]&lt;br /&gt;
|-&lt;br /&gt;
| set B,(I+D)-&amp;gt;R || &amp;lt;tt&amp;gt;11i11101 11001011 dddddddd 11bbbrrr&amp;lt;/tt&amp;gt; || 23 || - || - || - || - || - || - || - || - || (I+D) := R := (I+D) OR [1 &amp;lt;&amp;lt; B]&lt;br /&gt;
|-&lt;br /&gt;
| sla R || &amp;lt;tt&amp;gt;11001011 00100rrr&amp;lt;/tt&amp;gt; || 8 || + || + || + || 0 || + || P || 0 || X || cf := R.7, R := R &amp;lt;&amp;lt; 1&lt;br /&gt;
|-&lt;br /&gt;
| sla (hl) || &amp;lt;tt&amp;gt;11001011 00100110&amp;lt;/tt&amp;gt; || 15 || + || + || + || 0 || + || P || 0 || X || cf := (hl).7, (hl) := (hl) &amp;lt;&amp;lt; 1&lt;br /&gt;
|-&lt;br /&gt;
| sla (I+D) || &amp;lt;tt&amp;gt;11i11101 11001011 dddddddd 00100110&amp;lt;/tt&amp;gt; || 23 || + || + || + || 0 || + || P || 0 || X || cf := (I+D).7, (I+D) := (I+D) &amp;lt;&amp;lt; 1&lt;br /&gt;
|-&lt;br /&gt;
| sla (I+D)-&amp;gt;R || &amp;lt;tt&amp;gt;11i11101 11001011 dddddddd 00100rrr&amp;lt;/tt&amp;gt; || 23 || + || + || + || 0 || + || P || 0 || X || cf := (I+D).7, (I+D) := R := (I+D) &amp;lt;&amp;lt; 1&lt;br /&gt;
|-&lt;br /&gt;
| sra R || &amp;lt;tt&amp;gt;11001011 00101rrr&amp;lt;/tt&amp;gt; || 8 || + || + || + || 0 || + || P || 0 || X || cf := R.0, R := R &amp;gt;&amp;gt; 1, R.7 := R.6&lt;br /&gt;
|-&lt;br /&gt;
| sra (hl) || &amp;lt;tt&amp;gt;11001011 00101110&amp;lt;/tt&amp;gt; || 15 || + || + || + || 0 || + || P || 0 || X || cf := (hl).0, (hl) := (hl) &amp;gt;&amp;gt; 1, (hl).7 := (hl).6&lt;br /&gt;
|-&lt;br /&gt;
| sra (I+D) || &amp;lt;tt&amp;gt;11i11101 11001011 dddddddd 00101110&amp;lt;/tt&amp;gt; || 23 || + || + || + || 0 || + || P || 0 || X || cf := (I+D).0,&amp;lt;br&amp;gt;(I+D) := (I+D) &amp;gt;&amp;gt; 1, (I+D).7 := (I+D).6&lt;br /&gt;
|-&lt;br /&gt;
| sra (I+D)-&amp;gt;R || &amp;lt;tt&amp;gt;11i11101 11001011 dddddddd 00101rrr&amp;lt;/tt&amp;gt; || 23 || + || + || + || 0 || + || P || 0 || X || cf := (I+D).0,&amp;lt;br&amp;gt;tmp := (I+D) &amp;gt;&amp;gt; 1, tmp.7 := tmp.6&amp;lt;br&amp;gt;(I+D) := R := tmp&lt;br /&gt;
|-&lt;br /&gt;
| sll R || &amp;lt;tt&amp;gt;11001011 00110rrr&amp;lt;/tt&amp;gt; || 8 || + || + || + || 0 || + || P || 0 || X || cf := R.7, R := [R &amp;lt;&amp;lt; 1] + 1&lt;br /&gt;
|-&lt;br /&gt;
| sll (hl) || &amp;lt;tt&amp;gt;11001011 00110110&amp;lt;/tt&amp;gt; || 15 || + || + || + || 0 || + || P || 0 || X || cf := (hl).7, (hl) := [(hl) &amp;lt;&amp;lt; 1] + 1&lt;br /&gt;
|-&lt;br /&gt;
| sll (I+D) || &amp;lt;tt&amp;gt;11i11101 11001011 dddddddd 00110110&amp;lt;/tt&amp;gt; || 23 || + || + || + || 0 || + || P || 0 || X || cf := (I+D).7, (I+D) := [(I+D) &amp;lt;&amp;lt; 1] + 1&lt;br /&gt;
|-&lt;br /&gt;
| sll (I+D)-&amp;gt;R || &amp;lt;tt&amp;gt;11i11101 11001011 dddddddd 00110rrr&amp;lt;/tt&amp;gt; || 23 || + || + || + || 0 || + || P || 0 || X || cf := (I+D).7, (I+D) := R := [(I+D) &amp;lt;&amp;lt; 1] + 1&lt;br /&gt;
|-&lt;br /&gt;
| srl R || &amp;lt;tt&amp;gt;11001011 00111rrr&amp;lt;/tt&amp;gt; || 8 || 0 || + || + || 0 || + || P || 0 || X || cf := R.0, R := R &amp;gt;&amp;gt; 1&lt;br /&gt;
|-&lt;br /&gt;
| srl (hl) || &amp;lt;tt&amp;gt;11001011 00111110&amp;lt;/tt&amp;gt; || 15 || 0 || + || + || 0 || + || P || 0 || X || cf := (hl).0, (hl) := (hl) &amp;gt;&amp;gt; 1&lt;br /&gt;
|-&lt;br /&gt;
| srl (I+D) || &amp;lt;tt&amp;gt;11i11101 11001011 dddddddd 00111110&amp;lt;/tt&amp;gt; || 23 || 0 || + || + || 0 || + || P || 0 || X || cf := (I+D).0, (I+D) := (I+D) &amp;gt;&amp;gt; 1&lt;br /&gt;
|-&lt;br /&gt;
| srl (I+D)-&amp;gt;R || &amp;lt;tt&amp;gt;11i11101 11001011 dddddddd 00111rrr&amp;lt;/tt&amp;gt; || 23 || 0 || + || + || 0 || + || P || 0 || X || cf := (I+D).0, (I+D) := R := (I+D) &amp;gt;&amp;gt; 1&lt;br /&gt;
|-&lt;br /&gt;
| sub R || &amp;lt;tt&amp;gt;10010rrr&amp;lt;/tt&amp;gt; || 4 || + || + || + || + || + || V || 1 || + || a -= R&lt;br /&gt;
|-&lt;br /&gt;
| sub J || &amp;lt;tt&amp;gt;11i11101 1001010b&amp;lt;/tt&amp;gt; || 8 || + || + || + || + || + || V || 1 || + || a -= J&lt;br /&gt;
|-&lt;br /&gt;
| sub N || &amp;lt;tt&amp;gt;11010110 nnnnnnnn&amp;lt;/tt&amp;gt; || 7 || + || + || + || + || + || V || 1 || + || a -= N&lt;br /&gt;
|-&lt;br /&gt;
| sub (hl) || &amp;lt;tt&amp;gt;10010110&amp;lt;/tt&amp;gt; || 7 || + || + || + || + || + || V || 1 || + || a -= (hl)&lt;br /&gt;
|-&lt;br /&gt;
| sub (I+D) || &amp;lt;tt&amp;gt;11i11101 10010110 dddddddd&amp;lt;/tt&amp;gt; || 19 || + || + || + || + || + || V || 1 || + || a -= (I+D)&lt;br /&gt;
|-&lt;br /&gt;
| xor R || &amp;lt;tt&amp;gt;10101rrr&amp;lt;/tt&amp;gt; || 4 || + || + || + || 0 || + || P || 0 || 0 || a := a XOR R&lt;br /&gt;
|-&lt;br /&gt;
| xor J || &amp;lt;tt&amp;gt;11i11101 1010110b&amp;lt;/tt&amp;gt; || 8 || + || + || + || 0 || + || P || 0 || 0 || a := a XOR J&lt;br /&gt;
|-&lt;br /&gt;
| xor N || &amp;lt;tt&amp;gt;11101110 nnnnnnnn&amp;lt;/tt&amp;gt; || 7 || + || + || + || 0 || + || P || 0 || 0 || a := a XOR N&lt;br /&gt;
|-&lt;br /&gt;
| xor (hl) || &amp;lt;tt&amp;gt;10101110&amp;lt;/tt&amp;gt; || 7 || + || + || + || 0 || + || P || 0 || 0 || a := a XOR (hl)&lt;br /&gt;
|-&lt;br /&gt;
| xor (I+D) || &amp;lt;tt&amp;gt;11i11101 10101110 dddddddd&amp;lt;/tt&amp;gt; || 19 || + || + || + || 0 || + || P || 0 || 0 || a := a XOR (I+D)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Legend ==&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
! Notation !! Meaning !! Respective opcode bits&lt;br /&gt;
|-&lt;br /&gt;
| A || 16-bit address or immediate || alalalal ahahahah&lt;br /&gt;
|-&lt;br /&gt;
| B || Bit number: 0..7 || bbb = 000..111&lt;br /&gt;
|-&lt;br /&gt;
| C || Condition: nz, z, nc, c, po, pe, p, m || ccc = 000, 001, 010, 011, 100, 101, 110, 111&lt;br /&gt;
|-&lt;br /&gt;
| D || 8-bit signed relative offset || dddddddd&lt;br /&gt;
|-&lt;br /&gt;
| E || 16-bit relative address || dddddddd (E minus address of next instruction)&lt;br /&gt;
|-&lt;br /&gt;
| I || Index register: ix, iy || i = 0, 1&lt;br /&gt;
|-&lt;br /&gt;
| J || Half index register: ixh, ixl, iyh, iyl || (i, b) = (0, 0), (0, 1), (1, 0), (1, 1)&lt;br /&gt;
|-&lt;br /&gt;
| N || 8-bit immediate || nnnnnnnn&lt;br /&gt;
|-&lt;br /&gt;
| P || 16-bit register pair: bc, de, hl, af || pp = 00, 01, 10, 11&lt;br /&gt;
|-&lt;br /&gt;
| Q || 16-bit register: bc, de, hl/ix/iy, sp || qq = 00, 01, 10, 11&lt;br /&gt;
|-&lt;br /&gt;
| R || 8-bit general purpose register: a, b, c, d, e, h, l || rrr (or sss) = 111, 000, 001, 010, 011, 100, 101&lt;br /&gt;
|-&lt;br /&gt;
| S || Restart address: 0x00, 0x08,..., 0x38 || sss = 000, 001,..., 111&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Flags ==&lt;br /&gt;
* - = no change&lt;br /&gt;
* + = change by definition (if noted, by the operation marked with '=&amp;gt; flags', otherwise by the only non-single-bit operation):&lt;br /&gt;
** S = sign, bit 7 of the result byte (accumulator or high byte for 16-bit operations)&lt;br /&gt;
** Z = zero, set if the result is zero (8 or 16-bit value)&lt;br /&gt;
** X = undocumented, bit 5 of the result byte&lt;br /&gt;
** H = half-carry, the carry (theoretical bit 4) of the low nibble of the result byte&lt;br /&gt;
** Y = undocumented, bit 3 of the result byte&lt;br /&gt;
** P = parity (set if the result byte has an even number of bits set) or overflow (set when crossing the boundary of the signed range); always specified&lt;br /&gt;
** N = negative, set if the previous operation was a subtraction; always specified&lt;br /&gt;
** C = carry, the theoretical bit 8 of the result byte&lt;br /&gt;
* 0 = always reset&lt;br /&gt;
* 1 = always set&lt;br /&gt;
* X = change described under Effect&lt;br /&gt;
* P = parity (only for the parity flag)&lt;br /&gt;
* V = overflow (only for the parity flag)&lt;br /&gt;
* A = OR with the respective bit of the accumulator&lt;br /&gt;
* C = set if the counter (bc) is nonzero after decrementing&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous ==&lt;br /&gt;
* () = indirection&lt;br /&gt;
* (()) = I/O port&lt;br /&gt;
* [] = operator precedence (to avoid confusion with indirection)&lt;br /&gt;
* E.B = the Bth bit of the value of expression E&lt;br /&gt;
* &amp;amp;#42; = any bit value (0 or 1)&lt;br /&gt;
* memptr = an internal 16-bit register connected to 16-bit operations&lt;br /&gt;
* tmp, tmp2 = temporary storage whose value is thrown away after each instruction&lt;br /&gt;
&lt;br /&gt;
== English Language Explanations ==&lt;br /&gt;
=== Data Movement ===&lt;br /&gt;
'''EX'''&lt;br /&gt;
Three possible arguments:&lt;br /&gt;
&lt;br /&gt;
''EX DE, HL''&lt;br /&gt;
Swaps H with D and L with E&lt;br /&gt;
&lt;br /&gt;
''EX AF, AF'''&lt;br /&gt;
Swaps AF with its shadow&lt;br /&gt;
&lt;br /&gt;
''EX (SP), HL''&lt;br /&gt;
Swaps (SP) with L and (SP+1) with H.  Index registers are also valid&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''EXX'''&lt;br /&gt;
Swap BC, DE and HL with their shadows&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''LD'''&lt;br /&gt;
Four main arguments:&lt;br /&gt;
&lt;br /&gt;
''LD reg, #''&lt;br /&gt;
Sets the eight or 16 bit contents of reg to #&lt;br /&gt;
&lt;br /&gt;
''LD reg2, reg1''&lt;br /&gt;
Copies the contents of 8 bit reg1 to reg2&lt;br /&gt;
&lt;br /&gt;
''LD (imm16), reg''&lt;br /&gt;
Copies the value of 8 or 16 bit reg to 16 bit memory address imm16.  Programmers should remember that 16 bit values are stored little-endian.&lt;br /&gt;
&lt;br /&gt;
''LD reg, (imm16)''&lt;br /&gt;
Does the opposite of ''LD (imm16), reg''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''LDIR'''&lt;br /&gt;
Copies a byte from (HL) to (DE), increments DE and HL, then decrements BC.  The instruction is repeated if BC is not 0.  Interrupts are allowed to trigger while this instruction is running.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''PUSH'''&lt;br /&gt;
Used as ''PUSH reg16'' where reg16 is a register pair or index register.  Decrements SP, copies regMSB to (SP), decrements SP again, then copies regLSB to (SP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''POP'''&lt;br /&gt;
Same syntax as PUSH.  Copies (SP) to regLSB, increments SP, copies (SP) to regMSB, then increments SP again.  The word based at the starting value of SP is zeroed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control===&lt;br /&gt;
'''JP'''&lt;br /&gt;
''JP imm16''  Imm16 is copied to PC, causing execution to jump there.  Can also be conditional with Z, NZ, C, NC, PO, PE, P, or M as additional arguments such as ''JP Z, imm16''.  (HL) may be substituted for imm16 to have the current value of HL copied to PC&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''JR'''&lt;br /&gt;
''JR imm8''  The signed 8 bit value imm8 is added to PC, allowing a jump within 128 bytes of the instruction.  May also be conditional, but only with Z, NZ, C, and NC arguments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CALL'''&lt;br /&gt;
''CALL imm16''  The current value of PC+3 is PUSHed, then imm16 is loaded into PC.  May be conditional with the same syntax and arguments as JP, although (HL) is not valid.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''RET'''&lt;br /&gt;
''RET''  The top stack value is POPed into PC.  It may be conditional with the same arguments and syntax as JP.  This is usually used to return from a CALL instruction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''RST'''&lt;br /&gt;
''RST imm8''  PC+1 is PUSHed and PC is loaded with 00imm8.  This opcode is only 1 byte, so it is an alternative to CALLing routines that are mapped into the beginning of memory.  However, it may only be used for the following values of imm8: 00h, 08h, 18h, 20h, 28h, 30h, and 38h.  Imm8 must also be in -h suffix format.&lt;br /&gt;
&lt;br /&gt;
'''DJNZ'''&lt;br /&gt;
''DJNZ imm8''  B is decremented and if is 0, the rest of the instruction is skipped.  Otherwise, the signed 8 bit value imm8 is added to PC.  This instruction is usually used like a [[For(]] loop in BASIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOP'''&lt;br /&gt;
''NOP''  As the name implies, it is &amp;quot;no operation&amp;quot;.  The CPU does nothing for four clock cycles.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Care of ==&lt;br /&gt;
* Reference table thanks to [[User:CoBB|CoBB]]&lt;br /&gt;
* English language reference thanks to [[User:Taricorp|Taricorp]]&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=Talk:Z80_Good_Programming_Practices</id>
		<title>Talk:Z80 Good Programming Practices</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Talk:Z80_Good_Programming_Practices"/>
				<updated>2006-09-20T19:20:05Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: Note on this page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To be honest this article is questionable in its function, as &amp;quot;good practices&amp;quot; is relative per situation. The examples given are bad examples when to do what is suggested.  Further there isn't much substance here and it's poorly defined what would belong here.  A programming guide would be a better idea than this. --[[User:Jim e|Jim e]] 12:20, 20 September 2006 (PDT)&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=Z80_Good_Programming_Practices</id>
		<title>Z80 Good Programming Practices</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Z80_Good_Programming_Practices"/>
				<updated>2006-09-20T19:11:24Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: This entire article is questionable.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using IX ==&lt;br /&gt;
&lt;br /&gt;
If you have objects represented by adjacent chunks of data in memory, you can use IX to easily manage them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;Without&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;With&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 ld b,10&lt;br /&gt;
 ld hl,SpritesData&lt;br /&gt;
DisplaySpritesLoop&lt;br /&gt;
 ld b,(hl) ; coordx&lt;br /&gt;
 inc hl&lt;br /&gt;
 ld c,(hl) ; coordy&lt;br /&gt;
 inc hl&lt;br /&gt;
 ld d,(hl) ; first part of address&lt;br /&gt;
 inc hl&lt;br /&gt;
 ld e,(hl) ; end of address&lt;br /&gt;
 inc hl&lt;br /&gt;
 call DisplaySprite&lt;br /&gt;
 djnz DisplaySpritesLoop&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
COORDX .equ 0&lt;br /&gt;
COORDY .equ 1&lt;br /&gt;
ADDR1 .equ 2&lt;br /&gt;
ADDR2 .equ 3&lt;br /&gt;
&lt;br /&gt;
 ld b,10&lt;br /&gt;
 ld ix,SpritesData&lt;br /&gt;
DisplaySpritesLoop&lt;br /&gt;
 ld b,(ix+COORDX)&lt;br /&gt;
 ld c,(ix+COORDY)&lt;br /&gt;
 ld d,(ix+ADDR1)&lt;br /&gt;
 ld e,(ix+ADDR2)&lt;br /&gt;
 call DisplaySprite&lt;br /&gt;
 ld hl,4&lt;br /&gt;
 add ix,hl&lt;br /&gt;
 djnz DisplaySpritesLoop&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Defining constants for the offsets of each field of your &amp;quot;objects&amp;quot; makes the code more understandable. However this particular example is not the best, being that the original code is faster and smaller.  Typically in sequential access using the HL register would perform better, however if random access of different objects and different elements in an object is required through out a particular iteration, than ix would be the better choice.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Lookup table ==&lt;br /&gt;
&lt;br /&gt;
If you have a place in your code where a value is tested to choose between a lot of things, like subroutines or data, it can be a good idea to use lookup tables instead of a series of tests. It makes the code more readable, concise and extensible.&lt;br /&gt;
&lt;br /&gt;
In terms optimisation though it should be used when the data is not sequentially ordered or when the objects being pointed to are not the same size.  For example, using LUTs (Look Up Tables) to find a tile in a block of memory that is only tiles would both slower and cost more memory.  Using LUTs to find a particular string would be quicker but would waste more memory than a linear search.  Using LUTs as a jump table to different code blocks located through out a program would be faster and smaller compared to the alternative.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;Without&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;With&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 ld a,(SpriteNumber)&lt;br /&gt;
 cp 1&lt;br /&gt;
 jp z,ChooseSprite1&lt;br /&gt;
 cp 2&lt;br /&gt;
 jp z,ChooseSprite2&lt;br /&gt;
 cp 3&lt;br /&gt;
 jp z,ChooseSprite3&lt;br /&gt;
 cp 4&lt;br /&gt;
 jp z,ChooseSprite4&lt;br /&gt;
...&lt;br /&gt;
ChooseSprite1&lt;br /&gt;
 ld hl,Sprite1&lt;br /&gt;
 jp DisplaySprite&lt;br /&gt;
ChooseSprite2&lt;br /&gt;
 ld hl,Sprite2&lt;br /&gt;
 jp DisplaySprite&lt;br /&gt;
ChooseSprite3&lt;br /&gt;
 ld hl,Sprite3&lt;br /&gt;
 jp DisplaySprite&lt;br /&gt;
ChooseSprite4&lt;br /&gt;
 ld hl,Sprite4&lt;br /&gt;
 jp DisplaySprite&lt;br /&gt;
...&lt;br /&gt;
DisplaySprite&lt;br /&gt;
 ld bc,(coordinates)&lt;br /&gt;
 call SpriteRoutine&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 ld a,(SpriteNumber)&lt;br /&gt;
 add a,a ; a*2&lt;br /&gt;
 ld h,0 &lt;br /&gt;
 ld l,a &lt;br /&gt;
 ld de,SpriteAddressLUT&lt;br /&gt;
 add hl,de&lt;br /&gt;
 ld a,(hl)&lt;br /&gt;
 inc hl&lt;br /&gt;
 ld h,(hl)&lt;br /&gt;
 ld l,a&lt;br /&gt;
 ld bc,(coordinates)&lt;br /&gt;
 call SpriteRoutine&lt;br /&gt;
...&lt;br /&gt;
SpriteAddressLUT&lt;br /&gt;
 .dw Sprite1&lt;br /&gt;
 .dw Sprite2&lt;br /&gt;
 .dw Sprite3&lt;br /&gt;
 .dw Sprite4&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And this one :&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;Without&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;With&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 ld a,(MenuChoice)&lt;br /&gt;
 cp 1&lt;br /&gt;
 jp z,Choice1&lt;br /&gt;
 cp 2&lt;br /&gt;
 jp z,Choice2&lt;br /&gt;
 cp 3&lt;br /&gt;
 jp z,Choice3&lt;br /&gt;
 cp 4&lt;br /&gt;
 jp z,Choice4&lt;br /&gt;
...&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 ld a,(MenuChoice)&lt;br /&gt;
 add a,a ; a*2&lt;br /&gt;
 ld h,0&lt;br /&gt;
 ld l,a&lt;br /&gt;
 ld de,CodeBranchLUT&lt;br /&gt;
 add hl,de&lt;br /&gt;
 ld a,(hl)&lt;br /&gt;
 inc hl&lt;br /&gt;
 ld h,(hl)&lt;br /&gt;
 ld l,a&lt;br /&gt;
 jp (hl)&lt;br /&gt;
...&lt;br /&gt;
CodeBranchLUT&lt;br /&gt;
 .dw Choice1&lt;br /&gt;
 .dw Choice2&lt;br /&gt;
 .dw Choice3&lt;br /&gt;
 .dw Choice4&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
{{stub}}&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=83Plus:Software:usb8x/Supported_Devices</id>
		<title>83Plus:Software:usb8x/Supported Devices</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=83Plus:Software:usb8x/Supported_Devices"/>
				<updated>2006-08-31T06:30:57Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: added working controller&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Internal Driver ==&lt;br /&gt;
These devices work and usb8x contains an internal driver to control them.&lt;br /&gt;
* HID Keyboard&lt;br /&gt;
* HID Mouse&lt;br /&gt;
* Mass Storage Device.  Tested with:&lt;br /&gt;
** Sandisk Cruzer&lt;br /&gt;
** Lexar JumpDrive/Secure&lt;br /&gt;
* TI Silverlink&lt;br /&gt;
* Some gamepad controllers.  Tested with:&lt;br /&gt;
** Logitech Precision Gamepad&lt;br /&gt;
** [http://www.retrousb.com/nintendo.html RetroZone NES pad]&lt;br /&gt;
** [http://www.planetgamecube.com/hardArt.cfm?artid=2459 Skillz Gamecube to USB] (The company no longer seems to exist.)&lt;br /&gt;
&lt;br /&gt;
== External Driver ==&lt;br /&gt;
These devices work and an external driver exists to control them.&lt;br /&gt;
* None&lt;br /&gt;
&lt;br /&gt;
== Works, No Driver ==&lt;br /&gt;
These devices have been tested to work with usb8x, but no complete driver currently exists.&lt;br /&gt;
* EMS HID Playstation 2 controller adapter&lt;br /&gt;
* Vernier EasyTemp&lt;br /&gt;
&lt;br /&gt;
== Should Work ==&lt;br /&gt;
These devices have been tested to properly initialize with usb8x, but no drivers have been attempted.&lt;br /&gt;
* Canon i850 printer&lt;br /&gt;
* Canon SD400 digital camera&lt;br /&gt;
* Motorola SURFboard cable modem&lt;br /&gt;
* Motorola V220 (can act as USB Modem)&lt;br /&gt;
* TI-84 Plus (calc&amp;lt;-&amp;gt;calc)&lt;br /&gt;
&lt;br /&gt;
== Not Compatible ==&lt;br /&gt;
These devices are not compatible with usb8x.&lt;br /&gt;
* Ezonics webcam - isochronous endpoints&lt;br /&gt;
* Netgear WG111 802.11 adapter - draws too much current?&lt;br /&gt;
* SMC 802.11b adapter - draws too much current&lt;br /&gt;
* Taurus MBT-1203 bluetooth adapter - has integrated hub&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=Talk:83Plus:Software:usb8x/Asm_Interface/MSD/MSD_Initialize</id>
		<title>Talk:83Plus:Software:usb8x/Asm Interface/MSD/MSD Initialize</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Talk:83Plus:Software:usb8x/Asm_Interface/MSD/MSD_Initialize"/>
				<updated>2006-08-17T17:48:57Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I've been trying to work with this newest version.  But I seem to get an error when I MSD_Initialize, returning an error code of 8.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ld hl,driverram&lt;br /&gt;
 ld a,uDriverInit&lt;br /&gt;
 call USBDriverCall&lt;br /&gt;
 jp c,driverfailed&lt;br /&gt;
 ld hl,appBackUpScreen&lt;br /&gt;
 ld de,appBackUpScreen+256&lt;br /&gt;
 ld a,uMSD_Initialize&lt;br /&gt;
 call USBDriverCall&lt;br /&gt;
 jp c,msdfailed          ;fails here&lt;br /&gt;
 ld a,uUFI_Initialize&lt;br /&gt;
 call USBDriverCall&lt;br /&gt;
 jp c,ufifailed&lt;br /&gt;
 ld a,uFAT_Initialize&lt;br /&gt;
 call USBDriverCall&lt;br /&gt;
 jp c,fatfailed&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
I'm not using zds so I'm not using the U_call macro, does there seem to be anything wrong? MSD8x the app does get past initization and displays files.&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=Z80_Routines:Math:Square_root</id>
		<title>Z80 Routines:Math:Square root</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Z80_Routines:Math:Square_root"/>
				<updated>2006-07-20T21:13:53Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: Added square root routines, been a while hope I did this right&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Z80 Routines:Math|Square root]]&lt;br /&gt;
[[Category:Z80 Routines|Square root]]&lt;br /&gt;
&lt;br /&gt;
==Size Optimization==&lt;br /&gt;
This version is size optimized, it compares every perfect square against HL until a square that is larger is found.  Obviously slower, but does get the job done in only 12 bytes.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;;-------------------------------&lt;br /&gt;
;Square Root&lt;br /&gt;
;Inputs:&lt;br /&gt;
;HL = number to be square rooted&lt;br /&gt;
;Outputs:&lt;br /&gt;
;A  = square root&lt;br /&gt;
&lt;br /&gt;
sqrt:&lt;br /&gt;
   ld a,$ff&lt;br /&gt;
   ld de,1&lt;br /&gt;
sqrtloop:&lt;br /&gt;
   inc a&lt;br /&gt;
   dec e&lt;br /&gt;
   dec de&lt;br /&gt;
   add hl,de&lt;br /&gt;
   jr c,sqrtloop&lt;br /&gt;
   ret &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Speed Optimization==&lt;br /&gt;
This version uses the high school method of finding a square root and so it is much faster, running at about ~850 tstates.  Unfortunately it requires 180 bytes and is quite obfuscated.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;;-------------------------------&lt;br /&gt;
;Square Root&lt;br /&gt;
;Inputs:&lt;br /&gt;
;DE = number to be square rooted&lt;br /&gt;
;Outputs:&lt;br /&gt;
;A  = square root&lt;br /&gt;
&lt;br /&gt;
sqrt:&lt;br /&gt;
    xor a&lt;br /&gt;
    ld h,a&lt;br /&gt;
    ld l,a&lt;br /&gt;
    ld b,a&lt;br /&gt;
    rl d&lt;br /&gt;
    rl l&lt;br /&gt;
    rl d&lt;br /&gt;
    rl l&lt;br /&gt;
    ld c,1&lt;br /&gt;
    sbc hl,bc&lt;br /&gt;
    jp c,$+3+2+1&lt;br /&gt;
    sbc hl,bc&lt;br /&gt;
    inc a&lt;br /&gt;
    add hl,bc&lt;br /&gt;
    add a,a&lt;br /&gt;
    rl d&lt;br /&gt;
    rl l&lt;br /&gt;
    rl d&lt;br /&gt;
    rl l&lt;br /&gt;
    ld c,a&lt;br /&gt;
    scf&lt;br /&gt;
    rl c&lt;br /&gt;
    sbc hl,bc&lt;br /&gt;
    jp c,$+3+2+1&lt;br /&gt;
    sbc hl,bc&lt;br /&gt;
    inc a&lt;br /&gt;
    add hl,bc&lt;br /&gt;
    add a,a&lt;br /&gt;
    rl d&lt;br /&gt;
    rl l&lt;br /&gt;
    rl d&lt;br /&gt;
    rl l&lt;br /&gt;
    ld c,a&lt;br /&gt;
    scf&lt;br /&gt;
    rl c&lt;br /&gt;
    sbc hl,bc&lt;br /&gt;
    jp c,$+3+2+1&lt;br /&gt;
    sbc hl,bc&lt;br /&gt;
    inc a&lt;br /&gt;
    add hl,bc&lt;br /&gt;
    add a,a&lt;br /&gt;
    rl d&lt;br /&gt;
    rl l&lt;br /&gt;
    rl d&lt;br /&gt;
    rl l&lt;br /&gt;
    ld c,a&lt;br /&gt;
    scf&lt;br /&gt;
    rl c&lt;br /&gt;
    sbc hl,bc&lt;br /&gt;
    jp c,$+3+2+1&lt;br /&gt;
    sbc hl,bc&lt;br /&gt;
    inc a&lt;br /&gt;
    add hl,bc&lt;br /&gt;
    add a,a&lt;br /&gt;
    rl e&lt;br /&gt;
    adc hl,hl&lt;br /&gt;
    rl e&lt;br /&gt;
    adc hl,hl&lt;br /&gt;
    ld c,a&lt;br /&gt;
    scf&lt;br /&gt;
    rl c&lt;br /&gt;
    sbc hl,bc&lt;br /&gt;
    jp c,$+3+2+1&lt;br /&gt;
    sbc hl,bc&lt;br /&gt;
    inc a&lt;br /&gt;
    add hl,bc&lt;br /&gt;
    add a,a&lt;br /&gt;
    rl e&lt;br /&gt;
    adc hl,hl&lt;br /&gt;
    rl e&lt;br /&gt;
    adc hl,hl&lt;br /&gt;
    ld c,a&lt;br /&gt;
    scf&lt;br /&gt;
    rl c&lt;br /&gt;
    sbc hl,bc&lt;br /&gt;
    jp c,$+3+2+1&lt;br /&gt;
    sbc hl,bc&lt;br /&gt;
    inc a&lt;br /&gt;
    add hl,bc&lt;br /&gt;
    add a,a&lt;br /&gt;
    rl e&lt;br /&gt;
    adc hl,hl&lt;br /&gt;
    rl e&lt;br /&gt;
    adc hl,hl&lt;br /&gt;
    ld c,a&lt;br /&gt;
    scf&lt;br /&gt;
    rl c&lt;br /&gt;
    sbc hl,bc&lt;br /&gt;
    jp c,$+3+2+1&lt;br /&gt;
    sbc hl,bc&lt;br /&gt;
    inc a&lt;br /&gt;
    add hl,bc&lt;br /&gt;
    add a,a&lt;br /&gt;
    rl e&lt;br /&gt;
    adc hl,hl&lt;br /&gt;
    rl e&lt;br /&gt;
    adc hl,hl&lt;br /&gt;
    ld c,a&lt;br /&gt;
    scf&lt;br /&gt;
    rl c&lt;br /&gt;
    rl b&lt;br /&gt;
    sbc hl,bc&lt;br /&gt;
    jp c,$+3+2+1&lt;br /&gt;
    sbc hl,bc&lt;br /&gt;
    inc a&lt;br /&gt;
    add hl,bc&lt;br /&gt;
    ret&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Balanced Optimization==&lt;br /&gt;
This version is a balance between speed and size. It also uses the high school method and runs under 1200 tstates. It only costs 41 bytes.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;;-------------------------------&lt;br /&gt;
;Square Root&lt;br /&gt;
;Inputs:&lt;br /&gt;
;DE = number to be square rooted&lt;br /&gt;
;Outputs:&lt;br /&gt;
;A  = square root&lt;br /&gt;
&lt;br /&gt;
Sqrt:&lt;br /&gt;
    ld hl,0&lt;br /&gt;
    ld c,l&lt;br /&gt;
    ld b,h&lt;br /&gt;
    ld a,8&lt;br /&gt;
Sqrtloop:&lt;br /&gt;
    sla e&lt;br /&gt;
    rl d&lt;br /&gt;
    adc hl,hl&lt;br /&gt;
    sla e&lt;br /&gt;
    rl d&lt;br /&gt;
    adc hl,hl&lt;br /&gt;
    scf               ;Can be optimised&lt;br /&gt;
    rl c              ;with SL1 instruction&lt;br /&gt;
    rl b&lt;br /&gt;
    sbc hl,bc&lt;br /&gt;
    jr nc,Sqrtaddbit&lt;br /&gt;
    add hl,bc&lt;br /&gt;
    dec c&lt;br /&gt;
Sqrtaddbit:&lt;br /&gt;
    inc c&lt;br /&gt;
    res 0,c&lt;br /&gt;
    dec a&lt;br /&gt;
    jr nz,Sqrtloop&lt;br /&gt;
    ld a,c&lt;br /&gt;
    rr b&lt;br /&gt;
    rra&lt;br /&gt;
    ret&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Other Options==&lt;br /&gt;
A binary search of a square table would yield much better best case scenarios and the worst case scenarios would be similar to the high school method. However this would also require 512 byte table making it significantly larger than the other routines.  Of course the table could also serve as a rapid squaring method.&lt;br /&gt;
&lt;br /&gt;
== Credits and Contributions ==&lt;br /&gt;
* '''James Montelongo'''&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=Talk:History_of_the_TI_Z80_community</id>
		<title>Talk:History of the TI Z80 community</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Talk:History_of_the_TI_Z80_community"/>
				<updated>2006-07-16T01:52:49Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* I've added DS's history &amp;lt;offtopic love of DS&amp;gt;because I consider their products to be leaps and bounds above other programs/apps.  They documented A LOT of BCALLS, hooks, etc. when barely anyone knew about them.  They've revolutionized programming for the TI-83 Plus&amp;lt;/offtopic&amp;gt;. It is because of them that this wiki exists. [[User:Saibot84|Saibot84]] 09:16, 15 July 2006 (PDT)&lt;br /&gt;
&lt;br /&gt;
* This history goes farther back. I believe it all began with ti-files. Do we have any info on them?&lt;br /&gt;
&lt;br /&gt;
I really don't think mentioning every single DS product is nessacry. the maybe well produced but They aren't alone in that. Some of them should be on the proof of concept page.  Anyway I think looking back at significant events woulds more helpful.--[[User:Jim e|Jim e]] 18:52, 15 July 2006 (PDT)&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=Talk:83Plus:OS:Ram_Pages</id>
		<title>Talk:83Plus:OS:Ram Pages</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Talk:83Plus:OS:Ram_Pages"/>
				<updated>2006-05-23T07:28:37Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: page 83&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Really I figure this is where we should decide what pages should be temporary and what could be long term. Also, if any current programs use ram pages we should claim them and possible leave some kinda of marker on the page it self. Last is to find out when tios uses these pages. --[[User:Jim e|Jim e]] 20:14, 24 March 2006 (PST)&lt;br /&gt;
:Anyone know what pages emu8x uses.--[[User:Jim e|Jim e]] 00:49, 25 March 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
== usb ==&lt;br /&gt;
&lt;br /&gt;
There is definitely USB code that accesses some of the other RAM pages, but I haven't traced to see if/when it's called.  I would guess it's for receiving bulk data or something along those lines.  And it's also completely possible that it's never actually used by the OS, but it's something to look in to.  --[[User:Dan Englender|Dan Englender]] 21:52, 24 March 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
:The OS has at least the capability to receive both raw and virtual packets to either the main RAM or pages 82-83 (there are separate flags, I don't remember which ones, for &amp;quot;write raw packets to 82-83&amp;quot; and &amp;quot;write virtual packets to 82-83.&amp;quot;)  Precisely when it does so I don't know.  At any rate, during actual variable transmission I would make no assumptions about how much of those pages will be used.  For ordinary silent stuff (screenshots, remote control if that exists) I'd guess that they are safe. [[User:FloppusMaximus|FloppusMaximus]] 11:39, 25 March 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
::I just did a simple test, it does seem to use page 83(no changes to 82). I sent a large app then checked to see if 83 was alter, it was. It contained the first page of the app I had sent. I was even able to execute my app with a simple program (3E83D306C38040). It maybe reasonable to assume that only 83 is used for such transfers, being that the os makes it a point to strike out some of what would be the header of the app.--[[User:Jim e|Jim e]] 18:36, 25 March 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
== page 83 ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;4000h through 4080h&amp;quot;&lt;br /&gt;
I'm not certain that is correct. I don't see an any indicator that suggest that entire block is used, rather only the would be pages for application use.  If it was though that would suggest that an OS page could bcall into an app, which, upon first inspection of 2.40, would require an OS update. I'll leave as is though because I'm not absolutely certain. Someone more OS savvy should be more thorough.--[[User:Jim e|Jim e]] 00:28, 23 May 2006 (PDT)&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=83Plus:Ports:0D</id>
		<title>83Plus:Ports:0D</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=83Plus:Ports:0D"/>
				<updated>2006-03-31T08:25:10Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: Just realized the original example code was laughable.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:83Plus:Ports:By_Address|0D - Link Assist Output Buffer]] [[Category:83Plus:Ports:By_Name|Link Assist Output Buffer]]&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
'''Port Number:''' 0Dh&lt;br /&gt;
&lt;br /&gt;
'''Function:''' Link Assist Output Buffer&lt;br /&gt;
&lt;br /&gt;
This port allows you to write data to be sent by the link assist.&lt;br /&gt;
&lt;br /&gt;
=== Read Values ===&lt;br /&gt;
''None''&lt;br /&gt;
&lt;br /&gt;
=== Write Values ===&lt;br /&gt;
* [00h - FFh]: The byte to be written&lt;br /&gt;
&lt;br /&gt;
== Comments ==&lt;br /&gt;
This port only exists on the 83+ SE and the 84+.&lt;br /&gt;
&lt;br /&gt;
Check [[83Plus:Ports:09|port 9]] before you write this port, to be sure that the assist is ready.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
 SendByteSE:&lt;br /&gt;
 	ld b,a &lt;br /&gt;
 WaitToSend:&lt;br /&gt;
 	in a,[[83Plus:Ports:04|(4)]]&lt;br /&gt;
 	and 8&lt;br /&gt;
 	jr z,LinkError&lt;br /&gt;
 	in a,[[83Plus:Ports:09|(9)]]&lt;br /&gt;
 	bit 5,a&lt;br /&gt;
 	jr nz,SendByteSE_OK&lt;br /&gt;
 	bit 6,a&lt;br /&gt;
 	jr z,WaitToSend&lt;br /&gt;
 LinkError:&lt;br /&gt;
 	scf&lt;br /&gt;
 	ret&lt;br /&gt;
 SendByteSE_OK:&lt;br /&gt;
 	ld a,b&lt;br /&gt;
 	out (0Dh),a&lt;br /&gt;
 	or a&lt;br /&gt;
 	ret &lt;br /&gt;
&lt;br /&gt;
== Credits and Contributions ==&lt;br /&gt;
* '''Michael Vincent:''' Original documentation of the link assist&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=Talk:83Plus:OS:Ram_Pages</id>
		<title>Talk:83Plus:OS:Ram Pages</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Talk:83Plus:OS:Ram_Pages"/>
				<updated>2006-03-26T02:36:12Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: 83 used.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Really I figure this is where we should decide what pages should be temporary and what could be long term. Also, if any current programs use ram pages we should claim them and possible leave some kinda of marker on the page it self. Last is to find out when tios uses these pages. --[[User:Jim e|Jim e]] 20:14, 24 March 2006 (PST)&lt;br /&gt;
:Anyone know what pages emu8x uses.--[[User:Jim e|Jim e]] 00:49, 25 March 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
== usb ==&lt;br /&gt;
&lt;br /&gt;
There is definitely USB code that accesses some of the other RAM pages, but I haven't traced to see if/when it's called.  I would guess it's for receiving bulk data or something along those lines.  And it's also completely possible that it's never actually used by the OS, but it's something to look in to.  --[[User:Dan Englender|Dan Englender]] 21:52, 24 March 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
:The OS has at least the capability to receive both raw and virtual packets to either the main RAM or pages 82-83 (there are separate flags, I don't remember which ones, for &amp;quot;write raw packets to 82-83&amp;quot; and &amp;quot;write virtual packets to 82-83.&amp;quot;)  Precisely when it does so I don't know.  At any rate, during actual variable transmission I would make no assumptions about how much of those pages will be used.  For ordinary silent stuff (screenshots, remote control if that exists) I'd guess that they are safe. [[User:FloppusMaximus|FloppusMaximus]] 11:39, 25 March 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
::I just did a simple test, it does seem to use page 83(no changes to 82). I sent a large app then checked to see if 83 was alter, it was. It contained the first page of the app I had sent. I was even able to execute my app with a simple program (3E83D306C38040). It maybe reasonable to assume that only 83 is used for such transfers, being that the os makes it a point to strike out some of what would be the header of the app.--[[User:Jim e|Jim e]] 18:36, 25 March 2006 (PST)&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=Talk:83Plus:OS:Ram_Pages</id>
		<title>Talk:83Plus:OS:Ram Pages</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Talk:83Plus:OS:Ram_Pages"/>
				<updated>2006-03-25T08:49:11Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: Emu8x?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Really I figure this is where we should decide what pages should be temporary and what could be long term. Also, if any current programs use ram pages we should claim them and possible leave some kinda of marker on the page it self. Last is to find out when tios uses these pages. --[[User:Jim e|Jim e]] 20:14, 24 March 2006 (PST)&lt;br /&gt;
:Anyone know what pages emu8x uses.--[[User:Jim e|Jim e]] 00:49, 25 March 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
== usb ==&lt;br /&gt;
&lt;br /&gt;
There is definitely USB code that accesses some of the other RAM pages, but I haven't traced to see if/when it's called.  I would guess it's for receiving bulk data or something along those lines.  And it's also completely possible that it's never actually used by the OS, but it's something to look in to.  --[[User:Dan Englender|Dan Englender]] 21:52, 24 March 2006 (PST)&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=83Plus:OS:Ram_Pages</id>
		<title>83Plus:OS:Ram Pages</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=83Plus:OS:Ram_Pages"/>
				<updated>2006-03-25T08:46:44Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: Add virtual calc and restore mem&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:83Plus:OS_Information|Ram Pages]]&lt;br /&gt;
&lt;br /&gt;
This is to mark what ram pages may be used for short term or long term use.&lt;br /&gt;
&lt;br /&gt;
'''80'''&lt;br /&gt;
* Default for TIOS at C000h&lt;br /&gt;
* Execution protected&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''81'''&lt;br /&gt;
* Default for TIOS at 8000h&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''82'''&lt;br /&gt;
* Not used by TIOS under typical execution&lt;br /&gt;
* Execution protected&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''83'''&lt;br /&gt;
* 84+(se) overwrites data at 4008h through 4069h with bytes 08-69 at least prior to app execution.&lt;br /&gt;
* 3rd Party Uses&lt;br /&gt;
** Temporary swap for Virtual Calc by Michael Vincent&lt;br /&gt;
** Temporary code execution for Real Sound by James Montelongo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''84'''&lt;br /&gt;
* Not used by TIOS under typical execution&lt;br /&gt;
* Execution protected&lt;br /&gt;
* 3rd Party Uses&lt;br /&gt;
** Long term use for Virtual Calc by Michael Vincent&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''85'''&lt;br /&gt;
* Not used by TIOS under typical execution&lt;br /&gt;
* 3rd Party Uses&lt;br /&gt;
** Long term use for Virtual Calc by Michael Vincent&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''86'''&lt;br /&gt;
* Not used by TIOS under typical execution&lt;br /&gt;
* Execution protected&lt;br /&gt;
* 3rd Party Uses&lt;br /&gt;
** Long term use for Restore Mem by Michael Vincent&lt;br /&gt;
&lt;br /&gt;
'''87'''&lt;br /&gt;
* Not used by TIOS under typical execution&lt;br /&gt;
* 3rd Party Uses&lt;br /&gt;
** Long term use for Restore Mem by Michael Vincent&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=Talk:83Plus:OS:Ram_Pages</id>
		<title>Talk:83Plus:OS:Ram Pages</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Talk:83Plus:OS:Ram_Pages"/>
				<updated>2006-03-25T04:14:18Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: some talk.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Really I figure this is where we should decide what pages should be temporary and what could be long term. Also, if any current programs use ram pages we should claim them and possible leave some kinda of marker on the page it self. Last is to find out when tios uses these pages. --[[User:Jim e|Jim e]] 20:14, 24 March 2006 (PST)&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=83Plus:OS:Ram_Pages</id>
		<title>83Plus:OS:Ram Pages</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=83Plus:OS:Ram_Pages"/>
				<updated>2006-03-25T04:10:49Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: I created this page for ram page claiming.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:83Plus:OS_Information|Ram Pages]]&lt;br /&gt;
&lt;br /&gt;
This is to mark what ram pages may be used for short term or long term use.&lt;br /&gt;
&lt;br /&gt;
'''80'''&lt;br /&gt;
* Defualt for TIOS at C000h&lt;br /&gt;
* Execution protected&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''81'''&lt;br /&gt;
* Defualt for TIOS at 8000h&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''82'''&lt;br /&gt;
* Not used by TIOS under typical execution&lt;br /&gt;
* Execution protected&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''83'''&lt;br /&gt;
* 84+(se) overwrites data at 4008h through 4069h with bytes 08-69 atleast prior to app execution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''84'''&lt;br /&gt;
* Not used by TIOS under typical execution&lt;br /&gt;
* Execution protected&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''85'''&lt;br /&gt;
* Not used by TIOS under typical execution&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''86'''&lt;br /&gt;
* Not used by TIOS under typical execution&lt;br /&gt;
* Execution protected&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''87'''&lt;br /&gt;
* Not used by TIOS under typical execution&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=83Plus:Ports:04</id>
		<title>83Plus:Ports:04</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=83Plus:Ports:04"/>
				<updated>2006-03-16T15:34:35Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: Note on timers&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:83Plus:Ports:By_Address|04 - Memory Map / Interrupt]] [[Category:83Plus:Ports:By_Name|Memory Map / Interrupt]]&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
'''Port Number:''' 04h&lt;br /&gt;
&lt;br /&gt;
'''Function:''' Interrupting Device Identification and Memory Map Control&lt;br /&gt;
&lt;br /&gt;
This port serves two purposes. When read it indicates the device that triggered an interrupt. When written it sets the memory map mode and hardware timer speed.&lt;br /&gt;
&lt;br /&gt;
=== Read Values ===&lt;br /&gt;
* Bits 0~2 and 4~7 are set according to which device triggered the running interrupt.&lt;br /&gt;
** Bit 0: Set if pressing the ON Key triggered the interrupt.&lt;br /&gt;
** Bit 1: Set if the first hardware timer triggered the interrupt.&lt;br /&gt;
** Bit 2: Set if the second hardware timer triggered the interrupt.&lt;br /&gt;
** Bit 4: Link activity generated an interrupt.&lt;br /&gt;
** '''83+SE / 84+ only:''' Bit 5: First crystal timer has expired.&lt;br /&gt;
** '''83+SE / 84+ only:''' Bit 6: Second crystal timer has expired.&lt;br /&gt;
** '''83+SE / 84+ only:''' Bit 7: Third crystal timer has expired.&lt;br /&gt;
* Bit 3 is reset if the ON key is being pressed, set otherwise.&lt;br /&gt;
&lt;br /&gt;
=== Write Values ===&lt;br /&gt;
* Bit 0 reset to select memory map mode 0. In mode 0 the RAM and ROM is mapped to CPU memory as follows:&lt;br /&gt;
** Address 0000h ~ 3FFFh: ROM Page 0&lt;br /&gt;
** Address 4000h ~ 7FFFh: Memory Bank A (Page selected in [[83Plus:Ports:06|Port 06h]])&lt;br /&gt;
** Address 8000h ~ BFFFh: Memory Bank B (Page selected in [[83Plus:Ports:07|Port 07h]])&lt;br /&gt;
** '''83+ Basic''': Address C000h ~ FFFFh: RAM Page 0&lt;br /&gt;
** '''Everything else''': Address C000h ~ FFFFh: Page selected in [[83Plus:Ports:05|Port 05h]]&lt;br /&gt;
* Bit 0 set to select memory map mode 1. In mode 1 the RAM and ROM is mapped to CPU memory as follows:&lt;br /&gt;
** Address 0000h ~ 3FFFh: ROM Page 0&lt;br /&gt;
** Address 4000h ~ 7FFFh: RAM Page 0&lt;br /&gt;
** Address 8000h ~ BFFFh: Memory Bank A (Page selected in [[83Plus:Ports:06|Port 06h]])&lt;br /&gt;
** Address C000h ~ FFFFh: Memory Bank B (Page selected in [[83Plus:Ports:07|Port 07h]])&lt;br /&gt;
* Bits 1 and 2 control the hardware timer frequency. Setting both 0 sets the timer to the fastest speed, and both 1 is the slowest speed. The normal speed is with both bits 1.&lt;br /&gt;
{| width=&amp;quot;90%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;text-align: center&amp;quot;&lt;br /&gt;
|+Frequency (Hz)&lt;br /&gt;
|-&lt;br /&gt;
!&amp;amp;nbsp;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|first timer&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|second timer&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|both enabled&lt;br /&gt;
|-&lt;br /&gt;
!value&lt;br /&gt;
!width=&amp;quot;15%&amp;quot;|83+&lt;br /&gt;
!width=&amp;quot;15%&amp;quot;|83+SE 84+(SE)&lt;br /&gt;
!width=&amp;quot;15%&amp;quot;|83+&lt;br /&gt;
!width=&amp;quot;15%&amp;quot;|83+SE 84+(SE)&lt;br /&gt;
!width=&amp;quot;15%&amp;quot;|83+&lt;br /&gt;
!width=&amp;quot;15%&amp;quot;|83+SE 84+(SE)&lt;br /&gt;
|-&lt;br /&gt;
!00&lt;br /&gt;
|560||512||1120||1024||1680||1536&lt;br /&gt;
|-&lt;br /&gt;
!01&lt;br /&gt;
|248||227||497||455||746||682&lt;br /&gt;
|-&lt;br /&gt;
!10&lt;br /&gt;
|170||156||344||315||517||473&lt;br /&gt;
|-&lt;br /&gt;
!11&lt;br /&gt;
|118||108||236||216||353||323&lt;br /&gt;
|}&lt;br /&gt;
* Bits 4~6 should be 1 on the 83+ and 83+SE, and 0 on the 84+ and 84+SE.&lt;br /&gt;
&lt;br /&gt;
== Comments ==&lt;br /&gt;
The calculator uses mode 0 for normal operation. If you change the memory map mode be sure to change it back before returning control.&lt;br /&gt;
Also, do not switch from mode 0 to mode 1 inside the 4000h ~ 7FFFh range, as it will basically crash the calculator because RAM Page 0 will take over that section and RAM Page 0 cannot execute code.&lt;br /&gt;
&lt;br /&gt;
Interrupt timers seem to be independant of the CPU speed, so setting an SE calculator to 15mhz will not increase the timer frequency.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
This example shows successful use of this port, switching to mode 1 and back. Mode 1 is the only way to execute code beyond address C000h on the 83+ Basic.  (Assumes code is running from 4000h (i.e. an application))&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; in a, (7) ;Save current Bank B page because we'll trash it.&lt;br /&gt;
 push af&lt;br /&gt;
 in a,(6) ;Put this app's page into 8000&lt;br /&gt;
 out (7), a&lt;br /&gt;
 jp $ + 4003h ;This will actually jump to the next statement, but in Bank B.&lt;br /&gt;
 ld a, 77h ;Select mode 1 and keep the timer speed at normal...&lt;br /&gt;
 out (4), a ;Now we're in mode 1.&lt;br /&gt;
 ;We're still at 8000h here but we are back in Bank A.&lt;br /&gt;
 ;Now to go back.&lt;br /&gt;
 ld a, 76h ;I could dec a for this example, but...&lt;br /&gt;
 out (4), a ;Back in mode 0 and bank B.&lt;br /&gt;
 jp $ - 3FFDh ;Jump back to bank A.&lt;br /&gt;
 pop af&lt;br /&gt;
 out (7), a ;Restore bank B.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Credits and Contributions ==&lt;br /&gt;
* '''Dan Englender''': Originally documented memory map modes [http://www.detachedsolutions.com/forum/viewtopic.php?p=21593#21593 here]&lt;br /&gt;
* '''Michael Vincent''': For his docs [http://www.michaelv.org/programs/calcs/ports/port4.html here], which helped me figure out the interrupt device bits.&lt;br /&gt;
* '''James Montelongo''': For his docs [http://www.geocities.com/jimm09876/calc/port4.html here] on the hardware timer.&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=83Plus:Ports:05</id>
		<title>83Plus:Ports:05</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=83Plus:Ports:05"/>
				<updated>2006-03-15T18:34:12Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: Renamed(Seems to long), revert if you disagree&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:83Plus:Ports:By_Address|05 - RAM Page(SE) - Port 16 Config/Link Assist(83+)]] [[Category:83Plus:Ports:By_Name|RAM Page(SE) - Port 16 Config/Link Assist(83+)]]&lt;br /&gt;
== Synopsis (TI-83 Plus S.E. and TI-84 Plus Family) ==&lt;br /&gt;
'''Port Number:''' 05h&lt;br /&gt;
&lt;br /&gt;
'''Function:''' RAM Paging Port&lt;br /&gt;
&lt;br /&gt;
This port can be used to control what RAM page is paged into the C000h-FFFFh memory bank. Note that it can only page RAM pages, not flash pages.&lt;br /&gt;
&lt;br /&gt;
=== Read Values ===&lt;br /&gt;
Returns the current RAM pages.&lt;br /&gt;
&lt;br /&gt;
=== Write Values ===&lt;br /&gt;
Sets the current RAM page, by giving a value in 00h-07h, inclusive. When you work with the other paging ports, RAM pages are given in 80h-87h, but this port does not need bit 7 to be set. You cannot set the upper four bits.&lt;br /&gt;
&lt;br /&gt;
== Synopsis (TI-83 Plus) ==&lt;br /&gt;
'''Port Number:''' 05h&lt;br /&gt;
&lt;br /&gt;
'''Function:''' [[83Plus:Ports:16|Port 16h]] Configuration Port/Link Assist Read&lt;br /&gt;
&lt;br /&gt;
This port configures which memory pages are locked or unlocked (i.e. whether or not the PC register is allowed to point within the page) by port 16h. Only bits 0..2 are considered, the rest have no effect. Also, this port is used to read the last byte the link assist received.&lt;br /&gt;
&lt;br /&gt;
=== Read Values ===&lt;br /&gt;
The last byte received by the link assist (see [[83Plus:Ports:00|port 0]] for more information).&lt;br /&gt;
&lt;br /&gt;
=== Write Values ===&lt;br /&gt;
Writing a set bit to 16h protects the page; writing a clear bit unprotects the page.&lt;br /&gt;
&lt;br /&gt;
{|align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;1&amp;quot; style=&amp;quot;text-align: center&amp;quot;&lt;br /&gt;
!colspan=3|Port 05h Bit&lt;br /&gt;
!colspan=8|Port 16h Bit&lt;br /&gt;
|-&lt;br /&gt;
!2!!1!!0!!7!!6!!5!!4!!3!!2!!1!!0&lt;br /&gt;
|-&lt;br /&gt;
|0||0||0||ROM 0F||ROM 0E||ROM 0D||ROM 0C||ROM 0B||ROM 0A||ROM 09||ROM 08&lt;br /&gt;
|-&lt;br /&gt;
|0||0||1||ROM 17||ROM 16||ROM 15||ROM 14||ROM 13||ROM 12||ROM 11||ROM 10&lt;br /&gt;
|-&lt;br /&gt;
|0||1||0||X||X||X||X||ROM 1B||ROM 1A||ROM 19||ROM 18&lt;br /&gt;
|-&lt;br /&gt;
|1||1||1||X||X||RAM 01||X||X||X||X||RAM 00&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comments ==&lt;br /&gt;
At least on my TI-84+, if you output a value with bit 3 set, reading from the port will return a value with bit 3 set. This would imply that you can use RAM pages 08h-0Fh, but these RAM pages do not exist--this bit is simply ignored (only bits 0-2 actually determine what RAM page is active.)&lt;br /&gt;
&lt;br /&gt;
== Credits and Contributions ==&lt;br /&gt;
* '''Michael Vincent:''' Initial documentation.&lt;br /&gt;
* '''Tijl Coosemans:''' Documenting TI-83 Plus functionality [http://www.kalimero.be/83phwinfo.txt here].&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=Talk:WikiTI_Home</id>
		<title>Talk:WikiTI Home</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Talk:WikiTI_Home"/>
				<updated>2006-03-14T14:25:13Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Discussion =&lt;br /&gt;
What do you think about this wiki?&lt;br /&gt;
&lt;br /&gt;
== More! ==&lt;br /&gt;
&lt;br /&gt;
I think it needs information on more calculators than just the Ti-83+ series, and general assembly information (like a good cathegorized tutorial overview for instance) wouldn't hurt either, I think :)&lt;br /&gt;
&lt;br /&gt;
Timendus&lt;br /&gt;
&lt;br /&gt;
== I hope we can do that soon ==&lt;br /&gt;
&lt;br /&gt;
Just, we don't want to waste time getting it all set up for that and have no one use it. If we see a lot of people milling around here, contributing, then by all means, we'll expand. But one thing we '''DON'T''' want to do is mirror 28 Days. We can link TO it, but we don't want it actually here.&lt;br /&gt;
&lt;br /&gt;
--[[User:AndyJ|AndyJ]] 06:50, 27 Mar 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
== Categories ==&lt;br /&gt;
&lt;br /&gt;
On many pages, there is now a sizable blank space at the top due to several lines of category links.  What, if anything, should we do about this? [[User:FloppusMaximus|FloppusMaximus]] 19:06, 29 Mar 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
== Move them? ==&lt;br /&gt;
&lt;br /&gt;
Move the Category links to the bottom should do it. :) That, or put them all on one line.&lt;br /&gt;
&lt;br /&gt;
--[[User:AndyJ|AndyJ]] 19:07, 29 Mar 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
:Yeah, that sounds like a good idea. :) [[User:FloppusMaximus|FloppusMaximus]] 20:18, 29 Mar 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
:: I think I officially qualify as a robot now.  You can tell I was getting tired towards the end, as I missed the minor-edit button a few times... sorry about that... [[User:FloppusMaximus|FloppusMaximus]] 21:28, 29 Mar 2005 (PST)&lt;br /&gt;
:: Actually, I was going to just mod the php code to fix this bug....keeping the category tags on the top might be a good idea actually. (JasonM)&lt;br /&gt;
:::That might still be a good idea. [[User:FloppusMaximus|FloppusMaximus]] 13:18, 3 Apr 2005 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Caching ==&lt;br /&gt;
&lt;br /&gt;
Is it just me, or are there some serious caching problems here?&lt;br /&gt;
[[User:FloppusMaximus|FloppusMaximus]] 21:32, 1 Apr 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
: In particular?  --[[User:Dan Englender|Dan Englender]] 21:42, 1 Apr 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
:: Ya, the wiki seems to have weird caching problems, especially since it appears the reload the page every time, even if it doesn't get changes. I don't know what's up. --[[User:AndyJ|AndyJ]] 22:35, 1 Apr 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
::: Considering the dynamic nature of a wiki (a page could be edited, at pretty much any time), I wouldn't mind not having it cached. (Though I would personally disable browser caching altogether if firefox would let me... :P ) --[[User:Aquanight|Aquanight]] 22:44, 1 Apr 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
:::: Er... I think I see what you mean... stuff is getting cached when it shouldn't be. (I could've sworn I told firefox to only use 0 KB (aka none) for cache and it's still caching ... argh.) --[[User:Aquanight|Aquanight]] 22:46, 1 Apr 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
::::: I've disabled caching myself as well. Perhaps we should just disable caching altogether? (JasonM)&lt;br /&gt;
&lt;br /&gt;
::::::Caching has been disabled. (JasonM)&lt;br /&gt;
&lt;br /&gt;
::: I found a &amp;quot;Disable Caching&amp;quot; option in Misc. Preferences, if that helps. [[User:Gambit|Gambit]] 00:28, 2 Apr 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
== On Other Calculators ==&lt;br /&gt;
&lt;br /&gt;
Just a random idea I had -- a lot of the ROM calls, RAM addresses, and ports are very similar, if not identical, between the 83 and 83+, and more generally, between all of the Z80 calculators.  For some of them -- [[83Plus:RAM:86D8]] and [[83:RAM:8253]], for instance -- it may be possible to combine the two into a single page, though I'm not sure that would be a good idea, given the potential for confusion.  So here's what I propose instead:&lt;br /&gt;
* For simple things like penRow, we can just have two copies of the page, as there isn't very much to keep synchronized.&lt;br /&gt;
* For more detailed pages such as GetKey, have a brief description with a link -- &amp;quot;This routine waits for the user to press a key and returns it.  It is equivalent to [[83Plus:BCALLs:4972|GetKey]] on the TI-83 Plus.&amp;quot; -- on one page, and the more detailed description on the other.  Not a redirect in this case; I'm talking about a distinct page, which would point out the different call points and RAM addresses; in the case of GetKey, for instance, the address of keyExtend is different and should be noted.&lt;br /&gt;
* In either case, on ''both'' pages, add a new section &amp;quot;On Other Calculators&amp;quot; near the bottom, with appropriate links.  This section serves two purposes: First, it's simply useful information to have available, both for people trying to write cross-platform code, and for those of us who are interested in researching the OS.  Secondly, it would serve as a reminder to editors that there are multiple pages that may need to be updated.&lt;br /&gt;
* It's also important to maintain the distinction between routines/variables/ports that are ''identical'' as opposed to those which merely have related functions.  For example, the widely used GetK routine on the 83 isn't known -- to my knowledge -- on the 73, but GetCSC serves as an adequate substitute in many situations.  This is something that belongs in &amp;quot;See Also,&amp;quot; not in this section.&lt;br /&gt;
* Some templates might be in order here.&lt;br /&gt;
&lt;br /&gt;
[[User:FloppusMaximus|FloppusMaximus]] 18:41, 24 May 2005 (PDT)&lt;br /&gt;
&lt;br /&gt;
:It's not a bad idea.  The only problem is that it makes a lot more work for people who just want to make a simple addition to the wiki.  There's already a fairly high initial barrier (figuring out the templates and categories) to overcome for someone who wants to stroll along and add something to the wiki.  For you and I it wouldn't be a big deal, but I'm worried it's going to dissuade a random person who floats by from adding ErrMemory to 83 Plus, because then 83 (and 86 or 73, if someone decides to start them) will have to be added/changed as well.  --[[User:Dan Englender|Dan Englender]] 10:01, 25 May 2005 (PDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Wanted Pages ==&lt;br /&gt;
I decided it was too minor to post as news on the main page, but I modified the [[Special:wantedpages|Wanted Pages]] page so that the threshold is 1 link instead of 2 links.  A *lot* more wanted pages show up now, though there is some junk in the list now too (like fake links from templates).  I figure wanted pages are as good a place as any to start adding, so I'm going to try to make a dent in the list.  Anyone who would like to help is welcome to do so :)  --[[User:Dan Englender|Dan Englender]] 10:06, 25 May 2005 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Not &amp;quot;hardware&amp;quot; specific documents ==&lt;br /&gt;
&lt;br /&gt;
I was so free to edit the artilce over Emulator(s). I also created an article regarding PindurTI. &lt;br /&gt;
&lt;br /&gt;
As I already stated on the MaxCoderz board (http://joepnet.com/hosted/maxcoderz/phpBB2/viewtopic.php?t=1521), I think WikiTI has a lot of potential to collect information about the TI community aswell. Thinks like PindurTI, GrayScale and maybe even information about all the Zelda attempts. In my opinion, people can benefit from that information. --[[User:Kv83|Vincent Junemann]] 15:00, 21 February 2006 (CET)&lt;br /&gt;
&lt;br /&gt;
== Required logon ==&lt;br /&gt;
&lt;br /&gt;
If the spam is being done by bots, perhaps instead of requiring a log-on, we can require either a log-on or a captcha?  I realize there's additional coding involved, but we've had a fair number of useful contributions by non-logged in contributors, and it would be a shame to scare them off by prospects of account creation or the fact that we can track their activities, or what have you. --[[User:Dan Englender|Dan Englender]] 13:55, 23 Feb 2006 (PST)&lt;br /&gt;
:Agreed, if we can either find a mod for that or code one ourselves. Of course, maybe even a simple &amp;quot;check this box&amp;quot; thing would work if the bots are programmed just to hit mediawiki and not check for stuff... And if a botrunner ever finds it and fixes their bots, we can either just change it or go to a captcha... However, I think most of the legit anon edits were by people who have an account but just didn't notice they weren't logged in at the time. [[User:AndyJ|Andy Janata]] 18:40, 23 Feb 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
== Wiki update ==&lt;br /&gt;
&lt;br /&gt;
Whats this undefined link I see on a lot of the pages?--[[User:Jim e|Jim e]] 06:07, 14 March 2006 (PST)&lt;br /&gt;
:Example? --[[User:Dan Englender|Dan Englender]] 06:12, 14 March 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
::This page has it right under the contents.--[[User:Jim e|Jim e]] 06:18, 14 March 2006 (PST)&lt;br /&gt;
:::I'm not seeing it.  Screen grab? (Also, try clearing your browser's cache in case something's not playing nice between this and the old wiki) --[[User:Dan Englender|Dan Englender]] 06:21, 14 March 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
::::....It's gone now. I guess it was a fluke, but I did get an image before it disappeared, just to prove i'm not crazy. [http://www.txjim.com/undefined.jpg Pic]&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=Talk:WikiTI_Home</id>
		<title>Talk:WikiTI Home</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Talk:WikiTI_Home"/>
				<updated>2006-03-14T14:18:47Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Discussion =&lt;br /&gt;
What do you think about this wiki?&lt;br /&gt;
&lt;br /&gt;
== More! ==&lt;br /&gt;
&lt;br /&gt;
I think it needs information on more calculators than just the Ti-83+ series, and general assembly information (like a good cathegorized tutorial overview for instance) wouldn't hurt either, I think :)&lt;br /&gt;
&lt;br /&gt;
Timendus&lt;br /&gt;
&lt;br /&gt;
== I hope we can do that soon ==&lt;br /&gt;
&lt;br /&gt;
Just, we don't want to waste time getting it all set up for that and have no one use it. If we see a lot of people milling around here, contributing, then by all means, we'll expand. But one thing we '''DON'T''' want to do is mirror 28 Days. We can link TO it, but we don't want it actually here.&lt;br /&gt;
&lt;br /&gt;
--[[User:AndyJ|AndyJ]] 06:50, 27 Mar 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
== Categories ==&lt;br /&gt;
&lt;br /&gt;
On many pages, there is now a sizable blank space at the top due to several lines of category links.  What, if anything, should we do about this? [[User:FloppusMaximus|FloppusMaximus]] 19:06, 29 Mar 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
== Move them? ==&lt;br /&gt;
&lt;br /&gt;
Move the Category links to the bottom should do it. :) That, or put them all on one line.&lt;br /&gt;
&lt;br /&gt;
--[[User:AndyJ|AndyJ]] 19:07, 29 Mar 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
:Yeah, that sounds like a good idea. :) [[User:FloppusMaximus|FloppusMaximus]] 20:18, 29 Mar 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
:: I think I officially qualify as a robot now.  You can tell I was getting tired towards the end, as I missed the minor-edit button a few times... sorry about that... [[User:FloppusMaximus|FloppusMaximus]] 21:28, 29 Mar 2005 (PST)&lt;br /&gt;
:: Actually, I was going to just mod the php code to fix this bug....keeping the category tags on the top might be a good idea actually. (JasonM)&lt;br /&gt;
:::That might still be a good idea. [[User:FloppusMaximus|FloppusMaximus]] 13:18, 3 Apr 2005 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Caching ==&lt;br /&gt;
&lt;br /&gt;
Is it just me, or are there some serious caching problems here?&lt;br /&gt;
[[User:FloppusMaximus|FloppusMaximus]] 21:32, 1 Apr 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
: In particular?  --[[User:Dan Englender|Dan Englender]] 21:42, 1 Apr 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
:: Ya, the wiki seems to have weird caching problems, especially since it appears the reload the page every time, even if it doesn't get changes. I don't know what's up. --[[User:AndyJ|AndyJ]] 22:35, 1 Apr 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
::: Considering the dynamic nature of a wiki (a page could be edited, at pretty much any time), I wouldn't mind not having it cached. (Though I would personally disable browser caching altogether if firefox would let me... :P ) --[[User:Aquanight|Aquanight]] 22:44, 1 Apr 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
:::: Er... I think I see what you mean... stuff is getting cached when it shouldn't be. (I could've sworn I told firefox to only use 0 KB (aka none) for cache and it's still caching ... argh.) --[[User:Aquanight|Aquanight]] 22:46, 1 Apr 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
::::: I've disabled caching myself as well. Perhaps we should just disable caching altogether? (JasonM)&lt;br /&gt;
&lt;br /&gt;
::::::Caching has been disabled. (JasonM)&lt;br /&gt;
&lt;br /&gt;
::: I found a &amp;quot;Disable Caching&amp;quot; option in Misc. Preferences, if that helps. [[User:Gambit|Gambit]] 00:28, 2 Apr 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
== On Other Calculators ==&lt;br /&gt;
&lt;br /&gt;
Just a random idea I had -- a lot of the ROM calls, RAM addresses, and ports are very similar, if not identical, between the 83 and 83+, and more generally, between all of the Z80 calculators.  For some of them -- [[83Plus:RAM:86D8]] and [[83:RAM:8253]], for instance -- it may be possible to combine the two into a single page, though I'm not sure that would be a good idea, given the potential for confusion.  So here's what I propose instead:&lt;br /&gt;
* For simple things like penRow, we can just have two copies of the page, as there isn't very much to keep synchronized.&lt;br /&gt;
* For more detailed pages such as GetKey, have a brief description with a link -- &amp;quot;This routine waits for the user to press a key and returns it.  It is equivalent to [[83Plus:BCALLs:4972|GetKey]] on the TI-83 Plus.&amp;quot; -- on one page, and the more detailed description on the other.  Not a redirect in this case; I'm talking about a distinct page, which would point out the different call points and RAM addresses; in the case of GetKey, for instance, the address of keyExtend is different and should be noted.&lt;br /&gt;
* In either case, on ''both'' pages, add a new section &amp;quot;On Other Calculators&amp;quot; near the bottom, with appropriate links.  This section serves two purposes: First, it's simply useful information to have available, both for people trying to write cross-platform code, and for those of us who are interested in researching the OS.  Secondly, it would serve as a reminder to editors that there are multiple pages that may need to be updated.&lt;br /&gt;
* It's also important to maintain the distinction between routines/variables/ports that are ''identical'' as opposed to those which merely have related functions.  For example, the widely used GetK routine on the 83 isn't known -- to my knowledge -- on the 73, but GetCSC serves as an adequate substitute in many situations.  This is something that belongs in &amp;quot;See Also,&amp;quot; not in this section.&lt;br /&gt;
* Some templates might be in order here.&lt;br /&gt;
&lt;br /&gt;
[[User:FloppusMaximus|FloppusMaximus]] 18:41, 24 May 2005 (PDT)&lt;br /&gt;
&lt;br /&gt;
:It's not a bad idea.  The only problem is that it makes a lot more work for people who just want to make a simple addition to the wiki.  There's already a fairly high initial barrier (figuring out the templates and categories) to overcome for someone who wants to stroll along and add something to the wiki.  For you and I it wouldn't be a big deal, but I'm worried it's going to dissuade a random person who floats by from adding ErrMemory to 83 Plus, because then 83 (and 86 or 73, if someone decides to start them) will have to be added/changed as well.  --[[User:Dan Englender|Dan Englender]] 10:01, 25 May 2005 (PDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Wanted Pages ==&lt;br /&gt;
I decided it was too minor to post as news on the main page, but I modified the [[Special:wantedpages|Wanted Pages]] page so that the threshold is 1 link instead of 2 links.  A *lot* more wanted pages show up now, though there is some junk in the list now too (like fake links from templates).  I figure wanted pages are as good a place as any to start adding, so I'm going to try to make a dent in the list.  Anyone who would like to help is welcome to do so :)  --[[User:Dan Englender|Dan Englender]] 10:06, 25 May 2005 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Not &amp;quot;hardware&amp;quot; specific documents ==&lt;br /&gt;
&lt;br /&gt;
I was so free to edit the artilce over Emulator(s). I also created an article regarding PindurTI. &lt;br /&gt;
&lt;br /&gt;
As I already stated on the MaxCoderz board (http://joepnet.com/hosted/maxcoderz/phpBB2/viewtopic.php?t=1521), I think WikiTI has a lot of potential to collect information about the TI community aswell. Thinks like PindurTI, GrayScale and maybe even information about all the Zelda attempts. In my opinion, people can benefit from that information. --[[User:Kv83|Vincent Junemann]] 15:00, 21 February 2006 (CET)&lt;br /&gt;
&lt;br /&gt;
== Required logon ==&lt;br /&gt;
&lt;br /&gt;
If the spam is being done by bots, perhaps instead of requiring a log-on, we can require either a log-on or a captcha?  I realize there's additional coding involved, but we've had a fair number of useful contributions by non-logged in contributors, and it would be a shame to scare them off by prospects of account creation or the fact that we can track their activities, or what have you. --[[User:Dan Englender|Dan Englender]] 13:55, 23 Feb 2006 (PST)&lt;br /&gt;
:Agreed, if we can either find a mod for that or code one ourselves. Of course, maybe even a simple &amp;quot;check this box&amp;quot; thing would work if the bots are programmed just to hit mediawiki and not check for stuff... And if a botrunner ever finds it and fixes their bots, we can either just change it or go to a captcha... However, I think most of the legit anon edits were by people who have an account but just didn't notice they weren't logged in at the time. [[User:AndyJ|Andy Janata]] 18:40, 23 Feb 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
== Wiki update ==&lt;br /&gt;
&lt;br /&gt;
Whats this undefined link I see on a lot of the pages?--[[User:Jim e|Jim e]] 06:07, 14 March 2006 (PST)&lt;br /&gt;
:Example? --[[User:Dan Englender|Dan Englender]] 06:12, 14 March 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
::This page has it right under the contents.--[[User:Jim e|Jim e]] 06:18, 14 March 2006 (PST)&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=Talk:WikiTI_Home</id>
		<title>Talk:WikiTI Home</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=Talk:WikiTI_Home"/>
				<updated>2006-03-14T14:07:44Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: Wiki update&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Discussion =&lt;br /&gt;
What do you think about this wiki?&lt;br /&gt;
&lt;br /&gt;
== More! ==&lt;br /&gt;
&lt;br /&gt;
I think it needs information on more calculators than just the Ti-83+ series, and general assembly information (like a good cathegorized tutorial overview for instance) wouldn't hurt either, I think :)&lt;br /&gt;
&lt;br /&gt;
Timendus&lt;br /&gt;
&lt;br /&gt;
== I hope we can do that soon ==&lt;br /&gt;
&lt;br /&gt;
Just, we don't want to waste time getting it all set up for that and have no one use it. If we see a lot of people milling around here, contributing, then by all means, we'll expand. But one thing we '''DON'T''' want to do is mirror 28 Days. We can link TO it, but we don't want it actually here.&lt;br /&gt;
&lt;br /&gt;
--[[User:AndyJ|AndyJ]] 06:50, 27 Mar 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
== Categories ==&lt;br /&gt;
&lt;br /&gt;
On many pages, there is now a sizable blank space at the top due to several lines of category links.  What, if anything, should we do about this? [[User:FloppusMaximus|FloppusMaximus]] 19:06, 29 Mar 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
== Move them? ==&lt;br /&gt;
&lt;br /&gt;
Move the Category links to the bottom should do it. :) That, or put them all on one line.&lt;br /&gt;
&lt;br /&gt;
--[[User:AndyJ|AndyJ]] 19:07, 29 Mar 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
:Yeah, that sounds like a good idea. :) [[User:FloppusMaximus|FloppusMaximus]] 20:18, 29 Mar 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
:: I think I officially qualify as a robot now.  You can tell I was getting tired towards the end, as I missed the minor-edit button a few times... sorry about that... [[User:FloppusMaximus|FloppusMaximus]] 21:28, 29 Mar 2005 (PST)&lt;br /&gt;
:: Actually, I was going to just mod the php code to fix this bug....keeping the category tags on the top might be a good idea actually. (JasonM)&lt;br /&gt;
:::That might still be a good idea. [[User:FloppusMaximus|FloppusMaximus]] 13:18, 3 Apr 2005 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Caching ==&lt;br /&gt;
&lt;br /&gt;
Is it just me, or are there some serious caching problems here?&lt;br /&gt;
[[User:FloppusMaximus|FloppusMaximus]] 21:32, 1 Apr 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
: In particular?  --[[User:Dan Englender|Dan Englender]] 21:42, 1 Apr 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
:: Ya, the wiki seems to have weird caching problems, especially since it appears the reload the page every time, even if it doesn't get changes. I don't know what's up. --[[User:AndyJ|AndyJ]] 22:35, 1 Apr 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
::: Considering the dynamic nature of a wiki (a page could be edited, at pretty much any time), I wouldn't mind not having it cached. (Though I would personally disable browser caching altogether if firefox would let me... :P ) --[[User:Aquanight|Aquanight]] 22:44, 1 Apr 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
:::: Er... I think I see what you mean... stuff is getting cached when it shouldn't be. (I could've sworn I told firefox to only use 0 KB (aka none) for cache and it's still caching ... argh.) --[[User:Aquanight|Aquanight]] 22:46, 1 Apr 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
::::: I've disabled caching myself as well. Perhaps we should just disable caching altogether? (JasonM)&lt;br /&gt;
&lt;br /&gt;
::::::Caching has been disabled. (JasonM)&lt;br /&gt;
&lt;br /&gt;
::: I found a &amp;quot;Disable Caching&amp;quot; option in Misc. Preferences, if that helps. [[User:Gambit|Gambit]] 00:28, 2 Apr 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
== On Other Calculators ==&lt;br /&gt;
&lt;br /&gt;
Just a random idea I had -- a lot of the ROM calls, RAM addresses, and ports are very similar, if not identical, between the 83 and 83+, and more generally, between all of the Z80 calculators.  For some of them -- [[83Plus:RAM:86D8]] and [[83:RAM:8253]], for instance -- it may be possible to combine the two into a single page, though I'm not sure that would be a good idea, given the potential for confusion.  So here's what I propose instead:&lt;br /&gt;
* For simple things like penRow, we can just have two copies of the page, as there isn't very much to keep synchronized.&lt;br /&gt;
* For more detailed pages such as GetKey, have a brief description with a link -- &amp;quot;This routine waits for the user to press a key and returns it.  It is equivalent to [[83Plus:BCALLs:4972|GetKey]] on the TI-83 Plus.&amp;quot; -- on one page, and the more detailed description on the other.  Not a redirect in this case; I'm talking about a distinct page, which would point out the different call points and RAM addresses; in the case of GetKey, for instance, the address of keyExtend is different and should be noted.&lt;br /&gt;
* In either case, on ''both'' pages, add a new section &amp;quot;On Other Calculators&amp;quot; near the bottom, with appropriate links.  This section serves two purposes: First, it's simply useful information to have available, both for people trying to write cross-platform code, and for those of us who are interested in researching the OS.  Secondly, it would serve as a reminder to editors that there are multiple pages that may need to be updated.&lt;br /&gt;
* It's also important to maintain the distinction between routines/variables/ports that are ''identical'' as opposed to those which merely have related functions.  For example, the widely used GetK routine on the 83 isn't known -- to my knowledge -- on the 73, but GetCSC serves as an adequate substitute in many situations.  This is something that belongs in &amp;quot;See Also,&amp;quot; not in this section.&lt;br /&gt;
* Some templates might be in order here.&lt;br /&gt;
&lt;br /&gt;
[[User:FloppusMaximus|FloppusMaximus]] 18:41, 24 May 2005 (PDT)&lt;br /&gt;
&lt;br /&gt;
:It's not a bad idea.  The only problem is that it makes a lot more work for people who just want to make a simple addition to the wiki.  There's already a fairly high initial barrier (figuring out the templates and categories) to overcome for someone who wants to stroll along and add something to the wiki.  For you and I it wouldn't be a big deal, but I'm worried it's going to dissuade a random person who floats by from adding ErrMemory to 83 Plus, because then 83 (and 86 or 73, if someone decides to start them) will have to be added/changed as well.  --[[User:Dan Englender|Dan Englender]] 10:01, 25 May 2005 (PDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Wanted Pages ==&lt;br /&gt;
I decided it was too minor to post as news on the main page, but I modified the [[Special:wantedpages|Wanted Pages]] page so that the threshold is 1 link instead of 2 links.  A *lot* more wanted pages show up now, though there is some junk in the list now too (like fake links from templates).  I figure wanted pages are as good a place as any to start adding, so I'm going to try to make a dent in the list.  Anyone who would like to help is welcome to do so :)  --[[User:Dan Englender|Dan Englender]] 10:06, 25 May 2005 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Not &amp;quot;hardware&amp;quot; specific documents ==&lt;br /&gt;
&lt;br /&gt;
I was so free to edit the artilce over Emulator(s). I also created an article regarding PindurTI. &lt;br /&gt;
&lt;br /&gt;
As I already stated on the MaxCoderz board (http://joepnet.com/hosted/maxcoderz/phpBB2/viewtopic.php?t=1521), I think WikiTI has a lot of potential to collect information about the TI community aswell. Thinks like PindurTI, GrayScale and maybe even information about all the Zelda attempts. In my opinion, people can benefit from that information. --[[User:Kv83|Vincent Junemann]] 15:00, 21 February 2006 (CET)&lt;br /&gt;
&lt;br /&gt;
== Required logon ==&lt;br /&gt;
&lt;br /&gt;
If the spam is being done by bots, perhaps instead of requiring a log-on, we can require either a log-on or a captcha?  I realize there's additional coding involved, but we've had a fair number of useful contributions by non-logged in contributors, and it would be a shame to scare them off by prospects of account creation or the fact that we can track their activities, or what have you. --[[User:Dan Englender|Dan Englender]] 13:55, 23 Feb 2006 (PST)&lt;br /&gt;
:Agreed, if we can either find a mod for that or code one ourselves. Of course, maybe even a simple &amp;quot;check this box&amp;quot; thing would work if the bots are programmed just to hit mediawiki and not check for stuff... And if a botrunner ever finds it and fixes their bots, we can either just change it or go to a captcha... However, I think most of the legit anon edits were by people who have an account but just didn't notice they weren't logged in at the time. [[User:AndyJ|Andy Janata]] 18:40, 23 Feb 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
== Wiki update ==&lt;br /&gt;
&lt;br /&gt;
Whats this undefined link I see on a lot of the pages?--[[User:Jim e|Jim e]] 06:07, 14 March 2006 (PST)&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=83Plus:Ports:29</id>
		<title>83Plus:Ports:29</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=83Plus:Ports:29"/>
				<updated>2006-03-14T14:05:14Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: added warning about lcd not updating.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:83Plus:Ports:By Address|29 - LCD Delay (6 MHz)]] [[Category:83Plus:Ports:By Name|LCD Delay (6 MHz)]]&lt;br /&gt;
{{SE-Only Port|01}}&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
'''Port Number:''' 29h&lt;br /&gt;
&lt;br /&gt;
'''Function:''' LCD Delay (6 MHz)&lt;br /&gt;
&lt;br /&gt;
This port removes the amount of delay needed between accesses to the LCD driver by adding a delay to any instruction which reads from or writes to ports [[83Plus:Ports:10|10]] or [[83Plus:Ports:11|11]], as well as the mirror ports 12 and 13.&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
* Bit 0 enables the effects of the flash delay controlled by port 2E.&lt;br /&gt;
* Bit 1 enables the effects of the ram delay controlled by port 2E. &lt;br /&gt;
* Bits 2-7 control the amount of delay added at specified instructions. To calculate the number of clock cycles added, divide the contents of port 29 by 4 and round off. '''NOTE:''' The contents of this port should NOT be less than 0Ch or the LCD will no longer update.&lt;br /&gt;
&lt;br /&gt;
== Comments ==&lt;br /&gt;
This port is not available on the normal TI-83+. On the normal TI-83+ this port is a shadow of [[83Plus:Ports:01|Port 01h]].&lt;br /&gt;
&lt;br /&gt;
Bits 0&amp;amp;1 are reset on the 83+SE and set on the 84+(se).&lt;br /&gt;
&lt;br /&gt;
The effect of this port is only seen if the contents of [[83Plus:Ports:20|port 20h]] equals 00.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Credits and Contributions ==&lt;br /&gt;
* '''Michael Vincent:''' Documentation as found [http://michaelv.org/programs/calcs/ports/port29.html here].&lt;br /&gt;
* '''James Montelongo:''' Documentation found at [http://www.geocities.com/jimm09876/calc/port29.html here].&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=83Plus:Ports:2C</id>
		<title>83Plus:Ports:2C</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=83Plus:Ports:2C"/>
				<updated>2006-03-14T14:04:05Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: added 2e info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:83Plus:Ports:By Address|2C - LCD Delay(15 MHz)(03)]] [[Category:83Plus:Ports:By Name|LCD Delay (15 MHz)(03)]]&lt;br /&gt;
{{SE-Only Port|04}}&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
'''Port Number:''' 2Ch&lt;br /&gt;
&lt;br /&gt;
'''Function:''' LCD Delay (15 MHz)(03)&lt;br /&gt;
&lt;br /&gt;
This port works in the same manner 29 does, but only when the calculator is set at 15mhz and if port 20 equals 03. It removes the amount of delay needed between accesses to the lcd driver by adding a delay to any instruction which reads from or writes to ports [[83Plus:Ports:10|10]] or [[83Plus:Ports:11|11]], as well as the mirror ports 12 and 13.&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
* Bit 0 enables the effects of the flash delay controlled by port 2E.&lt;br /&gt;
* Bit 1 enables the effects of the ram delay controlled by port 2E. &lt;br /&gt;
* Bits 2-7 control the amount of delay added at specified instructions. To calculate the number of clock cycles added divide the contents of port 2C by 4 and round off. '''NOTE:''' The contents of this port should NOT be less than 0Ch or the LCD will no longer update.&lt;br /&gt;
&lt;br /&gt;
== Comments ==&lt;br /&gt;
This port is not available on the normal TI-83+. On the normal TI-83+ this port is a shadow of [[83Plus:Ports:04|Port 04h]].&lt;br /&gt;
&lt;br /&gt;
The effect of this port is only seen if the contents of [[83Plus:Ports:20|port 20h]] equals 03.&lt;br /&gt;
&lt;br /&gt;
== Credits and Contributions ==&lt;br /&gt;
* '''James Montelongo'''&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=83Plus:Ports:2B</id>
		<title>83Plus:Ports:2B</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=83Plus:Ports:2B"/>
				<updated>2006-03-14T14:02:49Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: added 2e info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:83Plus:Ports:By Address|2B - LCD Delay(15 MHz)(02)]] [[Category:83Plus:Ports:By Name|LCD Delay (15 MHz)(02)]]&lt;br /&gt;
{{SE-Only Port|03}}&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
'''Port Number:''' 2Bh&lt;br /&gt;
&lt;br /&gt;
'''Function:''' LCD Delay (15 MHz)(02)&lt;br /&gt;
&lt;br /&gt;
This port works in the same manner 29 does, but only when the calculator is set at 15mhz and if port 20 equals 02. It removes the amount of delay needed between accesses to the lcd driver by adding a delay to any instruction which reads from or writes to ports [[83Plus:Ports:10|10]] or [[83Plus:Ports:11|11]], as well as the mirror ports 12 and 13.&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
* Bit 0 enables the effects of the flash delay controlled by port 2E.&lt;br /&gt;
* Bit 1 enables the effects of the ram delay controlled by port 2E. &lt;br /&gt;
*Bits 2-7 control the amount of delay added at specified instructions. To calculate the number of clock cycles added divide the contents of port 2B by 4 and round off. '''NOTE:''' The contents of this port should NOT be less than 0Ch or the LCD will no longer update.&lt;br /&gt;
&lt;br /&gt;
== Comments ==&lt;br /&gt;
This port is not available on the normal TI-83+. On the normal TI-83+ this port is a shadow of [[83Plus:Ports:03|Port 03h]].&lt;br /&gt;
&lt;br /&gt;
The effect of this port is only seen if the contents of [[83Plus:Ports:20|port 20h]] equals 02.&lt;br /&gt;
&lt;br /&gt;
== Credits and Contributions ==&lt;br /&gt;
* '''James Montelongo'''&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=83Plus:Ports:2A</id>
		<title>83Plus:Ports:2A</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=83Plus:Ports:2A"/>
				<updated>2006-03-14T14:01:51Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: added 2e info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:83Plus:Ports:By Address|2A - LCD Delay(15 MHz)]] [[Category:83Plus:Ports:By Name|LCD Delay (15 MHz)]]&lt;br /&gt;
{{SE-Only Port|02}}&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
'''Port Number:''' 2Ah&lt;br /&gt;
&lt;br /&gt;
'''Function:''' LCD Delay (15 MHz)&lt;br /&gt;
&lt;br /&gt;
This port works in the same manner 29 does, but only when the calculator is set at 15mhz and if port 20 equals 01. It removes the amount of delay needed between accesses to the lcd driver by adding a delay to any instruction which reads from or writes to ports [[83Plus:Ports:10|10]] or [[83Plus:Ports:11|11]], as well as the mirror ports 12 and 13.&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
* Bit 0 enables the effects of the flash delay controlled by port 2E.&lt;br /&gt;
* Bit 1 enables the effects of the ram delay controlled by port 2E. &lt;br /&gt;
* Bits 2-7 control the amount of delay added at specified instructions. To calculate the number of clock cycles added divide the contents of port 2A by 4 and round off. '''NOTE:''' The contents of this port should NOT be less than 0Ch or the LCD will no longer update.&lt;br /&gt;
&lt;br /&gt;
== Comments ==&lt;br /&gt;
This port is not available on the normal TI-83+. On the normal TI-83+ this port is a shadow of [[83Plus:Ports:02|Port 02h]].&lt;br /&gt;
&lt;br /&gt;
The effect of this port is only seen if the contents of [[83Plus:Ports:20|port 20h]] equals 01.&lt;br /&gt;
&lt;br /&gt;
== Credits and Contributions ==&lt;br /&gt;
* '''Michael Vincent:''' Documentation as found [http://michaelv.org/programs/calcs/ports/port2a.html here].&lt;br /&gt;
* '''James Montelongo:''' Documentation found at [http://www.geocities.com/jimm09876/calc/port2a.html here].&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=83Plus:Ports:29</id>
		<title>83Plus:Ports:29</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=83Plus:Ports:29"/>
				<updated>2006-03-14T14:00:00Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: added 2e info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:83Plus:Ports:By Address|29 - LCD Delay (6 MHz)]] [[Category:83Plus:Ports:By Name|LCD Delay (6 MHz)]]&lt;br /&gt;
{{SE-Only Port|01}}&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
'''Port Number:''' 29h&lt;br /&gt;
&lt;br /&gt;
'''Function:''' LCD Delay (6 MHz)&lt;br /&gt;
&lt;br /&gt;
This port removes the amount of delay needed between accesses to the LCD driver by adding a delay to any instruction which reads from or writes to ports [[83Plus:Ports:10|10]] or [[83Plus:Ports:11|11]], as well as the mirror ports 12 and 13.&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
* Bit 0 enables the effects of the flash delay controlled by port 2E.&lt;br /&gt;
* Bit 1 enables the effects of the ram delay controlled by port 2E. &lt;br /&gt;
* Bits 2-7 control the amount of delay added at specified instructions. To calculate the number of clock cycles added, divide the contents of port 29 by 4 and round off.&lt;br /&gt;
&lt;br /&gt;
== Comments ==&lt;br /&gt;
This port is not available on the normal TI-83+. On the normal TI-83+ this port is a shadow of [[83Plus:Ports:01|Port 01h]].&lt;br /&gt;
&lt;br /&gt;
Bits 0&amp;amp;1 are reset on the 83+SE and set on the 84+(se).&lt;br /&gt;
&lt;br /&gt;
The effect of this port is only seen if the contents of [[83Plus:Ports:20|port 20h]] equals 00.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Credits and Contributions ==&lt;br /&gt;
* '''Michael Vincent:''' Documentation as found [http://michaelv.org/programs/calcs/ports/port29.html here].&lt;br /&gt;
* '''James Montelongo:''' Documentation found at [http://www.geocities.com/jimm09876/calc/port29.html here].&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=83:RAM:8E29</id>
		<title>83:RAM:8E29</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=83:RAM:8E29"/>
				<updated>2006-03-13T20:38:15Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:83:RAM:By_Address|8E29 - plotSScreen]] [[Category:83:RAM:By_Name|plotSScreen]]&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
'''Official Name:''' plotSScreen&lt;br /&gt;
&lt;br /&gt;
'''Memory Address:''' 8E29h&lt;br /&gt;
&lt;br /&gt;
'''Length:''' 768 bytes.&lt;br /&gt;
&lt;br /&gt;
This area of memory stores the contents of the graph screen.&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=83:RAM:8039</id>
		<title>83:RAM:8039</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=83:RAM:8039"/>
				<updated>2006-03-13T12:09:15Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:83:RAM:By_Address|8039 - OP Registers]] [[Category:83:RAM:By_Name|OP Registers]]&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
'''Official Name:''' OP Registers&lt;br /&gt;
&lt;br /&gt;
'''Memory Address:''' 8039h&lt;br /&gt;
&lt;br /&gt;
'''Length:''' 66 bytes&lt;br /&gt;
&lt;br /&gt;
In this RAM area the value of op1 to op6 is stored, each &amp;quot;register&amp;quot; getting 11 bytes.&lt;br /&gt;
&lt;br /&gt;
'''OP Equates:'''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OP1         EQU                 8039h&lt;br /&gt;
OP2         EQU                 8044h&lt;br /&gt;
OP3         EQU                 804Fh&lt;br /&gt;
OP4         EQU                 805Ah&lt;br /&gt;
OP5         EQU                 8065h&lt;br /&gt;
OP6         EQU                 8070h&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=83:RAM:8E29</id>
		<title>83:RAM:8E29</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=83:RAM:8E29"/>
				<updated>2006-03-13T12:08:48Z</updated>
		
		<summary type="html">&lt;p&gt;Jim e: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:83:RAM:By_Address|8E29 - plotSScreen]] [[Category:83:RAM:By_Name|plotSScreen]]&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
'''Official Name:''' plotSScreen&lt;br /&gt;
&lt;br /&gt;
'''Memory Address:''' 8E29h&lt;br /&gt;
&lt;br /&gt;
'''Length:''' 768 bytes.&lt;br /&gt;
&lt;br /&gt;
This area of memory stores the contents of the graph screen.&lt;/div&gt;</summary>
		<author><name>Jim e</name></author>	</entry>

	</feed>