Page 1 of 1

How to exactly compile with ASM6?

Posted: Thu May 10, 2018 2:04 pm
by Neship
So I want to disassemble a NES game (Ninja Gaiden) for the heck of it (and to test the little I know about 6502 language). I understand the "disassemble, create labels, reassemble, repeat" process, yet I can't start because this assembler doesn't want to do anything. (I have disassembled the whole thing with DISASM6).

1) It has this "unknown label" error for every "jsr _0000" mistake in the output the disassembler makes. I know disassemblers don't have to tell code from data, but this is not just a warning, it is just stopping the assembler from working. Anyways if I modify the instruction to not to point a wrong label, so the assembly was "succesful"...

2) When assembling the whole code, it only assembles the first 32 KB. I also know assemblers are not aware from banks and stuff, but if I split the banks to compile every 32/16 KB it says "uknown labels" again, but a lot more than usual.

So, how exactly should I use this assembler/disassembler? I also tried CA65 but it throws weird results when used with RENES.

Re: How to exactly compile with ASM6?

Posted: Thu May 10, 2018 2:09 pm
by lidnariq
Disasm6 only knows how to handle NROM (and other mappers without PRG banking) and UNROM. Ninja Gaiden is MMC1.

Perhaps try starting with nescom's clever-disasm instead?

Re: How to exactly compile with ASM6?

Posted: Thu May 10, 2018 2:37 pm
by Neship
Image

That's the problem with nescom. It doesn't identify the txt file that clever-disasm made (there's an extra option I should add?) although it produces a 0 KB output file, and neslink simply crashes.

Re: How to exactly compile with ASM6?

Posted: Thu May 10, 2018 2:52 pm
by lidnariq
You have to clever --asm ORIGINAL.NES [RULES.INI] to get something intended for reassembly.

Re: How to exactly compile with ASM6?

Posted: Thu May 10, 2018 3:07 pm
by Neship
What would go in rules.ini?

Re: How to exactly compile with ASM6?

Posted: Thu May 10, 2018 3:17 pm
by lidnariq
There's documentation and many examples in the download (in the "clever" directory)

Re: How to exactly compile with ASM6?

Posted: Thu May 10, 2018 3:38 pm
by Neship
The file I have downloaded have a readme.txt and a readme.html (https://bisqwit.iki.fi/source/nescom.html#download, I don't have Java so I took dev-win32 file), the latter document seems to tell how stuff inside the output can be managed, but barely anything related to the usage. Did I have downloaded the wrong thing?

Re: How to exactly compile with ASM6?

Posted: Thu May 10, 2018 5:26 pm
by lidnariq
... java? The other archives are "just" C++ source code...

Apparently bisqwit didn't package the examples and documentation in the binary build of 1.1.6 there. You can download the 1.1.6 source code for some examples, or the newest (1.1.8.1) source code for the documentation also.

Re: How to exactly compile with ASM6?

Posted: Thu May 10, 2018 7:08 pm
by dougeff
I wrote a disassembler for asm6, by the way. It's a python3 script.

https://github.com/nesdoug/NES-DISASSEMBLER

Re: How to exactly compile with ASM6?

Posted: Thu May 10, 2018 11:03 pm
by Neship
I thought it was Java because of the extensions, sorry about that ^^.

As for that python script,

IT WORKED!

Image
(Made a little palette change to test)

MANY THANKS! Thanks to you both for help me.
Well I think is up to me now to make good use of the code, but I'll try my best.

Re: How to exactly compile with ASM6?

Posted: Sat May 12, 2018 8:58 pm
by lidnariq
If it's 0kB then clever-disasm is not successfully disassembling anything. At smallest you should expect to see somewhere around 50kB.

I'd strongly recommend running clever-disasm without --asm until you've updated the ini file enough to see it generating correct output.