Branch Coverage

blib/lib/CPU/Emulator/DCPU16/Assembler.pm
Criterion Covered Total %
branch 46 62 74.1


line true false branch
74 8 38 unless length $line
85 0 38 unless defined $op
87 8 30 if defined $label
90 2 36 if ($oc = $_EXTENDED_OPS{$op}) { }
36 0 elsif ($oc = $_OPS{$op}) { }
91 0 2 unless defined $a and not defined $b
93 0 2 unless defined $val
98 2 0 if defined $label
100 2 0 if defined $next_word
103 0 36 unless defined $a and defined $b
106 0 36 unless defined $val_a
108 0 36 unless defined $val_b
112 8 28 if defined $label_a or defined $label_b
115 3 33 if defined $next_word_a
116 17 19 if defined $next_word_b
126 20 5 if $num =~ /^0x/i
135 26 48 if (0 <= index($regs, $op)) { }
3 45 elsif ($op =~ /^\[\s*([$regs])\s*\]$/) { }
2 43 elsif ($op =~ /^\[\s*($nums)\s*\+\s*([$regs])\s*\]$/) { }
1 42 elsif ($op eq 'POP' or $op =~ /^\[\s*SP\+\+\s*\]$/) { }
0 42 elsif ($op eq 'PEEK' or $op =~ /^\[\s*\-\-SP\s*\]$/) { }
0 42 elsif ($op eq 'PUSH') { }
0 42 elsif ($op eq 'SP') { }
9 33 elsif ($op eq 'PC') { }
0 33 elsif ($op eq 'O') { }
3 30 elsif ($op =~ /^\[\s*($nums)\s*\]$/) { }
20 10 elsif ($op =~ /^($nums)$/) { }
10 0 elsif ($op =~ /\w+/) { }
157 13 7 $num < 32 ? :
173 0 10 unless @labels
178 0 10 unless defined $resolved