Difference between revisions of "CLC"

From NES Hacker Wiki
Jump to: navigation, search
 
Line 11: Line 11:
 
}}
 
}}
  
'''''CLC (Clear Carry Flag)''''' clears the [[Carry Flag]] in the [[Processor Status Register]] by setting the 0th bit 0. To set the carry flag, use [[SEC]].
+
'''''CLC (Clear Carry Flag)''''' clears the [[Carry Flag]] in the [[Processor Status Register]] by setting the 0th bit 0. To set the carry flag, use [[SEC]]. Clearing the carry flag should be done prior to any instruction that might set it where you might need to read the carry flag's value after the instruction.
  
 
==Operation==
 
==Operation==

Latest revision as of 09:05, 28 January 2019

Clear Carry Flag
Opcode: CLC
Operation: 0 → C
Status Register: Status-List.png
Status-Ignore.pngStatus-Space.pngStatus-Ignore.pngStatus-Space.pngStatus-Clear.pngStatus-Space.pngStatus-Ignore.pngStatus-Space.pngStatus-Ignore.pngStatus-Space.pngStatus-Ignore.png

CLC (Clear Carry Flag) clears the Carry Flag in the Processor Status Register by setting the 0th bit 0. To set the carry flag, use SEC. Clearing the carry flag should be done prior to any instruction that might set it where you might need to read the carry flag's value after the instruction.

Operation

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

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

Addressing Modes

Addressing Mode Assembly Language Form Opcode # Bytes # Cycles
Implied CLC 18 1 2

Examples