Guest User

Untitled

a guest
Sep 25th, 2026
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;by: DoomsDay (Robert Milan)
  2. ;1-06-2005
  3.  
  4. ;set ds to 0x7c00 where boot sector starts
  5. mov ax,0x7c0
  6. mov ds,ax
  7. ;jump past function db etc.
  8. jmp start
  9. ;declared bytes
  10. bootmsg db "DOS (doomsdays operating system)",13,10,"press any key to boot...",0
  11. ;functions
  12. print:
  13. lodsb ;load 1 byte from si into al
  14. cmp al,0x0 ;compare the byte loaded in al to NULL
  15. je pdone ;if al=NULL jmp to pdone label
  16. mov ah,0xe ;bios function TTYL
  17. int 0x10 ;call bios interrupt
  18. jmp print ;jump back to print to load the next byte in si
  19. pdone: ;pdone label
  20. ret ; return
  21. ;beginning of code
  22. start:
  23. ;print bootmsg & wait for key press
  24. mov si,bootmsg
  25. call print
  26. mov ah,0x0
  27. int 0x16
  28. ;disable interrupts, setup stack & renable interrupts
  29. cli
  30. mov ax,0x9000
  31. mov ss,ax
  32. mov sp,0
  33. sti
  34. ;reset disk
  35. mov ah,0
  36. int 0x13
  37. ;read
  38. mov ax,0x1000
  39. mov es,ax
  40. mov bx,0
  41. ;read sectors
  42. mov ah,2
  43. mov al,5
  44. mov cx,2
  45. mov dh,0
  46. int 0x13
  47. ;jump to boot strap
  48. jmp 0x1000:0x0
  49. times 512-($-$$)-2 db 0
  50. dw 0xAA55
Advertisement
Add Comment
Please, Sign In to add comment