[Coco] Clearing condition code register

jdaggett at gate.net jdaggett at gate.net
Sun Mar 27 15:20:46 EST 2005


James

The ANDCC and ORCC instructions on the 6809 are there to give 
some backward ability of the old 6800 CLC, CLI, SEC,  and SEI. 
The 6809 instructions take one machine cycle more than the 6800 
instrructions did. 

The COM instruction will always set the Carry bit. The NEG will set 
the carry bit if there is a borrow, otherwise it is cleared.

james


On 26 Mar 2005 at 23:24, James Dessart wrote:

From:           	James Dessart <james at skwirl.ca>
Subject:        	Re: [Coco] Clearing condition code register
Date sent:      	Sat, 26 Mar 2005 23:24:34 -0500
To:             	CoCoList for Color Computer Enthusiasts 
<coco at maltedmedia.com>
Send reply to:  	CoCoList for Color Computer Enthusiasts 
<coco at maltedmedia.com>
	<mailto:coco-
request at maltedmedia.com?subject=unsubscribe>
	<mailto:coco-
request at maltedmedia.com?subject=subscribe>

> 
> On 26-Mar-05, at 11:09 PM, Robert Gault wrote:
> 
> > If you want regA preserved, then how about using regB. COMB and CLRB
> > will produce the same results.
> 
> B might be in use. It's part of the implementation of the sdcc
> backend, and registers might be allocated already, so rather than
> complicate the logic, I'll simply use andcc #FEh, which clears the
> carry bit without affecting anything else. It's one extra byte and
> cycle, so unless it gets used a lot, I don't think it'll make much
> difference.
> 
> I'll see if it entails more code and time, but my guess is that it
> wont. There's only one place in the backend where it's used, and it's
> a sub-case of greater-or-less-than comparison.
> 
> James
> 
> 
> -- 
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco





More information about the Coco mailing list