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

		<summary type="html">&lt;p&gt;Initial automated import&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;!-- Short summary of instruction --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the interrupt mode.&lt;br /&gt;
&lt;br /&gt;
=== Mode 0 ===&lt;br /&gt;
&lt;br /&gt;
Not used by TI calculators, but means that an external device plugged into a z80 device generates the interrupt.&lt;br /&gt;
&lt;br /&gt;
=== Mode 1 ===&lt;br /&gt;
&lt;br /&gt;
Interrupts are generated by the internal circuitry of the processor (aka the OS). The frequency of these interrupts is 200 per second on a ZX Spectrum, but it depends on the state of the batteries in the case of TI calculators (probably varies between 100 and 150). Every time an interrupt is encountered, the OS performs an [[Z80:Opcodes:RST|RST]] $28.&lt;br /&gt;
&lt;br /&gt;
=== Mode 2 ===&lt;br /&gt;
&lt;br /&gt;
Allows user to determine when an interrupt happens, and what the interrupt does. For more information on interrupts, see this [[Z80:Interrupts|page]].&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Syntax for this instruction --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    IM 0		;will compile, but will result in a crash on your calculator&lt;br /&gt;
    IM 1&lt;br /&gt;
    IM 2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Effects ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- What the instruction does to flags --&amp;gt;&lt;br /&gt;
All flags are preserved.&lt;br /&gt;
&lt;br /&gt;
== Uses ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- What the instruction can be used for --&amp;gt;&lt;br /&gt;
The most important use of IM is to allow for the programmer to create their own interrupts that can do whatever they want them to, when they want the interrupts to occur. For more information on how interrupts work, see this [[Z80:Interrupts|page]].&lt;br /&gt;
&lt;br /&gt;
== T-States ==&lt;br /&gt;
8 t-states for each mode&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Other instructions that are related to this one --&amp;gt;&lt;br /&gt;
[[Z80:Opcodes:DI|DI]],[[Z80:Opcodes:EI|EI]],[[Z80:Opcodes:RETI|RETI]],[[Z80:Opcodes:RETN|RETN]],[[Z80:Opcodes:RST|RST]]&lt;br /&gt;
&lt;br /&gt;
{{lowercase}}&lt;br /&gt;
[[Category:Z80 Assembly]]&lt;br /&gt;
[[Category:Z80 Heaven]]&lt;br /&gt;
[[Category:Z80 Opcodes]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>