It's a bit more complicated than that. The C preprocessor can be used to 
generate text other than C programs, but it is not Turing complete. The macro 
languages of PL/I and HLASM are Turing complete and can also generate text in 
other languages, but the macros don't really extend the compiler. As John 
noted, assembler macros have access to the symbol table, which adds an 
additional degree of flexibility.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Assembler List <[email protected]> on behalf 
of Charles Mills <[email protected]>
Sent: Monday, December 11, 2017 5:16 PM
To: [email protected]
Subject: Re: Macro Processors

I get your point. The assembler macro facility is more like a facility for 
writing extensions to the assembler than it is like the C macro preprocessor. 
That ability to write a macro that is integrated in its processing with the 
main passes of the assembler -- yes, that is very cool.

In C I can write a macro FOO(bar) that expands out into C code -- shorthand, in 
other words. But an assembler macro has the ability to be more like an 
extension of the assembler itself, not simply a shorthand for some more wordy 
assembler instructions.

Charles


-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]] On 
Behalf Of John Ehrman
Sent: Monday, December 11, 2017 12:19 PM
To: [email protected]
Subject: Macro Processors

Charles Mills noted...




> Date: Sat, 9 Dec 2017 17:58:15 -0800
> From: Charles Mills <[email protected]>




> PL/I has a very powerful "macro" (preprocessor, I think they call it)
> facility. I don't know it well at all, but in my impression it is more
> powerful than either assembler or C macros.




I agree that PL/I's macro preprocessor is indeed powerful; but it and

all other macro facilities I know of lack a key feature of HLASM's

conditional assembly and macro facility: an intimate interaction

between the base language and the macro language. While the

Reply via email to