NAME
CPU::Emulator::Z80::Register16 - a 16 bit register for a Z80
DESCRIPTION
This class implements a 16-bit register for a Z80.
METHODS
new
Returns an object. Takes two or three named parameters:
- cpu
-
mandatory, a reference to the CPU this register lives in, mostly so that operations on the register can get at the flags register.
and either of:
- value
-
The value to initialise the register to;
or
- get, set
-
Subroutines to call when getting/setting the register instead of the default get/set methods. The 'get' subroutine will be passed no parameters, the 'set' subroutine will be passed the new value. Consequently, they are expected to be closures if they are to be of any use.
get
Get the register's current value.
set
Set the register's value to whatever is passed in as a parameter.
add
Add the specified value to the register, frobbing flags
sub
Subtract the specified value from the register.
inc, dec
These use the implementation from the parent class
BUGS/WARNINGS/LIMITATIONS
None known.
AUTHOR, LICENCE and COPYRIGHT
Copyright 2008 David Cantrell <david@cantrell.org.uk>
This module is free-as-in-speech software, and may be used, distributed, and modified under the same terms as Perl itself.
CONSPIRACY
This module is also free-as-in-mason software.