[Coco] 6502 to 6809 translation

John Kent jekent at optusnet.com.au
Tue Aug 2 06:35:07 EDT 2011



On 2/08/2011 4:22 PM, John Kent wrote:
>
> For  lda b,y  according to my VHDL 6809, B is sign extended so you are 
> right for an offset from 128 to 255 from a 16 bit base address you 
> will need to use D as the base address rather than B as a replacement 
> for Y so your sequence 3 I would say is correct. The thing is that D 
> is made up of A & B so when you load A you destroy the base address in 
> D but I guess you can reload it again later anyway.
>
> LDA data_addr, y  "data_addr" is a constant offset not a variable 
> address. I think the 6502 used direct page memory for the indirect 
> indexed addressing although it's a while since I looked at the 6502.

STA (FRED),Y becomes rather interesting

PSHS A
LDD FRED
LEAU D,Y
PULS A
STA ,U

yuck :-)

John.

-- 
http://www.johnkent.com.au
http://members.optusnet.com.au/jekent





More information about the Coco mailing list