| Games-NES-Emulator documentation | Contained in the Games-NES-Emulator distribution. |
CPU::Emulator::6502::Op::INC - Increment by one
Increments the value at $addr by 1.
Brian Cassidy <bricas@cpan.org>
Copyright 2007 by Brian Cassidy
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Games-NES-Emulator documentation | Contained in the Games-NES-Emulator distribution. |
package CPU::Emulator::6502::Op::INC; use strict; use warnings; use constant INSTRUCTIONS => { 0xE6 => { addressing => 'zero_page', cycles => 5, code => \&inc, }, 0xF6 => { addressing => 'zero_page_x', cycles => 6, code => \&inc, }, 0xEE => { addressing => 'absolute', cycles => 6, code => \&inc, }, 0xFE => { addressing => 'absolute_x', cycles => 7, code => \&inc, }, };
sub inc { my $self = shift; my $reg = $self->registers; my $temp = $self->memory->[ shift ]; $temp++; $self->RAM_write( $temp ); $self->set_nz( $temp ); }
1;