|MACRO PROCESSOR Pcohen@sii.fr (PAtrick COhen) (1998-06-27)|
|Re: MACRO PROCESSOR email@example.com (John Lindsay) (1998-06-28)|
|Re: MACRO PROCESSOR firstname.lastname@example.org (1998-06-28)|
|Re: MACRO PROCESSOR (and Re: writing an assembler!) email@example.com (Phil Budne) (1998-07-01)|
|MACRO PROCESSOR firstname.lastname@example.org (1998-07-01)|
|Re: MACRO PROCESSOR email@example.com (1998-07-05)|
|Re: MACRO PROCESSOR firstname.lastname@example.org (Sameer Nanajkar) (1998-07-08)|
|Re: MACRO PROCESSOR email@example.com (Olaf Langmack) (1998-07-08)|
|From:||"John Lindsay" <firstname.lastname@example.org>|
|Date:||28 Jun 1998 00:00:28 -0400|
|Organization:||Royal Military College of Canada|
|Keywords:||assembler, macros, comment|
PAtrick COhen wrote:
> I have to develop a macro processor for the macro used in
> assembly of IBM 370. You know the MACRO.. MEND block and the AIF, AGO
> and LCLA , SETA .....
> So I'm intersted to know if any one has an idea about the
> algorithm and where to find the algorithm (URL ?). I'm intersted if
> some one can give me too the name of a book that treat this subject
> with detail.
You have a very big job on your hands. It can mushroom into a huge
piece of code because of the open-code macro capabilities (using macro
capabilities outside of macros -- and some of this is subtly different
from the uses inside!). There are 2 major ways to go. The first is,
realizing that the 370 assembler and macro language is a language,
write a compiler for it may be written using compiler-compiler tools
like PCCTS (but the language is a _MESS_). Any of the
compiler-compiler books like the dragon book or the PCCTS book will
provide a start here. The second is ye olde ad hoc method, especially
if it is implemented in a language with a powerful string-processing
and data handling capability like SNOBOL 4 (get the Spitbol compiler
from Catspaw for any of a number of platforms, or one of a couple of
other SNOBOL systems) or Icon (surf to the U. of Arizona -- its free
and available for several platforms and systems!).
If this is a one-off job, the second way to go is almost certainly
better; in the general case there are many wierd things to take care
of, like the inconsistent interpretation of list and sublist macro
arguments, and if this is to be used apart from the 370 assemblers as
a standing utility, it may be necessary to go the first way.
Do note the PUNCH statement; it may be possible to do your macro
processing with a 370 assembler, and use the PUNCH output elsewhere.
As for algorithms, see if you can get a copy of the SPASM assembler;
it was (?is?) a student assembler done at Stanford Linear Accelerator
(sorry, I'm retiring and I just threw several listings and tapes out).
There was another assembler called Assist done at (????) University of
Pennsylvania, and its listings might be a help.
John H. Lindsay email@example.com
Department of Mathematics and Computer Science
ROYAL MILITARY COLLEGE OF CANADA
P O BOX 17000 STN FORCES
KINGSTON ON K7K 7B4 CANADA
Phone: (613) 541-6000--1--6419
Fax: (613) 541-6584
[I agree. If you need Assembler H, you know where to find it. -John]
Return to the
Search the comp.compilers archives again.