Index: trunk/XTIDE_Universal_BIOS/Inc/EBIOS.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/EBIOS.inc	(revision 166)
+++ trunk/XTIDE_Universal_BIOS/Inc/EBIOS.inc	(revision 167)
@@ -22,5 +22,4 @@
 	.qwTotalSectors			resb	8	; 16, Total number of addressable sectors
 	.wSectorSize			resb	2	; 24, Number of bytes per sector
-
 	.fpEDDparams			resb	8	; 26, Optional pointer to Enhanced Disk Drive (EDD) configuration parameters
 endstruc
Index: trunk/XTIDE_Universal_BIOS/Inc/RamVars.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/RamVars.inc	(revision 166)
+++ trunk/XTIDE_Universal_BIOS/Inc/RamVars.inc	(revision 167)
@@ -54,6 +54,5 @@
 
 	; Parameters for 48-bit LBA
-	.wSectorCountHighAndLbaLowExt:
-	.bSectorCountHighExt	resb	1	; LBA48 Sector Count 15...8
+							resb	1
 	.bLbaLowExt				resb	1	; LBA48 31...24
 
Index: trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm	(revision 166)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm	(revision 167)
@@ -128,5 +128,6 @@
 
 	; Output Sector Address High (only used by LBA48)
-	mov		ax, [bp+IDEPACK.wSectorCountHighAndLbaLowExt]
+	xor		ax, ax	; Sector Count High always zero since 127 sector limit
+	mov		ah, BYTE [bp+IDEPACK.bLbaLowExt]
 	mov		cx, [bp+IDEPACK.wLbaMiddleAndHighExt]
 	call	OutputSectorCountAndAddress
Index: trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm	(revision 166)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm	(revision 167)
@@ -5,8 +5,10 @@
 ; This struct must not be larger than IDEPACK without INTPACK.
 struc PIOVARS
-	.wBlocksLeft			resb	2
+	.wBlockLeftAndSectorsInLastBlock:
+	.bBlocksLeft			resb	1
+	.bSectorsInLastBlock:	resb	1
 	.wBlockSize				resb	2	; Block size in WORDs (256...32768)
 	.wDataPort				resb	2
-	.bSectorsInLastBlock:	resb	1
+							resb	1
 							resb	1	; Offset 7 = IDEPACK.bDeviceControl
 	.fnXfer					resb	2	; Offset to transfer function
@@ -32,6 +34,4 @@
 ALIGN JUMP_ALIGN
 IdeTransfer_StartWithCommandInAL:
-	mov		ah, [bp+IDEPACK.bSectorCountHighExt]
-
 	; Are we reading or writing?
 	test	al, 16	; Bit 4 is cleared on all the read commands but set on 3 of the 4 write commands
@@ -42,21 +42,24 @@
 	; Prepare to read data to ESSI
 	mov		bx, g_rgfnPioRead
-	mov		al, [bp+IDEPACK.bSectorCount]
-	call	InitializePiovarsInSSBPwithSectorCountInAX
+	call	InitializePiovarsToSSBPfromIdepackInSSBP
 	xchg	si, di
+%ifdef USE_186
+	push	ReadFromDriveToESDI
+	jmp		Registers_NormalizeESDI
+%else
 	call	Registers_NormalizeESDI
-	jmp		SHORT ReadFromDrive
+	jmp		SHORT ReadFromDriveToESDI
+%endif
 
 ALIGN JUMP_ALIGN
 .PrepareToWriteDataFromESSI:
 	mov		bx, g_rgfnPioWrite
-	mov		al, [bp+IDEPACK.bSectorCount]
-	call	InitializePiovarsInSSBPwithSectorCountInAX
+	call	InitializePiovarsToSSBPfromIdepackInSSBP
 	call	Registers_NormalizeESSI
-	; Fall to WriteToDrive
-
-
-;--------------------------------------------------------------------
-; WriteToDrive
+	; Fall to WriteToDriveFromESSI
+
+
+;--------------------------------------------------------------------
+; WriteToDriveFromESSI
 ;	Parameters:
 ;		DS:DI:	Ptr to DPT (in RAMVARS segment)
@@ -70,5 +73,5 @@
 ;		AL, BX, CX, DX, SI, ES
 ;--------------------------------------------------------------------
-WriteToDrive:
+WriteToDriveFromESSI:
 	; Always poll when writing first block (IRQs are generated for following blocks)
 	mov		bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRQ)
@@ -78,18 +81,8 @@
 .WriteNextBlock:
 	mov		dx, [bp+PIOVARS.wDataPort]
-	dec		WORD [bp+PIOVARS.wBlocksLeft]		; Transferring last (possibly partial) block?
+	dec		BYTE [bp+PIOVARS.bBlocksLeft]		; Transferring last (possibly partial) block?
 	jz		SHORT .XferLastBlock				;  If so, jump to transfer
 	mov		cx, [bp+PIOVARS.wBlockSize]			; Load block size in WORDs
 	call	[bp+PIOVARS.fnXfer]					; Transfer full block
-
-	; Normalize pointer when necessary
-	mov		ax, si
-	shr		ax, 1								; WORD offset
-	add		ax, [bp+PIOVARS.wBlockSize]
-	jns		SHORT .WaitUntilReadyToTransferNextBlock
-	call	Registers_NormalizeESSI
-
-ALIGN JUMP_ALIGN
-.WaitUntilReadyToTransferNextBlock:
 %ifdef USE_186
 	push	.WriteNextBlock
@@ -117,5 +110,5 @@
 
 ;--------------------------------------------------------------------
-; ReadFromDrive
+; ReadFromDriveToESDI
 ;	Parameters:
 ;		ES:DI:	Normalized ptr to buffer to recieve data
@@ -131,25 +124,23 @@
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
-ReadFromDrive:
+ReadFromDriveToESDI:
 	; Wait until drive is ready to transfer
 	xchg	di, si								; DS:DI now points DPT
 	call	IdeWait_IRQorDRQ					; Wait until ready to transfer
-	jc		SHORT WriteToDrive.ReturnWithTransferErrorInAH
+	jc		SHORT WriteToDriveFromESSI.ReturnWithTransferErrorInAH
 	xchg	si, di								; ES:DI now points buffer
 
 	; Transfer full or last (possible partial) block
 	mov		dx, [bp+PIOVARS.wDataPort]
-	dec		WORD [bp+PIOVARS.wBlocksLeft]
+	dec		BYTE [bp+PIOVARS.bBlocksLeft]
 	jz		SHORT .XferLastBlock
 	mov		cx, [bp+PIOVARS.wBlockSize]			; Load block size in WORDs
+%ifdef USE_186
+	push	ReadFromDriveToESDI
+	jmp		[bp+PIOVARS.fnXfer]
+%else
 	call	[bp+PIOVARS.fnXfer]					; Transfer full block
-
-	; Normalize pointer when necessary
-	mov		ax, di
-	shr		ax, 1								; WORD offset
-	add		ax, [bp+PIOVARS.wBlockSize]
-	jns		SHORT ReadFromDrive
-	call	Registers_NormalizeESDI
-	jmp		SHORT ReadFromDrive					; Loop while blocks left
+	jmp		SHORT ReadFromDriveToESDI					; Loop while blocks left
+%endif
 
 ALIGN JUMP_ALIGN
@@ -164,29 +155,27 @@
 
 ;--------------------------------------------------------------------
-; InitializePiovarsInSSBPwithSectorCountInAX
-;	Parameters:
-;		AX:		Number of sectors to transfer (1...65535)
+; InitializePiovarsToSSBPfromIdepackInSSBP
+;	Parameters:
 ;		BX:		Offset to transfer function lookup table
 ;		DS:DI:	Ptr to DPT (in RAMVARS segment)
+;		SS:BP:	Ptr to IDEPACK
+;	Returns:
 ;		SS:BP:	Ptr to PIOVARS
-;	Returns:
-;		Nothing
 ;	Corrupts registers:
 ;		AX, BX, CX, DX
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
-InitializePiovarsInSSBPwithSectorCountInAX:
+InitializePiovarsToSSBPfromIdepackInSSBP:
 	; Store number of blocks to transfer
-	eMOVZX	cx, BYTE [di+DPT_ATA.bSetBlock]		; Block size in sectors
-	xor		dx, dx		; DX:AX = Sectors to transfer (1...65535)
-	div		cx			; AX = Full blocks to transfer
-	test	dx, dx
-	mov		dh, cl		; DH = Full block size if no partial blocks to transfer
+	eMOVZX	cx, BYTE [di+DPT_ATA.bSetBlock]		; Block size in sectors, zero CH
+	eMOVZX	ax, BYTE [bp+IDEPACK.bSectorCount]	; AX = sectors to transfer (1...128)
+	div		cl			; AL = Full blocks to transfer
+	test	ah, ah		; AH = Sectors in partial block
 	jz		SHORT .NoPartialBlocksToTransfer
-	inc		ax			; Partial block
-	mov		dh, dl		; DH = Size of partial block in sectors
+	inc		ax			; Add partial block to total block count
+	SKIP2B	dx			; Skip mov ah, cl
 .NoPartialBlocksToTransfer:
-	mov		[bp+PIOVARS.wBlocksLeft], ax
-	mov		[bp+PIOVARS.bSectorsInLastBlock], dh
+	mov		ah, cl		; Full block size if no partial blocks to transfer
+	mov		[bp+PIOVARS.wBlockLeftAndSectorsInLastBlock], ax
 
 	; Store block size in WORDs
Index: trunk/XTIDE_Universal_BIOS/Src/Device/Idepack.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/Idepack.asm	(revision 166)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/Idepack.asm	(revision 167)
@@ -39,7 +39,6 @@
 Idepack_ConvertDapToIdepackAndIssueCommandFromAH:
 	mov		[bp+IDEPACK.bCommand], ah
-	mov		ax, [es:si+DAP.wSectorCount]
+	mov		al, [es:si+DAP.wSectorCount]
 	mov		[bp+IDEPACK.bSectorCount], al
-	mov		[bp+IDEPACK.bSectorCountHighExt], ah	; Always zero
 
 	mov		al, [es:si+DAP.qwLBA]		; LBA byte 0
@@ -84,5 +83,4 @@
 	mov		[bp+IDEPACK.bSectorCount], al
 	mov		[bp+IDEPACK.bCommand], ah
-	mov		BYTE [bp+IDEPACK.bSectorCountHighExt], 0
 
 	push	bx
@@ -127,5 +125,4 @@
 	mov		[bp+IDEPACK.wSectorCountAndLbaLow], dx
 	mov		[bp+IDEPACK.wLbaMiddleAndHigh], cx
-	mov		BYTE [bp+IDEPACK.bSectorCountHighExt], 0
 
 	; Drive and Head select byte
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm	(revision 166)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm	(revision 167)
@@ -42,11 +42,11 @@
 ALIGN JUMP_ALIGN
 .JumpToEbiosFunction:
-	test	BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_FULLMODE	; Full mode?
-	jz		SHORT Int13h_UnsupportedFunction
-	test	BYTE [di+DPT.bFlagsLow], FLG_DRVNHEAD_LBA		; LBA supported?
-	jz		SHORT Int13h_UnsupportedFunction
-	cmp		ah, 48h						; Above last valid function?
+	test	BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_FULLMODE
+	jz		SHORT Int13h_UnsupportedFunction	; No eINT 13h in lite mode
+	test	BYTE [di+DPT.bFlagsLow], FLG_DRVNHEAD_LBA
+	jz		SHORT Int13h_UnsupportedFunction	; No eINT 13h for CHS drives
+	cmp		ah, 48h
 	ja		SHORT Int13h_UnsupportedFunction
-	sub		bx, 41h<<1					; BX = Offset to EBIOS jump table
+	sub		bx, 41h<<1					; BX = Offset to eINT 13h jump table
 	jl		SHORT Int13h_UnsupportedFunction
 	jmp		[cs:bx+g_rgwEbiosFunctionJumpTable]
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH25h_HDrvID.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH25h_HDrvID.asm	(revision 166)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH25h_HDrvID.asm	(revision 167)
@@ -25,7 +25,7 @@
 %ifdef USE_186
 	push	Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
-	; Fall to AH25h_GetDriveInformationToBufferInESSIfromDriveInDL
+	; Fall to AH25h_GetDriveInformationToBufferInESSI
 %else
-	call	AH25h_GetDriveInformationToBufferInESSIfromDriveInDL
+	call	AH25h_GetDriveInformationToBufferInESSI
 	jmp		Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
 %endif
@@ -33,7 +33,6 @@
 
 ;--------------------------------------------------------------------
-; AH25h_GetDriveInformationToBufferInESSIfromDriveInDL
+; AH25h_GetDriveInformationToBufferInESSI
 ;	Parameters:
-;		DL:		Translated Drive number
 ;		DS:DI:	Ptr to DPT (in RAMVARS segment)
 ;		ES:SI:	Ptr to buffer to receive 512-byte drive information
@@ -44,5 +43,6 @@
 ;		AL, BX, CX, DX
 ;--------------------------------------------------------------------
-AH25h_GetDriveInformationToBufferInESSIfromDriveInDL:
+ALIGN JUMP_ALIGN
+AH25h_GetDriveInformationToBufferInESSI:
 	push	es
 	push	bp
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH2h_HRead.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH2h_HRead.asm	(revision 166)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH2h_HRead.asm	(revision 167)
@@ -28,9 +28,8 @@
 ALIGN JUMP_ALIGN
 AH2h_HandlerForReadDiskSectors:
-	cmp		BYTE [bp+IDEPACK.intpack+INTPACK.al], 0
+	cmp		al, 0
 	jle		SHORT AH2h_ExitInt13hSinceSectorCountInIntpackIsZero
 
-	xor		bx, bx
-	call	CommandLookup_OrOldInt13hIndexToBL
+	call	CommandLookup_GetOldInt13hIndexToBX
 	mov		ah, [cs:bx+g_rgbReadCommandLookup]
 	mov		bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRQ)
@@ -55,3 +54,2 @@
 	mov		ah, RET_HD_INVALID
 	jmp		Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
-
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH3h_HWrite.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH3h_HWrite.asm	(revision 166)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH3h_HWrite.asm	(revision 167)
@@ -27,9 +27,8 @@
 ALIGN JUMP_ALIGN
 AH3h_HandlerForWriteDiskSectors:
-	cmp		BYTE [bp+IDEPACK.intpack+INTPACK.al], 0
+	cmp		al, 0
 	jle		SHORT AH2h_ExitInt13hSinceSectorCountInIntpackIsZero
 
-	xor		bx, bx
-	call	CommandLookup_OrOldInt13hIndexToBL
+	call	CommandLookup_GetOldInt13hIndexToBX
 	mov		ah, [cs:bx+g_rgbWriteCommandLookup]
 	mov		bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRQ)
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH4h_HVerify.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH4h_HVerify.asm	(revision 166)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH4h_HVerify.asm	(revision 167)
@@ -26,5 +26,5 @@
 ALIGN JUMP_ALIGN
 AH4h_HandlerForVerifyDiskSectors:
-	cmp		BYTE [bp+IDEPACK.intpack+INTPACK.al], 0
+	cmp		al, 0
 	jle		SHORT AH2h_ExitInt13hSinceSectorCountInIntpackIsZero
 
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH41h_CheckIfExtensionsPresent.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH41h_CheckIfExtensionsPresent.asm	(revision 166)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH41h_CheckIfExtensionsPresent.asm	(revision 167)
@@ -17,5 +17,5 @@
 ;	Returns with INTPACK:
 ;		AH:		Major version of EBIOS extensions
-;		BX:		55AAh
+;		BX:		AA55h
 ;		CX:		Support bits
 ;		CF:		0 if succesfull, 1 if error
@@ -26,6 +26,7 @@
 	jne		SHORT .EbiosNotSupported
 
+	mov		BYTE [bp+IDEPACK.intpack+INTPACK.ah], EBIOS_VERSION
+	mov		WORD [bp+IDEPACK.intpack+INTPACK.bx], 0AA55h
 	mov		WORD [bp+IDEPACK.intpack+INTPACK.cx], ENHANCED_DRIVE_ACCESS_SUPPORT
-	mov		ah, EBIOS_VERSION
 	and		BYTE [bp+IDEPACK.intpack+INTPACK.flags], ~FLG_FLAGS_CF	; Return with CF cleared
 	jmp		Int13h_ReturnFromHandlerWithoutStoringErrorCode
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH42h_ExtendedReadSectors.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH42h_ExtendedReadSectors.asm	(revision 166)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH42h_ExtendedReadSectors.asm	(revision 167)
@@ -55,5 +55,5 @@
 	cmp		BYTE [es:si+DAP.bSize], MINIMUM_DAP_SIZE
 	jb		SHORT .DapContentsNotValid
-	cmp		BYTE [es:si+DAP.bSectorCount], 0
+	cmp		WORD [es:si+DAP.wSectorCount], BYTE 0
 	jle		SHORT .DapContentsNotValid			; Must be 1...127
 	ret
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm	(revision 166)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm	(revision 167)
@@ -23,24 +23,36 @@
 ALIGN JUMP_ALIGN
 AH48h_HandlerForGetExtendedDriveParameters:
-	; Get ATA Drive Information and total sector count from it
+	; Get our buffer to ES:SI
+	push	di
+	call	FindDPT_ForNewDriveToDSDI
+	lea		si, [di+LARGEST_DPT_SIZE]	; IdeCommand.asm required fake DPT
+	pop		di
 	push	ds
-	pop		es			; ES now points RAMVARS segment
-	mov		si, [cs:ROMVARS.bStealSize]
-	and		si, BYTE 7Fh
-	eSHL_IM	si, 10		; Kilobytes to bytes
-	sub		si, 512		; Subtract buffer size for offset in RAMVARS
-	call	AH25h_GetDriveInformationToBufferInESSIfromDriveInDL
+	pop		es
+
+	; Get Drive ID and total sector count from it
+	call	AH25h_GetDriveInformationToBufferInESSI
+	jc		SHORT .ReturnWithError
 	call	AtaID_GetTotalSectorCountToBXDXAXfromAtaInfoInESSI
-	xchg	cx, ax
+	xchg	cx, ax		; Sector count now in BX:DX:CX
 
 	; Point ES:DI to Destination buffer
 	mov		di, [bp+IDEPACK.intpack+INTPACK.si]
 	mov		es, [bp+IDEPACK.intpack+INTPACK.ds]
-	cmp		WORD [es:di+EDRIVE_INFO.wSize], MINIMUM_EDRIVEINFO_SIZE
+	mov		ax, MINIMUM_EDRIVEINFO_SIZE
+	cmp		WORD [es:di+EDRIVE_INFO.wSize], ax
 	jb		SHORT .BufferTooSmall
+	je		SHORT .SkipEddConfigurationParameters
+
+	; We do not support EDD Configuration Parameters so set to FFFF:FFFFh
+	xor		ax, ax
+	dec		ax			; AX = FFFFh
+	mov		[es:di+EDRIVE_INFO.fpEDDparams], ax
+	mov		[es:di+EDRIVE_INFO.fpEDDparams+2], ax
+	mov		ax, EDRIVE_INFO_size
 
 	; Fill Extended Drive Information Table in ES:DI
-	mov		ax, MINIMUM_EDRIVEINFO_SIZE
-	stosw
+.SkipEddConfigurationParameters:
+	stosw				; Store Extended Drive Information Table size
 	mov		al, FLG_DMA_BOUNDARY_ERRORS_HANDLED_BY_BIOS
 	stosw
@@ -63,3 +75,4 @@
 .BufferTooSmall:
 	mov		ah, RET_HD_INVALID
+.ReturnWithError:
 	jmp		Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/CommandLookup.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/CommandLookup.asm	(revision 166)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/CommandLookup.asm	(revision 167)
@@ -7,5 +7,4 @@
 ;--------------------------------------------------------------------
 ; CommandLookup_GetEbiosIndexToBX
-; CommandLookup_OrOldInt13hIndexToBL
 ;	Parameters:
 ;		DS:DI:	Ptr to DPT
@@ -14,22 +13,33 @@
 ;		BX:		Index to command lookup table
 ;	Corrupts registers:
-;		AX
+;		AX, DX
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
 CommandLookup_GetEbiosIndexToBX:
 	; LBA28 or LBA48 command
-	xor		bx, bx
-	mov		ax, [es:si+DAP.qwLBA+3]	; Load LBA48 bytes 3 and 4
-	and		al, ~0Fh				; Clear LBA28 bits 24...27
-	or		al, [es:si+DAP.qwLBA+5]
-	cmp		bx, ax					; Set CF if any of bits 28...47 set
-	rcl		bx, 1					; BX = 0 for LBA28, BX = 1 for LBA48
+	xor		dx, dx
+	mov		al, [es:si+DAP.qwLBA+3]	; Load LBA48 byte 3 (bits 24...31)
+	and		ax, 00F0h				; Clear LBA28 bits 24...27
+	or		ax, [es:si+DAP.qwLBA+4]	; Set bits from LBA bytes 4 and 5
+	cmp		dx, ax					; Set CF if any of bits 28...47 set
+	rcl		dx, 1					; DX = 0 for LBA28, DX = 1 for LBA48
+	call	CommandLookup_GetOldInt13hIndexToBX
+	or		bx, dx					; Set block mode / single sector bit
+	ret
 
+;--------------------------------------------------------------------
+; CommandLookup_GetOldInt13hIndexToBX
+;	Parameters:
+;		DS:DI:	Ptr to DPT
+;	Returns:
+;		BX:		Index to command lookup table
+;	Corrupts registers:
+;		Nothing
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+CommandLookup_GetOldInt13hIndexToBX:
 	; Block mode or single sector
-ALIGN JUMP_ALIGN
-CommandLookup_OrOldInt13hIndexToBL:
-	mov		al, FLGH_DPT_BLOCK_MODE_SUPPORTED	; Bit 1
-	and		al, [di+DPT.bFlagsHigh]
-	or		bl, al					; BX = index to lookup table
+	mov		bl, [di+DPT.bFlagsHigh]
+	and		bx, BYTE FLGH_DPT_BLOCK_MODE_SUPPORTED	; Bit 1
 	ret
 
@@ -52,3 +62,2 @@
 	db		COMMAND_VERIFY_SECTORS
 	db		COMMAND_VERIFY_SECTORS_EXT		
-
