[Coco] What's wrong with the 6809 Y Register?

jdaggett at gate.net jdaggett at gate.net
Tue Oct 11 22:37:21 EDT 2005


Tony

Since there are more than 256 opcodes in the 6809 opcode map, Motorola had to 
find a means of designating opcodes that were on page 2 and page 3. This was 
done be assigning two opcodes in the base 256 opcode map as page switches, $10 
and $11. These are often called "prebytes" but in actual they are specific opcodes 
that instruct the CPU to do another instruction fetch and tell it what page it is  on. 
This is unique way of doing things but when y ou start to study the opcodes and 
instruction set it becomes quite clear as to why they did it that way. One case in 
point LDX and LDY share the same opcodes. $6E, $7E, $8E and $9E. LDY is 
preceeded with $10 and that along with the next byte opcode tell the CPU to do a 
load and the page 2 switch directs which register is the destination register. 

The load,  store and compare opcodes using the Y register are two byte instructions. 
The first being the page 2 opcode $10 and then the opcode for the actual command. 
The usage of the Y register adds a cycle to the overall time. This is not so critical 
unless you are in a very tight timing constraints that needs to save as much time as 
needed. Often known as cycle counting. 

The Y register becomes a very useful pointer. So unless you are pushed for time, 
use the X register. 

james

On 11 Oct 2005 at 15:18, Tony Cappellini wrote:

Date sent:      	Tue, 11 Oct 2005 15:18:46 -0700
To:             	coco at maltedmedia.com
From:           	Tony Cappellini <tony at tcapp.com>
Subject:        	[Coco] What's wrong with the 6809 Y Register?
Send reply to:  	CoCoList for Color Computer Enthusiasts <coco at maltedmedia.com>
	<mailto:coco-request at maltedmedia.com?subject=unsubscribe>
	<mailto:coco-request at maltedmedia.com?subject=subscribe>

> 
> 
> During an interview with Chet Simpson about Digger II, in Nick
> Marentes' book CocoNuts,  Chet states "The Y register was avoided at
> all costs"
> 
> What is the problem with using the Y register?
> 
> 
> -- 
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco





More information about the Coco mailing list