CPU::Emulator::6502::Op::STY - Store the Y register in memory


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

Index


Code Index:

NAME

Top

CPU::Emulator::6502::Op::STY - Store the Y register in memory

SYNOPSIS

Top

DESCRIPTION

Top

METHODS

Top

sty( $addr )

Stores the Y register in memory address $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::STY;

use strict;
use warnings;

use constant INSTRUCTIONS => {
    0x84 => {
        addressing => 'zero_page',
        cycles => 3,
        code => \&sty,
    },
    0x94 => {
        addressing => 'zero_page_x',
        cycles => 4,
        code => \&sty,
    },
    0x8c => {
        addressing => 'absolute',
        cycles => 4,
        code => \&sty,
    },
};

sub sty {
    my $self = shift;
    $self->RAM_write( shift, $self->registers->{ y } );
}

1;