<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -60,22 +60,26 @@ describe Z80E do
     @cpu.state.should == state.merge(:pc =&gt; 1, :b =&gt; 0x13, :c =&gt; 0x00)
   end
   
-  it &quot;should execute INC B&quot; do
-    256.times do |i|
-      @cpu.f = rand(256)
-      @cpu.b = i
-      @cpu[i] = 0x04
-      state = @cpu.state
-      @cpu.step.should == 4
-      new_state = @cpu.state
-      state[:pc] += 1
-      state[:f] &amp;= 0x01 # reset N, don't change C
-      state[:f] |= 0x80 if (new_state[:b] &amp; 0x80 != 0)
-      state[:f] |= 0x40 if (new_state[:b] == 0)
-      state[:f] |= 0x20 if (new_state[:b] &amp; 0x10 == (state[:b] ^ 0xff) &amp; 0x10)
-      state[:f] |= 0x04 if (state[:b] == 0x7f)
-      state[:b] = (state[:b] + 1) % 256
-      @cpu.state.should == state
+  it &quot;should execute INC r&quot; do
+    [0x04, 0x0c, 0x14, 0x1c, 0x24, 0x2c, 0x3c].each do |opcode|
+      @cpu.reset!
+      r = register_vector(opcode)
+      256.times do |i|
+        @cpu.f = rand(256)
+        @cpu.send(&quot;#{r}=&quot;, i)
+        @cpu[i] = opcode
+        state = @cpu.state
+        @cpu.step.should == 4
+        new_state = @cpu.state
+        state[:pc] += 1
+        state[:f] &amp;= 0x01 # reset N, don't change C
+        state[:f] |= 0x80 if (new_state[r] &amp; 0x80 != 0)
+        state[:f] |= 0x40 if (new_state[r] == 0)
+        state[:f] |= 0x20 if (new_state[r] &amp; 0x10 == (state[r] ^ 0xff) &amp; 0x10)
+        state[:f] |= 0x04 if (state[r] == 0x7f)
+        state[r] = (state[r] + 1) % 256
+        @cpu.state.should == state
+      end
     end
   end
   
@@ -141,7 +145,6 @@ describe Z80E do
   it &quot;should execute ADD HL,BC&quot; # 09
   it &quot;should execute LD A,(BC)&quot; # 0A
   it &quot;should execute DEC BC&quot; # 0B
-  it &quot;should execute INC C&quot; # 0C
   it &quot;should execute DEC C&quot; # 0D
   it &quot;should execute RRCA&quot; # 0F
   it &quot;should execute DJNZ (PC+e)&quot; # 10 e
@@ -149,7 +152,6 @@ describe Z80E do
   it &quot;should execute LD (DE),A&quot; # 12
   it &quot;should execute INC DE&quot; # 13
   it &quot;should execute INC D&quot; # 14
-  it &quot;should execute DEC D&quot; # 15
   it &quot;should execute RLA&quot; # 17
   it &quot;should execute JR (PC+e)&quot; # 18 e
   it &quot;should execute ADD HL,DE&quot; # 19
@@ -157,7 +159,6 @@ describe Z80E do
   it &quot;should execute DEC DE&quot; # 1B
   it &quot;should execute INC E&quot; # 1C
   it &quot;should execute DEC E&quot; # 1D
-  it &quot;should execute RRA&quot; # 1F
   it &quot;should execute JR NZ,(PC+e)&quot; # 20 e
   it &quot;should execute LD HL,nn&quot; # 21 n n
   it &quot;should execute LD (nn),HL&quot; # 22 n n
@@ -165,7 +166,6 @@ describe Z80E do
   it &quot;should execute INC H&quot; # 24
   it &quot;should execute DEC H&quot; # 25
   it &quot;should execute DAA&quot; # 27
-  it &quot;should execute JR Z,(PC+e)&quot; # 28 e
   it &quot;should execute ADD HL,HL&quot; # 29
   it &quot;should execute LD HL,(nn)&quot; # 2A n n
   it &quot;should execute DEC HL&quot; # 2B
@@ -173,7 +173,6 @@ describe Z80E do
   it &quot;should execute DEC L&quot; # 2D
   it &quot;should execute CPL&quot; # 2F
   it &quot;should execute JR NC,(PC+e)&quot; # 30 e
-  it &quot;should execute LD SP,nn&quot; # 31 n n
   it &quot;should execute LD (nn),A&quot; # 32 n n
   it &quot;should execute INC SP&quot; # 33
   it &quot;should execute INC (HL)&quot; # 34
@@ -189,7 +188,6 @@ describe Z80E do
   it &quot;should execute CCF&quot; # 3F
   it &quot;should execute LD B,B&quot; # 40
   it &quot;should execute LD B,C&quot; # 41
-  it &quot;should execute LD B,D&quot; # 42
   it &quot;should execute LD B,E&quot; # 43
   it &quot;should execute LD B,H&quot; # 44
   it &quot;should execute LD B,L&quot; # 45</diff>
      <filename>test/test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2d290a3bb1b01310484663bc5eed336ba8039a36</id>
    </parent>
  </parents>
  <author>
    <name>Dana Contreras</name>
    <email>dana@danadanger.org</email>
  </author>
  <url>http://github.com/DanaDanger/z80e/commit/f691d9743b50962b7176e4e1153f2547644c456f</url>
  <id>f691d9743b50962b7176e4e1153f2547644c456f</id>
  <committed-date>2009-07-05T04:09:35-07:00</committed-date>
  <authored-date>2009-07-05T04:09:35-07:00</authored-date>
  <message>generalized INC B test for INC r</message>
  <tree>5bd28b0a243e7087a2612fd5b7457597b6b409fd</tree>
  <committer>
    <name>Dana Contreras</name>
    <email>dana@danadanger.org</email>
  </committer>
</commit>
