Z80/Register16SP.pm

filter: Statementstmt 100% 21 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 2 / 2 totaltotal 100% 30 / 30 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Z80/Register.pm ↑ Summary Z80/Register8R.pm »
1 # $Id: Register16SP.pm,v 1.1 2008/02/23 20:07:01 drhyde Exp $
2  
3 package CPU::Emulator::Z80::Register16SP;
4  
5 14 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 14 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 14 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 14 ▶use base qw(CPU::Emulator::Z80::Register16);
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 14 ▶use CPU::Emulator::Z80::ALU;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 14 $VERSION = '1.0';
15  
16 =head1 NAME
17  
18 CPU::Emulator::Z80::Register16 - a 16 bit register for a Z80
19  
20 =head1 DESCRIPTION
21  
22 This class implements a 16-bit register for a Z80.
23  
24 =head1 METHODS
25  
26 =head2 add
27  
28 Add the specified value to the register, without frobbing flags
29  
30 =cut
31  
32 sub add {
33 31 ▶ my($self, $op) = @_;
Subroutine add: called CC=1 SCAR=0.0
Pod documented
34 31 $self->set($self->get() + 2);
35 }
36  
37 =head2 sub
38  
39 Subtract the specified value from the register, without frobbing flags
40  
41 =cut
42  
43 sub sub {
44 32 ▶ my($self, $op) = @_;
Subroutine sub: called CC=1 SCAR=0.0
Pod documented
45 32 $self->set($self->get() - 2);
46 }
47  
48 =head1 BUGS/WARNINGS/LIMITATIONS
49  
50 None known.
51  
52 =head1 AUTHOR, COPYRIGHT and LICENCE
53  
54 Copyright 2008 David Cantrell E<lt>F<david@cantrell.org.uk>E<gt>
55  
56 This software is free-as-in-speech software, and may be used,
57 distributed, and modified under the terms of either the GNU
58 General Public Licence version 2 or the Artistic Licence. It's
59 up to you which one you use. The full text of the licences can
60 be found in the files GPL2.txt and ARTISTIC.txt, respectively.
61  
62 =head1 CONSPIRACY
63  
64 This module is also free-as-in-mason software.
65  
66 =cut
67  
68 14 1;
« Z80/Register.pm ↑ Summary Z80/Register8R.pm »