Well, there's two choices. Either a bit of inline asm (probably easier in the end) or look at Base Services->Hardware on the Platform SDK on http://msdn.microsoft.com

I'll have a look in my asm book...