Assembler/Linker Trouble

Discussion of hardware and software development for Super NES and Super Famicom.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Post Reply
Posts: 2
Joined: Tue Apr 16, 2019 11:46 am

Assembler/Linker Trouble

Post by KazutoB » Tue Apr 16, 2019 1:47 pm

So, I'm looking into giving SNES development a try, as it seems like a fun project, but, I'm having some trouble figuring out what tools to use/how to set them up.

Specifically, I'm having trouble with finding and using an Assembler/Linker. Looking around, I'm finding a lot of people recommending different tools and saying all the other tools are crap/buggy/unstable, without actually giving any info or examples on why that's the case. Now, that's pretty typical with software tools in my experience, so, whatever, but even when I decide to go grab a tool someone recommends, I cant figure out how to use it. The documentation for these assemblers seem to list features and change lists but no actual "Heres how you install and use this tool" section. Hell, the readme for Asar just straight up assumes you're familiar with Xkas and tells you to read THAT documentation if you aren't, but the documentation for Xkas as far as I can tell only lists specific commands you can use with it and what they do, and when i try opening the .exe for Xkas it just closes itself immediately. Am I using it wrong? Do I need to put it in a specific location? I don't know. The readme doesn't say. It's not very helpful, honestly.

It's probably worth noting that I've never used a standalone compiler before, so, if installation and use for these tools are fairly standard for compilers and they just expect the user to know how those work, that's where I'm falling behind. I've done a decent bit with programming before, especially C and C++, but the only compilers I've used are either built into the IDE I was using, such as Visual Studio's compiler, or I was working on a school computer where we were working in Unix/Linux and the compiler was already set up and working beforehand.

I've tried looking for tutorials on making SNES games that might go over what tools they use and how to set them up, but, mostly I've just found tutorials on making repro carts, tutorials for rom hacking, and tutorials on patching roms, where as I'm looking to start making roms from scratch. The two tutorials I have found for making roms from scratch seem pretty solid, but- they're writing their code in C and using a C compiler. While I do know some C and I like C++ a lot- I really want to use 65816 Assembly for this project, just to do it, really.

So, those of you that are making roms in Assembly- what Assemblers/Linkers do you recommend? Why do you like them better than alternatives you've tried? And could you provide or point to some instructions on how to set them up?

For reference; I'm running Windows 7 64-bit professional (I know I found at least one Assembler that only supported 32-bit Windows), and I'd like to use Notepad++ for writing my .ASM files. I'll be using emulators for actually running roms, probably higan unless I run into issues with it.

Thanks for your time!

User avatar
Posts: 2672
Joined: Fri May 08, 2015 7:17 pm
Location: DIGDUG

Re: Assembler/Linker Trouble

Post by dougeff » Tue Apr 16, 2019 2:37 pm

it just closes itself immediately.
Are you familiar with a command line app, also called a console app?

Typically, when you try to run one outside of a terminal it will immediately close.

it is a program without a graphic interface, and you need to open a command prompt (terminal) to use it.

I suggest you use either ca65 or WLA assemblers

there's references and tutorials here. -- blog/tutorial on programming for the NES

User avatar
Site Admin
Posts: 3819
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis

Re: Assembler/Linker Trouble

Post by Memblers » Tue Apr 16, 2019 3:01 pm

Yeah, that's pretty normal for there to be no installation. I can only speak about GCC and CC65, as those are the main tools I use outside of an IDE.

I know in the past, the MinGW GCC installer would add its /bin (EXE) folder to the PATH environment variable. That's an old throwback to the DOS days, so from the command-line, you could run an exe as if it exists in every directory. But that can get kinda hairy if you have a different version of the EXE in the folder you're running from.. When I installed MinGW on my new PC, it seems they're deprecating that. So what I do, is open a command window and run "set path=%PATH%;c:\mingw\bin". But I have to do that every time I launch the command prompt.

For cc65, there was never any kind of installer (that I know of). You just put it on your disk drive, then are expected to set the environment variables manually.

Here's a guide on setting the path in Windows:

If you use CC65 (what I'd recommend) and have it at C:\cc65, then you will add to the path "C:\cc65\bin". You probably won't need to do that though. I haven't set up Notepad++ for this before, but you should be able to make it launch the assembler and linker. You might need to make a batch file, and you could run the EXEs with the full path, like this (not a complete, working example):
c:\cc65\bin\ca65 source.asm
c:\cc65\bin\ld65 source.o

Posts: 2
Joined: Tue Apr 16, 2019 11:46 am

Re: Assembler/Linker Trouble

Post by KazutoB » Wed Apr 17, 2019 1:17 pm

Well I feel pretty stupid now. I guess I was just over thinking things. Thank you both for your help, and thanks for posting that link Dougeff; I had looked at that wiki before and somehow couldn't find the page on setting up a programming environment. In fact in another forum I had even found someone linking to that exact page but got a 404 when I clicked it. Maybe they changed the page index or something. Either way- you posting it made me look again and this time I found it.

For now I guess I'll give WLA a try and if it gives me trouble I know I've got several other options.

Post Reply