cs.S 391 B

12345678910111213141516171819202122232425262728
  1. /* https://github.com/cirosantilli/x86-bare-metal-examples#cs */
  2. #include "common.h"
  3. BEGIN
  4. CLEAR
  5. mov %cs, %ax
  6. PRINT_HEX <%al>
  7. PRINT_NEWLINE
  8. /* CS = 1 */
  9. ljmp $1, $1f
  10. 1:
  11. .skip 0x10
  12. mov %cs, %ax
  13. PRINT_HEX <%al>
  14. PRINT_NEWLINE
  15. /* CS = 2 */
  16. ljmp $2, $1f
  17. 1:
  18. .skip 0x20
  19. mov %cs, %ax
  20. PRINT_HEX <%al>
  21. PRINT_NEWLINE
  22. hlt