Luigi301, on Fri Apr 29, 2005 7:34 PM, said:
I want to make games for the 2600. I know some x86 ASM, but 6502 ASM is a bit more confusing (somehow) than x86. Any tips on going from x86 to 6502 or PC arch to 2600 arch other than memory is gold?

First, let's assume 8086 for simplicity. This is what I know, or at least think. I could be wrong, so others feel free to correct me.
The 6502 has only three registers while 8086 has a bunch (I forget how many exactly.)
The 6502 has one interrupt, the 6507 has zero, the 8086 has 256 (?).
The 6502 can only move data 8 bits at a time. The 8086 can do 8 or 16 bit operations.
The 6502's hardware registers are memory mapped. The 8086's are not.
The 6502 has a flat memory model. The 8086 (IIRC) can do segemted memory, or maybe it was relocatable memory for code+data or something of that sort.
The 6502 has 16-bit addressing, the 8086=24 bit.
Flags are similar.
Both have stacks.
Both have interrupt/reset/NMI vectors.
Here's a few 8086 instructions and their closest 6502 analog. Not all 6502 instructions are represented.
8086 6502
____________
adc adc
add none
and and
call jsr
cbw none
cli cli
cwd none
cmp cmp
dec dec
div none
idiv none
imul none
in none
inc inc
int brk
iret rti
ja none
jae bcc
jb bcs
jbe none
je beq
jne bne
jg none
jge bpl
jl bmi
jle none
jmp jmp
lea none (?)
mov lda, ldx, ldy, sta, stx, sty, tax, tay, txa, tya
mul none
neg none
nop nop
not none
or ora
out none
pop pla
popf plp
push pha
pushf php
ret rts
sal asl (?)
sar lsr (?)
shl rol (?)
shr ror (?)
sbb sbc
sti sei
sub none
test bit
xor eor
This should get you started. Once you have the instructions down. it's time to learn addressing modes. Try reading some existing 6502 code first, then view the various modes on a website somewhere (google is your friend.)
Edited by batari, Fri Apr 29, 2005 9:11 PM.