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

jdaggett at gate.net jdaggett at gate.net
Tue Nov 20 15:28:16 EST 2012


On 20 Nov 2012 at 14:21, Juan Castro wrote:

> Whoa, so do these increment and decrement the index register (to use
> the next pointer next time) or the memory pointer? Hummm, since it's a
> one byte increment it must be an increment to the memory pointer, it
> wouldn't be useful otherwise. Am I right?
> 
> But the question is valid for [,W++].
> 
> I'm having some 6502 feelings here. Such feelings are never good.


The pointer registers,(X,Y,S, and U) in indexed mode can be post incremented or 
predecremented by one or two. They can be used as counters or pointers to memory such as 
tables. This allows you to go up or down in a table. A very nice feature. You can load one or 
two bytes. 

Post increment will load or save at the current address in the pointer register then increment 
the sorce register be one or two depending on whether you want to advance the pointer by 
one or two. The predecrement will subtract one or two from the current value of the pointer 
register and then load or save depending on opcode selected. 


james



More information about the Coco mailing list