Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- USE16
- ORG 0x7c00
- STACK_BASE equ 0x7000
- code_begin:
- xor ax,ax
- mov ds,ax
- mov ss,ax
- mov es,ax
- mov fs,ax
- mov [0x500],dl
- mov sp,STACK_BASE
- mov si,0x7c00
- mov di,0x7a00
- mov ax,di
- mov cx,0x200
- rep movsb
- mov bx,mbr_main
- sub bx,code_begin
- add ax,bx
- jmp ax
- mbr_main:
- mov word [read_pack.cnt-0x200],40
- mov word [read_pack.dst-0x200],0x7c00
- mov dword [read_pack.srcl-0x200],0x01
- mov [read_pack.srch-0x200],0x00
- mov dl,[0x500]
- mov ah,0x42
- mov si,read_pack-0x200
- int 0x13
- push 0x7c00
- ret
- print_str:
- and ah,0x3
- add ah,0x30
- mov byte [dgg-0x200],ah
- mov cx,5
- mov bp,dgg-0x200
- mov ah,0x13
- mov al,0x00
- mov bh,0x00
- mov bl,0x0f
- xor dx,dx
- int 0x10
- hlt
- jmp $
- dgg:
- db "Error"
- read_pack:
- .size: db 0x10 ; packet size
- db 0x00 ; reserved
- .cnt dw 0x0000 ; packets to transfer
- .dst dd 0x00000000 ; destination address
- .srcl dd 0x00000000 ; source LBA low
- .srch dd 0x00000000 ; source LBA hi
- code_end:
- times 510-(code_end-code_begin) db 0x00
- db 0x55,0xaa
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement