Catalina 4.3 is now available
Wingineer19
Posts: 291
in Propeller 1
Hi @RossH,
All of the discussions taking place on the P2 forum about Spin and inline assembly has prompted me to ask this question about Catalina for the P1: Is there a command line switch I can use when invoking the compiler to produce a list file that contains the C source code with the assembly code created for it?
By that I mean the list file shows the C source code line by line, with the generated assembly code for each aforementioned C source code statement listed directly below it?
I'm thinking such a feature would be helpful in determining if I needed to hand code some assembly to implement time critical functions just in case the compiler generated code wasn't compact or efficient enough.
I've probably just overlooked this feature, but I've glanced over the various command line switches to try to do this but can't seem to find it.
Thanks.
All of the discussions taking place on the P2 forum about Spin and inline assembly has prompted me to ask this question about Catalina for the P1: Is there a command line switch I can use when invoking the compiler to produce a list file that contains the C source code with the assembly code created for it?
By that I mean the list file shows the C source code line by line, with the generated assembly code for each aforementioned C source code statement listed directly below it?
I'm thinking such a feature would be helpful in determining if I needed to hand code some assembly to implement time critical functions just in case the compiler generated code wasn't compact or efficient enough.
I've probably just overlooked this feature, but I've glanced over the various command line switches to try to do this but can't seem to find it.
Thanks.
Comments
There is no such feature "out of the box". From memory, I looked into doing this very early on in Catalina's development, and discovered it is not so easy to do because of the nature of the lcc compiler - the back-end code generator works off a complex parse-tree generated from the C source code by the front-end, and not the original source itself. So when you are generating the assembly, you no longer have access to the source code.
So after a bit of unsuccessful faffing about, I gave up on the idea.
However, since then I have had to generate the necessary information to to this anyway - to support the source code debugger. So I could probably now add it as a "post-processing" feature.
I'll look into it again when I have some time.
Ross.