[Coco] 6X09 Assembly Newbies.

Roger Taylor rtaylor at bayou.com
Fri Jan 16 16:58:02 EST 2004


At 12:15 PM 1/16/2004 -0800, you wrote:
I have NO intention of starting something seperate from the list.  I just 
wanted to know if there are others out there who are interested in learning 
6X09 assembly.
>I would be interested as what is considered a good common starting point 
>for us newbies though.  Maybe we could focus on a common problem/project 
>and work on it.


I think a good starting point would be the memory access instruction 
modes.  It doesn't take long at all to figure out what LDA 2000 means, 
which copies the 8-bit data at address 2000 into the A register, and it's 
fairly easy to understand how the Direct Page mode works by limiting your 
memory access to address 0-255 ($00-$FF), but takes into account the CPU's 
DP register and uses that for  the upper byte (MSB) of this address to form 
a 16-bit address; but indexed operations are the real fun.

The following 5 examples end up doing the same thing in the end...

1)

lda 2000

2)

ldx #0
lda 2000,x

3)

addy equ 2000
lda addy,pcr

4)

lda #7
tfr a,dp
lda <208

5)

addy equ 2000
leax addy,pcr
lda ,x


Knowing that there's probably 10-20 different ways to do a single task in 
assembly, this should help ease any intimidation anybody might have.  I 
guess a newbie exercise could be to figure out exactly what is happening in 
each example.


----------
Roger Taylor






More information about the Coco mailing list