Index: /trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm	(revision 160)
+++ /trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm	(revision 161)
@@ -56,5 +56,5 @@
 	CALL_DISPLAY_LIBRARY PrintNewlineCharacters
 	mov		si, ROMVARS.szVersion
-	; Fall through to BootMenuPrint_NullTerminatedStringFromCSSIandSetCF
+	; Fall to BootMenuPrint_NullTerminatedStringFromCSSIandSetCF
 
 
@@ -169,5 +169,5 @@
 	mov		si, g_szDriveNum
 	push	ax
-	jmp		BootMenuPrint_FormatCSSIfromParamsInSSBP
+	jmp		SHORT BootMenuPrint_FormatCSSIfromParamsInSSBP
 
 
@@ -187,41 +187,11 @@
 	call	FloppyDrive_GetType			; Get Floppy Drive type to BX
 	test	bx, bx						; Two possibilities? (FLOPPY_TYPE_525_OR_35_DD)
+	push	bp
+	mov		bp, sp
 	jz		SHORT .PrintXTFloppyType
 	cmp		bl, FLOPPY_TYPE_35_ED
 	ja		SHORT .PrintUnknownFloppyType
-	jmp		SHORT .PrintKnownFloppyType
-
-;--------------------------------------------------------------------
-; .PrintXTFloppyType
-;	Parameters:
-;		Nothing
-;	Returns:
-;		CF:		Set since menu event was handled successfully
-;	Corrupts registers:
-;		AX, SI, DI
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-.PrintXTFloppyType:
-	push	bp
-	mov		si, g_szFddSizeOr
-	jmp		SHORT .FormatXTorUnknownTypeFloppyDrive
-
-;--------------------------------------------------------------------
-; .PrintUnknownFloppyType
-;	Parameters:
-;		Nothing
-;	Returns:
-;		CF:		Set since menu event was handled successfully
-;	Corrupts registers:
-;		AX, SI, DI
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-.PrintUnknownFloppyType:
-	push	bp
-	mov		si, g_szFddUnknown
-.FormatXTorUnknownTypeFloppyDrive:
-	mov		bp, sp
-	ePUSH_T	ax, g_szCapacity
-	jmp		BootMenuPrint_FormatCSSIfromParamsInSSBP
+	; Fall to .PrintKnownFloppyType
+
 
 ;--------------------------------------------------------------------
@@ -236,18 +206,282 @@
 ALIGN JUMP_ALIGN
 .PrintKnownFloppyType:
-	push	bp
-	mov		bp, sp
 	mov		si, g_szFddSize
 	ePUSH_T	ax, g_szCapacity
 	dec		bx						; Cannot be 0 (FLOPPY_TYPE_525_OR_35_DD)
 	shl		bx, 1					; Shift for WORD lookup
-	mov		ax, [cs:bx+.rgwPhysicalSize]
+	mov		ax, [cs:bx+FloppyTypes.rgwPhysicalSize]
 	push	ax						; '5' or '3'
 	mov		al, ah
 	push	ax						; '1/4' or '1/2'
-	push	WORD [cs:bx+.rgwCapacity]
+	push	WORD [cs:bx+FloppyTypes.rgwCapacity]
 	jmp		SHORT BootMenuPrint_FormatCSSIfromParamsInSSBP
 
+
+;--------------------------------------------------------------------
+; .PrintXTFloppyType
+; .PrintUnknownFloppyType
+;	Parameters:
+;		Nothing
+;	Returns:
+;		CF:		Set since menu event was handled successfully
+;	Corrupts registers:
+;		AX, SI, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.PrintXTFloppyType:
+	mov		si, g_szFddSizeOr
+	jmp		SHORT .FormatXTorUnknownTypeFloppyDrive
+ALIGN JUMP_ALIGN
+.PrintUnknownFloppyType:
+	mov		si, g_szFddUnknown
+.FormatXTorUnknownTypeFloppyDrive:
+	ePUSH_T	ax, g_szCapacity
+	jmp		SHORT BootMenuPrint_FormatCSSIfromParamsInSSBP
+
+
+;--------------------------------------------------------------------
+; Prints Hard Disk Menuitem information strings.
+;
+; BootMenuPrint_HardDiskMenuitemInformation
+;	Parameters:
+;		DL:		Untranslated Hard Disk number
+;		DS:		RAMVARS segment
+;	Returns:
+;		CF:		Set since menu event was handled successfully
+;	Corrupts registers:
+;		BX, CX, DX, SI, DI, ES
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+BootMenuPrint_HardDiskMenuitemInformation:
+	call	RamVars_IsDriveHandledByThisBIOS
+	jnc		SHORT .HardDiskMenuitemInfoForForeignDrive
+	call	FindDPT_ForDriveNumber		; DS:DI to point DPT
+	; Fall to .HardDiskMenuitemInfoForOurDrive
+
+;--------------------------------------------------------------------
+; .HardDiskMenuitemInfoForOurDrive
+;	Parameters:
+;		DL:		Untranslated Hard Disk number
+;		DS:DI:	Ptr to DPT
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX, CX, DX, SI, DI, ES
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.HardDiskMenuitemInfoForOurDrive:
+	push	di
+	ePUSH_T	ax, BootMenuPrintCfg_ForOurDrive	; Return from BootMenuPrint_FormatCSSIfromParamsInSSBP
+	push	bp
+	mov		bp, sp
+	ePUSH_T	ax, g_szCapacity
+
+	; Get and push L-CHS size
+	mov		[RAMVARS.bTimeoutTicksLeft], dl		; Store drive number
+	call	AH15h_GetSectorCountToDXAX
+	call	ConvertSectorCountInBXDXAXtoSizeAndPushForFormat
+
+	; Get and push total LBA size
+	mov		dl, [RAMVARS.bTimeoutTicksLeft]		; Restore drive number
+	call	BootInfo_GetTotalSectorCount
+	call	ConvertSectorCountInBXDXAXtoSizeAndPushForFormat
+
+	mov		si, g_szSizeDual
+	jmp		SHORT BootMenuPrint_FormatCSSIfromParamsInSSBP
+
+
+;--------------------------------------------------------------------
+; .HardDiskMenuitemInfoForForeignDrive
+;	Parameters:
+;		DL:		Untranslated Hard Disk number
+;		DS:		RAMVARS segment
+;	Returns:
+;		CF:		Set since menu event was handled successfully
+;	Corrupts registers:
+;		AX, BX, CX, DX, SI, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.HardDiskMenuitemInfoForForeignDrive:
+	push	bp
+	mov		bp, sp
+	ePUSH_T	ax, g_szCapacity
+
+	call	DriveXlate_ToOrBack
+	call	AH15h_GetSectorCountFromForeignDriveToDXAX
+	call	ConvertSectorCountInBXDXAXtoSizeAndPushForFormat
+
+	mov		si, g_szSizeSingle
+	; Fall to BootMenuPrint_FormatCSSIfromParamsInSSBP
+
+
+;--------------------------------------------------------------------
+; BootMenuPrint_FormatCSSIfromParamsInSSBP
+;	Parameters:
+;		CS:SI:	Ptr to string to format
+;		BP:		SP before pushing parameters
+;	Returns:
+;		BP:		Popped from stack
+;	Corrupts registers:
+;		AX, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+BootMenuPrint_FormatCSSIfromParamsInSSBP:
+	CALL_DISPLAY_LIBRARY FormatNullTerminatedStringFromCSSI
+	stc				; Successfull return from menu event
+	pop		bp
+	ret
+
+
+;--------------------------------------------------------------------
+; ConvertSectorCountInBXDXAXtoSizeAndPushForFormat
+;	Parameters:
+;		BX:DX:AX:	Sector count
+;	Returns:
+;		Size in stack
+;	Corrupts registers:
+;		AX, BX, CX, DX, SI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+ConvertSectorCountInBXDXAXtoSizeAndPushForFormat:
+	pop		si		; Pop return address
+	call	Size_ConvertSectorCountInBXDXAXtoKiB
+	mov		cx, BYTE_MULTIPLES.kiB
+	call	Size_GetSizeToAXAndCharToDLfromBXDXAXwithMagnitudeInCX
+	push	ax		; Size in magnitude
+	push	cx		; Tenths
+	push	dx		; Magnitude character
+	jmp		si
+
+
+;--------------------------------------------------------------------
+; BootMenuPrint_ClearInformationArea
+;	Parameters:
+;		Nothing
+;	Returns:
+;		CF:		Set
+;	Corrupts registers:
+;		AX, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+BootMenuPrint_ClearInformationArea:
+	CALL_MENU_LIBRARY ClearInformationArea
+	stc
+	ret
+
+
+;--------------------------------------------------------------------
+; BootMenuPrint_TheBottomOfScreen
+;	Parameters:
+;		DS:		RAMVARS segment
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX, CX, DX, SI, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+BootMenuPrint_TheBottomOfScreen:
+	call	FloppyDrive_GetCountToCX
+	mov		bl, cl					; Floppy Drive count to BL
+	call	RamVars_GetHardDiskCountFromBDAtoCX
+	mov		bh, cl					; Hard Disk count to BH
+	; Fall to .MoveCursorToHotkeyStrings
+
+;--------------------------------------------------------------------
+; .MoveCursorToHotkeyStrings
+;	Parameters:
+;		Nothing
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, DI
+;--------------------------------------------------------------------
+.MoveCursorToHotkeyStrings:
+	CALL_DISPLAY_LIBRARY GetColumnsToALandRowsToAH
+	xor		al, al
+	dec		ah
+	CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
+	; Fall to .PrintHotkeyString
+
+;--------------------------------------------------------------------
+; .PrintHotkeyString
+;	Parameters:
+;		BL:		Floppy Drives
+;		BH:		Hard Drives
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, CX, DX, SI, DI
+;--------------------------------------------------------------------
+.PrintHotkeyString:
+	; Display Library should not be called like this
+	mov		si, ATTRIBUTE_CHARS.cHighlightedItem
+	call	MenuAttribute_GetToAXfromTypeInSI
+	xchg	dx, ax
+	mov		cx, MONO_BRIGHT
+
+	test	bl, bl		; Any Floppy Drives?
+	jz		SHORT .SkipFloppyDriveHotkeys
+	mov		ax, 'A' | (ANGLE_QUOTE_RIGHT<<8)
+	mov		si, g_szFDD
+	call	PushHotkeyParamsAndFormat
+
+.SkipFloppyDriveHotkeys:
+	test	bh, bh		; Any Hard Drives?
+	jz		SHORT .SkipHardDriveHotkeys
+	xchg	ax, cx		; Store Key Attribute
+	call	BootMenu_GetLetterForFirstHardDiskToCL
+	mov		ch, ANGLE_QUOTE_RIGHT
+	xchg	ax, cx
+	mov		si, g_szHDD
+	call	PushHotkeyParamsAndFormat
+
+.SkipHardDriveHotkeys:
+	; Fall to .PrintRomBootHotkey
+
+;--------------------------------------------------------------------
+; .PrintRomBootHotkey
+;	Parameters:
+;		CX:		Key Attribute
+;		DX:		Description Attribute
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, SI, DI
+;--------------------------------------------------------------------
+.PrintRomBootHotkey:
+	mov		ax, 'F' | ('8'<<8)		; F8
+	mov		si, g_szRomBoot
+	; Fall to PushHotkeyParamsAndFormat
+
+;--------------------------------------------------------------------
+; PushHotkeyParamsAndFormat
+;	Parameters:
+;		AL:		First character
+;		AH:		Second character
+;		CX:		Key Attribute
+;		DX:		Description Attribute
+;		CS:SI:	Description string
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, SI, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+PushHotkeyParamsAndFormat:
+	push	bp
+	mov		bp, sp
+
+	push	cx			; Key attribute
+	push	ax			; First character
+	xchg	al, ah
+	push	ax			; Second character
+	push	dx			; Description attribute
+	push	si			; Description string
+	push	cx			; Key attribute for last space
+	mov		si, g_szHotkey
+	jmp		SHORT BootMenuPrint_FormatCSSIfromParamsInSSBP
+
 ALIGN WORD_ALIGN
+FloppyTypes:
 .rgwCapacity:
 	dw		360
@@ -264,245 +498,2 @@
 	db		'3', 171	; 5, 3.5" ED on some BIOSes
 	db		'3', 171	; 6, FLOPPY_TYPE_35_ED
-
-
-;--------------------------------------------------------------------
-; Prints Hard Disk Menuitem information strings.
-;
-; BootMenuPrint_HardDiskMenuitemInformation
-;	Parameters:
-;		DL:		Untranslated Hard Disk number
-;		DS:		RAMVARS segment
-;	Returns:
-;		CF:		Set since menu event was handled successfully
-;	Corrupts registers:
-;		BX, CX, DX, SI, DI, ES
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-BootMenuPrint_HardDiskMenuitemInformation:
-	call	RamVars_IsDriveHandledByThisBIOS
-	jnc		SHORT .HardDiskMenuitemInfoForForeignDrive
-	call	FindDPT_ForDriveNumber		; DS:DI to point DPT
-	; Fall to .HardDiskMenuitemInfoForOurDrive
-
-;--------------------------------------------------------------------
-; .HardDiskMenuitemInfoForOurDrive
-;	Parameters:
-;		DL:		Untranslated Hard Disk number
-;		DS:DI:	Ptr to DPT
-;	Returns:
-;		Nothing
-;	Corrupts registers:
-;		AX, BX, CX, DX, SI, DI, ES
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-.HardDiskMenuitemInfoForOurDrive:
-	push	di
-	ePUSH_T	ax, BootMenuPrintCfg_ForOurDrive	; Return from BootMenuPrint_FormatCSSIfromParamsInSSBP
-	push	bp
-	mov		bp, sp
-	ePUSH_T	ax, g_szCapacity
-
-	; Get and push L-CHS size
-	mov		[RAMVARS.bTimeoutTicksLeft], dl		; Store drive number
-	call	AH15h_GetSectorCountToDXAX
-	call	ConvertSectorCountInBXDXAXtoSizeAndPushForFormat
-
-	; Get and push total LBA size
-	mov		dl, [RAMVARS.bTimeoutTicksLeft]		; Restore drive number
-	call	BootInfo_GetTotalSectorCount
-	call	ConvertSectorCountInBXDXAXtoSizeAndPushForFormat
-
-	mov		si, g_szSizeDual
-	jmp		SHORT BootMenuPrint_FormatCSSIfromParamsInSSBP
-
-
-;--------------------------------------------------------------------
-; .HardDiskMenuitemInfoForForeignDrive
-;	Parameters:
-;		DL:		Untranslated Hard Disk number
-;		DS:		RAMVARS segment
-;	Returns:
-;		CF:		Set since menu event was handled successfully
-;	Corrupts registers:
-;		AX, BX, CX, DX, SI, DI
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-.HardDiskMenuitemInfoForForeignDrive:
-	push	bp
-	mov		bp, sp
-	ePUSH_T	ax, g_szCapacity
-
-	call	DriveXlate_ToOrBack
-	call	AH15h_GetSectorCountFromForeignDriveToDXAX
-	call	ConvertSectorCountInBXDXAXtoSizeAndPushForFormat
-
-	mov		si, g_szSizeSingle
-	; Fall to BootMenuPrint_FormatCSSIfromParamsInSSBP
-
-
-;--------------------------------------------------------------------
-; BootMenuPrint_FormatCSSIfromParamsInSSBP
-;	Parameters:
-;		CS:SI:	Ptr to string to format
-;		BP:		SP before pushing parameters
-;	Returns:
-;		BP:		Popped from stack
-;	Corrupts registers:
-;		AX, DI
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-BootMenuPrint_FormatCSSIfromParamsInSSBP:
-	CALL_DISPLAY_LIBRARY FormatNullTerminatedStringFromCSSI
-	stc				; Successfull return from menu event
-	pop		bp
-	ret
-
-
-;--------------------------------------------------------------------
-; ConvertSectorCountInBXDXAXtoSizeAndPushForFormat
-;	Parameters:
-;		BX:DX:AX:	Sector count
-;	Returns:
-;		Size in stack
-;	Corrupts registers:
-;		AX, BX, CX, DX, SI
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-ConvertSectorCountInBXDXAXtoSizeAndPushForFormat:
-	pop		si		; Pop return address
-	call	Size_ConvertSectorCountInBXDXAXtoKiB
-	mov		cx, BYTE_MULTIPLES.kiB
-	call	Size_GetSizeToAXAndCharToDLfromBXDXAXwithMagnitudeInCX
-	push	ax		; Size in magnitude
-	push	cx		; Tenths
-	push	dx		; Magnitude character
-	jmp		si
-
-
-;--------------------------------------------------------------------
-; BootMenuPrint_ClearInformationArea
-;	Parameters:
-;		Nothing
-;	Returns:
-;		CF:		Set
-;	Corrupts registers:
-;		AX, DI
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-BootMenuPrint_ClearInformationArea:
-	CALL_MENU_LIBRARY ClearInformationArea
-	stc
-	ret
-
-
-;--------------------------------------------------------------------
-; BootMenuPrint_TheBottomOfScreen
-;	Parameters:
-;		DS:		RAMVARS segment
-;	Returns:
-;		Nothing
-;	Corrupts registers:
-;		AX, BX, CX, DX, SI, DI
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-BootMenuPrint_TheBottomOfScreen:
-	call	FloppyDrive_GetCountToCX
-	mov		bl, cl					; Floppy Drive count to BL
-	call	RamVars_GetHardDiskCountFromBDAtoCX
-	mov		bh, cl					; Hard Disk count to BH
-	; Fall to .MoveCursorToHotkeyStrings
-
-;--------------------------------------------------------------------
-; .MoveCursorToHotkeyStrings
-;	Parameters:
-;		Nothing
-;	Returns:
-;		Nothing
-;	Corrupts registers:
-;		AX, DI
-;--------------------------------------------------------------------
-.MoveCursorToHotkeyStrings:
-	CALL_DISPLAY_LIBRARY GetColumnsToALandRowsToAH
-	xor		al, al
-	dec		ah
-	CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
-	; Fall to .PrintHotkeyString
-
-;--------------------------------------------------------------------
-; .PrintHotkeyString
-;	Parameters:
-;		BL:		Floppy Drives
-;		BH:		Hard Drives
-;	Returns:
-;		Nothing
-;	Corrupts registers:
-;		AX, CX, DX, SI, DI
-;--------------------------------------------------------------------
-.PrintHotkeyString:
-	; Display Library should not be called like this
-	mov		si, ATTRIBUTE_CHARS.cHighlightedItem
-	call	MenuAttribute_GetToAXfromTypeInSI
-	xchg	dx, ax
-	mov		cx, MONO_BRIGHT
-
-	test	bl, bl		; Any Floppy Drives?
-	jz		SHORT .SkipFloppyDriveHotkeys
-	mov		ax, 'A' | (ANGLE_QUOTE_RIGHT<<8)
-	mov		si, g_szFDD
-	call	PushHotkeyParamsAndFormat
-
-.SkipFloppyDriveHotkeys:
-	test	bh, bh		; Any Hard Drives?
-	jz		SHORT .SkipHardDriveHotkeys
-	xchg	ax, cx		; Store Key Attribute
-	call	BootMenu_GetLetterForFirstHardDiskToCL
-	mov		ch, ANGLE_QUOTE_RIGHT
-	xchg	ax, cx
-	mov		si, g_szHDD
-	call	PushHotkeyParamsAndFormat
-
-.SkipHardDriveHotkeys:
-	; Fall to .PrintRomBootHotkey
-
-;--------------------------------------------------------------------
-; .PrintRomBootHotkey
-;	Parameters:
-;		CX:		Key Attribute
-;		DX:		Description Attribute
-;	Returns:
-;		Nothing
-;	Corrupts registers:
-;		AX, SI, DI
-;--------------------------------------------------------------------
-.PrintRomBootHotkey:
-	mov		ax, 'F' | ('8'<<8)		; F8
-	mov		si, g_szRomBoot
-	; Fall to PushHotkeyParamsAndFormat
-
-;--------------------------------------------------------------------
-; PushHotkeyParamsAndFormat
-;	Parameters:
-;		AL:		First character
-;		AH:		Second character
-;		CX:		Key Attribute
-;		DX:		Description Attribute
-;		CS:SI:	Description string
-;	Returns:
-;		Nothing
-;	Corrupts registers:
-;		AX, SI, DI
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-PushHotkeyParamsAndFormat:
-	push	bp
-	mov		bp, sp
-
-	push	cx			; Key attribute
-	push	ax			; First character
-	xchg	al, ah
-	push	ax			; Second character
-	push	dx			; Description attribute
-	push	si			; Description string
-	push	cx			; Key attribute for last space
-	mov		si, g_szHotkey
-	jmp		BootMenuPrint_FormatCSSIfromParamsInSSBP
Index: /trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm	(revision 160)
+++ /trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm	(revision 161)
@@ -20,6 +20,6 @@
 	jnz		SHORT ReturnSuccessForSerialPort
 	jmp		IdeDPT_Finalize
-.FinalizeDptForSerialPortDevice:
-	jmp		SerialDPT_Finalize
+;.FinalizeDptForSerialPortDevice:	; Dead label
+;	jmp		SerialDPT_Finalize		; and code
 
 
Index: /trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeIrq.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeIrq.asm	(revision 160)
+++ /trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeIrq.asm	(revision 161)
@@ -44,6 +44,6 @@
 	stc									; Set CF since wait done by OS
 .ReturnFromWaitNotify:
+	sti									; Enable interrupts
 	pop		ds
-	sti									; Enable interrupts
 	ret
 
Index: /trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm	(revision 160)
+++ /trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm	(revision 161)
@@ -223,5 +223,9 @@
 ALIGN JUMP_ALIGN
 DualByteReadForXtide:
+%ifdef USE_186
+	shr		cx, 2		; Smaller but slower on 186/286
+%else
 	times 2	shr	cx, 1	; Loop unrolling
+%endif
 	mov		bx, 8		; Bit mask for toggling data low/high reg
 ALIGN JUMP_ALIGN
@@ -311,5 +315,9 @@
 	push	ds
 	push	bx
+%ifdef USE_186
+	shr		cx, 2		; Smaller but slower on 186/286
+%else
 	times 2	shr	cx, 1	; Loop unrolling
+%endif
 	mov		bx, 8		; Bit mask for toggling data low/high reg
 	push	es			; Copy ES...
@@ -357,5 +365,9 @@
 WordWriteForXTIDEmod:
 	push	ds
+%ifdef USE_186
+	shr		cx, 2		; Smaller but slower on 186/286
+%else
 	times 2	shr	cx, 1	; Loop unrolling
+%endif
 	push	es			; Copy ES...
 	pop		ds			; ...to DS
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm	(revision 160)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm	(revision 161)
@@ -48,5 +48,5 @@
 ;		SS:BP:	Ptr to IDEPACK
 ;		BX, DI:	Corrupted on Int13h_DiskFunctionsHandler
-;		Other:	Function specific INT 13h parameters 
+;		Other:	Function specific INT 13h parameters
 ;	Returns:
 ;		Depends on function
@@ -152,6 +152,6 @@
 	xchg	di, [es:BIOS_DISK_INTERRUPT_13h*4+2]
 	mov		[RAMVARS.fpOldI13h+2], di
+	sti
 	pop		es
-	sti
 	ret
 
@@ -184,5 +184,4 @@
 	or		BYTE [bp+IDEPACK.intpack+INTPACK.flags], FLG_FLAGS_CF
 	ret
-
 
 
@@ -212,15 +211,15 @@
 	dw	Int13h_UnsupportedFunction						; 14h, Controller Internal Diagnostic (All)
 	dw	AH15h_HandlerForReadDiskDriveSize				; 15h, Read Disk Drive Size (AT+)
-	dw	Int13h_UnsupportedFunction						; 16h, 
-	dw	Int13h_UnsupportedFunction						; 17h, 
-	dw	Int13h_UnsupportedFunction						; 18h, 
+	dw	Int13h_UnsupportedFunction						; 16h,
+	dw	Int13h_UnsupportedFunction						; 17h,
+	dw	Int13h_UnsupportedFunction						; 18h,
 	dw	Int13h_UnsupportedFunction						; 19h, Park Heads (PS/2)
 	dw	Int13h_UnsupportedFunction						; 1Ah, Format ESDI Drive (PS/2)
 	dw	Int13h_UnsupportedFunction						; 1Bh, Get ESDI Manufacturing Header (PS/2)
 	dw	Int13h_UnsupportedFunction						; 1Ch, ESDI Special Functions (PS/2)
-	dw	Int13h_UnsupportedFunction						; 1Dh, 
-	dw	Int13h_UnsupportedFunction						; 1Eh, 
-	dw	Int13h_UnsupportedFunction						; 1Fh, 
-	dw	Int13h_UnsupportedFunction						; 20h, 
+	dw	Int13h_UnsupportedFunction						; 1Dh,
+	dw	Int13h_UnsupportedFunction						; 1Eh,
+	dw	Int13h_UnsupportedFunction						; 1Fh,
+	dw	Int13h_UnsupportedFunction						; 20h,
 	dw	Int13h_UnsupportedFunction						; 21h, Read Disk Sectors, Multiple Blocks (PS/1)
 	dw	Int13h_UnsupportedFunction						; 22h, Write Disk Sectors, Multiple Blocks (PS/1)
@@ -228,31 +227,31 @@
 	dw	AH24h_HandlerForSetMultipleBlocks				; 24h, Set Multiple Blocks (PS/1)
 	dw	AH25h_HandlerForGetDriveInformation				; 25h, Get Drive Information (PS/1)
-;	dw	Int13h_UnsupportedFunction						; 26h, 
-;	dw	Int13h_UnsupportedFunction						; 27h, 
-;	dw	Int13h_UnsupportedFunction						; 28h, 
-;	dw	Int13h_UnsupportedFunction						; 29h, 
-;	dw	Int13h_UnsupportedFunction						; 2Ah, 
-;	dw	Int13h_UnsupportedFunction						; 2Bh, 
-;	dw	Int13h_UnsupportedFunction						; 2Ch, 
-;	dw	Int13h_UnsupportedFunction						; 2Dh, 
-;	dw	Int13h_UnsupportedFunction						; 2Eh, 
-;	dw	Int13h_UnsupportedFunction						; 2Fh, 
-;	dw	Int13h_UnsupportedFunction						; 30h, 
-;	dw	Int13h_UnsupportedFunction						; 31h, 
-;	dw	Int13h_UnsupportedFunction						; 32h, 
-;	dw	Int13h_UnsupportedFunction						; 33h, 
-;	dw	Int13h_UnsupportedFunction						; 34h, 
-;	dw	Int13h_UnsupportedFunction						; 35h, 
-;	dw	Int13h_UnsupportedFunction						; 36h, 
-;	dw	Int13h_UnsupportedFunction						; 37h, 
-;	dw	Int13h_UnsupportedFunction						; 38h, 
-;	dw	Int13h_UnsupportedFunction						; 39h, 
-;	dw	Int13h_UnsupportedFunction						; 3Ah, 
-;	dw	Int13h_UnsupportedFunction						; 3Bh, 
-;	dw	Int13h_UnsupportedFunction						; 3Ch, 
-;	dw	Int13h_UnsupportedFunction						; 3Dh, 
-;	dw	Int13h_UnsupportedFunction						; 3Eh, 
-;	dw	Int13h_UnsupportedFunction						; 3Fh, 
-;	dw	Int13h_UnsupportedFunction						; 40h, 
+;	dw	Int13h_UnsupportedFunction						; 26h,
+;	dw	Int13h_UnsupportedFunction						; 27h,
+;	dw	Int13h_UnsupportedFunction						; 28h,
+;	dw	Int13h_UnsupportedFunction						; 29h,
+;	dw	Int13h_UnsupportedFunction						; 2Ah,
+;	dw	Int13h_UnsupportedFunction						; 2Bh,
+;	dw	Int13h_UnsupportedFunction						; 2Ch,
+;	dw	Int13h_UnsupportedFunction						; 2Dh,
+;	dw	Int13h_UnsupportedFunction						; 2Eh,
+;	dw	Int13h_UnsupportedFunction						; 2Fh,
+;	dw	Int13h_UnsupportedFunction						; 30h,
+;	dw	Int13h_UnsupportedFunction						; 31h,
+;	dw	Int13h_UnsupportedFunction						; 32h,
+;	dw	Int13h_UnsupportedFunction						; 33h,
+;	dw	Int13h_UnsupportedFunction						; 34h,
+;	dw	Int13h_UnsupportedFunction						; 35h,
+;	dw	Int13h_UnsupportedFunction						; 36h,
+;	dw	Int13h_UnsupportedFunction						; 37h,
+;	dw	Int13h_UnsupportedFunction						; 38h,
+;	dw	Int13h_UnsupportedFunction						; 39h,
+;	dw	Int13h_UnsupportedFunction						; 3Ah,
+;	dw	Int13h_UnsupportedFunction						; 3Bh,
+;	dw	Int13h_UnsupportedFunction						; 3Ch,
+;	dw	Int13h_UnsupportedFunction						; 3Dh,
+;	dw	Int13h_UnsupportedFunction						; 3Eh,
+;	dw	Int13h_UnsupportedFunction						; 3Fh,
+;	dw	Int13h_UnsupportedFunction						; 40h,
 ;	dw	Int13h_UnsupportedFunction						; 41h, Check if Extensions Present (EBIOS)*
 ;	dw	Int13h_UnsupportedFunction						; 42h, Extended Read Sectors (EBIOS)*
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Address.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Address.asm	(revision 160)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Address.asm	(revision 161)
@@ -93,5 +93,5 @@
 	shl		dx, cl					; DX = LCylinder << n
 	add		ax, dx					; AX = P-CHS Cylinder number
-	mov		cx, ax					; Copy P-CHS Cylinder number to CX
+	xchg	cx, ax					; Move P-CHS Cylinder number to CX
 DoNotConvertLCHS:
 	ret
Index: /trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm	(revision 160)
+++ /trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm	(revision 161)
@@ -71,12 +71,13 @@
 ALIGN JUMP_ALIGN
 AccessDPT_GetLCHSfromPCHS:
-	xchg	ax, cx
-	mov		cl, [di+DPT.bFlagsLow]
-	and		cl, MASKL_DPT_CHS_SHIFT_COUNT	; Load shift count
+	mov		al, [di+DPT.bFlagsLow]
+	and		al, MASKL_DPT_CHS_SHIFT_COUNT	; Load shift count
+	xchg	cx, ax
 	mov		bx, [di+DPT.wPchsCylinders]		; Load P-CHS cylinders
 	shr		bx, cl							; Shift to L-CHS cylinders
 	xchg	cx, ax
-	eMOVZX	dx, BYTE [di+DPT.bLchsHeads]	; Load L-CHS heads
 	eMOVZX	ax, BYTE [di+DPT.bPchsSectors]	; Load Sectors per track
+	cwd
+	mov		dl, [di+DPT.bLchsHeads]			; Load L-CHS heads
 	ret
 
Index: /trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm	(revision 160)
+++ /trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm	(revision 161)
@@ -39,5 +39,5 @@
 FindDPT_ForDriveNumber:
 	push	dx
-	push	ax
+	xchg	di, ax	; Save the contents of AX in DI
 
 	mov		al, LARGEST_DPT_SIZE
@@ -45,7 +45,6 @@
 	mul		dl
 	add		ax, BYTE RAMVARS_size
-	xchg	di, ax
 
-	pop		ax
+	xchg	di, ax	; Restore AX and put result in DI
 	pop		dx
 	ret
@@ -119,20 +118,4 @@
 
 ;--------------------------------------------------------------------
-; FindDPT_ToDSDIforInterruptInService
-;	Parameters:
-;		DS:		RAMVARS segment
-;	Returns:
-;		DS:DI:	Ptr to DPT
-;		CF:		Set if wanted DPT found
-;				Cleared if DPT not found
-;	Corrupts registers:
-;		SI
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-FindDPT_ToDSDIforInterruptInService:
-	mov		si, IterateToDptWithInterruptInServiceFlagSet
-	jmp		SHORT IterateAllDPTs
-
-;--------------------------------------------------------------------
 ; IterateToDptWithInterruptInServiceFlagSet
 ;	Parameters:
@@ -153,4 +136,21 @@
 	clc										; Clear CF since wrong DPT
 	ret
+
+
+;--------------------------------------------------------------------
+; FindDPT_ToDSDIforInterruptInService
+;	Parameters:
+;		DS:		RAMVARS segment
+;	Returns:
+;		DS:DI:	Ptr to DPT
+;		CF:		Set if wanted DPT found
+;				Cleared if DPT not found
+;	Corrupts registers:
+;		SI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+FindDPT_ToDSDIforInterruptInService:
+	mov		si, IterateToDptWithInterruptInServiceFlagSet
+	; Fall to IterateAllDPTs
 
 
