Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. [bits 16]
  2. [org 0x7c00]
  3.  
  4. cli
  5. mov bx,cs
  6. mov ds,bx
  7. mov ss,bx
  8. mov sp,0xfffe
  9.  
  10. mov ax,0
  11. mov es,ax
  12. mov ax,0x6000
  13. mov word [es:0],0
  14. mov [es:2],ax
  15.  
  16. mov bx,0x6000
  17. mov es,bx
  18. mov bx,0
  19. sti
  20.  
  21. mov ah,2 ;service
  22. mov al,1 ;sector count
  23. mov ch,0 ;cylinder
  24. mov cl,2 ;sbector#
  25. mov dh,0 ;head
  26. mov dl,0
  27. int 13h
  28.  
  29. jc error
  30.  
  31. ;int 0h
  32. mov bx,0
  33. mov es,bx
  34. mov bx,0h
  35. jmp far[es:bx]
  36.  
  37. error:
  38. mov al,'E'
  39. mov ah,0eh
  40. mov bl,7
  41. mov bh,0
  42. int 10h
  43. jmp $
  44.  
  45. k:
  46. mov al,'F'
  47. mov ah,0eh
  48. mov bl,7
  49. mov bh,0
  50. int 10h
  51. jmp $
  52.  
  53. times 510-($-$$) db 0
  54. dw 0xAA55
  55.  
  56.  
  57.  
  58. **Sector2 :**
  59.  
  60. [bits 16]
  61.  
  62. SECTOR2:
  63.  
  64. mov bx,cs
  65. mov ds,bx
  66. mov es,bx
  67.  
  68. mov ah,0eh
  69. mov bl,7
  70. mov bh,0
  71. int 10h
  72.  
  73. call SECTOR3
  74. mov si,msg2
  75. l:
  76. cmp byte [si],0
  77. je exit
  78. mov al,[si]
  79. int 10h
  80. inc si
  81. jmp l
  82. exit:
  83. jmp $
  84. msg2 db "Sector 2 is loaded",0
  85. times 512-($-$$) db 0
  86.  
  87. [bits 16]
  88.  
  89. SECTOR3:
  90.  
  91. mov bx,cs
  92. mov ds,bx
  93. mov es,bx
  94.  
  95.  
  96.  
  97. mov ah,0eh
  98. mov bl,7
  99. mov bh,0
  100. int 10h
  101. mov si,msg1
  102. l2:
  103. cmp byte [si],0
  104. je exit3
  105. mov al,[si]
  106. int 10h
  107. inc si
  108. jmp l2
  109. exit3:
  110. retf
  111. ; jmp $
  112. msg1 db "Sector 3 is loaded",0
  113. times 512-($-$$) db 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement