Prev: What is the purpose of terminating resistors in a Communication Network?
Next: In search of (agile?) change management resource
From: benn on 30 Apr 2010 19:10 I need to tweak the assembly file that the c compiler generates, but it goes straight to an exe. Is there a way to view and modify the assembly file before it go the assembler? Thanks!
From: Dave Nadler on 30 Apr 2010 19:18 On Apr 30, 7:10 pm, benn <benn...(a)hotmail.com> wrote: > I need to tweak the assembly file that the c compiler generates, but > it goes straight to an exe. Is there a way to view and modify the > assembly file before it go the assembler? > > Thanks! Use -S option (capitalization significant)... But you shouldn't need to "tweak"; use inline asm...
From: Tim Wescott on 30 Apr 2010 21:01 benn wrote: > I need to tweak the assembly file that the c compiler generates, but > it goes straight to an exe. Is there a way to view and modify the > assembly file before it go the assembler? That sounds scary-dangerous. At least if you're establishing a build procedure where you compile, then tweak, then assemble, then declare victory. Having source code that's also a build product is kind of like standing on a hilltop in a thunderstorm, giving the finger to the sky. It looks pretty damned impressive if you can get away with it, but the consequences can be severe. Do you mean you want to inspect the assembly to make sure that the inline assembly statements you're using do the right thing, or that your C code is generating the intended behavior, or so you have a nice template to use for an all-assembly, really-o, truly-o source file? -- Tim Wescott Control system and signal processing consulting www.wescottdesign.com
From: Hans-Bernhard Bröker on 1 May 2010 08:59 benn wrote: > I need to tweak the assembly file that the c compiler generates, but > it goes straight to an exe. It does that only for those who strictly can't be bothered to RTFM to find out how to control their tools properly. Mixing that attitude with what (you think) you need to do is a recipe for highly probable disaster. I strongly suggest you calm down, sit back, and re-analyze what you really need to do. No matter what your actual problem is, post-patching compiler output is pretty much guaranteed to be the wrong approach to solving it.
From: vladitx on 4 May 2010 10:34
On May 1, 3:59 pm, Hans-Bernhard Bröker <HBBroe...(a)t-online.de> wrote: > benn wrote: > > I need to tweak the assembly file that the c compiler generates, but > > it goes straight to an exe. > > It does that only for those who strictly can't be bothered to RTFM to > find out how to control their tools properly. Mixing that attitude with > what (you think) you need to do is a recipe for highly probable disaster. > > I strongly suggest you calm down, sit back, and re-analyze what you > really need to do. No matter what your actual problem is, post-patching > compiler output is pretty much guaranteed to be the wrong approach to > solving it. Hans-Bernhard's analysis is of course very true. As an interesting exception, I should mention that about 15 years ago I came up with a very effective solution for large x86 16-bit ROM-able code based on post-processing of compiler output - of course, automated, and tied to a certain compiler. What this approach made possible, together with the excellent optimising 'C' compiler, achieved results I couldn't get with any other tool at the time. The OP is still on the wrong track, though. |