[Coco] 6309/6809 opcodes with mixed 8/16 bit registers

jdaggett at gate.net jdaggett at gate.net
Tue Nov 20 16:29:38 EST 2012


On 20 Nov 2012 at 15:49, Luis Antoniosi wrote:

> It's is limited but I can think some ways where it would be useful.
> Like sub-string search where you can compare 2 first characters
> instead of one. If there is a mismatch, it will continue on the next
> byte on string, and not next word. Supose you want to find all CR/LF
> in a text file.
> 

You can do it in indexed mode only. In indexed indirect mode it may or may not work the way 
you want it to.I forgot the the [] are for indexed indirect mode for most assemblers. The LEA 
opcodes calculate an effective address and then loads. In indexed mode there can be no 
offset, 5 bit offset, a byte offset or a word offset. In indexed Indirect mode the next two bytes 
loaded is the address where the offset is located to be used in calculating the EA(Effective 
Address). That will be a byte or a word depending on the post byte opcode. IF you did a 
single post increment or single predecrement then you have a horrible issue with pointing to 
the wrong location in memory. The only way I could see where a single byte auto 
increment/decrement would work is if the DP register were to be involved. This would then 
only be limited to direct page access. I guess that option seemed not necessary or to difficult 
to implement in logic back then.

Been a while since I did any 6809 assembly programming. Sorry for the mix up. Had to 
reread indexed and indexed indirect mode. 


You have to think of the post byte in indexed mode as a second opcode. In fact in most 
opcodes that use a post byte the post byte is often a second opcode. 

james
 





More information about the Coco mailing list