assembly - ADDC versus ADD -


i'm trying figure out difference between addc , add instructions 8051 microcontrollers.

description: description: add , addc both add value operand value of accumulator, leaving resulting value in accumulator. value operand not affected. add , addc function identically except addc adds value of operand value of carry flag whereas add not add carry flag result.

how addc "add carry flag result"? result in accumulator, how add carry flag it?

currently, see it, here how work:

mov a, #0xff add a, #0x01   

the result of a = 0x01 , c = 1

with addc,

mov a, #0xff addc a, #0x01   

the result of a = 0x01 , c = 1

maybe tests not right or something. can explain difference between add , addc?

it's value of carry flag before addition relevant. addc includes in sum while add doesn't.

addc x, y stores x + y + carry in x.

add stores x + y in x.

the purpose of allow chained addition on multi-word "big integers." accomplished adding each word least significant. using addc ensures carries previous additions carried next-higher significant word.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -