68HC11 Microcontroller

View: New views
3 Messages — Rating Filter:   Alert me  

68HC11 Microcontroller

by stewartraymond :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Question:

Accumulator A contains $FF, and the C flag is cleared. If a DECA instruction is executed, the Z flag will be ____________________.


Re: 68HC11 Microcontroller

by zoltan-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Thu, 26 Mar 2009, stewartraymond wrote:

> Question:
>
> Accumulator A contains $FF, and the C flag is cleared. If a DECA
> instruction is executed, the Z flag will be ____________________.


Cleared. DECA subtracts 1 from accumulator A and sets the Z flag if the
result is 0, clears it otherwise. ff - 1 is fe, a non-zero value
therefore the Z flag will be cleared. The value of the C flag before the
instruction is irrelevant and the instruction will not change it.


Zoltan


Re: 68HC11 Microcontroller

by John Hartman (NoICE) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

At 10:24 PM 3/25/09, you wrote:
>Question:
>Accumulator A contains $FF, and the C flag is cleared. If a DECA
>instruction is executed, the Z flag will be ____________________.

Worth 5 points on your mid-term exam?

You might consider looking in the processor databook.  You will need
to do so many times in your engineering career.
You might consider using a debugger and single-stepping a DECA to see
what happens.  You will need to do so many times in your engineering
career.  Especially when it turns out that the databook is wrong...


[Non-text portions of this message have been removed]