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

jdaggett at gate.net jdaggett at gate.net
Tue Nov 20 16:03:18 EST 2012


On 20 Nov 2012 at 9:14, Harry Hurst wrote:

> One thing I've found, that may not be in your book, Darren, is that the
> supposedly "not allowed" modes [,R+] and [,-R] are actually functional on
> the 68B09E. They are "not allowed" in every reference I could find, and
> yet they work

The post increment and predecrement by one of the pointer registers are allowed in indexed 
mode but not in indexed indirect mode. Please reread and understand what indexed indirect 
mode is all about. 

Also there is a quirk in LEAx opdoce in indexed mode with auto increment. If you implement 
LEAX, X+ or LEAX, X++ the X register remains unchanged and one or two in not added to 
the pointer register. This is true for all four pointer registers. This is because how the 6809 
calculated the EA before doing the auto increment. In indexed mode it is better to use LEAX 
2,X instead for a two byte post increment. Also the LEAX and LEAY opcodes do affect the Z 
bit in the status register. LEAS and LEAU do not. This keeps backward compatibility with the 
6800 INX, INY, DECX, and DECY opcodes. 

james



More information about the Coco mailing list