This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

I need some info about those NES assemblers.

I need some info about those NES assemblers.
by on (#122125)
Well here's some problems about some assemblers.
I'm working on a hack project, and my source code relies on a disassembly source which should be compiled with x816.

First to note: My source uses directives like .db instead of .byte, and uses <Addr16 and >Addr16 for high and lo bytes of a 16-bit value.
So here are results from some assemblers:
NESASM: Doesn't recognize < and >; Seems to use LSR A instead of LSR; says the symbol A is reserved.
x816: Runs out of memory since it operates on 16-bit DOS.
ca65: It doesn't recognize .db etc.

So here's the problem:
1: The x816 runs out of memory on compiling a 3000-line source file. How to prevent this?
2: Does any other assembler use the same syntax as x816?

Thanks.


Edit: The x816 works now, but it seems to generate syntax as SNES programs. How to generate NES programs with it?
Re: I need some info about those NES assemblers.
by on (#122127)
Most syntax differs in very minor ways; try using search-and-replace in your favorite text editor.
Re: I need some info about those NES assemblers.
by on (#122129)
w7n wrote:
Well here's some problems about some assemblers.
I'm working on a hack project, and my source code relies on a disassembly source which should be compiled with x816.

Nowadays it would have been done with da65, which generates ca65 source, but at the time, x816 was probably the best choice.

Quote:
NESASM: Doesn't recognize < and >; Seems to use LSR A instead of LSR; says the symbol A is reserved.

I use ca65 which recognizes both LSR and LSR A.

Quote:
ca65: It doesn't recognize .db etc.

If you know how to program in Python, you could write a tool to fix the biggest syntax differences. You might want to start from nesasm2ca65, which I wrote for the Action 53 volume 1 source code package so that I could squeeze Munchie Attack into unused space in LAN Master's PRG bank.
Re: I need some info about those NES assemblers.
by on (#122130)
I think the standard is to use LSL A (same with LSR, ROL, ROR, and for 65C02 processors INC and DEC).

LSL alone looks like an incomplete instruction to me.
Re: I need some info about those NES assemblers.
by on (#122196)
Just use ASM6, or use CA65 which can be used with a text editor with a ''replace all'' function like notepad by converting all .dbs to .bytes/.byts and .dws to .words/.addrs

Either way, Source conversion is common in these parts, Still trying to experiment converting SMB3 Disassembly from Southbird's to CA65 is a hard task I am taking. Some NESASM programs use .funcs that are only convertable by hand via .macros with .bytes in them, plus NESASM uses the WLA-DX Macro number system, which is okay if you know how to relabel them.

You have to deal with syntax if you want to learn how to do or convert assembly, It may be a bit hard, Heck anything is hard in the world of Programming, I've learned that the hard way and I still do today!

I understand it's a SMB1 Disassembly hack, I think? Been there enough to convert enough of SMBDIS or my any hacks of mine (practise hacks) to CA65

EDIT: ASM6 requires trickery for mapper hacks, to use a mapper, use this:

http://forums.nesdev.com/viewtopic.php?t=6160

Give them a try, Extra Tip #1: Try to figure how the CHR ROM part of CNROM to the end of the PRG-ROM part of the UxROM template to make MMC1 or MMC3 ROMs.
Re: I need some info about those NES assemblers.
by on (#122213)
Hamtaro126 wrote:
Just use ASM6, or use CA65 which can be used with a text editor with a ''replace all'' function like notepad by converting all .dbs to .bytes/.byts and .dws to .words/.addrs

Either way, Source conversion is common in these parts, Still trying to experiment converting SMB3 Disassembly from Southbird's to CA65 is a hard task I am taking. Some NESASM programs use .funcs that are only convertable by hand via .macros with .bytes in them, plus NESASM uses the WLA-DX Macro number system, which is okay if you know how to relabel them.

You have to deal with syntax if you want to learn how to do or convert assembly, It may be a bit hard, Heck anything is hard in the world of Programming, I've learned that the hard way and I still do today!

I understand it's a SMB1 Disassembly hack, I think? Been there enough to convert enough of SMBDIS or my any hacks of mine (practise hacks) to CA65

EDIT: ASM6 requires trickery for mapper hacks, to use a mapper, use this:

http://forums.nesdev.com/viewtopic.php?t=6160

Give them a try, Extra Tip #1: Try to figure how the CHR ROM part of CNROM to the end of the PRG-ROM part of the UxROM template to make MMC1 or MMC3 ROMs.


that worked for me, thx