osdev-jpでは、OS開発に有用な情報を収集し公開しています
brew install binutils
gobjdumpという名前でインストールされる。ソースの先頭に下記の記述を追加すればok
.intel_syntax noprefix
hello.shello.ohello.binにバイナリが出力されるhello.binの先頭には.code16と書きましょう!(こうしないと16bitモードの機械語が出力されない)gcc -c -Wall -o hello.o hello.s
gobjcopy --only-section=.text --output-target binary hello.o hello.bin