ADC $hhll, X
From C64-Wiki
Jump to navigationJump to searchMnemonic: | ADC $hhll, X | ||||||
2. Schreibweise: | {{{2. Schreibweise}}} | ||||||
Opcode: | $7D | ||||||
Operator(en): | $ll $hh | ||||||
Byte count: | 3 | ||||||
Command type: | Arithmetic- and logic command | ||||||
Address mode: | absolute X indexed | ||||||
register flags: | |||||||
Carry Flag | |||||||
Negative Flag | |||||||
Overflow Flag | |||||||
Zero Flag | |||||||
Cycles: | 4 | ||||||
1 cycle when crossing page boundary | |||||||
The assembler command ADC $hhll, X adds the content of memory location ($hhll + X) to the accumulator.
If the carry flag is set the result is incremented by one.
Therefore the carry flag should be cleared with CLC before an addition; unless the behaviour is intended.
The result is stored in the accumulator.
If the result is bigger than 255 ($ff) the carry flag is set as overflow bit.
Function flow
Explanation of the mnemonic shortcut
ADC | ADd with Carry |
Add accumulator with operator and carry flag |