Index: trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeDmaBlock.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeDmaBlock.asm	(revision 490)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeDmaBlock.asm	(revision 491)
@@ -74,5 +74,5 @@
 ;--------------------------------------------------------------------
 TransferBlockToOrFromXTCF:
-	; 8-bit DMA transfers must be done withing 64k physical page.
+	; 8-bit DMA transfers must be done within 64k physical page.
 	; XT-CF support maximum of 64 sector (32768 bytes) blocks in DMA mode
 	; so we never need to separate transfer to more than 2 separate DMA operations.
Index: trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeIO.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeIO.asm	(revision 490)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeIO.asm	(revision 491)
@@ -53,5 +53,5 @@
 IdeIO_InputToALfromIdeRegisterInDL:
 	xor		dh, dh	; IDE Register index now in DX
-
+	mov		bx, dx	; and BX
 	mov		al, [di+DPT_ATA.bDevice]
 	cmp		al, DEVICE_8BIT_XTIDE_REV2
@@ -63,19 +63,16 @@
 
 .InputToALfromMemoryMappedRegisterInDX:
-	mov		bx, JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET
-	add		bx, dx
 	push	ds
 	mov		ds, [di+DPT.wBasePort]	; Segment for JR-IDE/ISA
-	mov		al, [bx]
+	mov		al, [bx+JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET]
 	pop		ds
 	ret
 
 .ReverseA0andA3fromRegisterIndexInDX:
-	mov		bx, dx
 	mov		dl, [cs:bx+g_rgbSwapA0andA3fromIdeRegisterIndex]
 	SKIP2B	bx	; Skip shl dx, 1
 
 .ShlRegisterIndexInDX:
-	shl		dx, 1
+	eSHL_IM	dx, 1
 	; Fall to .InputToALfromRegisterInDX
 
@@ -116,5 +113,5 @@
 .ShlRegisterIndexInDX:
 	add		dl, OFFSET_TO_CONTROL_BLOCK_REGISTERS
-	shl		dx, 1
+	eSHL_IM	dx, 1
 	jmp		SHORT OutputALtoRegisterInDX
 
@@ -164,5 +161,5 @@
 
 .ShlRegisterIndexInDX:
-	shl		dx, 1
+	eSHL_IM	dx, 1
 	; Fall to OutputALtoRegisterInDX
 
Index: trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm	(revision 490)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm	(revision 491)
@@ -231,13 +231,53 @@
 
 	; Convert ES:SI to physical address
-	xor		dx, dx
-	mov		ax, es
+%ifdef USE_186			; Bytes	EU Cycles(286)
+	mov		ax, es		; 2		2
+	rol		ax, 4		; 3		9
+	mov		dx, ax		; 2		2
+	and		ax, BYTE 0Fh; 3		3
+	xor		dx, ax		; 2		2
+	add		si, dx		; 2		2
+	adc		al, ah		; 2		2
+	mov		es, ax		; 2		2
+	;------------------------------------
+						; 18	24
+%else ; 808x
+
+%if 0
+						; Bytes	EU Cycles(808x)
+	mov		al, 4		; 2		4
+	mov		dx, es		; 2		2
+	xchg	cx, ax		; 1		3
+	rol		dx, cl		; 2		24
+	mov		cx, dx		; 2		2
+	xchg	cx, ax		; 1		3
+	and		ax, BYTE 0Fh; 3		4
+	xor		dx, ax		; 2		3
+	add		si, dx		; 2		3
+	adc		al, ah		; 2		3
+	mov		es, ax		; 2		2
+	;------------------------------------
+						; 21	53
+;
+; Judging by the Execution Unit cycle count the above block of code is
+; apparently slower. However, the shifts and rotates in the block below
+; execute faster than the Bus Interface Unit on an 8088 can fetch them,
+; thus causing the EU to starve. The difference in true execution speed
+; (if any) might not be worth the extra 5 bytes.
+; In other words, we could use a real world test here.
+;
+%endif ; 0
+						; Bytes	EU Cycles(808x/286)
+	xor		dx, dx		; 2		3/2
+	mov		ax, es		; 2		2/2
 %rep 4
-	shl		ax, 1
-	rcl		dx, 1
+	shl		ax, 1		; 8		8/8
+	rcl		dx, 1		; 8		8/8
 %endrep
-	add		si, ax
-	adc		dl, dh
-	mov		es, dx
+	add		si, ax		; 2		3/2
+	adc		dl, dh		; 2		3/2
+	mov		es, dx		; 2		2/2
+	;------------------------------------
+%endif					; 26	29/26
 	ret
 %endif ; MODULE_8BIT_IDE
@@ -266,5 +306,5 @@
 %ifdef MODULE_8BIT_IDE
 		dw		IdePioBlock_ReadFrom8bitDataPort	; 2, DEVICE_8BIT_ATA
-		dw		IdePioBlock_ReadFromXtideRev1		; 3, DEVICE_8BIT_XTIDE_REV1		
+		dw		IdePioBlock_ReadFromXtideRev1		; 3, DEVICE_8BIT_XTIDE_REV1
 		dw		IdePioBlock_ReadFromXtideRev2		; 4, DEVICE_8BIT_XTIDE_REV2
 		dw		IdePioBlock_ReadFrom8bitDataPort	; 5, DEVICE_8BIT_XTCF_PIO8
Index: trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeWait.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeWait.asm	(revision 490)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeWait.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
@@ -93,5 +93,5 @@
 ;		AL, BX, CX, DX
 ;--------------------------------------------------------------------
-.IdePollBsyAndFlgInAH:
+PollBsyAndFlgInAH:
 	call	IdeIO_InputStatusRegisterToAL		; Discard contents of first read
 
