Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [org 0x7C00]
- [bits 16]
- jmp start
- bootDisk: db 0x00
- errorMessage: db 'Drive Error',0
- errorMessage2: db 'Display Error',0
- global start
- start:
- mov [bootDisk], dl
- ;Set up segments
- cli
- mov ax, 0x00
- mov ds, ax
- mov es, ax
- mov ss, ax
- mov sp, 0x6C00
- sti
- ;Read disk
- mov ah, 2
- mov al, 60 ; sector count
- mov dl, [bootDisk]
- mov cl, 2
- mov ch, 0
- mov dh, 0
- mov bx, 0x7E00
- int 0x13
- jc derror
- mov ax, 0
- mov es, ax
- mov ah, 0
- mov al, 3
- int 0x10
- jmp end
- verror:
- lea si, [errorMessage2]
- jmp loop
- derror:
- lea si, [errorMessage]
- loop:
- mov al, [si]
- cmp al, 0
- je loop
- inc si
- mov ah, 0xE
- int 0x10
- cmp al, 0
- jnz loop
- jmp $
- times 510-($-$$) db 0
- dw 0xAA55
- end:
Advertisement
Add Comment
Please, Sign In to add comment