I think an "example code" from BIOS of x86 mainboard is enough for your purpose. You can disassemble a mainboard BIOS to find out this routines. However you will need the datasheets of the chipsets. If the chipset is made Intel, the datasheet is freely available from intel website. To begin with, you can read my article on how to disassemble an x86 BIOS at : hxxp://www.geocities.com/mamanzip/Articles/Award_Bios_RE/Award_Bios_RE_guide.html