Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm	(revision 489)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm	(revision 491)
@@ -36,5 +36,5 @@
 	; corrupted. We start by making sure P-CHS values are valid.
 	; If they are, we assume the ATA ID to be valid. Fortunately we can do
-	; futher checking for ATA-5 and later since they contain signature and
+	; further checking for ATA-5 and later since they contain signature and
 	; checksum bytes. Those are not available for ATA-4 and older.
 
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm	(revision 489)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm	(revision 491)
@@ -3,5 +3,5 @@
 
 ;
-; XTIDE Universal BIOS and Associated Tools 
+; XTIDE Universal BIOS and Associated Tools
 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
 ;
@@ -10,11 +10,11 @@
 ; the Free Software Foundation; either version 2 of the License, or
 ; (at your option) any later version.
-; 
+;
 ; This program is distributed in the hope that it will be useful,
 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-; GNU General Public License for more details.		
+; GNU General Public License for more details.
 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
-;		
+;
 
 ; Section containing code
@@ -153,6 +153,6 @@
 ;--------------------------------------------------------------------
 StartDetectionWithDriveSelectByteInBHandStringInCX:
+%ifdef MODULE_8BIT_IDE
 	; Autodetect port for XT-CF
-%ifdef MODULE_8BIT_IDE
 	call	DetectDrives_DoesIdevarsInCSBPbelongToXTCF
 	jne		SHORT .SkipXTCFportDetection
@@ -165,7 +165,12 @@
 	; for next drive (another XT-CF card on same system)
 .DetectNextPort:
-	call	BootVars_GetNextXTCFportToDetectToDX
-	cmp		dx, XTCF_BASE_PORT_4
+	mov		dx, [es:BOOTVARS.wNextXTCFportToScan]
+	xor		dl, 40h
+	jnz		SHORT .StoreNextXTCFportToScan
+	inc		dh
+	cmp		dh, XTCF_BASE_PORT_4 >> 8
 	ja		SHORT .SkipXTCFportDetection		; XT-CF not found from any port
+.StoreNextXTCFportToScan:
+	mov		[es:BOOTVARS.wNextXTCFportToScan], dx
 
 	call	AH1Eh_DetectXTCFwithBasePortInDX
@@ -178,5 +183,5 @@
 	jmp		SHORT .DriveDetectionStringPrintedOnScreen
 
-	; Print detect string for devices that do not support autodetection 	
+	; Print detect string for devices that do not support autodetection
 .SkipXTCFportDetection:
 	push	dx
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm	(revision 489)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm	(revision 491)
@@ -3,5 +3,5 @@
 
 ;
-; XTIDE Universal BIOS and Associated Tools 
+; XTIDE Universal BIOS and Associated Tools
 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
 ;
@@ -10,11 +10,11 @@
 ; the Free Software Foundation; either version 2 of the License, or
 ; (at your option) any later version.
-; 
+;
 ; This program is distributed in the hope that it will be useful,
 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-; GNU General Public License for more details.		
+; GNU General Public License for more details.
 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
-;		
+;
 
 ; Section containing code
@@ -97,7 +97,7 @@
 .InitializeHardwareIrqHandlers:
 	call	RamVars_GetIdeControllerCountToCX
-	mov		di, ROMVARS.ideVars0			; CS:SI points to first IDEVARS
+	mov		di, ROMVARS.ideVars0+IDEVARS.bIRQ	; CS:SI points to first IDEVARS
 .IdeControllerLoop:
-	mov		al, [cs:di+IDEVARS.bIRQ]
+	mov		al, [cs:di]
 	add		di, BYTE IDEVARS_size			; Increment to next controller
 	call	.InstallLowOrHighIrqHandler
