line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: Register16SP.pm,v 1.1 2008/02/23 20:07:01 drhyde Exp $ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package CPU::Emulator::Z80::Register16SP; |
4
|
|
|
|
|
|
|
|
5
|
13
|
|
|
13
|
|
70
|
use strict; |
|
13
|
|
|
|
|
23
|
|
|
13
|
|
|
|
|
586
|
|
6
|
13
|
|
|
13
|
|
72
|
use warnings; |
|
13
|
|
|
|
|
24
|
|
|
13
|
|
|
|
|
378
|
|
7
|
|
|
|
|
|
|
|
8
|
13
|
|
|
13
|
|
2024
|
use vars qw($VERSION); |
|
13
|
|
|
|
|
32
|
|
|
13
|
|
|
|
|
559
|
|
9
|
|
|
|
|
|
|
|
10
|
13
|
|
|
13
|
|
66
|
use base qw(CPU::Emulator::Z80::Register16); |
|
13
|
|
|
|
|
23
|
|
|
13
|
|
|
|
|
1130
|
|
11
|
|
|
|
|
|
|
|
12
|
13
|
|
|
13
|
|
193
|
use CPU::Emulator::Z80::ALU; |
|
13
|
|
|
|
|
22
|
|
|
13
|
|
|
|
|
2641
|
|
13
|
|
|
|
|
|
|
|
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
|
|
|
31
|
1
|
372
|
my($self, $op) = @_; |
34
|
31
|
|
|
|
|
144
|
$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
|
|
|
32
|
1
|
381
|
my($self, $op) = @_; |
45
|
32
|
|
|
|
|
145
|
$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 EFE |
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
|
|
|
|
|
|
|
1; |