nesdev.com
http://forums.nesdev.com/

How to exactly compile with ASM6?
http://forums.nesdev.com/viewtopic.php?f=5&t=17342
Page 1 of 1

Author:  Neship [ Thu May 10, 2018 2:04 pm ]
Post subject:  How to exactly compile with ASM6?

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.

Author:  lidnariq [ Thu May 10, 2018 2:09 pm ]
Post subject:  Re: How to exactly compile with ASM6?

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?

Author:  Neship [ Thu May 10, 2018 2:37 pm ]
Post subject:  Re: How to exactly compile with ASM6?

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.

Author:  lidnariq [ Thu May 10, 2018 2:52 pm ]
Post subject:  Re: How to exactly compile with ASM6?

You have to clever --asm ORIGINAL.NES [RULES.INI] to get something intended for reassembly.

Author:  Neship [ Thu May 10, 2018 3:07 pm ]
Post subject:  Re: How to exactly compile with ASM6?

What would go in rules.ini?

Author:  lidnariq [ Thu May 10, 2018 3:17 pm ]
Post subject:  Re: How to exactly compile with ASM6?

There's documentation and many examples in the download (in the "clever" directory)

Author:  Neship [ Thu May 10, 2018 3:38 pm ]
Post subject:  Re: How to exactly compile with ASM6?

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?

Author:  lidnariq [ Thu May 10, 2018 5:26 pm ]
Post subject:  Re: How to exactly compile with ASM6?

... 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.

Author:  dougeff [ Thu May 10, 2018 7:08 pm ]
Post subject:  Re: How to exactly compile with ASM6?

I wrote a disassembler for asm6, by the way. It's a python3 script.

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

Author:  Neship [ Thu May 10, 2018 11:03 pm ]
Post subject:  Re: How to exactly compile with ASM6?

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.

Author:  lidnariq [ Sat May 12, 2018 8:58 pm ]
Post subject:  Re: How to exactly compile with ASM6?

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.

Page 1 of 1 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/