Currently, the Disassemblies use at least three differents assemblers: - SNASM68k - ASM68K - The macro assembler AS SNASM68k, according to what I've read, was an assembler used to build official games. However, there seems to have been many complaints against it. ASM68K is only used for the Sonic 1 disassembly as of now. I've tried to search for some information on Google about this one, but I couldn't find anything relevant. Does someone have documentation on this assembler? I'd like to know what I can do with it, as I'm using it for my Sonic 1 "hack". AS is great, but there seems to be a few problems with the Sonic 1 disassembly (after replacing incbin's with binclude's and splitting dc's with more than 20 arguments - I could use some help if I'd ever like to do things ASM68K can't do). Also, it seems to be a bit slow with Sonic 2, compared to ASM68K with Sonic 1. tl;dr: what's the "best" assembler for Megadrive/Genesis games?
I'd say AS. It's reasonably fast, it has excellent macro and function capabilities (see Xeno's disassembly), it can handle Z80 code as well as 68000 (once again see Xeno's disassembly), and loads of other goodies like nameless temporary symbols, sharefiles, etc. It's not as fast as ASM68k and lacks the optimization features, but in other areas it's far superior. I don't think SNASM68k was used to build Sonic games, I think it was ASM68k (though it beats me why Sega turned zero-offset optimization off while building). The site containing ASM68k documentation is down I believe, but you can download the PSY-Q systems manual (which includes info on ASM68k) here. About the problems you're encountering, I'm guessing it's because AS only allows double quotes for strings, while Hive's S1 disassembly uses single quotes for strings. Swapping them around shouldn't be too hard though.
Regarding AS, puto "padded off to the very beginning of the code" for it to work on S1 though I find ASM68K to be faster. There's plenty of bother in AS such as annoying errors, ASM68K is a great replacement for SNASM68K, which only requires a macro & one line fix. I don't know, since I haven't tried doing it on an earlier SNASM68K-based S2 assembly but I mostly prefer ASM68K.
I did replace the quotes. The kind of errors that annoyed me were "addressing mode not allowed here" and "addressing mode not allowed on 68000" (both errors appeared for one line, but they appeared more than once).
Which are caused by coding errors. Assemblers don't cause errors by themselves, but they'll obviously complain if they're asked to assemble code containing errors. Sounds either like an error caused by another error or an alignment issue. You did replace all instances of even with align 2 right? Are those errors the first errors which appear, or are there others before them?
Code (Text): > > >obj89.asm(9): error: addressing mode not allowed on 68000 > > > jmp Obj89_Index(pc,d1.w) > > >obj89.asm(9): error: addressing mode not allowed here > > > jmp Obj89_Index(pc,d1.w) > > >obj8B.asm(8): error: addressing mode not allowed on 68000 > > > move.w Obj8B_Index(pc,d0.w),d1 > > >obj8B.asm(8): error: addressing mode not allowed here > > > move.w Obj8B_Index(pc,d0.w),d1 > > >obj8B.asm(9): error: addressing mode not allowed on 68000 > > > jsr Obj8B_Index(pc,d1.w) > > >obj8B.asm(9): error: addressing mode not allowed here > > > jsr Obj8B_Index(pc,d1.w) > > >obj8C.asm(8): error: addressing mode not allowed on 68000 > > > move.w Obj8C_Index(pc,d0.w),d1 > > >obj8C.asm(8): error: addressing mode not allowed here > > > move.w Obj8C_Index(pc,d0.w),d1 > > >obj8C.asm(9): error: addressing mode not allowed on 68000 > > > jsr Obj8C_Index(pc,d1.w) > > >obj8C.asm(9): error: addressing mode not allowed here > > > jsr Obj8C_Index(pc,d1.w) > > >sonic1.asm(6165): error: addressing mode not allowed on 68000 > > > move.w BgScroll_Index(pc,d2.w),d2 > > >sonic1.asm(6165): error: addressing mode not allowed here > > > move.w BgScroll_Index(pc,d2.w),d2 > > >sonic1.asm(6166): error: addressing mode not allowed on 68000 > > > jmp BgScroll_Index(pc,d2.w) > > >sonic1.asm(6166): error: addressing mode not allowed here > > > jmp BgScroll_Index(pc,d2.w) > > >obj15_1.asm(5): error: addressing mode not allowed on 68000 > > > jmp Obj15_Index(pc,d1.w) > > >obj15_1.asm(5): error: addressing mode not allowed here > > > jmp Obj15_Index(pc,d1.w) Other objects don't cause this error... BTW, I've split objects in separate ASM files.
Well, I guess I'll stick to ASM68K, it seems to be the best choice so far. Also, thanks for the docs, shobiz.
Hmm, have you added "padding off" to the beginning of the file? If you haven't, that could be a cause of the errors. I can't think of any other reason right now. Hayate mentioned a while back he got his Sonic 1 disassembly working perfectly with AS, perhaps you could ask him what changes he had to make?
Figured it out. The problem is stuff like jmp somewhere, which is supposed to be jmp (somewhere).l. Aurochs mentioned a while back things like that could cause AS to throw errors during the second pass. It's a simple regular expression search and replace fix though. In case anyone else is interested, I've uploaded the AS version to the wiki, at Image:S1hive2005_AS.zip. Changes are listed in the modified README.txt, and it assembles to a bit-perfect copy of the original, since the AS executable included is one with the zero-offset displacement optimization disabled thanks to SHB's instructions.
I still believe that, besides the fact that it can prove that the disassembly is done right, there's no real point to disabling optimizations.
I agree, but in this case I was using the modified version to ensure my changes didn't screw anything up, and for some reason didn't consider the possibility of switching back to a normal AS executable once I had checked that. It's quite easy to use search-and-replace to get rid of all 0-offset displacements though, so I think I'll just leave it as it is.
Good catch! I'd probably have figured it out if I actually compared the good ones with the erroneous ones. I'll consider this if I ever want to use AS. Thanks!