SEC

From NES Hacker Wiki
Jump to: navigation, search
Set Carry Flag
Opcode: SEC
Operation: 1 → C
Status Register: Status-List.png
Status-Ignore.pngStatus-Space.pngStatus-Ignore.pngStatus-Space.pngStatus-Set.pngStatus-Space.pngStatus-Ignore.pngStatus-Space.pngStatus-Ignore.pngStatus-Space.pngStatus-Ignore.png

SEC (Set Carry Flag) sets the Carry Flag in the Processor Status Register by setting the 0th bit 1. To clear the carry flag, use CLC.

Operation

This pseudo C code shows how the SEC opcode functions when it is executed.

SET_CARRY((1));               // Set the 0th bit of the processor status to 1.

Addressing Modes

Addressing Mode Assembly Language Form Opcode # Bytes # Cycles
Implied SEC 38 1 2

Examples