From NES Hacker Wiki
Jump to: navigation, search
Set Decimal Flag
Opcode: SED
Operation: 1 → D
Status Register: Status-List.png

SED (Set Decimal Flag) set the Decimal Flag in the Processor Status Register by setting the 3rd bit 1. To clear the decimal flag, use CLD. Even though the NES doesn't use decimal mode, the opcodes to clear and set the flag do work, so if you need to store a bit, this acts as a free space.


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

SET_DECIMAL((1));             // Set the 3rd bit of the processor status to 1.

Addressing Modes

Addressing Mode Assembly Language Form Opcode # Bytes # Cycles
Implied SED F8 1 2