File Coverage

blib/lib/CPU/Emulator/Z80/Register16SP.pm
Criterion Covered Total %
statement 19 19 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod 2 2 100.0
total 28 28 100.0


line stmt bran cond sub pod time code
1             package CPU::Emulator::Z80::Register16SP;
2              
3 15     15   86 use strict;
  15         29  
  15         370  
4 15     15   63 use warnings;
  15         25  
  15         347  
5              
6 15     15   60 use vars qw($VERSION);
  15         25  
  15         465  
7              
8 15     15   62 use base qw(CPU::Emulator::Z80::Register16);
  15         29  
  15         1330  
9              
10 15     15   93 use CPU::Emulator::Z80::ALU;
  15         27  
  15         2276  
11              
12             $VERSION = '1.01';
13              
14             =head1 NAME
15              
16             CPU::Emulator::Z80::Register16 - a 16 bit register for a Z80
17              
18             =head1 DESCRIPTION
19              
20             This class implements a 16-bit register for a Z80.
21              
22             =head1 METHODS
23              
24             =head2 add
25              
26             Add the specified value to the register, without frobbing flags
27              
28             =cut
29              
30             sub add {
31 31     31 1 318 my($self, $op) = @_;
32 31         84 $self->set($self->get() + 2);
33             }
34              
35             =head2 sub
36              
37             Subtract the specified value from the register, without frobbing flags
38              
39             =cut
40              
41             sub sub {
42 32     32 1 324 my($self, $op) = @_;
43 32         108 $self->set($self->get() - 2);
44             }
45              
46             =head1 BUGS/WARNINGS/LIMITATIONS
47              
48             None known.
49              
50             =head1 AUTHOR, COPYRIGHT and LICENCE
51              
52             Copyright 2008 David Cantrell EFE
53              
54             This software is free-as-in-speech software, and may be used,
55             distributed, and modified under the terms of either the GNU
56             General Public Licence version 2 or the Artistic Licence. It's
57             up to you which one you use. The full text of the licences can
58             be found in the files GPL2.txt and ARTISTIC.txt, respectively.
59              
60             =head1 CONSPIRACY
61              
62             This module is also free-as-in-mason software.
63              
64             =cut
65              
66             1;