NesASM 3.01 addressing and syntax errors

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

Post Reply
User avatar
Petruza
Posts: 311
Joined: Mon Dec 22, 2008 10:45 pm
Location: Argentina

NesASM 3.01 addressing and syntax errors

Post by Petruza »

I've got NesASM 3.01 from here: http://www.nespowerpak.com/nesasm/
Not the .exe since I use MacOS, but built the sources.

I'm coding a simple CPU test, and get this errors:

Code: Select all

   67  00:C02B                    STX $0,Y
       Incorrect addressing mode!

  105  00:C056                    STA ($0,X)
       Syntax error in expression!
Isn't STX ##, Y a valid instruction and addressing mode? ( opcode $96 )

And what's the syntax error in STA($0,X) ?
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: NesASM 3.01 addressing and syntax errors

Post by tokumaru »

Petruza wrote:And what's the syntax error in STA($0,X) ?
Doesn't NESASM use '[' and ']' for indirection?
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: NesASM 3.01 addressing and syntax errors

Post by tokumaru »

Petruza wrote:Isn't STX ##, Y a valid instruction and addressing mode? ( opcode $96 )
Just remembered: I think NESASM doesn't use ZP addressing by default (since STX ####, Y doesn't exist you get an error), you have to use '<' before the address to indicate that you want it treated that way.
User avatar
Petruza
Posts: 311
Joined: Mon Dec 22, 2008 10:45 pm
Location: Argentina

Post by Petruza »

Ooops!
Neither the docs nor the example codes had any indirection example, so I guessed ()
Gonna try, thanks!
tomaitheous
Posts: 592
Joined: Thu Aug 28, 2008 1:17 am
Contact:

Post by tomaitheous »

Does NESASM have the bug where if a single instruction crosses over an 8k region it will error out on a bank overflow?
User avatar
Memblers
Site Admin
Posts: 3901
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Post by Memblers »

tomaitheous wrote:Does NESASM have the bug where if a single instruction crosses over an 8k region it will error out on a bank overflow?
Yes, but I'm not sure about v3.01. It's a really annoying feature, since almost no one uses 8kB banks.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Memblers wrote:[Enforcement of 8192 byte ROM areas is] a really annoying feature, since almost no one uses 8kB banks.
Yet. This will change if bunnyboy ever finishes his MMC3 on a CPLD. In fact, when I first read about NESASM's 8 KiB bank model, I thought it was because of the MMC3, not because of the assembler's PC Engine heritage.
tomaitheous
Posts: 592
Joined: Thu Aug 28, 2008 1:17 am
Contact:

Post by tomaitheous »

tepples wrote:
Memblers wrote:[Enforcement of 8192 byte ROM areas is] a really annoying feature, since almost no one uses 8kB banks.
Yet. This will change if bunnyboy ever finishes his MMC3 on a CPLD. In fact, when I first read about NESASM's 8 KiB bank model, I thought it was because of the MMC3, not because of the assembler's PC Engine heritage.
I always thought PCEAS was a modified version of NESASM, not the other way around. Though... NESASM appears to use Hudson's NES/FC 6502 assembler syntax.
Post Reply