4 ms·
Are memory mapped registers even implemented in any architectures these days?
by DannoHung 14y ago
Are memory mapped registers even implemented in any architectures these days?
- allenbrunson 14y agoI assume you're referring to the use of the 'register' keyword? well, that's not "memory mapped registers!" That's a suggestion to the compiler that it should store a variable in a cpu register, if possible. that means that you can't take the address of that variable, and so on. Last I heard, 'register' is pretty much obsolete these days, because there is no way you can do better at guessing which variables are candidates to be stored in registers than the compiler can.
- CJefferson 14y agoNo, he is refering to the fact that the original Duff's device contains: *to = *from++ Note that there isn't a '++' on 'to'. Make people think that Duff's device is for making a fast memcpy (which you would get with to++ = from++), but in fact it was for copying data to a MMR. Nowadays, most of the loop would be optimised away by the compiler, unless you marked to as volatile. Assuming you mark to as volatile, this kind of code is still used to write the MMR, although they are much less used than they used to be. The last time I wrote code anything like this was on the Nintendo Gameboy Advance. I don't know if the DS / 3DS still use similar code.
- nickzoic 14y agoAVR microcontrollers, certainly. Edit: That's answering the question I think you meant, which was "Is memory mapped I/O in use anywhere ..." And yes, they're often programmed in C.
- tptacek 14y agoWell, the chipset has 'em, right? The "old" ('05) Intel network processors also had them.