liveBook · Manning

CLC

As explained in Classic Game Programming on the NES: Make your own retro video game

CLC is a 6502 instruction that clears the processor's carry flag.

CLC clears the processor’s carry flag. Place it before ADC when starting an addition so an old carry value cannot change the result. section 4.1.1

Start an addition

The sequence clc, lda #$01, adc #$05 resets carry, loads 1 into A, and adds 5, producing A=$06. section 4.1.1

Listing 4.1 Adding with carry
clc              #1
adc <source>

Use the annotated instruction listing to see CLC immediately before ADC. section 4.1.1

How Classic Game Programming on the NES: Make your own retro video game covers it

How deep it goes
Defines CLC and demonstrates its placement before ADC, stopping short of broader carry-flag behavior.
Examples
Uses direct-value addition, including LDA #$01 followed by ADC #$05 and the result A=$06.
What it assumes
Assumes familiarity with the A register and ADC while demonstrating the carry-reset step explicitly.
What you can do after
Apply CLC before ADC to begin an 8-bit addition without an unwanted prior carry.
How it connects
Connects CLC to the carry flag, the A register, and ADC addressing forms.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Classic Game Programming on the NES: Make your own retro video game. The section links point to the parts of the book it draws on.