NESASM3 - Using Multiple ASM files?

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
chemical
Posts: 2
Joined: Mon Jul 23, 2018 10:46 pm

NESASM3 - Using Multiple ASM files?

Post by chemical »

Hello,

I am working through Nerdy Nights right now, and everything is going well.

I am noticing my ASM code is starting to get rather long, is there a way to incorporate multiple ASM files so I can break my code out into multiple files?
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: NESASM3 - Using Multiple ASM files?

Post by tokumaru »

You can use the INCLUDE directive to "insert" the contents of a file into another (e.g. .include "otherfile.asm"). One common solution is to break up the program in several .asm files as you see fit (modules, functions, whatever), and have a main file that includes all the others to make a cohesive ROM.
chemical
Posts: 2
Joined: Mon Jul 23, 2018 10:46 pm

Re: NESASM3 - Using Multiple ASM files?

Post by chemical »

Awesome! Thank you, my code is so much easier to read now.
User avatar
Banshaku
Posts: 2417
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Re: NESASM3 - Using Multiple ASM files?

Post by Banshaku »

Great. Once you have something working then share it with the community ;)
Post Reply