min.S 608 B

12345678910111213141516171819202122
  1. /* Tell GAS to generate 16 bit code. */
  2. .code16
  3. /* Don't listen to interrupts. */
  4. cli
  5. /* Zero ds.
  6. *
  7. * This is only needed if we are going to access memory.
  8. *
  9. * The program might work on QEMU without this, but fail on real hardware:
  10. * http://stackoverflow.com/questions/32508919/how-to-produce-a-minimal-bios-hello-world-boot-sector-with-gcc-that-works-from-a
  11. *
  12. * You cannot write immediates direclty to it, must pass through ax:
  13. * http://stackoverflow.com/questions/19074666/8086-why-cant-we-move-an-immediate-data-into-segment-register
  14. */
  15. xor %ax, %ax
  16. mov %ax, %ds
  17. /* Stop the processor. */
  18. ret