Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
1.7 KiB

  1. ;
  2. ; Program to be inserted on the boot sector of the emergency repair
  3. ; disk. Prints out a message and hangs.
  4. ;
  5. ; The program is designed to be inserted around the existing BPB.
  6. ; Whoever puts it in place should read the first three bytes of the
  7. ; boot sector to determine the byte offset within the sector where the
  8. ; program should be placed.
  9. ;
  10. ; See setup\src\restore.c.
  11. ;
  12. TheSeg segment
  13. assume cs:TheSeg,ds:nothing,es:nothing,ss:nothing
  14. ;
  15. ; Make link happy with /tiny by setting org to 100h.
  16. ; The program itself is designed to run at 0:7c00h, so
  17. ; the org is just a dummy.
  18. ;
  19. org 100h
  20. Start:
  21. ;
  22. ; Set up a stack and initialize necessary segment registers.
  23. ;
  24. xor bx,bx
  25. mov ss,bx
  26. mov ds,bx
  27. mov sp,7c00h
  28. ;
  29. ; Set video mode -- 80x25 text.
  30. ;
  31. mov ax,3
  32. int 10h
  33. ;
  34. ; Make ds:si point at the message to be displayed.
  35. ;
  36. call @f
  37. @@: pop si
  38. add si,offset cs:msg - @b
  39. ;
  40. ; Print out the string via BIOS calls. Registers ds, si, and bx are
  41. ; already set up.
  42. ;
  43. ; Some BIOSes don't preserve ax properly so we'll reload it
  44. ; on every iteration.
  45. ;
  46. cld
  47. @@: mov ah,0eh
  48. lodsb
  49. or al,al
  50. jz @f
  51. int 10h
  52. jmp @b
  53. ;
  54. ; Done. Hide the cursor and hang.
  55. ; Register bh is already set up.
  56. ;
  57. @@: mov ah,2
  58. mov dl,bl
  59. mov dh,19h
  60. int 10h
  61. sti
  62. @@: jmp @b
  63. ;
  64. ; The message to be printed. This will be inserted by setup from its
  65. ; resources (IDS_REPAIR_BOOTCODE_MSG), and must be nul-terminated.
  66. ;
  67. msg label byte
  68. TheSeg ends
  69. end Start