boot:
;Load the floppy data to 0:7c00h+200h
;This boot loader is more than 512b
; So it is can not save in one sector
mov bx,512
mov ax,offset boot_end-offset boot
mov dx,0
div bx
cmp ax,0
je load_ok -------->cmp ax,0后的load_ok是做什么的?
cmp dx,0
je r_floppy -------->cmp dx,0后的r_floppy是做什么的?
inc ax
r_floppy:cmp ax,1
jna load_ok
mov bx,0
mov es,bx
mov bx,7c00h+200h
dec al
mov ch,0
mov cl,2
mov dh,0
mov dl,0
mov ah,2
int 13h
load_ok:mov bx,0
push bx
mov bx,offset b_start-offset boot+7c00h
push bx
retf
;Define the boot menu
b_menu1:db "1) Reset PC",0
b_menu2:db "2) Start system",0
b_menu3:db "3) Clock",0
b_menu4:db "4) Set clock",0
b_menu5:db "Please enter your choice:[1-4]",0
time_str:db "yy/mm/dd hh:mm:ss",0
set_clock_p:db "Please enter the new time(yy/mm/dd hh:mm:ss):",0
set_clock_s:db "__/__/__ __:__:__",0
set_clock_top dw 0
menu_tab dw offset b_menu1-offset boot+7c00h,offset b_menu2-offset boot+7c00h,offset b_menu3-offset boot+7c00h,offset b_menu4-offset boot+7c00h,offset b_menu5-offset boot+7c00h
fun_table dw offset reset_pc-offset boot+7c00h,0,200h,0,offset clock-offset boot+7c00h,0,offset set_clock-offset boot+7c00h,0
org_int9_addr dw 0,0 |