Hardware Registers?

Status
Not open for further replies.

yzmxer608

Fully Optimized
Messages
1,559
Location
WI, USA
I'm reading the book C++ How to Program Seventh Edition by Deitel and Associates Inc. It's talking about storage classes and I had a question about what it's saying about register variables.

The storage-class specifier register can be placed before and automatic variable declaration to suggest that the compiler maintain the variable in one of the computer's high-speed hardware registers rather than in memory. If intensely used variables such as counters or totals are kept in hardware registers, the overhead of repeatedly loading the variables from memory into the registers and storing the results back into memory is eliminated.

What do they mean by "high-speed hardware registers"? I can't figure out what they are talking about.
 
Well im not sure about modern cpu's but in my university course we are programming small custom cpu's in assembler and the regesters are part of the actual cpu itself, in this particular one there is 14 available and each one can store a 32bit value. Im guessing that there is most likely more on a modern cpu (and each one is most likey 64bit) - they are faster than both the RAM and cache.
 
Status
Not open for further replies.
Back
Top Bottom