Z80/Register8R.pm

filter: Statementstmt 100% 17 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 100% 23 / 23 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Z80/Register16SP.pm ↑ Summary
1 # $Id: Register8R.pm,v 1.2 2008/02/22 02:08:08 drhyde Exp $
2  
3 package CPU::Emulator::Z80::Register8R;
4  
5 15 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 15 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 15 ▶use vars qw($VERSION $AUTOLOAD);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 15 ▶use base qw(CPU::Emulator::Z80::Register8);
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 15 $VERSION = '1.0';
13  
14 =head1 NAME
15  
16 CPU::Emulator::Z80::Register8R - the R register for a Z80
17  
18 =head1 DESCRIPTION
19  
20 This class is a ...::Register8 with a weird inc() method
21  
22 =head1 METHODS
23  
24 It has the same methods as its parent, with the following changes:
25  
26 =head2 inc
27  
28 The inc() method operates on the least significant 7 bits of the
29 register only.
30  
31 =cut
32  
33 sub inc {
34 2562 ▶ my $self = shift;
Subroutine inc: called CC=1 SCAR=0.0
Pod documented
35 2562 my $r = $self->get();
36 2562 $self->set(($r & 0b10000000) | (($r + 1) & 0b01111111));
37 }
38  
39 =head1 BUGS/WARNINGS/LIMITATIONS
40  
41 None known.
42  
43 =head1 AUTHOR, COPYRIGHT and LICENCE
44  
45 Copyright 2008 David Cantrell E<lt>F<david@cantrell.org.uk>E<gt>
46  
47 This software is free-as-in-speech software, and may be used,
48 distributed, and modified under the terms of either the GNU
49 General Public Licence version 2 or the Artistic Licence. It's
50 up to you which one you use. The full text of the licences can
51 be found in the files GPL2.txt and ARTISTIC.txt, respectively.
52  
53 =head1 CONSPIRACY
54  
55 This module is also free-as-in-mason software.
56  
57 =cut
58  
59 15 1;
« Z80/Register16SP.pm ↑ Summary