Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- call gca
- ; it's the begin of execution call gca -> push cs
- gca:
- pop bx ; bx=cs=0x0,since bootloader is load at 0x
- mov ax,0x07c0
- mov ds,ax
- mov si,bx
- add si,0x200
- ;
- ;DAP
- mov byte [si],0x10
- inc si
- mov byte [si],0x0
- inc si
- mov word [si],0x1
- mov word [si],0x300
- mov word [si],bx
- mov word [si],0x1
- mov word [si],0x0
- mov dword [si],0
- ; What to write is here
- mov word [bx+0x300],'AB'
- ;
- ; Write
- mov ah,0x41
- mov bx,0x55aa
- mov dl,0x80
- int 0x13
- jc error
- ;
- mov ah,0x43
- mov dl,0x80
- mov si,bx
- add si,0x200
- int 0x13
- jc error
- ;
- success:
- mov si,suc_msg
- print_succ:
- lodsb
- or al,al
- jz hang
- mov ah,0xe
- int 0x10
- jmp print_succ
- ;
- error:
- mov si,err_msg
- print_err:
- lodsb
- or al,al
- jz hang
- mov ah,0xe
- int 0x10
- jmp print_err
- hang:
- jmp hang
- err_msg db "You have encountered an error!",0x0
- suc_msg db "You are success!",0x0
- times 510-($-$$) db 0
- dw 0xAA55
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement