CPU::Emulator::6502::Op::JMP - Jump


Games-NES-Emulator documentation Contained in the Games-NES-Emulator distribution.

Index


Code Index:

NAME

Top

CPU::Emulator::6502::Op::JMP - Jump

SYNOPSIS

Top

DESCRIPTION

Top

METHODS

Top

jmp( $addr )

Jump to $addr.

AUTHOR

Top

Brian Cassidy <bricas@cpan.org>

COPYRIGHT AND LICENSE

Top

SEE ALSO

Top

* CPU::Emulator::6502

Games-NES-Emulator documentation Contained in the Games-NES-Emulator distribution.
package CPU::Emulator::6502::Op::JMP;

use strict;
use warnings;

use constant INSTRUCTIONS => {
    0x4C => {
        addressing => 'absolute',
        cycles => 3,
        code => \&jmp,
    },
    0x6C => {
        addressing => 'indirect',
        cycles => 5,
        code => \&jmp,
    }
};

sub jmp {
    my $self = shift;
    $self->registers->{ pc } = shift;
}

1;