[Coco] Clearing condition code register

James Dessart james at skwirl.ca
Sat Mar 26 23:24:34 EST 2005


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




More information about the Coco mailing list