1
0

boot_sect_segmentation.asm 493 B

123456789101112131415161718192021222324252627
  1. mov ah, 0x0e ; tty
  2. mov al, [the_secret]
  3. int 0x10 ; we already saw this doesn't work, right?
  4. mov bx, 0x7c0 ; remember, the segment is automatically <<4 for you
  5. mov ds, bx
  6. ; WARNING: from now on all memory references will be offset by 'ds' implicitly
  7. mov al, [the_secret]
  8. int 0x10
  9. mov al, [es:the_secret]
  10. int 0x10 ; doesn't look right... isn't 'es' currently 0x000?
  11. mov bx, 0x7c0
  12. mov es, bx
  13. mov al, [es:the_secret]
  14. int 0x10
  15. jmp $
  16. the_secret:
  17. db "X"
  18. times 510 - ($-$$) db 0
  19. dw 0xaa55