📄 hpt370.cod
字号:
; 502 : SecondChannel->HwDeviceExtension = (PHW_DEVICE_EXTENSION)FirstChannel;
; 503 : SecondChannel->CallBack = AtapiCallBack2;
; 504 : FirstChannel->BaseBMI = SecondChannel->BaseBMI = IoPort;
; 505 :
; 506 :
; 507 : pci1_cfg.reg_num = REG_PCICMD;
005a2 81 e7 04 ff 00
00 and edi, 65284 ; 0000ff04H
005a8 83 e3 fe and ebx, -2 ; fffffffeH
005ab 83 cf 04 or edi, 4
005ae 66 89 7d 08 mov WORD PTR _pci1_cfg$[ebp], di
; 508 : ScsiPortWritePortUlong((PULONG)0xCF8, *((PULONG)&pci1_cfg));
005b2 8b 7d 08 mov edi, DWORD PTR _pci1_cfg$[ebp]
005b5 8d 53 08 lea edx, DWORD PTR [ebx+8]
005b8 89 5e 18 mov DWORD PTR [esi+24], ebx
005bb 89 96 94 04 00
00 mov DWORD PTR [esi+1172], edx
005c1 89 36 mov DWORD PTR [esi], esi
005c3 c7 46 04 00 00
00 00 mov DWORD PTR [esi+4], OFFSET FLAT:_AtapiCallBack@4
005ca 57 push edi
005cb 89 b6 7c 04 00
00 mov DWORD PTR [esi+1148], esi
005d1 c7 86 80 04 00
00 00 00 00 00 mov DWORD PTR [esi+1152], OFFSET FLAT:_AtapiCallBack2@4
005db 66 89 9e 86 04
00 00 mov WORD PTR [esi+1158], bx
005e2 68 f8 0c 00 00 push 3320 ; 00000cf8H
005e7 66 89 5e 0a mov WORD PTR [esi+10], bx
005eb e8 00 00 00 00 call _ScsiPortWritePortUlong@8
; 509 : i = (ScsiPortReadPortUshort((PUSHORT)0xCFC) & ~12) |
; 510 : PCI_BMEN | PCI_IOSEN;
005f0 68 fc 0c 00 00 push 3324 ; 00000cfcH
005f5 e8 00 00 00 00 call _ScsiPortReadPortUshort@4
005fa 25 ff ff 00 00 and eax, 65535 ; 0000ffffH
005ff 24 f7 and al, -9 ; fffffff7H
00601 0c 05 or al, 5
; 511 : ScsiPortWritePortUshort((PUSHORT)0xCFC, (USHORT)i);
00603 50 push eax
00604 68 fc 0c 00 00 push 3324 ; 00000cfcH
00609 e8 00 00 00 00 call _ScsiPortWritePortUshort@8
; 512 :
; 513 :
; 514 : pci1_cfg.reg_num = REG_MLT & ~3;
0060e 81 e7 0c ff 00
00 and edi, 65292 ; 0000ff0cH
00614 83 cf 0c or edi, 12 ; 0000000cH
00617 66 89 7d 08 mov WORD PTR _pci1_cfg$[ebp], di
; 515 : ScsiPortWritePortUlong((PULONG)0xCF8, *((PULONG)&pci1_cfg));
0061b 8b 7d 08 mov edi, DWORD PTR _pci1_cfg$[ebp]
0061e 57 push edi
0061f 68 f8 0c 00 00 push 3320 ; 00000cf8H
00624 e8 00 00 00 00 call _ScsiPortWritePortUlong@8
; 516 : ScsiPortWritePortUchar((PUCHAR)(0xCFC+ (REG_MLT & 3)), 0x40);
00629 6a 40 push 64 ; 00000040H
0062b 68 fd 0c 00 00 push 3325 ; 00000cfdH
00630 e8 00 00 00 00 call _ScsiPortWritePortUchar@8
; 517 :
; 518 : #ifdef DPLL
; 519 : FirstChannel->Clk_Mode = SecondChannel->Clk_Mode = 0x20;
; 520 : pci1_cfg.reg_num = 0x5B & ~3;
00635 81 e7 58 ff 00
00 and edi, 65368 ; 0000ff58H
0063b c6 86 85 04 00
00 20 mov BYTE PTR [esi+1157], 32 ; 00000020H
00642 83 cf 58 or edi, 88 ; 00000058H
00645 c6 46 09 20 mov BYTE PTR [esi+9], 32 ; 00000020H
00649 66 89 7d 08 mov WORD PTR _pci1_cfg$[ebp], di
; 521 : ScsiPortWritePortUlong((PULONG)0xCF8, *((PULONG)&pci1_cfg));
0064d 8b 7d 08 mov edi, DWORD PTR _pci1_cfg$[ebp]
00650 57 push edi
00651 68 f8 0c 00 00 push 3320 ; 00000cf8H
00656 e8 00 00 00 00 call _ScsiPortWritePortUlong@8
; 522 : if(ScsiPortReadPortUchar((PUCHAR)(0xCFC + (0x5B & 3))) & 0x80)
0065b 68 ff 0c 00 00 push 3327 ; 00000cffH
00660 e8 00 00 00 00 call _ScsiPortReadPortUchar@4
00665 a8 80 test al, 128 ; 00000080H
00667 0f 85 5e 01 00
00 jne $DPLL_OK$2060
; 523 : goto DPLL_OK;
; 524 : #endif
; 525 :
; 526 : pci1_cfg.reg_num = 0x78;
0066d 81 e7 78 ff 00
00 and edi, 65400 ; 0000ff78H
00673 83 cf 78 or edi, 120 ; 00000078H
00676 66 89 7d 08 mov WORD PTR _pci1_cfg$[ebp], di
; 527 : ScsiPortWritePortUlong((PULONG)0xCF8, *((PULONG)&pci1_cfg));
0067a 8b 7d 08 mov edi, DWORD PTR _pci1_cfg$[ebp]
0067d 57 push edi
0067e 68 f8 0c 00 00 push 3320 ; 00000cf8H
00683 e8 00 00 00 00 call _ScsiPortWritePortUlong@8
; 528 : i = ScsiPortReadPortUshort((PUSHORT)0xCFC) & 0x1FF;
00688 68 fc 0c 00 00 push 3324 ; 00000cfcH
0068d e8 00 00 00 00 call _ScsiPortReadPortUshort@4
00692 25 ff 01 00 00 and eax, 511 ; 000001ffH
; 529 : if(i < 0x9C)
00697 3d 9c 00 00 00 cmp eax, 156 ; 0000009cH
0069c 73 09 jae SHORT $L2064
; 530 : i = 0x23;
0069e c7 45 fc 23 00
00 00 mov DWORD PTR _i$[ebp], 35 ; 00000023H
; 531 : else if(i < 0xb0)
006a5 eb 1f jmp SHORT $L2068
$L2064:
006a7 3d b0 00 00 00 cmp eax, 176 ; 000000b0H
006ac 73 09 jae SHORT $L2066
; 532 : i = 0x29;
006ae c7 45 fc 29 00
00 00 mov DWORD PTR _i$[ebp], 41 ; 00000029H
; 533 : else if (i < 0xc8)
006b5 eb 0f jmp SHORT $L2068
$L2066:
006b7 3d c8 00 00 00 cmp eax, 200 ; 000000c8H
006bc 1b c0 sbb eax, eax
006be 24 eb and al, -21 ; ffffffebH
006c0 83 c0 42 add eax, 66 ; 00000042H
006c3 89 45 fc mov DWORD PTR _i$[ebp], eax
$L2068:
; 534 : i = 0x2d;
; 535 : else
; 536 : i = 0x42;
; 537 :
; 538 : k = 0;
006c6 c7 45 f8 00 00
00 00 mov DWORD PTR _k$[ebp], 0
$reset_5C$2070:
; 539 : reset_5C:
; 540 : pci1_cfg.reg_num = 0x5C;
006cd 81 e7 5c ff 00
00 and edi, 65372 ; 0000ff5cH
006d3 83 cf 5c or edi, 92 ; 0000005cH
006d6 66 89 7d 08 mov WORD PTR _pci1_cfg$[ebp], di
; 541 : ScsiPortWritePortUlong((PULONG)0xCF8, *((PULONG)&pci1_cfg));
006da 8b 7d 08 mov edi, DWORD PTR _pci1_cfg$[ebp]
006dd 57 push edi
006de 68 f8 0c 00 00 push 3320 ; 00000cf8H
006e3 e8 00 00 00 00 call _ScsiPortWritePortUlong@8
; 542 : ScsiPortWritePortUlong((PULONG)0xCFC, (((i <= 0x2d? 2 : 4) + i)
; 543 : << 16) | i | 0x100);
006e8 8b 45 fc mov eax, DWORD PTR _i$[ebp]
006eb b9 2d 00 00 00 mov ecx, 45 ; 0000002dH
006f0 3b c8 cmp ecx, eax
006f2 1b d2 sbb edx, edx
006f4 83 e2 02 and edx, 2
006f7 83 c2 02 add edx, 2
006fa 03 d0 add edx, eax
006fc c1 e2 10 shl edx, 16 ; 00000010H
006ff 0b d0 or edx, eax
00701 80 ce 01 or dh, 1
00704 52 push edx
00705 68 fc 0c 00 00 push 3324 ; 00000cfcH
0070a e8 00 00 00 00 call _ScsiPortWritePortUlong@8
; 544 :
; 545 : pci1_cfg.reg_num = 0x5B & ~3;
0070f 81 e7 58 ff 00
00 and edi, 65368 ; 0000ff58H
00715 83 cf 58 or edi, 88 ; 00000058H
00718 66 89 7d 08 mov WORD PTR _pci1_cfg$[ebp], di
; 546 : ScsiPortWritePortUlong((PULONG)0xCF8, *((PULONG)&pci1_cfg));
0071c 8b 7d 08 mov edi, DWORD PTR _pci1_cfg$[ebp]
0071f 57 push edi
00720 68 f8 0c 00 00 push 3320 ; 00000cf8H
00725 e8 00 00 00 00 call _ScsiPortWritePortUlong@8
; 547 : #ifdef DPLL
; 548 : ScsiPortWritePortUchar((PUCHAR)(0xCFC + (0x5B & 3)), 0x20);
0072a 6a 20 push 32 ; 00000020H
0072c 68 ff 0c 00 00 push 3327 ; 00000cffH
00731 e8 00 00 00 00 call _ScsiPortWritePortUchar@8
; 549 : for(j = 0; j < 1000; j++) {
00736 c7 45 10 00 00
00 00 mov DWORD PTR _j$[ebp], 0
$L2327:
; 550 : if(ScsiPortReadPortUchar((PUCHAR)(0xCFC + (0x5B & 3))) & 0x80) {
0073d 68 ff 0c 00 00 push 3327 ; 00000cffH
00742 e8 00 00 00 00 call _ScsiPortReadPortUchar@4
00747 a8 80 test al, 128 ; 00000080H
00749 75 37 jne SHORT $L2321
; 553 : goto re_try;
; 554 : goto DPLL_OK;
; 555 : }
; 556 : ScsiPortStallExecution(1000);
0074b 68 e8 03 00 00 push 1000 ; 000003e8H
00750 e8 00 00 00 00 call _ScsiPortStallExecution@4
00755 8b 45 10 mov eax, DWORD PTR _j$[ebp]
00758 40 inc eax
00759 3d e8 03 00 00 cmp eax, 1000 ; 000003e8H
0075e 89 45 10 mov DWORD PTR _j$[ebp], eax
00761 72 da jb SHORT $L2327
$re_try$2087:
; 557 : }
; 558 : re_try:
; 559 : if(++k < 5) {
00763 8b 45 f8 mov eax, DWORD PTR _k$[ebp]
00766 40 inc eax
00767 83 f8 05 cmp eax, 5
0076a 89 45 f8 mov DWORD PTR _k$[ebp], eax
0076d 73 45 jae SHORT $L2088
; 560 : if(k & 1)
0076f a8 01 test al, 1
00771 74 32 je SHORT $L2089
; 561 : i -= (k >> 1);
00773 8b 4d fc mov ecx, DWORD PTR _i$[ebp]
00776 d1 e8 shr eax, 1
00778 2b c8 sub ecx, eax
0077a 89 4d fc mov DWORD PTR _i$[ebp], ecx
; 562 : else
0077d e9 4b ff ff ff jmp $reset_5C$2070
$L2321:
; 551 : for(j = 0; j < 0x10000; j++)
00782 c7 45 10 00 00
00 00 mov DWORD PTR _j$[ebp], 0
$L2082:
00789 81 7d 10 00 00
01 00 cmp DWORD PTR _j$[ebp], 65536 ; 00010000H
00790 73 39 jae SHORT $DPLL_OK$2060
; 552 : if((ScsiPortReadPortUchar((PUCHAR)(0xCFC + (0x5B & 3))) & 0x80) == 0)
00792 68 ff 0c 00 00 push 3327 ; 00000cffH
00797 e8 00 00 00 00 call _ScsiPortReadPortUchar@4
0079c a8 80 test al, 128 ; 00000080H
0079e 74 c3 je SHORT $re_try$2087
007a0 ff 45 10 inc DWORD PTR _j$[ebp]
007a3 eb e4 jmp SHORT $L2082
$L2089:
; 563 : i += (k >> 1);
007a5 8b 4d fc mov ecx, DWORD PTR _i$[ebp]
007a8 d1 e8 shr eax, 1
007aa 03 c8 add ecx, eax
007ac 89 4d fc mov DWORD PTR _i$[ebp], ecx
; 564 : goto reset_5C;
007af e9 19 ff ff ff jmp $reset_5C$2070
$L2088:
; 565 : }
; 566 : ScsiPortWritePortUchar((PUCHAR)(0xCFC + (0x5B & 3)), 0x22);
007b4 6a 22 push 34 ; 00000022H
007b6 68 ff 0c 00 00 push 3327 ; 00000cffH
007bb e8 00 00 00 00 call _ScsiPortWritePortUchar@8
; 567 : FirstChannel->Clk_Mode = SecondChannel->Clk_Mode = 0x22;
007c0 c6 86 85 04 00
00 22 mov BYTE PTR [esi+1157], 34 ; 00000022H
007c7 c6 46 09 22 mov BYTE PTR [esi+9], 34 ; 00000022H
$DPLL_OK$2060:
; 568 : #endif
; 569 : #ifdef EXT_CLOCK
; 570 : ScsiPortWritePortUchar((PUCHAR)(0xCFC + (0x5B & 3), 0x30);
; 571 : #endif
; 572 : #ifdef FIX_33CLK
; 573 : ScsiPortWritePortUchar((PUCHAR)(0xCFC + (0x5B & 3)), 0x22);
; 574 : FirstChannel->Clk_Mode = SecondChannel->Clk_Mode = 0x22;
; 575 : #endif
; 576 : DPLL_OK:
; 577 : pci1_cfg.reg_num = 0x5A & ~3;
007cb 81 e7 58 ff 00
00 and edi, 65368 ; 0000ff58H
007d1 83 cf 58 or edi, 88 ; 00000058H
007d4 66 89 7d 08 mov WORD PTR _pci1_cfg$[ebp], di
; 578 : ScsiPortWritePortUlong((PULONG)0xCF8, *((PULONG)&pci1_cfg));
007d8 8b 7d 08 mov edi, DWORD PTR _pci1_cfg$[ebp]
007db 57 push edi
007dc 68 f8 0c 00 00 push 3320 ; 00000cf8H
007e1 e8 00 00 00 00 call _ScsiPortWritePortUlong@8
; 579 : i = ScsiPortReadPortUchar((PUCHAR)(0xCFC + (0x5A & 3)));
007e6 68 fe 0c 00 00 push 3326 ; 00000cfeH
007eb e8 00 00 00 00 call _ScsiPortReadPortUchar@4
007f0 25 ff 00 00 00 and eax, 255 ; 000000ffH
; 580 :
; 581 : FirstChannel->Is40PinCable = i & 2;
; 582 : SecondChannel->Is40PinCable = i & 1;
; 583 :
; 584 : pci1_cfg.reg_num = REG_MISC;
007f5 81 e7 50 ff 00
00 and edi, 65360 ; 0000ff50H
007fb 8a c8 mov cl, al
007fd 24 01 and al, 1
007ff 80 e1 02 and cl, 2
00802 83 cf 50 or edi, 80 ; 00000050H
00805 88 4e 08 mov BYTE PTR [esi+8], cl
00808 88 86 84 04 00
00 mov BYTE PTR [esi+1156], al
0080e 66 89 7d 08 mov WORD PTR _pci1_cfg$[ebp], di
; 585 : ScsiPortWritePortUlong((PULONG)0xCF8, *((PULONG)&pci1_cfg));
00812 8b 75 08 mov esi, DWORD PTR _pci1_cfg$[ebp]
00815 56 push esi
00816 68 f8 0c 00 00 push 3320 ; 00000cf8H
0081b e8 00 00 00 00 call _ScsiPortWritePortUlong@8
; 586 : ScsiPortWritePortUchar((PUCHAR)0xCFC, 5);
00820 6a 05 push 5
00822 68 fc 0c 00 00 push 3324 ; 00000cfcH
00827 e8 00 00 00 00 call _ScsiPortWritePortUchar@8
; 587 :
; 588 : pci1_cfg.reg_num = REG_MISC + 4;
0082c 81 e6 54 ff 00
00 and esi, 65364 ; 0000ff54H
00832 83 ce 54 or esi, 84 ; 00000054H
00835 66 89 75 08 mov WORD PTR _pci1_cfg$[ebp], si
; 589 : ScsiPortWritePortUlong((PULONG)0xCF8, *((PULONG)&pci1_cfg));
00839 8b 55 08 mov edx, DWORD PTR _pci1_cfg$[ebp]
0083c 52 push edx
0083d 68 f8 0c 00 00 push 3320 ; 00000cf8H
00842 e8 00 00 00 00 call _ScsiPortWritePortUlong@8
; 590 : ScsiPortWritePortUchar((PUCHAR)0xCFC, 5);
00847 6a 05 push 5
00849 68 fc 0c 00 00 push 3324 ; 00000cfcH
0084e e8 00 00 00 00 call _ScsiPortWritePortUchar@8
; 591 :
; 592 : for(i = 0x60; i < 0x70; i+=4)
00853 be 60 00 00 00 mov esi, 96 ; 00000060H
$L2101:
; 593 : ScsiPortWritePortUlong((PULONG)(IoPort + i), 0xad9f50b);
00858 8d 04 33 lea eax, DWORD PTR [ebx+esi]
0085b 68 0b f5 d9 0a push 182056203 ; 0ad9f50bH
00860 50 push eax
00861 e8 00 00 00 00 call _ScsiPortWritePortUlong@8
00866 83 c6 04 add esi, 4
00869 83 fe 70 cmp esi, 112 ; 00000070H
0086c 72 ea jb SHORT $L2101
0086e 5f pop edi
0086f 5e pop esi
; 594 :
; 595 : return(1);
00870 b8 01 00 00 00 mov eax, 1
00875 5b pop ebx
; 596 : }
00876 8b e5 mov esp, ebp
00878 5d pop ebp
00879 c2 0c 00 ret 12 ; 0000000cH
_ScanHpt366@12 ENDP
_TEXT ENDS
PUBLIC _AtapiStringCmp@12
_TEXT SEGMENT
_FirstStr$ = 8
_SecondStr$ = 12
_Count$ = 16
_AtapiStringCmp@12 PROC NEAR
; 642 : {
00880 55 push ebp
00881 8b ec mov ebp, esp
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -