Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;by: DoomsDay (Robert Milan)
- ;1-06-2005
- ;set ds to 0x7c00 where boot sector starts
- mov ax,0x7c0
- mov ds,ax
- ;jump past function db etc.
- jmp start
- ;declared bytes
- bootmsg db "DOS (doomsdays operating system)",13,10,"press any key to boot...",0
- ;functions
- print:
- lodsb ;load 1 byte from si into al
- cmp al,0x0 ;compare the byte loaded in al to NULL
- je pdone ;if al=NULL jmp to pdone label
- mov ah,0xe ;bios function TTYL
- int 0x10 ;call bios interrupt
- jmp print ;jump back to print to load the next byte in si
- pdone: ;pdone label
- ret ; return
- ;beginning of code
- start:
- ;print bootmsg & wait for key press
- mov si,bootmsg
- call print
- mov ah,0x0
- int 0x16
- ;disable interrupts, setup stack & renable interrupts
- cli
- mov ax,0x9000
- mov ss,ax
- mov sp,0
- sti
- ;reset disk
- mov ah,0
- int 0x13
- ;read
- mov ax,0x1000
- mov es,ax
- mov bx,0
- ;read sectors
- mov ah,2
- mov al,5
- mov cx,2
- mov dh,0
- int 0x13
- ;jump to boot strap
- jmp 0x1000:0x0
- times 512-($-$$)-2 db 0
- dw 0xAA55
Advertisement
Add Comment
Please, Sign In to add comment