My recent experience with ca65, asm6, nesasm, and wla-dx
Moderator: Moderators
@Blargg:
I didn't say that they're evil per se: I'm just biased because I never used them. If used and documented properly, it should have it place I guess. But I saw some example in the past with no documentation and abuse of them (up to 5 or 6 +) so you can see that it can get quite messy in the hands of, I would guess, beginners. So I would not add them in my "coding practices" for beginners.
Nesasm:
As for nesasm popularity, my only guess would be from a "mental image" of it. If you want a "nes assembler", when you see the name "nesasm" then it seems to be the right tool for the job for someone looking for the first time for an assembler, isn't it? That's how I feel about it. I could be wrong thought.
I didn't say that they're evil per se: I'm just biased because I never used them. If used and documented properly, it should have it place I guess. But I saw some example in the past with no documentation and abuse of them (up to 5 or 6 +) so you can see that it can get quite messy in the hands of, I would guess, beginners. So I would not add them in my "coding practices" for beginners.
Nesasm:
As for nesasm popularity, my only guess would be from a "mental image" of it. If you want a "nes assembler", when you see the name "nesasm" then it seems to be the right tool for the job for someone looking for the first time for an assembler, isn't it? That's how I feel about it. I could be wrong thought.
Exactly, that's why I did back when I was a noob.
As for nesasm popularity, my only guess would be from a "mental image" of it. If you want a "nes assembler", when you see the name "nesasm" then it seems to be the right tool for the job for someone looking for the first time for an assembler, isn't it? That's how I feel about it. I could be wrong thought.
I rarely, if ever, use more than 2 + or -, however I use these all the time. You can't imagine how I has happy after quiting Nesasm to not have to find labels for every little damn thing any longer.
I didn't say that they're evil per se: I'm just biased because I never used them. If used and documented properly, it should have it place I guess. But I saw some example in the past with no documentation and abuse of them (up to 5 or 6 +) so you can see that it can get quite messy in the hands of, I would guess, beginners. So I would not add them in my "coding practices" for beginners.
True, however I just like to have "full" CHR banks of a 2^n size in .chr files (as opposed to a small set of tiles).A .png to .chr converter that can handle sizes less than full banks allows this easily.
This sounds really great. Same that other assemblers lacks this - especially considering that loading code from ROM to RAM is common.Something that ld65 handles easily with its load and run addresses.
Useless, lumbering half-wits don't scare us.
For those of you talking about how good/bad anonymous labels are, let me share my labeling convention.
This is how all of my labels look. They might be wordy, but at least you know exactly what each label is for, and I rarely ever have any problems with duplicate labels, or running out of names for labels.
Plus, if you ever start having trouble coming up with label names (too many labels), perhaps you need to revise your code's structure?
Code: Select all
[game.asm]
game_init
jsr game_loadlevel
game_main
[...]
jsr system_wait_vblank
[...]
jmp game_main
game_loadlevel
[...] ;Initialize some variables
game_loadlevel_loop
[...] ;Read a pointer or something
game_loadlevel_loop_getchunk
[...] ;Copy a block of bytes to ram
bne game_loadlevel_loop_getchunk
[...] ;Process them somehow
bne game_loadlevel_loop
rts
[system.asm]
system_wait_vblank
[...] ;Check a variable that my NMI routine sets when vblank occurs
beq system_wait_vblank
[...] ;Reset the aforementioned variable
rts
Plus, if you ever start having trouble coming up with label names (too many labels), perhaps you need to revise your code's structure?
Verbose labels obscure the relevant information of what the code is doing. More noise, less signal = less readability = most cost to maintain. Being able to use local @symbols and +/- unnamed labels is what the assembler is for, to allow more concise expression of things, to do the tedious work so you don't have to (in this case, your eyes having to wade through increased noise).
That's one reason why I use NESHLA, avoiding creation of such labels.tokumaru wrote:There are several instances where I don't feel the need to name labels. Now that I think of it, this usually happens with labels used to simulate FOR, IF, and other commands present in high-level languages. You don't really need labels to identify these structures.
- Hamtaro126
- Posts: 818
- Joined: Thu Jan 19, 2006 5:08 pm
About the SNES side: CA65 also supports 65816. But CC65 (C compiler) is very limited/incomplete for that CPU. also, DA65 does not support the 65816 yet!Memblers wrote:Yeah, the only notable complaint I've had with CA65/CC65 is the anonymous label syntax. I do remember there being a discussion about on the CC65 email list many years ago, not sure what the conclusion was, but maybe there's some insight there if it's available for searching. x816 seemed like a pretty good assembler, I can't use anymore though without using DOSBox. I mostly used it for my SNES 2A03 emulator, so it has to be assembled in DOSBox if I rebuild it anymore, heheh. Nerdtracker 2 used it originally (later I changed Bananmos' old code to assemble in CA65)
I tried using DOSBox on X816, Does not work, When assembling something with X816 in a DOSBox, It Stops Forever until exiting!
This is why I use CA65 and sometimes ASM6
AKA SmilyMZX/AtariHacker.
Yeah, I'd heard the C compiler is mostly geared for 6502.
x816 should work with DOSBox because I've definitely used it (it took a long time assemble the NSF player, which was funny to watch). Maybe it uses a DOS 32-bit extender .exe that wasn't in your path when you ran it? I guess it would've said so, though.
ASM6 sorta reminds me of the x816 (for 6502) in some ways, I guess because it's simple and effective.
x816 should work with DOSBox because I've definitely used it (it took a long time assemble the NSF player, which was funny to watch). Maybe it uses a DOS 32-bit extender .exe that wasn't in your path when you ran it? I guess it would've said so, though.
ASM6 sorta reminds me of the x816 (for 6502) in some ways, I guess because it's simple and effective.
Re: My recent experience with ca65, asm6, nesasm, and wla-dx
Sorry about digging up such old thread, but as far as I'm concerned, I'd consider it as a plus of ASM6 - it makes debugging more straightforward and you can know where you made a mistake if assembly file closely resembles ROM in structure. And if you want modularity, you can always .include files that deal with different stuff.blargg wrote:- Can't switch segments as in ca65, so order of things in file must match output (as far as I can tell).
Re: My recent experience with ca65, asm6, nesasm, and wla-dx
For quick sample it may be but for managing bigger projects ca65 is a must. As for order, it doesn't matter much and it become easier to manage with experience
Re: My recent experience with ca65, asm6, nesasm, and wla-dx
I too prefer to organize my source code sequentially. Even when using ca65 I don't switch segments all the time, I basically switch once to each bank, in order, and .include all the code/data that's supposed to be there. That doesn't mean that the OPTION of having the assembler do some organization on its own is a bad thing.
Unfortunately, the one time I really needed ca65 to let me shuffle segments around, it couldn't do what I wanted, which was to automatically right-align arbitrarily sized chunks of ROM. You have to either use constant sizes or stich the binaries afterwards.
I like how straightforward ASM6 is, and how versatile it is because it allows all kinds of expressions with all kinds of symbols, even in directives that affect the amount of generated code, such as IF, REPT and ORG. I still think ca65 is cool, but there are a lot of annoyances and limitations that arise from the fact it's single-pass and the mysterious ways in which macros are implemented.
Unfortunately, ASM6 lacks some things that are extremely useful in larger projects, such as any means to keep track of the memory banks each label belongs to. Another extremely annoying thing in ASM6 is how its anonymous labels break the scope of local labels, effectively making it impossible to use both in the same subroutine.
Unfortunately, the one time I really needed ca65 to let me shuffle segments around, it couldn't do what I wanted, which was to automatically right-align arbitrarily sized chunks of ROM. You have to either use constant sizes or stich the binaries afterwards.
I like how straightforward ASM6 is, and how versatile it is because it allows all kinds of expressions with all kinds of symbols, even in directives that affect the amount of generated code, such as IF, REPT and ORG. I still think ca65 is cool, but there are a lot of annoyances and limitations that arise from the fact it's single-pass and the mysterious ways in which macros are implemented.
Unfortunately, ASM6 lacks some things that are extremely useful in larger projects, such as any means to keep track of the memory banks each label belongs to. Another extremely annoying thing in ASM6 is how its anonymous labels break the scope of local labels, effectively making it impossible to use both in the same subroutine.
Re: My recent experience with ca65, asm6, nesasm, and wla-dx
I always found this extremely strange and bizarre, to the point of seeing it as a bug.tokumaru wrote:Another extremely annoying thing in ASM6 is how its anonymous labels break the scope of local labels, effectively making it impossible to use both in the same subroutine.
Re: My recent experience with ca65, asm6, nesasm, and wla-dx
Yeah, forcing users to choose between nameless and local labels doesn't seem like an intentional design choice, but who knows? I haven't seen anyone being bothered by this over the years besides me...
Re:
It depends on what you want out of the macros, but they're decent. Maybe not as big and magical and complex as ca65, but they're not terrible.Memblers wrote: I used DASM before, I left it then because it didn't have incbin (it does now though), it seemed good but I was a newb at the time and wasn't using macros or any kind of fancy stuff yet. If it's got good macro support (I don't remember), it should be just fine.
My games: http://www.bitethechili.com