It is currently Sun Nov 18, 2018 7:20 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: Thu Oct 07, 2010 9:07 pm 
Offline
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 2047
Location: Fukuoka, Japan
@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.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 08, 2010 10:46 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7574
Location: Chexbres, VD, Switzerland
Quote:


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.

Quote:


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.

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.
Quote:
A .png to .chr converter that can handle sizes less than full banks allows this easily.

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).
Quote:
Something that ld65 handles easily with its load and run addresses.

This sounds really great. Same that other assemblers lacks this - especially considering that loading code from ROM to RAM is common.

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 08, 2010 11:00 am 
Offline

Joined: Mon Sep 27, 2004 2:57 pm
Posts: 1258
For those of you talking about how good/bad anonymous labels are, let me share my labeling convention.

Code:
[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


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

Plus, if you ever start having trouble coming up with label names (too many labels), perhaps you need to revise your code's structure? :P


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 08, 2010 12:28 pm 
Offline
User avatar

Joined: Mon Sep 27, 2004 8:33 am
Posts: 3715
Location: Central Texas, USA
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).


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 08, 2010 12:39 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10974
Location: Rio de Janeiro - Brazil
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.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 10, 2010 6:12 am 
Offline

Joined: Mon Nov 16, 2009 5:59 am
Posts: 110
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.

That's one reason why I use NESHLA, avoiding creation of such labels.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 10, 2010 8:00 am 
Offline
User avatar

Joined: Thu Jan 19, 2006 5:08 pm
Posts: 753
Location: Shelton, Washington.
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)


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!

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.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 10, 2010 3:27 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3583
Location: Indianapolis
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.


Top
 Profile  
 
PostPosted: Sat Oct 20, 2018 3:00 pm 
Offline

Joined: Tue Jun 28, 2011 2:39 pm
Posts: 192
blargg wrote:
- Can't switch segments as in ca65, so order of things in file must match output (as far as I can tell).


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.


Top
 Profile  
 
PostPosted: Sat Oct 20, 2018 7:21 pm 
Offline
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 2047
Location: Fukuoka, Japan
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 ;)


Top
 Profile  
 
PostPosted: Sat Oct 20, 2018 7:59 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10974
Location: Rio de Janeiro - Brazil
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.


Top
 Profile  
 
PostPosted: Mon Oct 22, 2018 6:58 am 
Offline

Joined: Mon Apr 04, 2016 3:19 am
Posts: 85
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.


I always found this extremely strange and bizarre, to the point of seeing it as a bug.


Top
 Profile  
 
PostPosted: Mon Oct 22, 2018 7:42 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10974
Location: Rio de Janeiro - Brazil
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...


Top
 Profile  
 
 Post subject: Re:
PostPosted: Mon Oct 22, 2018 8:21 am 
Offline
User avatar

Joined: Sat Jan 09, 2016 9:21 pm
Posts: 505
Location: Central Illinois, USA
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.


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.

_________________
My games: http://www.bitethechili.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group