EmbeddedRelated.com
Forums

Accumulator A - INCA - C flag

Started by stewartraymond March 31, 2009
The contents of Accumulator A are $FF, and the C flag is cleared. An INCA instruction is executed, the C flag will be ____________________.

1. set
2. cleared
3. cannot be determined
4. added to Accumulator A, so that it contains $01

On Prima Aprilis contents of flag C indeed depends on what will be in A
after INCA instruction. It does depend even more on what was in A before
INCA. Open CPU12 reference manual, Instruction Questionary, INCA, and you
will see triangle in corresponding to C flag CCR details box. Which, as
22.19 Condition Code Changes states, means that it's hard to predict C
value....

----- Original Message -----
From: "stewartraymond"
To: <6...>
Sent: Wednesday, April 01, 2009 3:49 AM
Subject: [68HC12] Accumulator A - INCA - C flag
> The contents of Accumulator A are $FF, and the C flag is cleared. An INCA
> instruction is executed, the C flag will be ____________________.
>
> 1. set
> 2. cleared
> 3. cannot be determined
> 4. added to Accumulator A, so that it contains $01
>
>
In "Core User Guide" (S12CPU15UG V1.2) about INCA instruction, only N, Z and
V flags are affected, not C...
I read :
"The C bit is not affected by the operation, thus allowing the INC
instruction to be used as a loop counter in multiple precision computation".

So, the answer is "5", an answer you didn't write, that means "unchanged".

In order to verify my answer, I wrote code and test this, and it's OK : C
remain unchanged.

Joel

-----Message d'origine-----
De: 6... [mailto:6...] De la part de
Edward Karpicz
Envoy mercredi 1 avril 2009 06:10
: 6...
Objet: Re: [68HC12] Accumulator A - INCA - C flag

On Prima Aprilis contents of flag C indeed depends on what will be in A
after INCA instruction. It does depend even more on what was in A before
INCA. Open CPU12 reference manual, Instruction Questionary, INCA, and you
will see triangle in corresponding to C flag CCR details box. Which, as
22.19 Condition Code Changes states, means that it's hard to predict C
value....

----- Original Message -----
From: "stewartraymond"
To: <6...>
Sent: Wednesday, April 01, 2009 3:49 AM
Subject: [68HC12] Accumulator A - INCA - C flag
> The contents of Accumulator A are $FF, and the C flag is cleared. An INCA
> instruction is executed, the C flag will be ____________________.
>
> 1. set
> 2. cleared
> 3. cannot be determined
> 4. added to Accumulator A, so that it contains $01
>
>