<?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%3ABIT</id>
	<title>Z80:Opcodes:BIT - 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%3ABIT"/>
	<link rel="alternate" type="text/html" href="http://learn.cemetech.net/index.php?title=Z80:Opcodes:BIT&amp;action=history"/>
	<updated>2026-06-04T12:41:30Z</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:BIT&amp;diff=318&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:BIT&amp;diff=318&amp;oldid=prev"/>
		<updated>2016-02-05T22:37:55Z</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;
Tests if the specified bit is set.&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;
    bit n,op8&lt;br /&gt;
&lt;br /&gt;
=== Allowed Instructions ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- All possible inputs --&amp;gt;&lt;br /&gt;
n can be any integer from [0,7]. It must be defined on compile time.&lt;br /&gt;
&lt;br /&gt;
    bit n,a&lt;br /&gt;
    bit n,b&lt;br /&gt;
    bit n,c&lt;br /&gt;
    bit n,d&lt;br /&gt;
    bit n,e&lt;br /&gt;
    bit n,h&lt;br /&gt;
    bit n,l&lt;br /&gt;
    bit n,(hl)&lt;br /&gt;
    bit n,(ix+n)&lt;br /&gt;
    bit n,(iy+n)&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;
Opposite of the n^^th^^ bit is written into the Z flag. C is preserved, N is reset, H is set, and S and P/V are undefined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ld a,%00000001&lt;br /&gt;
    bit 0,a		;would reset Z&lt;br /&gt;
    bit 1,a		;would set Z&lt;br /&gt;
&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;
== T-States ==&lt;br /&gt;
r denotes 8-bit register.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| r || 8 &lt;br /&gt;
|-&lt;br /&gt;
| (hl) || 12 &lt;br /&gt;
|-&lt;br /&gt;
| (ix+X) || 20 &lt;br /&gt;
|-&lt;br /&gt;
| (iy+X) || 20 &lt;br /&gt;
|}&lt;br /&gt;
&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:AND|AND]],[[Z80:Opcodes:CCF|CCF]],[[Z80:Opcodes:CP|CP]],[[Z80:Opcodes:CPD|CPD]],[[Z80:Opcodes:CPDR|CPDR]],[[Z80:Opcodes:CPI|CPI]],[[Z80:Opcodes:CPIR|CPIR]],[[Z80:Opcodes:CPL|CPL]],[[Z80:Opcodes:OR|OR]],[[Z80:Opcodes:RES|RES]],[[Z80:Opcodes:SCF|SCF]],[[Z80:Opcodes:SET|SET]],[[Z80:Opcodes:XOR|XOR]]&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>