Compile a code for running on boot

How can I compile a code that can be runned on boot:??

What OS are you using? And when exactly do you want to run it?

i using Windows XP and I want to compile the lastest version off FreeDos in a VmWare Workstation(Virtual Machine). The boot section of FreeDos Kernel is coded in ASM.