Assembler listing of 'C' code

Assembler listing of 'C' code

Post by Rajesh Malhot » Fri, 03 Jul 1992 06:09:44



Hi netters,

        How do I get xlc to dump out an assembler listing of 'C' source?
Have tried the -S and -s options. The -s option does not seem to do
anything, and -S says that it is reserved for future use. Have RTFM'd but
could not find a way.
        Any pointers would be appreciated.
        BTW, I have AIX 3.1.5 (soon to be upgraded to 3.2).

        Any and All help appreciated.

Raj.
--
===============================================================================
Raj Malhotra.
(908)613 4313.


===============================================================================

 
 
 

Assembler listing of 'C' code

Post by Charles R. Wrig » Fri, 03 Jul 1992 23:46:59



Quote:>    How do I get xlc to dump out an assembler listing of 'C' source?
>Have tried the -S and -s options. The -s option does not seem to do
>anything, and -S says that it is reserved for future use. Have RTFM'd but
>could not find a way.
>    Any pointers would be appreciated.
>    BTW, I have AIX 3.1.5 (soon to be upgraded to 3.2).

Well, I have 3.2, and I use cc instead of xlc, but I assume the
options are the same...

Try the switch "-qlist".  You'll find it in the InfoExplorer under
"Detailed Descriptions of the XL C Compiler Options: par 167", which I
refer to constantly.

Quote:>    Any and All help appreciated.

Hope it works!

>==============================================================================
>Raj Malhotra.
>(908)613 4313.


>==============================================================================

--------------------------|-----------------------------------------------
Charles Wright            | "Allow me to share with you my private

--------------------------|-----------------------------------------------

 
 
 

Assembler listing of 'C' code

Post by r.. » Sat, 04 Jul 1992 02:45:50



|>   How do I get xlc to dump out an assembler listing of 'C' source?
|> Have tried the -S and -s options. The -s option does not seem to do
|> anything, and -S says that it is reserved for future use. Have RTFM'd but
|> could not find a way.
To get an "object listing" along with source to match up:
cc -qsource -qlist -c foo.c

This gives you a listing names foo.lst.  It reads like assembler, but it is not
assemblable.
--
*********************************************************************
Rudy Chukran                |       EMAIL:            
IBM AIX Technical Consulting| RSCS: CHUKRAN at AUSTIN


Austin, Texas 78758         |
*********************************************************************

 
 
 

1. 'while' and 'compound-list'

I accidentally hit the following problem for which I can't
find any explanation in Bolsky & Korn:

Take this script (don't worry about the '((...)) && break' statement
for now, we'll need it later):

#!/bin/ksh
integer n=2
while (( n > 0 ))
do
    print "n=$n a=$a"
    n=n-1
    (( n == -2 )) && break
done

if you run it it will produce , as expected:

n=2 a=
n=1 a=

Now add one line to it as follows:

#!/bin/ksh
integer n=2
while (( n > 0 ))
    a=2         # <----- this line
do
    print "n=$n a=$a"
    n=n-1
    (( n == -2 )) && break
done

I would have expected this to violate 'while' syntax, but reading
the B & K book, this seems to be allowed as a 'compound statement'
which may follow the 'while' construct.
Now run that script:

n=2 a=2
n=1 a=2
n=0 a=2
n=-1 a=2

(and without the '(( n == -2 )) && break' line it would have
been an infinite loop).

Why is that? Am I reading B & K book wrongly or what's the problem
here?

---Zdenek

--
=========================================================

VNET: 557-4844                      Silicon Graphics SA
Tel : +41-22-710.4844       18, Ave. Louis Casai, 1209 Geneva
Fax : +41-22-710.4860                   Switzerland

2. VidTech GraphmaxLB Dot Clocks

3. Need advice on removing 'old' entries listed by 'who -u'

4. How to mounting the DOS file system

5. Anyone have hint on coding 'fg', 'bg'?

6. Oops....

7. source code for 'init' and 'login'?

8. Kernel printk format string compression: C syntax problem

9. How do I get 'routed' and 'gated' (source code)?

10. Determining process swap space/mem utilization with 'ps' and 'pstat' listings

11. GCC's inline assembler, and it's apparent lack of knowledge

12. i386 UNIX 'as' Assembler syntax

13. gcc - compile C to assembler, with C code included in listing??