# MSVC 6/2003 assembler output listing

## Recommended Posts

Silly_con    136
Hi, exists a "trick" or a addin/plugin/macro for visual c++ 6 and 2003 that generates a clear and good for read assembly output file, I mean something without segments info, labels, comments of lines, only name of function and assembler code, and optionaly the C/C++ code in comments.
// fragment of generated code
;	COMDAT ??HFoo@@QBE?BV0@ABV0@@Z
_TEXT	SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT	ENDS
;	COMDAT ?func@?$A@PAH@@QAEXM@Z _TEXT SEGMENT PARA USE32 PUBLIC 'CODE' _TEXT ENDS ; COMDAT ?func@?$A@PAH@@QAEXH@Z
_TEXT	SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT	ENDS
;	COMDAT ?func@?$A@PAH@@QAEXPAM@Z _TEXT SEGMENT PARA USE32 PUBLIC 'CODE' _TEXT ENDS FLAT GROUP _DATA, CONST, _BSS ASSUME CS: FLAT, DS: FLAT, SS: FLAT endif PUBLIC ?mysqrt@@YAMM@Z ; mysqrt EXTRN __fltused:NEAR _TEXT SEGMENT _n$ = 8
?mysqrt@@YAMM@Z PROC NEAR				; mysqrt

; 10   : {

push	ebp
mov	ebp, esp

; 11   : 	return n;

fld	DWORD PTR _n$[ebp] ; 12 : } pop ebp ret 0 ?mysqrt@@YAMM@Z ENDP ; mysqrt _TEXT ENDS PUBLIC ?func@?$A@D@@QAEXH@Z				; A<char>::func
EXTRN	__chkesp:NEAR
EXTRN	_printf:NEAR
_DATA	SEGMENT


I want some like this:
// _n$= 8 mysqrt PROC NEAR push ebp mov ebp, esp fld DWORD PTR _n$[ebp]
pop	ebp
ret	0

thnx


##### Share on other sites
Extrarius    1412
To get rid of part of the text after the @, compile C code instead of C++ code. I'm fairly certain that is part of the name mangling

The rest of the stuff you want to get rid of shouldn't be too hard to strup out with a simple regular expression.

As far as I know, there is no way to autmatically make VC generate your clean asm for you.