0681 8AE0 MOV AH,AL AH=0E
0683 885624 MOV [BP+24],DL
;tmpvar=DL,引导分区标志
0686 C706A106EB1E MOV WORD PTR [06A1],1EEB
;改06A1处指令为PUSH DS; JMP NEW_LOCATION_1
INT13H_EXTENSION_UNSUPPORTED:
068C 886604 MOV [BP+04],AH
;如果支持的话置分区类型为0E(类型 WIN95: DOS 16-bit FAT, LBA-mapped)
;否则为06(类型 DOS 3.31+ 16-bit FAT over 32M)
TYPE_DEFAULT:
068F BF0A00 MOV DI,000A
READ_SECTOR_LOOP:
0692 B80102 MOV AX,0201
0695 8BDC MOV BX,SP BX设置为7C00
0697 33C9 XOR CX,CX CX=0
0699 83FF05 CMP DI,+05
069C 7F03 JG NEW_LOCATION_0
069E 8B4E25 MOV CX,[BP+25]
NEW_LOCATION_0:
06A1 034E02 ADD CX,[BP+02]
06A4 CD13 INT 13 将活动分区的起始扇区读到0000:7C00
NEW_LOCATION_1:
06A6 7229 JB READ_SECTOR_ERROR
;CF=1 - 错误
06A8 BE5907 MOV SI,0759
06AB 813EFE7D55AA CMP WORD PTR [7DFE],AA55
;扇区结束标志是否正确?
06B1 745A JZ READ_SECTOR_SUCCEEDED
;正确
06B3 83EF05 SUB DI,+05 DI=DI-5
06B6 7FDA JG READ_SECTOR_LOOP
06B8 85F6 TEST SI,SI
06BA 7583 JNZ DISPLAY_ERROR_MESSAGE_LOOP:
;显示错误信息:缺少操作系统
06BC BE2E07 MOV SI,072E
06BF EB8A JMP DISPLAY_ERROR_MESSAGE_LOOP_ALIAS
;显示错误信息:加载操作系统时发生错误。
070D EB74 JMP CONTINUE_KOAD_OS
0783 8BFC MOV DI,SP
;DI=7C00
0785 1E PUSH DS
0786 57 PUSH DI
0787 8BF5 MOV SI,BP
0789 CB RETF 转到执行0000:7C00处的语句,即操作系统的引导程序
硬盘MBR全面分析(4) www.jdcok.com/anli/5/589.html