This was a helpful site for me, but it is 100 percent assembly code:

http://www.mcmanis.com/chuck/robotic...e_measure.html