Luigi301 Posted April 30, 2005 Share Posted April 30, 2005 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? Quote Link to comment Share on other sites More sharing options...
+batari Posted April 30, 2005 Share Posted April 30, 2005 (edited) 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? 846685[/snapback] 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 April 30, 2005 by batari Quote Link to comment Share on other sites More sharing options...
Tom Posted April 30, 2005 Share Posted April 30, 2005 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. Relocatable code (as long as you don't use far calls/jumps) was just a lame excuse to have a memory model as braindead as the 8086's Actually, if you do know your way around assembly programming, you should be fine with these tutorials on the 6502: http://www.6502.org/tutorials Quote Link to comment Share on other sites More sharing options...
danwinslow Posted April 30, 2005 Share Posted April 30, 2005 At first I thought the 6502 was brain dead due to lack of registers. Then I realized that the entire page 0 ( first 256 bytes of ram ) is nothing *but* registers. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.