[cc65] Proposal for CA65 improvement(?): .maclib directive

From: Spiro Trikaliotis <ml-cc651trikaliotis.net>
Date: 2006-02-21 10:56:32
Hello,

having seen this on another assembler (for Motorola/Freescale DSP56K), I
want to propose something that I think is very handy (and "in the same
sense" as the .macpack directive).

I am citing from the assembler manual
(http://www.freescale.com/files/dsp/doc/ref_manual/DSPASMRM.pdf):

   5.2 MACRO LIBRARIES
   The Motorola DSP Assembler allows for the maintenance of macro
   libraries with the MACLIB directive. This directive is used to
   specify the pathname (as defined by the host operating system) of a
   directory that contains macro definitions. Each macro definition must
   be in a separate file, and the file must be named the same as the
   macro with the extension .ASM added. For example, BLOCKMV.ASM would
   be a file that contained the definition of the macro called BLOCKMV.

   If a MACLIB directive has been specified in the source code and the
   Assembler encounters a name in the operation field that is not a
   previously defined macro or is not contained in the directive or
   mnemonic tables, the directory specified in the MACLIB directive will
   be searched for a file of that name (with the .ASM extension added).
   If such a file is found, the current source line will be saved, and
   the file will be opened for input as an INCLUDE file. When the end of
   the file is encountered, the source line is restored and processing
   is resumed.

   Because the source line is restored, the processed file must have a
   macro definition of the unknown name, or an error will result when
   the source line is restored and processed.  However, the processed
   file is not limited to macro definitions, and can include any legal
   source code statements. Multiple MACLIB directives may be given, in
   which case the Assembler will search each directory in the order in
   which they were specified.

I find this very handy. Additionally, it is like some "superset" of what
the current .macpack directive already does, allowing not only the use
of predefinied "macro packages", but adding user-defined "macro
libraries", too.

What do you think?

Regards,
   Spiro.

-- 
Spiro R. Trikaliotis
http://www.trikaliotis.net/
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Tue Feb 21 10:56:47 2006

This archive was generated by hypermail 2.1.8 : 2006-02-21 10:56:50 CET