引导加载程序不会跳转到内核代码
jmp
; ; SECTOR 0x0 ; ;dl is number of harddrive where is bootloader org 0x7C00 bits 16 ;reset hard drive xor ah,ah int 0x13 ;read sectors clc mov bx,0x7E00 mov es,bx xor bx,bx mov ah,0x02 ;function mov al,0x1 ;sectors to read mov ch,0x0 ;tracks mov cl,0x1 ;sector mov dh,0x0 ;head int 0x13 ;if not readed jmp to error jc error ;jump to 0x7E00 - executed only if loaded jmp 0x7E00 error: mov si,MSGError .loop: lodsb or al,al jz .end mov ah,0x0E int 0x10 jmp .loop .end: hlt MSGError db "Error while booting", 0x0 times 0x1FE - ($ - $$) db 0x0 db 0x55 db 0xAA ; ; SECTOR 0x1 ; jmp printtest ;definitions MSGLoaded db "Execution successful", 0x0 ; ; Print function ; si - message to pring (NEED TO BE FINISHED WITH 0x0) printtest: mov si,MSGLoaded .loop: lodsb or al,al jz .end mov ah,0x0E int 0x10 jmp .loop .end: hlt times 0x400 - ($-$$) db 0x0