What can I do about this error?

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

Moderator: Moderators

User avatar
Sivak
Posts: 316
Joined: Tue Jul 17, 2007 9:04 am
Location: Somewhere
Contact:

What can I do about this error?

Post by Sivak »

The error: Out of range, bank offset > $1FFF!

I'm assuming this means I have too much code or something... But I thought I had a lot more space than what I have... A whole bunch of the nes rom has 0's in it...

One "fix" I've attempted:

Code: Select all

.bank 0
.org $C000
That is basically above my constants section, which I have at the bottom of my code. Basically messages, palette defines, etc. Though that doesn't seem to work. Is there something I need to do when trying to reference that area?
User avatar
never-obsolete
Posts: 403
Joined: Wed Sep 07, 2005 9:55 am
Location: Phoenix, AZ
Contact:

Post by never-obsolete »

expand your rom to 32k prg. i never figured out how to get past 16k with (i'm assuming) nesasm back when i used it. bunnyboy might be able to tell you.
. That's just like, your opinion, man .
User avatar
Zepper
Formerly Fx3
Posts: 3264
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Post by Zepper »

$C000-$FFFF mirrors $8000-$BFFF, as far as I know; that's why you got that error.
User avatar
Sivak
Posts: 316
Joined: Tue Jul 17, 2007 9:04 am
Location: Somewhere
Contact:

Post by Sivak »

Right now, the only "fix" I have done is to just comment out a bunch of my .db statements. Mainly the text ones in screens I don't need to see.

I also got rid of that .org $C000 as that makes it compile and not work. Heh.

So... Could it be that I have way too many .db's in there? I have quite a few messages I write to the player and use the .db to simplify the tasks. I'd be kind of amazed if I had too many instructions as the SMB1 disasm has like 4X the code my program does.
bunnyboy
Posts: 449
Joined: Thu Oct 27, 2005 1:44 pm
Location: CA
Contact:

Post by bunnyboy »

NESASM does everything in 8KB banks, so you just need to tell it to use more banks. If you have a section that is too big (for example if bank 0 had 10KB) then you can skip the next bank declaration (bank 1) and it should automatically overflow into there. I know that works for data, assume it works for code. Be sure to change your ines header to 2x 16KB prg too.

Code: Select all

  .bank 0
  .org $8000
  (8KB code/data)

  .bank 1
  .org $A000
  (8KB code/data)

  .bank 2
  .org $C000
  (8KB code/data)
  
  .bank 3
  .org $E000
  (8KB code/data)

  .bank 4
  (8KB chr graphics)
User avatar
Sivak
Posts: 316
Joined: Tue Jul 17, 2007 9:04 am
Location: Somewhere
Contact:

Post by Sivak »

Alright. We figured it out. I had used up my first 8KB bank from $C000 to $DFFF. I just needed to declare a new one starting at $E000

No problems now. :)
doppelganger
Posts: 183
Joined: Tue Apr 05, 2005 7:30 pm

Post by doppelganger »

Hey, here's an idea.

Get a different assembler, preferably one that doesn't suck donkey balls.
Be whatever the situation demands.
NotTheCommonDose
Posts: 523
Joined: Thu Jun 29, 2006 7:44 pm
Location: lolz!

Post by NotTheCommonDose »

I AM ERROR! lol :roll:
User avatar
blargg
Posts: 3717
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Post by blargg »

Get a different assembler, preferably one that doesn't suck donkey balls.
You know, I get really tired of the non-technical content on this board. nesasm wins over others for a few reasons, two being that you can write examples as one source file, and that the source code is available to compile for any operating system. Until you, or any of the others who rip on nesasm every damn time it's mentioned, can offer an alternative, STFU.
Celius wrote:You know, you should probably get a different assembler. NESASM is known for not being very good, so I reccomend getting one of the more common ones around here, such as WLA-DX or CA65.
Or even better, offer technical reasons about the best choice of assembler for a task. Saying that something is good/bad merely hides the technical reasons why that particular individual prefers one over the other. It's little use to know what you like/dislike, unless you share the reasons why. nesasm is apparently(?) hardwired for 8K banks, so if you are using larger banks/none, it will apparently require you to carefully separate your data. So if you're working on a larger project that doesn't use 8K banks, another assembler would be appropriate.
Last edited by blargg on Sun Dec 30, 2007 1:00 am, edited 2 times in total.
Celius
Posts: 2159
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius »

doppelganger wrote:Hey, here's an idea.

Get a different assembler, preferably one that doesn't suck donkey balls.
Was the crude approach really neccesary? You could've said:

You know, you should probably get a different assembler. NESASM is known for not being very good, so I reccomend getting one of the more common ones around here, such as WLA-DX or CA65.

Also, the way you said it makes it sound like an attack or something, so the listener probably won't be thinking as much about how they should go get a different assembler as they will be about how they should ignore the vulgar post they just read.

EDIT:
blargg wrote: Or even better, offer technical reasons about the best choice of assembler for a task. Saying that something is good/bad merely hides the technical reasons why that particular individual prefers one over the other. It's little use to know what you like/dislike, unless you share the reasons why. nesasm is apparently(?) hardwired for 8K banks, so if you are using larger banks/none, it will apparently require you to carefully separate your data. So if you're working on a larger project that doesn't use 8K banks, another assembler would be appropriate.
I'm actually starting to agree with you on the NESASM bashing. I know I've done my fair share of it, I will not deny that. I at least offered a little bit of an explanation why I don't prefer it. But bashing it every time it's mentioned is uncalled for. Saying you shouldn't use it because someone doesn't like it (or because it "sucks donkey balls") just is completely useless and uninformative.

And useless posts are getting rather annoying.
NotTheCommonDose wrote:I AM ERROR! lol :roll:
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

blargg wrote:nesasm wins over others for a few reasons, two being that you can write examples as one source file
I'll grant that. CA65 needs two source files: one .s file and one linker script file, but a sample linker script comes with the docs package.
and that the source code is available to compile for any operating system.
So is CA65.
User avatar
Sivak
Posts: 316
Joined: Tue Jul 17, 2007 9:04 am
Location: Somewhere
Contact:

Post by Sivak »

Well, the only reason I'm using NESASM is because I could get it to work and because it's my first program ever and the step-by-step tutorial on how to set things up was useful.

I took an assembly class last semester and we used MASM in there, so a lot of assembly-related concepts are similar here.

But anyway, as I had said, the issue's been resolved by using my second bank that spans from $E000-$FFF9. I didn't know about it until talking to bunnyboy.
bunnyboy
Posts: 449
Joined: Thu Oct 27, 2005 1:44 pm
Location: CA
Contact:

Post by bunnyboy »

Celius wrote:You know, you should probably get a different assembler. NESASM is known for not being very good, so I reccomend getting one of the more common ones around here, such as WLA-DX or CA65.
Except as discussed in another topic, the only significant reason NESASM is not good is no temporary labels. Everyone claims it sucks, but have no technical reasons. WLA-DX and CA65 may be more common but using them would not have solved this problem. It likely would have created more problems related to code layout earlier, since setting those tends to be more tricky without examples.
Celius
Posts: 2159
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius »

bunnyboy wrote:
Celius wrote:You know, you should probably get a different assembler. NESASM is known for not being very good, so I reccomend getting one of the more common ones around here, such as WLA-DX or CA65.
Except as discussed in another topic, the only significant reason NESASM is not good is no temporary labels. Everyone claims it sucks, but have no technical reasons. WLA-DX and CA65 may be more common but using them would not have solved this problem. It likely would have created more problems related to code layout earlier, since setting those tends to be more tricky without examples.
That was only an example of rewording a crude post, not actually what I wanted to let the person using NESASM know. I wasn't trying to establish that someone should switch assemblers, I was trying to establish that saying something "sucks donkey balls" is uncalled for, and that that person should've approached saying what they were trying to say in a more proffesional manner.
bunnyboy
Posts: 449
Joined: Thu Oct 27, 2005 1:44 pm
Location: CA
Contact:

Post by bunnyboy »

I am sorry, I missed your "what you could have said" part. I actually pulled it out of blarggs post, my bad!
Post Reply