[Coco] ANDCC
jdaggett at gate.net
jdaggett at gate.net
Tue Jun 12 15:33:40 EDT 2007
On 12 Jun 2007 at 10:25, Ries, Rich (S&FS) wrote:
> I always found "ANDCC #nn"/"ORCC #nn" to be a royal pain. Why should I
> need to remember where the various bits are positioned in the micro?
> Isn't that the type of thing the computer is good at?
>
**************
The 6800 had a set and clear instruction for three of the 6 bits of the CCR. They
were:
CLI SEI
CLC SEC
CLV SEV
To do so with each bit of the 6809 CCR bits would require 8 instructions. The
designers felt that one instruction for clear "ANDCC" and one for SET "ORCC"
would be more flexable than having 8 different opcodes. All you have to do is
remember to clear you and the appropriate bits with a logic "0". To set you or with
a logic "1".
> A nice assembler would recognize "SETCC N" or "CLRCC OV" and translate
> it into the proper hex codes. Honestly, in all my years of micro
> programming, I cannot remember needing to set or clear more than one
> bit of the PSW/CC at a time.
>
*****************
Yes it would be nice to have the assembler torecognize psuedo codes for
clearing and setting each bit of the CCR. Then again you are back to what the
designers got away with in the first place. Also you face the potential of having
code that can be assembled by only one assembler.
> I guess an "almost nice" assembler would have macros with parameters,
> to allow creation of SETCC and CLRCC macros.
>
That is why it is nice to use a macro assembler. That way if your heart desires,
you write a macro and have at it.
james
More information about the Coco
mailing list