In particular, this the very first step: https://github.com/oriansj/stage0-posix/blob/master/x86/hex0... (or its hand-edited binary version ?)
Edit: this how it's "assembled":
sed 's/[;#].*$//g' $input_file | xxd -r -p > $output_file