[Coco] Assembler Question???

Robert Gault robert.gault at worldnet.att.net
Wed Sep 2 20:33:37 EDT 2009

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.

More information about the Coco mailing list