4 ms·
> doesn't say anything about registers at all Considering that C has a "register" storage-class specifier keyword, I don't see how you can make that claim. Gr
by Mindless2112 13y ago
> doesn't say anything about registers at all
Considering that C has a "register" storage-class specifier keyword, I don't see how you can make that claim. Granted, modern compilers ignore it.
Certainly, the C specification states that "register" storage is non-addressable, so it does say something.
- Someone 13y agoThat "register" nowadays is just a sequence of characters that, to those familiar with CPU architecture, rings a bell. Modern C standards do not convey any links between the keyword and hardware registers. http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1124.pdf http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1124.pdf, section 6.7.1: "A declaration of an identifier for an object with storage-class specifier register suggests that access to the object be as fast as possible. The extent to which such suggestions are effective is implementation-defined." And 'non-addressable' only applies to the C 'runtime'. The standard does not say anything about the hardware. For example, a C compiler for the 6502 could attempt to store variables of storage class 'register' in the zero page. Such storage locations have an address, but you are not allowed to take it from standard C. For an even better example, look at http://en.wikipedia.org/wiki/TMS9900 http://en.wikipedia.org/wiki/TMS9900. That CPU stored all its general purpose registers in RAM.