<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -83,23 +83,27 @@ describe Z80E do
     end
   end
   
-  it &quot;should execute DEC B&quot; do
-    256.times do |i|
-      @cpu.f = rand(256)
-      @cpu.b = i
-      @cpu[i] = 0x05
-      state = @cpu.state
-      @cpu.step.should == 4
-      new_state = @cpu.state
-      state[:pc] += 1
-      state[:f] = state[:f] &amp; 0x01 | 0x12 # set 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 (state[:b] &amp; 0x0f == 0)
-      state[:f] |= 0x04 if (state[:b] == 0x80)
-      state[:b] -= 1
-      state[:b] = 255 if (state[:b] == -1)
-      @cpu.state.should == state
+  it &quot;should execute DEC r&quot; do
+    [0x05, 0x0d, 0x15, 0x1d, 0x25, 0x2d, 0x3d].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] = state[:f] &amp; 0x01 | 0x12 # set 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 (state[r] &amp; 0x0f == 0)
+        state[:f] |= 0x04 if (state[r] == 0x80)
+        state[r] -= 1
+        state[r] = 255 if (state[r] == -1)
+        @cpu.state.should == state
+      end
     end
   end
   
@@ -145,7 +149,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 DEC C&quot; # 0D
   it &quot;should execute RRCA&quot; # 0F
   it &quot;should execute DJNZ (PC+e)&quot; # 10 e
   it &quot;should execute LD DE,nn&quot; # 11 n n
@@ -158,19 +161,16 @@ describe Z80E do
   it &quot;should execute LD A,(DE)&quot; # 1A
   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 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
   it &quot;should execute INC HL&quot; # 23
   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 ADD HL,HL&quot; # 29
   it &quot;should execute LD HL,(nn)&quot; # 2A n n
   it &quot;should execute DEC HL&quot; # 2B
   it &quot;should execute INC L&quot; # 2C
-  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 (nn),A&quot; # 32 n n
@@ -184,7 +184,6 @@ describe Z80E do
   it &quot;should execute LD A,(nn)&quot; # 3A n n
   it &quot;should execute DEC SP&quot; # 3B
   it &quot;should execute INC A&quot; # 3C
-  it &quot;should execute DEC A&quot; # 3D
   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</diff>
      <filename>test/test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f691d9743b50962b7176e4e1153f2547644c456f</id>
    </parent>
  </parents>
  <author>
    <name>Dana Contreras</name>
    <email>dana@danadanger.org</email>
  </author>
  <url>http://github.com/DanaDanger/z80e/commit/d185eca05122c882630a362df77c3289557a5f3b</url>
  <id>d185eca05122c882630a362df77c3289557a5f3b</id>
  <committed-date>2009-07-05T04:11:27-07:00</committed-date>
  <authored-date>2009-07-05T04:11:27-07:00</authored-date>
  <message>generalized DEC B test for DEC r</message>
  <tree>8648ff91c42b166eaf87fdec3f1eebbc422fa484</tree>
  <committer>
    <name>Dana Contreras</name>
    <email>dana@danadanger.org</email>
  </committer>
</commit>
