I wrote a x86 assembly program for MBR section. I compile it as follows:
nasm hellombr.asm -f bin -o hellombr.img
Then I run it in qemu:
A really good (and simple) way is to use IDA with bochs, you find an excellent blog post on it here, along with some other hints/suggestions for bootloader development.