.TH UNSTAB LOCAL .UC 4 .SH NAME unstab \- insert C source code into compiled assembly language .SH SYNOPSIS .BI cc " -g -S [-O]" .IR "" file.c; .BR "unstab" " file.s" .SH DESCRIPTION .PP .B unstab allows you to more easily see what assembly language is generated from your C code by intermingling the C source code and the generated assembly language into a single output file (for reading only). .PP Even if you can't fully understand the generated assembly language, it can be quite helpful to see how much (or how little) your C code is generating. If you have a program which must run as fast as possible, looking at the code generated in its innermost loops can be very helpful. .PP Note in the example below, .I putc is not the macro you might think it should be. .SH EXAMPLE .\" ### initiate asis block ### .nr UU \n(.u \"asis block ### .nf \"asis block ### \&% \fBcat -n foo.c\fP \& \fI1 #include \fP \& \fI2 main(){\fP \& \fI3 putc('a', stdout);\fP \& \fI4 fputc('b', stdout);\fP \& \fI5 }\fP \&% \fBcc -g -O -S foo.c\fP \&% \fBunstab foo.s\fP \&(some initial cruft omitted) \&main: \& \fI1:#include \fP \& \fI2:main(){\fP \&.LM1: \& pushl %ebp \& movl %esp, %ebp \& subl $16, %esp \& \fI3: putc('a', stdout);\fP \&.LM2: \& pushl stdout \& pushl $97 \& call _IO_putc \& \fI4: fputc('b', stdout);\fP \&.LM3: \& addl $8, %esp \& pushl stdout \& pushl $98 \& call fputc \& \fI5:}\fP \&.LM4: \& leave \& ret \&(some trailing cruft omitted) .if \n(UU .fi \"asis block ### .\" ### complete asis block ### .SH SEE ALSO .BR cc (1) .SH AUTHOR Corey Satten \- corey @ cac.washington.edu .SH BUGS .PP The more optimization used in compilation, the less ordered the output. .PP A source line which appears out of sequence in the .B unstab output is only flagged with a negative line number.