| Games-NES-Emulator documentation | Contained in the Games-NES-Emulator distribution. |
CPU::Emulator::6502::Op::ORA - Logical OR memory with accumulator
Logical OR $addr with the accumulator.
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::ORA; use strict; use warnings; use constant INSTRUCTIONS => { 0x09 => { addressing => 'immediate', cycles => 2, code => \&ora, }, 0x05 => { addressing => 'zero_page', cycles => 3, code => \&ora, }, 0x15 => { addressing => 'zero_page_x', cycles => 4, code => \&ora, }, 0x0D => { addressing => 'absolute', cycles => 4, code => \&ora, }, 0x0D => { addressing => 'absolute_x', cycles => 4, code => \&ora, }, 0x19 => { addressing => 'absolute_y', cycles => 4, code => \&ora, }, 0x01 => { addressing => 'indirect_x', cycles => 6, code => \&ora, }, 0x11 => { addressing => 'indirect_y', cycles => 5, code => \&ora, }, };
sub ora { my $self = shift; my $reg = $self->registers; $reg->{ acc } |= $self->memory->[ shift ]; $self->set_nz( $reg->{ acc } ); }
1;