Changeset 605 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/AutoConfigure.asm
- Timestamp:
- May 8, 2021, 6:55:56 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/AutoConfigure.asm
r592 r605 41 41 push es 42 42 pop ds ; ROMVARS now in DS:DI 43 call ChecksumSystemBios 43 44 call ResetIdevarsToDefaultValues 44 45 call DetectIdePortsAndDevices … … 48 49 pop ds 49 50 pop es 51 .Return: 52 ret 53 54 55 ;-------------------------------------------------------------------- 56 ; ChecksumSystemBios 57 ; Parameters: 58 ; DS:DI: Ptr to ROMVARS 59 ; Returns: 60 ; Nothing 61 ; Corrupts registers: 62 ; AX, BX, CX, DX, SI 63 ;-------------------------------------------------------------------- 64 ALIGN JUMP_ALIGN 65 ChecksumSystemBios: 66 push ds 67 mov si, 0F000h 68 mov ds, si 69 mov si, 0FFFFh 70 ; DS:SI now points to the end of the System BIOS. 71 std 72 mov cx, 32768 ; The smallest known problematic BIOS so far. 73 mov dx, si ; Initialize the checksum 74 call CalculateCRC_CCITTfromDSSIwithSizeInCX 75 pop ds 76 mov bx, .Checksums 77 cld 78 .NextChecksum: 79 mov ax, [cs:bx] 80 test ax, ax 81 jz SHORT AutoConfigure_ForThisSystem.Return 82 inc bx 83 inc bx 84 cmp ax, dx 85 jne SHORT .NextChecksum 86 or BYTE [di+ROMVARS.wFlags], FLG_ROMVARS_CLEAR_BDA_HD_COUNT 87 mov dx, g_szDlgBadBiosFound 88 jmp Dialogs_DisplayNotificationFromCSDX 89 90 ALIGN WORD_ALIGN 91 .Checksums: 92 dw 0D192h ; 32 KB Zenith Z-161 (071784) 93 dw 02F69h ; 32 KB Zenith Z-171 (031485) 94 dw 0 95 96 97 ;-------------------------------------------------------------------- 98 ; CalculateCRC_CCITTfromDSSIwithSizeInCX 99 ; Parameters: 100 ; DS:SI: Pointer to string to checksum 101 ; CX: Length of string to checksum 102 ; DX: Checksum (initially 0FFFFh) 103 ; DF: Set/Clear depending on direction wanted 104 ; Returns: 105 ; DX: Checksum 106 ; DS:SI: Pointer to byte after the end of checksummed string 107 ; Corrupts registers: 108 ; AX, BX, CX 109 ;-------------------------------------------------------------------- 110 ALIGN JUMP_ALIGN 111 CalculateCRC_CCITTfromDSSIwithSizeInCX: 112 ; jcxz .Return 113 xor bh, bh 114 mov ah, 0E0h 115 .NextByte: 116 lodsb 117 xor dh, al 118 mov bl, dh 119 rol bx, 1 120 rol bx, 1 121 rol bx, 1 122 rol bx, 1 123 xor dx, bx 124 rol bx, 1 125 xchg dh, dl 126 xor dx, bx 127 ror bx, 1 128 ror bx, 1 129 ror bx, 1 130 ror bx, 1 131 and bl, ah 132 xor dx, bx 133 ror bx, 1 134 xor dh, bl 135 loop .NextByte 136 ;.Return: 50 137 ret 51 138
Note:
See TracChangeset
for help on using the changeset viewer.