help me ca65 for snes

Discussion of hardware and software development for Super NES and Super Famicom.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Post Reply
User avatar
zgh4000
Posts: 29
Joined: Tue May 30, 2006 10:11 am

help me ca65 for snes

Post by zgh4000 » Sat Aug 26, 2006 3:48 pm

x816
.mem
.index

Ca65 Without these instructions!
help me!

example:
ldx #lable

error: range over

tepples
Posts: 21842
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples » Sat Aug 26, 2006 4:07 pm

The NES has a 6502, not a 65C02 or 65C816. Put the .p02 keyword at the top of source to specify that you are coding for a 6502.

The 6502 has only 8-bit registers. You'll need to load an address into two labels, using the < (get bits 7-0) and > (get bits 15-8) operators:

Code: Select all

  lda #<label
  sta 0
  lda #>label
  sta 1
  ldy
  lda (0),y
If you want Super NES help, please ask in SNESdev.

User avatar
zgh4000
Posts: 29
Joined: Tue May 30, 2006 10:11 am

Post by zgh4000 » Sat Aug 26, 2006 8:18 pm

Ca65 support 65816 !
"all valid 65618 mnemonics when in 65816 mode (after the .P816 command was given)."

B:\SFC开发>.\bin\ca65 --cpu 65816 demo.asm
demo.asm(14): Error: Range error (4660 not in [0..255])

User avatar
zgh4000
Posts: 29
Joined: Tue May 30, 2006 10:11 am

Post by zgh4000 » Sat Aug 26, 2006 8:57 pm

I already solved!
.A16
.A8
.I16
.I8

Post Reply