Won't assemble correctly...

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

Post Reply
DementedPurple
Posts: 318
Joined: Mon Jan 30, 2017 5:20 pm
Location: Colorado USA

Won't assemble correctly...

Post by DementedPurple »

So yeah, when I assembled, the binary file it created was larger then the CHR bank and text file combined. the text file was 2k and the chr file was 8k, and when I assembled, I got a 40k Binary. As a matter of fact, I'll give you the code and CHR file to debug it. And when I opened it up in YY-CHR, it had a lot of unused space, and I mean a lot. When you open it with a hex editor, most of the 40k is just $00. Why it assembled this way? I have no clue.
Attachments
New WinZip File.zip
(4.63 KiB) Downloaded 109 times
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Won't assemble correctly...

Post by tokumaru »

DementedPurple wrote:the text file was 2k and the chr file was 8k, and when I assembled, I got a 40k Binary.
This is correct. Text and binary 6502 code are 2 completely different things. Not only that, but NES ROMs need padding to fill the entire ROM chip in order to be valid.
And when I opened it up in YY-CHR, it had a lot of unused space, and I mean a lot.
Padding. As you write more code, the empty space will reduce, but if you're assembling a program with 32KB of PRG-ROM, the entire space must be reserved, whether you're using it or not, otherwise the resulting ROM file won't be valid.
DementedPurple
Posts: 318
Joined: Mon Jan 30, 2017 5:20 pm
Location: Colorado USA

Re: Won't assemble correctly...

Post by DementedPurple »

Okay, now my code does literally nothing at all. Just to make sure, I did a simple program that loads the number 5 into the accumulator and it won't even do that. It does nothing at all.
User avatar
Quietust
Posts: 1920
Joined: Sun Sep 19, 2004 10:59 pm
Contact:

Re: Won't assemble correctly...

Post by Quietust »

DementedPurple wrote:Okay, now my code does literally nothing at all. Just to make sure, I did a simple program that loads the number 5 into the accumulator and it won't even do that. It does nothing at all.
Perhaps you could explain to us, in detail, exactly how it was that you came to this conclusion.
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Won't assemble correctly...

Post by tokumaru »

Source code?
DementedPurple
Posts: 318
Joined: Mon Jan 30, 2017 5:20 pm
Location: Colorado USA

Re: Won't assemble correctly...

Post by DementedPurple »

I'm going to comment it better when I have access to my computer.
DementedPurple
Posts: 318
Joined: Mon Jan 30, 2017 5:20 pm
Location: Colorado USA

Re: Won't assemble correctly...

Post by DementedPurple »

I think I found a glitch when looking through my code, I'll respond if it still doesn't work.
Post Reply