What is the most popular assembler used for NES?

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

Moderator: Moderators

Post Reply
User avatar
greatkreator
Posts: 49
Joined: Wed Dec 09, 2015 2:18 pm

What is the most popular assembler used for NES?

Post by greatkreator » Sat Oct 26, 2019 2:19 pm

What is the most popular assembler used for NES?

User avatar
NOOPr
Posts: 67
Joined: Tue Feb 27, 2018 10:41 am
Location: Brazil
Contact:

Re: What is the most popular assembler used for NES?

Post by NOOPr » Sat Oct 26, 2019 2:28 pm

Don't know for sure, but i guess it is ca65 ... second asm6

User avatar
greatkreator
Posts: 49
Joined: Wed Dec 09, 2015 2:18 pm

Re: What is the most popular assembler used for NES?

Post by greatkreator » Sat Oct 26, 2019 4:07 pm

Thanks! I will try them.

User avatar
tokumaru
Posts: 11559
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: What is the most popular assembler used for NES?

Post by tokumaru » Sat Oct 26, 2019 8:16 pm

The top 3 are definitely ca65, NESASM and ASM6. Here's a quick summary of all 3:

NESASM: common among beginners, due to it having been used in a popular tutorial series (Nerdy Nights). It's a very straightforward assembler, takes assembly code as input and outputs a binary ROM file. Uses non-standard syntax for some things, and has a few weird bugs/quirks that sometimes creates problems that are hard to debug.

ASM6: Just as straightforward as NESASM, also taking assembly code and spitting out a binary file. Has very few built-in functionalities, only covering the basics. Being a multi-pass assembler means it offers a lot of versatility when it comes to organizing banks and variables. Also has it's share of little bugs/quirks, but these are normally less problematic than the ones in NESASM.

ca65: The most "professional" one. After the assembly step, it needs to link the intermediary code in order to generate the final binary, which requires a memory configuration file, which is normally what you use to define the ROM/RAM layout. Has a very extensive set of built-in directives and an advanced macro system that combined allow the implementation of all sorts of custom functionalities. Some versatility is lost sure to the fact it's a single pass assembler.

I personally avoid NESASM, use ASM6 for small programs and quick tests, and ca65 for bigger projects, but I'm still not 100% satisfied with this combination. Ideally I'd like something between ASM6 and ca65, with a decent number of useful directives and functions, but not so strict about ROM/RAM organization.

Oziphantom
Posts: 808
Joined: Tue Feb 07, 2017 2:03 am

Re: What is the most popular assembler used for NES?

Post by Oziphantom » Wed Oct 30, 2019 11:09 pm

maybe 64tass, you can just set up sections, and then send things to it, this way you can make 'procs' and then just put them in BANK0 BANK1 etc. ZP
It basically has a built in linker and it is N pass, so you can do some voodoo with it. http://tass64.sourceforge.net/

nitrofurano
Posts: 10
Joined: Sun Mar 21, 2010 3:07 pm

Re: What is the most popular assembler used for NES?

Post by nitrofurano » Sat Jan 04, 2020 4:39 am

what do you all think about dasm?

calima
Posts: 1070
Joined: Tue Oct 06, 2015 10:16 am

Re: What is the most popular assembler used for NES?

Post by calima » Sat Jan 04, 2020 5:18 am

Literally neverheard.

User avatar
gauauu
Posts: 674
Joined: Sat Jan 09, 2016 9:21 pm
Location: Central Illinois, USA
Contact:

Re: What is the most popular assembler used for NES?

Post by gauauu » Sat Jan 04, 2020 4:11 pm

Dasm is really popular in the Atari 2600 community. I've used it.... It's fine. I prefer ca65 for NES stuff primarily because of how the segments and linker work, but dasm is a nice usable simple assembler.

turboxray
Posts: 57
Joined: Thu Oct 31, 2019 12:56 am

Re: What is the most popular assembler used for NES?

Post by turboxray » Sat Jan 04, 2020 4:30 pm

Do any other the assemblers, besides nesasm, support including binary files and then setting destination address to overwrite part of them?

lidnariq
Posts: 9127
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: What is the most popular assembler used for NES?

Post by lidnariq » Sat Jan 04, 2020 4:40 pm

XA65 is specifically designed for that use case.

User avatar
rainwarrior
Posts: 7734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: What is the most popular assembler used for NES?

Post by rainwarrior » Tue Jan 07, 2020 10:27 am

turboxray wrote:
Sat Jan 04, 2020 4:30 pm
Do any other the assemblers, besides nesasm, support including binary files and then setting destination address to overwrite part of them?
ca65 has an incbin directive that lets you include part of a binary file. Using segments to place them at the correct location, you can replace the middle of a binary file with a patch:

Code: Select all

.segment "BIN1"
.incbin "bank.bin", 0, $9500 - $8000

.segment "PATCH"
; patch code goes here

.segment "BIN2"
.incbin "bank.bin", $A000 - $8000, $C000 - $A000
Alternatively, what I tend to prefer to this is to use ca65 to output an IPS file directly, rather than a new NES ROM, then just use a command line IPS patcher in my build step to make the ROM. It ends up looking something like this:

Code: Select all

.segment "HEADER"
.ascii "PATCH"

.segment "PATCH1_HEADER"
PATCH1_POS = $9500 - $8000
.import __PATCH1_SIZE__
.byte PATCH1_POS >> 16
.byte >PATCH1_POS
.byte <PATCH1_POS
.byte >__PATCH1__SIZE__
.byte <__PATCH1__SIZE__

.segment "PATCH1"
; patch code goes here
; remember to use 'define = yes' in the segment definition

.segment "FOOTER"
.ascii "EOF"
A third method I've found useful is to use the da65 tool to disassemble the whole bank, so you can just edit the code more directly. (example)

Post Reply