Re: [stella] Reflex: Source of PAIN!

Subject: Re: [stella] Reflex: Source of PAIN!
From: KirkIsrael@xxxxxxxxxxxxx
Date: 5 Apr 2004 16:38:33 -0000
> Just one minor suggestion:  place your constants in UPPERCASE;  eg:
> 
> MODE_PRESET equ %00011111 ; Inverted
> 
> It's pretty much a universal standard in assembler programming.

Can anyone think of a good way of automagically (maybe macro based?) 
finding instances of of using something that's "obviously" a Constant
as a variable, i.e. the ubiquitous newbie mistake of leaving out the 
"#"?  

I can think of 2 or 3 ways, but I'm not sure what's automatable inside
of DASM or a text editor:

* a pseudohungarian notation for constants would be easy to find in
  an editor: do a text search for " CONST" -- that's an error, but 
  the use of CONST_ or whatever prefix is a bit inelegant.
* Any argument that is all in caps should probably be proceeded by 
  a #, always. Is there a way of DASM macroing that? (and are there
  exceptions to that rule, assuming non-cowboy programming?)
* optionally, I could see some rule where a comment proceeds and follows
  the "constants section", any reference defined in there without the 
  "#" is likely a problem. This would be easy to make a perl script for,
  don't know if it's any easier for DASM.


Anyway, Andrew, it's good to see you back in the instructional 
mode.  Have you suspended new posts to the newbie forum 'til 
the book is out, or is it just the usual resource issue? 
Also, what's the status of Fu Kung?

-- 
KirkIsrael@xxxxxxxxxxxxx    http://kisrael.com
"If I knew who Godot was, I would have said so in the play" --Beckett


----------------------------------------------------------------------------------------------
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/


Current Thread