[Coco] Assembler Question???
6809er at bjork-huffman.net
Wed Sep 2 18:36:40 EDT 2009
As many have pointed out the SUB command's Immediate data is the real
number. (Not already 2's complimented.)
There are many reason for doing this...
First, the SUB command does not just use the Immediate data addressing
mode but other modes to get the number. Just think, you want need to
run 2's compliment on ever bit of data that used with the SUB command.
Also, self modifying code would not work with the SUB command.
You will need to do the extra work to make a complete SUB command.
By the way, most older 8 bit CPU only had one ALU for both addressing
and accumulator registers. When the could put more stuff on a chip,
they added one or more ALUs for address calculations to speed up
instructions. (Less clock states.)
Oh yes, the Great PDP-8 Mini Main Frame computer had NO SUB command.
Even the 6800 had more instructions and addressing modes.
The good old days when men were men and coders went crazy!
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.
More information about the Coco