bios_color.S 483 B

12345678910111213141516171819202122232425
  1. /* https://github.com/cirosantilli/x86-bare-metal-examples#bios-color */
  2. #include "common.h"
  3. BEGIN
  4. /* ID of character to print. */
  5. mov $0x0961, %ax
  6. /* Page, color, */
  7. mov $0x0034, %bx
  8. /* How many times to write.
  9. * If too big, wraps around screen.
  10. */
  11. mov $0x0002, %cx
  12. int $0x10
  13. /* The new color is reused only for character that overwrite the writen region.
  14. *
  15. * Cursor is not moved by the previous interrupt, so this produces a colored 'a'.
  16. */
  17. PUTC $'b
  18. PUTC $'c
  19. PUTC $'d
  20. hlt