Simtec published a very simple, and in my opinion elegant, C program that reads and writes to processor registers. I believe it was written for ARM processors but it seems to work on my A13 Olinuxino. Below is their website which should prove quite informative on this subject.
Vito Faraci
http://www.simtec.co.uk/appnotes/AN0014/