[Coco] Assembler Question???

jdaggett at gate.net jdaggett at gate.net
Wed Sep 2 15:12:06 EDT 2009

On 2 Sep 2009 at 11:40, Darren A wrote:

> On 9/2/09, jdaggett at gate.net wrote:
> >
> > To better qualify what my question better is
> > what is the
> > binary code generated from a SUBA #1. My suspicion is;
> >
> > When SUBA #1 ( immedate mode)  is assembled and it is stored in binary form
> > as
> >
> > $80 $FF instead of $80 $01.
> >
> >
> ---
> No.  SUBA #1 is assembled to $80 $01.
> Darren


That is specifically what I wanted to know. I suspected that was the case after I looked at 
some HC11 code that stored the subtrahend byte not in 2's complement form. 

That means when data is routed through the CPU to portA of the ALU there would be a 
2's complementor at the input to do just that and then add. I know that in digital logic you 
can not subtract. Within the CPU you either have the data in 2's complement form prior 
to subtraction or you have to convert the subtrahend to 1's complement and leave the 
menuend in its binary form. Then you do an add and the carry becomes a borrow. 

So my querry is answered. Now onto my coding. 


More information about the Coco mailing list