[Coco] Assembler Question???
Darren A
mechacoco at gmail.com
Wed Sep 2 13:36:51 EDT 2009
On 9/2/09, jdaggett at gate.net wrote:
> To the list:
>
> I have started looking at two FPGA cores for the 6809 in altering one of
> them to handle
> 6309 opcodes and stumbled across a potential issue. As far as I can
> remember the
> Motorola Freeware Assemblers treat subtraction as adding the 2's compliment
> of the
> subtrahend. Also I seem to remember that is how the internal workings of the
> MC6809
> is. There is actually no subtractor but the assemly code has the 2's
> compliment of the
> subtrahend and does addition.
>
> If this is so then, the ALU becomes simpler when doing a FPGA core.
>
---
Another thing to keep in mind is that the Carry flag is affected
differently for ADD and SUB. Consider the following examples:
CLRA
SUBA #1
CLRA
ADDA #$FF
Both will leave $FF in accumulator A, but SUB will set the Carry flag
and ADD will not.
Darren
More information about the Coco
mailing list