How to exactly compile with ASM6?

You can talk about almost anything that you want to on this board.

Moderator: Moderators

Post Reply
Neship
Posts: 5
Joined: Thu May 10, 2018 12:14 pm

How to exactly compile with ASM6?

Post by Neship » Thu May 10, 2018 2:04 pm

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.

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

Re: How to exactly compile with ASM6?

Post by lidnariq » Thu May 10, 2018 2:09 pm

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?

Neship
Posts: 5
Joined: Thu May 10, 2018 12:14 pm

Re: How to exactly compile with ASM6?

Post by Neship » Thu May 10, 2018 2:37 pm

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.

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

Re: How to exactly compile with ASM6?

Post by lidnariq » Thu May 10, 2018 2:52 pm

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

Neship
Posts: 5
Joined: Thu May 10, 2018 12:14 pm

Re: How to exactly compile with ASM6?

Post by Neship » Thu May 10, 2018 3:07 pm

What would go in rules.ini?

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

Re: How to exactly compile with ASM6?

Post by lidnariq » Thu May 10, 2018 3:17 pm

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

Neship
Posts: 5
Joined: Thu May 10, 2018 12:14 pm

Re: How to exactly compile with ASM6?

Post by Neship » Thu May 10, 2018 3:38 pm

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?

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

Re: How to exactly compile with ASM6?

Post by lidnariq » Thu May 10, 2018 5:26 pm

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

User avatar
dougeff
Posts: 2599
Joined: Fri May 08, 2015 7:17 pm
Location: DIGDUG
Contact:

Re: How to exactly compile with ASM6?

Post by dougeff » Thu May 10, 2018 7:08 pm

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

https://github.com/nesdoug/NES-DISASSEMBLER
nesdoug.com -- blog/tutorial on programming for the NES

Neship
Posts: 5
Joined: Thu May 10, 2018 12:14 pm

Re: How to exactly compile with ASM6?

Post by Neship » Thu May 10, 2018 11:03 pm

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.

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

Re: How to exactly compile with ASM6?

Post by lidnariq » Sat May 12, 2018 8:58 pm

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.

Post Reply