Most BIOSes are written in a mixture of assembly language and C. Have a look at www.coreboot.org if you want to get into more detail. The BIOS found in a typical PC is rather large, 1 MB is common.<p>The flash memory is programmed in the factory before being installed into the motherboard and can also be reprogrammed in the field. There are other technologies, such as JTAG which allow you to reprogram flash memories. In effect, part of the memory contains a very simple computer (if you dare call it that) which will communicate with an external device to perform the task.<p>Older technologies, e.g. EPROMs used high voltages (as in 12V vs. 5V) to program what was in effect a huge array of capacitors which could be erased by ultraviolet light. Before them ROMs were actually programmed by changing the manufacturing masks.