Author |
Topic: Compiling ASM program containing array labels (Read 2284 times) |
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: Compiling ASM program containing array labels
« Reply #6 on: Jun 2nd, 2009, 08:34am » |
|
Quote:| I used a two-dimensional array |
|
OK. Personally I'm not keen on that approach, partly because it runs somewhat contrary to the principle of 'information hiding' (having a data structure shared between more than one routine that needn't be) and partly because it makes the labels so 'anonymous' (all called 'label' something!).
I think my preferred approach (had it worked!) would have been to use a separate array for each routine, perhaps with the same name as the routine itself. So the routine GFXLIB_Plot would have had labels GFXLIB_Plot(0), GFXLIB_Plot(1) etc.
If I was faced with converting what you've got to a structure-member approach (which again I'd want to be self-contained to each routine) I'd write a little utility in BASIC to do it!
Richard.
|
|
Logged
|
|
|
|
David Williams
Developer
member is offline

meh

Gender: 
Posts: 452
|
 |
Re: Compiling ASM program containing array labels
« Reply #7 on: Jun 2nd, 2009, 10:04am » |
|
on Jun 2nd, 2009, 08:34am, Richard Russell wrote:| OK. Personally I'm not keen on that approach, partly because it runs somewhat contrary to the principle of 'information hiding' (having a data structure shared between more than one routine that needn't be) and partly because it makes the labels so 'anonymous' (all called 'label' something!). |
|
You've probably noticed that I tend to comment my code verbosely! So, for me personally, the 'anonymous' label names aren't a problem because I always include an informative comment on the same line:
Code:.label%(37,3) ; .GFXLIB_AlphaBlend__skip
jmp label%(37,5) ; GFXLIB_AlphaBlend__exit
etc.
on Jun 2nd, 2009, 08:34am, Richard Russell wrote:| If I was faced with converting what you've got to a structure-member approach (which again I'd want to be self-contained to each routine) I'd write a little utility in BASIC to do it! |
|
Well, again, thanks for another excellent suggestion, but I best channel my energy into improving the efficiency of existing routines, developing new ones, writing more examples, and finishing the currently very poor documentation.
David.
|
|
Logged
|
|
|
|
|