??? 03/03/09 23:07 Read: times |
#163041 - A C compiler can map the hardware quite well Responding to: ???'s previous message |
Richard Erlacher said:
The dual data pointers with automatic increment/decrement, and automatic alternation between them, if you want/need it, is not something I'd expect to see on an ARM anytime soon. Why do you think the ARM needs it? With every regiter a potential pointer, the compiler don't have to think single or double. The auto-alternate in the 8051 is smart. But it is a hack since the instruction set don't have any bit to select which register to use. All real processors have indexed reads with automatic increment/decrement. There are some things, however, that will likely cause 'C' and other HLL's to cough, for example moving an array from external XRAM to internal XRAM at the same physical address. I can't imagine am elegant way to do that in any HLL since it requires the pointers to have the same value and I'd expect the compiler to complain. Keil doesn't have support for it, but what you are talking about is basically the based pointers used by Borland to get a 16-bit near pointers that addressed code (__cs) or stack (__ss) which in the 16-bit and 32-bit segmented modes of the x86 processors do represent different memory areas with identical offsets. What a HLL can do is very much a factor of the ingenuity of the developers of the compiler, and the number of users paying for the compiler maintainance. Have a look at the code generated for a modern x86 processor. I don't think you would find it too funny to try and match it other than for very small code blocks. The big factor here is that the x86 market is huge, so the people with the good compilers have a lot of money available for development and testing. Keil charges a lot for their C51 compiler, but will still only collect peanuts compared to the x86 compiler vendors. And there is limited interest in investing too much into a compiler for a processor that has been on the market for so long as the 8051 has. It will continue to live for a lot of years more, but compiler vendors are looking at the new processors. |