Branch Coverage

blib/lib/CPU/Emulator/Z80.pm
Criterion Covered Total %
branch 223 236 94.4


line true false branch
103 1287 27 if (exists $args{'memory'}) { }
104 1285 2 if (&blessed($args{'memory'})) { }
2 0 elsif (not ref $args{'memory'}) { }
106 0 1285 unless $args{'memory'}->isa("CPU::Emulator::Memory")
119 3 1311 if (exists $args{'ports'}) { }
121 1 2 unless $args{'ports'} == 256 or $args{'ports'} == 65536
128 28885 1 unless exists $args{"init_$register"}
209 200 453 $half eq 'high' ? :
215 126 379 $half eq 'high' ? :
241 1 26 if exists $self->{'inputs'}{$address}
248 42 0 if (exists $self->{'inputs'}{$addr}) { }
269 1 9 if exists $self->{'outputs'}{$address}
276 21 0 if (exists $self->{'outputs'}{$addr}) { }
305 2721 126183 $r eq '(HL)' ? :
317 1 2 if (@_)
734 1 2 if (_interrupts_enabled($self))
743 3 8 unless defined $toggle
750 1344 2 if @_
758 1 3392 if ($self->{'NMI'}) { }
1 3391 elsif ($self->{'INTERRUPT'}) { }
770 6 3386 if ($self->{'STOPREACHED'})
787 4485 512 unless $self->_got_prefix(203) and $self->_got_prefix(221) || $self->_got_prefix(253)
796 1606 3391 if (ref $self->{'instr_length_table'}{$byte})
810 0 3391 if $bytes_to_fetch eq "UNDEFINED"
821 3391 1 if (exists $self->{'instr_dispatch_table'}{$instr} and ref $self->{'instr_dispatch_table'}{$instr} and &reftype($self->{'instr_dispatch_table'}{$instr}) eq 'CODE') { }
826 347 3044 if $self->_got_prefix(221)
827 344 3047 if $self->_got_prefix(253)
829 344 3047 if $self->_got_prefix(253)
830 347 3044 if $self->_got_prefix(221)
850 6 6 $cond eq 'P' ? :
262 12 $cond eq 'PE' ? :
6 274 $cond eq 'PO' ? :
8 280 $cond eq 'Z' ? :
8 288 $cond eq 'NZ' ? :
8 296 $cond eq 'C' ? :
8 304 $cond eq 'NC' ? :
877 6 24 if $r2 eq "(HL)"
885 224 161 if (defined $d and $r ne '(HL)') { }
887 32 32 $self->_got_prefix(221) ? :
64 160 if $realr =~ /^[HL]$/
894 112 112 if $value
897 224 0 if $r eq "(HL)"
900 48 113 if $r eq "(HL)"
904 81 80 if $value
907 48 113 if $r eq "(HL)"
915 128 72 if defined $d
917 136 64 if $r eq "(HL)"
927 128 72 if (defined $d)
936 9 292 if $r2 eq "(HL)"
946 15 0 $op eq '^' ? :
271 15 $op eq '|' ? :
15 286 $op eq '&' ? :
969 0 67 if $r2 eq "Z"
970 23 44 if $r2 eq "(HL)"
995 3 273 if $r eq "(HL)"
997 3 273 if $r eq "(HL)"
1025 265 3 if ($bREG->get)
1036 3 18 if $r eq "(HL)"
1038 3 18 if $r eq "(HL)"
1057 15 1 if $self->register("BC")->get
1071 7 1 if $self->register("BC")->get
1094 3 1 if $self->register("BC")->get and $self->register("Z")->get
1108 7 1 if $self->register("BC")->get and $self->register("Z")->get
1183 297 2 unless defined $byte
1185 259 40 if $r eq "(HL)"
1211 4 770 if (defined $d and $r2 eq '(HL)' and $r1 =~ /^[HL]$/) { }
4 776 elsif (defined $d and $r1 eq '(HL)' and $r2 =~ /^[HL]$/) { }
1212 2 2 $self->_got_prefix(221) ? :
1214 2 2 $self->_got_prefix(221) ? :
1218 42 732 if ($r1 eq "(HL)" or $r2 eq "(HL)")
1222 21 753 if ($r2 eq "(HL)")
1226 21 753 if ($r1 eq '(HL)') { }
1306 56 40 if (defined $d and $r ne '(HL)') { }
1307 8 8 $self->_got_prefix(221) ? :
16 40 if $r =~ /^[HL]$/
1310 56 0 if $r eq "(HL)"
1311 56 0 if $r ne "A"
1313 56 0 if $r ne "A"
1314 56 0 if $r eq "(HL)"
1317 12 28 if $r eq "(HL)"
1318 36 4 if $r ne "A"
1320 36 4 if $r ne "A"
1321 12 28 if $r eq "(HL)"
1342 2 2 $self->_got_prefix(253) ? :
2 4 $self->_got_prefix(221) ? :
6 18 if $r =~ /^[HL]$/
1351 2 2 $self->_got_prefix(253) ? :
2 4 $self->_got_prefix(221) ? :
6 18 if $r =~ /^[HL]$/
1360 14 10 if (defined $d and $r ne '(HL)') { }
1362 2 2 $self->_got_prefix(221) ? :
4 10 if $realr =~ /^[HL]$/
1371 3 7 if $r eq "(HL)"
1374 3 7 if $r eq "(HL)"
1388 14 10 if (defined $d and $r ne '(HL)') { }
1390 2 2 $self->_got_prefix(221) ? :
4 10 if $realr =~ /^[HL]$/
1400 3 7 if $r eq "(HL)"
1404 3 7 if $r eq "(HL)"
1418 14 10 if (defined $d and $r ne '(HL)') { }
1420 2 2 $self->_got_prefix(221) ? :
4 10 if $realr =~ /^[HL]$/
1432 3 7 if $r eq "(HL)"
1438 3 7 if $r eq "(HL)"
1452 14 10 if (defined $d and $r ne '(HL)') { }
1454 2 2 $self->_got_prefix(221) ? :
4 10 if $realr =~ /^[HL]$/
1467 3 7 if $r eq "(HL)"
1474 3 7 if $r eq "(HL)"
1509 2 4 if ($f->getC == $row[0] and $row[2] eq '.' || $f->getH == $row[2] and sprintf("%x", $a->get >> 4 & 15) =~ /^[$row[1]]$/ and sprintf("%x", $a->get & 15) =~ /^[$row[3]]$/)
1515 1 1 $f->getN ? :
1521 1 1 unless $n
1522 1 1 if $n and not $h
1523 0 2 if $n and $h
1626 1 1 if $self->register("B")->get
1632 1 1 if $self->register("B")->get
1656 2 1 if $self->register("B")->get
1662 2 1 if $self->register("B")->get