There's also the solution of rolling your own assembler for 6502, which may have advantages. Assembling 6502 doesn't require many resouces, and even dynamic languages like Python, Ruby, Perl, and .NET are more than capable. Furthermore, you could easily download a 6502 assembler already built in one of these languages and update the code to make creating NES specific machine code easier, such as building out the banked memory, building spritesheets, etc... There are plenty of advantages in rolling out your own 6502 assembler.
I recently created my own 6502 assembler, and it's about 150 lines of code or so, it's made in Python and uses a OP_CODE table and a regular expression table to make the code very compact, I compared the generated machiine code with code generated by the nicely made
http://6502asm.com/ assembler and simulator to confirm my assembly was working correctly.
I also created a 6502 emulator/VM, but that is much much more work, as you need to handle all the op_codes, and make sure that your code executes them reliably. But, I am proud to say, that my implementation here also works nice, it uses a nice class system, and each op-code is coded as a class method... eg:
Code:
class CPU(object):
def op_0x0c(self):
p = self.fetch()
...
def run():
while self.running:
op = hex(self.fetch())
try:
getattr(self, 'op_%s' % op)()
except:
...
This is just some example code I wrote off the top of my head, but shows the basic priniple of how I wrote the emulator code. It makes the code very readable and easy to locate specific op codes, if there are any weird runtime issues. I love Python for doing this sort of introspection on objects.
I have a more primitive assembler/VM for a fiction processor on my bitbucket here:
https://bitbucket.org/kveroneau/simple-cpuI also have a very very basic assember/VM for a learning tool called a CARDIAC here:
https://bitbucket.org/kveroneau/pythone ... at=defaultMore info on a CARDIAC:
https://www.cs.drexel.edu/~bls96/museum/cardiac.htmlIn fact, I highly recommend checking out the CARDIAC, as it's a great teaching tool for understanding how microprocessors fundamentally work.