bios_pixel.S 490 B

123456789101112131415161718192021222324252627282930
  1. /* https://github.com/cirosantilli/x86-bare-metal-examples#bios-draw-pixel */
  2. #include "common.h"
  3. BEGIN
  4. /* Enter video mode 13h. */
  5. mov $0x0013, %ax
  6. int $0x10
  7. start:
  8. /* Draw the pixel:
  9. *
  10. * * AH = 0Ch
  11. * * AL = Color
  12. * * BH = Page Number
  13. * * CX = x
  14. * * DX = y
  15. */
  16. mov $0x0C0C, %ax
  17. mov $0x01, %bh
  18. mov $0x0001, %cx
  19. mov $0x0001, %dx
  20. int $0x10
  21. inc %cx
  22. inc %dx
  23. cmp $201, %dx
  24. jz end
  25. jmp start
  26. end:
  27. hlt