| ??? 03/06/02 18:04 Read: times |
#20504 - RE: What is cheap ?, Erik |
I would gladly pay much more for a REAL '51 compiler. A compiler that amongst other things would use jump tables for switch statements, allow true inline assembly (not the stupid .src) fully utilize the double dptr in the derivatives that have it, convert for (a=0; a <9 .. to for (a=9; a != 0 to take advantage of the simple zero check instead of an arithmetic conversion.
I usually code in assembly except when a customer specifically requests 'C', and I've never really looked at the output of those compilers. Luckily it's always worked as expected and within memory requirements and I haven't HAD to analyze the output. That said, I'm surprised they don't use jump tables for switch statements. That seems pretty straight-forward to me. What I wonder (I'm thinking out loud here, I've not analyzed the question enough to even realize whether this question is stupid) is whether it would be possible for a 'C' compiler to usefully use double DPTRs? When we code in assembly it can become quite obvious when a second DPTR could help. I'm wondering what criteria a 'C' compiler could use to say to itself, "Wait, this could be improved with the other DPTR." It would certainly be a type of code optimization, but given the spaghetti code produced by many programmers in 'C' I wonder if a 'C' compiler could figure out when to use the second DPTR. Again, I haven't given this much thought. But since I've been working on-and-off with adding a 'C' compiler to my Pinnacle package your message raised an interesting question... Craig Steiner |



