It is currently Tue, 17 May 2022 02:17:53 GMT

Author Message
 Comments in assembly language vs. cpp
Yes, we know it's best not to write in assembly language any more.
OK, now that that's settled...

We need to have C style preprocessor directives in assembly language
files.  In AIX, unfortunately, it appears the only comment initiator
is a '#', which causes the remainder of the line to be ignored.

The C preprocessor in AIX appears to accept the expression

    '^[ \t]#'

as a legitimate preprocessor line, whereas most compilers I've used
only accept


Given that, how can we pass an assembler file through the
preprocessor, but NOT have the preprocessor attempt to preprocess the
assembly language comment lines?

Is there another comment style that the assembler will accept?

Is there some cpp option I don't know about?

And, just for fun, is it really true that ANSI allows white space
before the '#' in a directive?


 == Mark Warren                      Bull HN Information Systems Inc. ==
 == (508) 294-3171 (FAX 294-3705)    300 Concord Road   MA30/MS833A   ==
 ==                Billerica, MA 01821              ==

 Wed, 28 Dec 1994 05:43:58 GMT   
 Comments in assembly language vs. cpp
The X3J11 committee decided to allow any white space before the # and
horizontal white space between the # and the directive proper.

All of the following are legal in ANSI C:

#        if     FOOBAR
        #       if      FOOBAR
 /* This comment is converted to whitespace */ #if FOOBAR
#/* more comment as whitespace */if FOOBAR
# if /* a multi-
        line comment */ FOOBAR

 == Roland F. McKenney               Bull HN Information Systems Inc. ==
 == 1-508-294-3686 (FAX 294-3807)    300 Concord Road   MA30-826A     ==
 ==         Billerica, MA 01821-4186    USA  ==

 Wed, 04 Jan 1995 01:53:48 GMT   
   [ 2 post ] 

Similar Threads

1. Need script to remove assembly language comments

2. cpp - the C language preprocessor

3. Sparc Assembly Language Linking Questions

4. Assembly Language Linking Problem

5. assembly language


7. Assembly Language

8. SPARC assembly language?

9. Symbolic Debugger for Sparc Assembly Language?

10. ALD - Assembly Language Debugger - where?

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software