[Coco] Assembler Question???

jdaggett at gate.net jdaggett at gate.net
Thu Sep 3 14:36:34 EDT 2009


On 2 Sep 2009 at 20:33, Robert Gault wrote:

> jdaggett at gate.net wrote:
> > 
> > Steve
> > 
> > It is not the SUB command that I was querrying. What the main inquiry was if the 
> > assembler converted a binary number and stored it as a 2's compliment or not.
> > 
> > I used it because if my assumption were true, then that would be the most likely 
> > command to do it with. There is no way that I know of in logic gates to make a subtractor 
> > other than by taking the subtrahend and converting it to its 2's complement and then 
> > add. You can do the same with 10's complementer and then add decimal to do decimal 
> > subtraction and so forth and so forth. 
> > 
> > james
> > 
> 
> There was a poor example in my first message but regards the assembler 
> vs the ALU ....
> 
>   ADDA #-1   gives $8B $FF
>   SUBA #1    gives $80 $01
> 
> and the other pair
> 
>   ADDA #1    gives $8B $01
>   SUBA #-1   gives $80 $FF
> 
> In short, the assembler uses twos complimentary notation but does not 
> convert subtractions into additions.
> 

Robert

Thanks. What that tells me is that negative numbers are represented as their 2's 
compliment. 

james





More information about the Coco mailing list