As is often suggested you will need to do a little work using Google.
Registers are CPU specific and will you will need to employ CPU instructions directly to read their values. This will require assembly language functions or inlining ASM.
You have not stated CPU or OS so you seem not to have done too much homework yet.
From here I got this example to read Intel EDX:
http://sim0n.wordpress.com/2009/04/15/c-getting-register-values/[
^]
#include <iostream>
void setEDX(int value) {
_asm mov edx, value;
}
int getEDX() {
int value;
_asm mov value, edx;
return value;
}
int main()
{
int edxValue = getEDX() ; std::cout << "EDX: " << edxValue << "\n";
std::cout << "Set EDX Value: ";
int value;
std::cin >> value; setEDX(value);
edxValue = getEDX() ; std::cout << "EDX: " << edxValue << "\n";
system("pause");
return 1 ;
}
Work on understanding this example and you will be in business.
Repeat this process for all the CPU registers you wish to examine.
If it is not CPU registers you need but device registers (eg UART) then the same technique can be used.