Index: trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeIO.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeIO.asm	(revision 413)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeIO.asm	(revision 414)
@@ -33,15 +33,15 @@
 ;--------------------------------------------------------------------
 IdeIO_OutputALtoIdeControlBlockRegisterInDL:
-%ifdef MODULE_8BIT_IDE
-	mov		dh, [di+DPT_ATA.bDevice]
-%ifdef MODULE_JRIDE
-	test	dh, dh
-	jnz		SHORT .OutputToIoMappedIde
-
-	add		dx, JRIDE_CONTROL_BLOCK_REGISTER_WINDOW_OFFSET
-	jmp		SHORT OutputToJrIdeRegister
-.OutputToIoMappedIde:
-%endif	; MODULE_JRIDE
-%endif	; MODULE_8BIT_IDE
+	%ifdef MODULE_8BIT_IDE
+		mov		dh, [di+DPT_ATA.bDevice]
+		%ifdef MODULE_JRIDE
+			test	dh, dh
+			jnz		SHORT .OutputToIoMappedIde
+		
+			add		dx, JRIDE_CONTROL_BLOCK_REGISTER_WINDOW_OFFSET
+			jmp		SHORT OutputToJrIdeRegister
+		.OutputToIoMappedIde:
+		%endif	; MODULE_JRIDE
+	%endif	; MODULE_8BIT_IDE
 
 	mov		bl, IDEVARS.wPortCtrl
@@ -62,23 +62,23 @@
 ALIGN JUMP_ALIGN
 IdeIO_OutputALtoIdeRegisterInDL:
-%ifdef MODULE_8BIT_IDE
-	mov		dh, [di+DPT_ATA.bDevice]
-%ifdef MODULE_JRIDE
-	test	dh, dh
-	jnz		SHORT OutputALtoIOmappedIdeRegisterInDL
-
-%if JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET & 0FFh = 0
-	mov		dh, JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET >> 8
-%else
-	add		dx, JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET
-%endif
-OutputToJrIdeRegister:
-	mov		bx, dx
-	mov		[cs:bx], al
-	ret
-ALIGN JUMP_ALIGN
-OutputALtoIOmappedIdeRegisterInDL:
-%endif	; MODULE_JRIDE
-%endif	; MODULE_8BIT_IDE
+	%ifdef MODULE_8BIT_IDE
+		mov		dh, [di+DPT_ATA.bDevice]
+		%ifdef MODULE_JRIDE
+			test	dh, dh
+			jnz		SHORT OutputALtoIOmappedIdeRegisterInDL
+		
+		%if JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET & 0FFh = 0
+			mov		dh, JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET >> 8
+		%else
+			add		dx, JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET
+		%endif
+		OutputToJrIdeRegister:
+			mov		bx, dx
+			mov		[cs:bx], al
+			ret
+		ALIGN JUMP_ALIGN
+		OutputALtoIOmappedIdeRegisterInDL:
+		%endif	; MODULE_JRIDE
+	%endif	; MODULE_8BIT_IDE
 
 	mov		bl, IDEVARS.wPort
@@ -114,21 +114,21 @@
 ;--------------------------------------------------------------------
 IdeIO_InputToALfromIdeRegisterInDL:
-%ifdef MODULE_8BIT_IDE
-	mov		dh, [di+DPT_ATA.bDevice]
-%ifdef MODULE_JRIDE
-	test	dh, dh
-	jnz		SHORT .InputToALfromIOmappedIdeRegisterInDL
-
-%if JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET & 0FFh = 0
-	mov		dh, JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET >> 8
-%else
-	add		dx, JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET
-%endif
-	mov		bx, dx
-	mov		al, [cs:bx]
-	ret
-.InputToALfromIOmappedIdeRegisterInDL:
-%endif	; MODULE_JRIDE
-%endif	; MODULE_8BIT_IDE
+	%ifdef MODULE_8BIT_IDE
+		mov		dh, [di+DPT_ATA.bDevice]
+		%ifdef MODULE_JRIDE
+			test	dh, dh
+			jnz		SHORT .InputToALfromIOmappedIdeRegisterInDL
+		
+		%if JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET & 0FFh = 0
+			mov		dh, JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET >> 8
+		%else
+			add		dx, JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET
+		%endif
+			mov		bx, dx
+			mov		al, [cs:bx]
+			ret
+		.InputToALfromIOmappedIdeRegisterInDL:
+		%endif	; MODULE_JRIDE
+	%endif	; MODULE_8BIT_IDE
 	mov		bl, IDEVARS.wPort
 	call	GetIdePortToDX
Index: trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm	(revision 413)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm	(revision 414)
@@ -20,8 +20,8 @@
 ; Structure containing variables for PIO transfer functions.
 ; This struct must not be larger than IDEPACK without INTPACK.
-struc PIOVARS
-	.wDataPort				resb	2	; 0, IDE Data Port
-	.fnXfer					resb	2	; 2, Offset to transfer function
-	.wSectorsInBlock		resb	2	; 4, Block size in sectors
+struc PIOVARS	; Must not be larger than 9 bytes! See IDEPACK in RamVars.inc.
+	.wDataPort				resb	2	; 0-1, IDE Data Port
+	.fnXfer					resb	2	; 2-3, Offset to transfer function
+	.wSectorsInBlock		resb	2	; 4-5, Block size in sectors
 	.bSectorsLeft			resb	1	; 6, Sectors left to transfer
 							resb	1	; 7, IDEPACK.bDeviceControl
Index: trunk/XTIDE_Universal_BIOS/Src/Device/IDE/JrIdeTransfer.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/IDE/JrIdeTransfer.asm	(revision 413)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/IDE/JrIdeTransfer.asm	(revision 414)
@@ -20,11 +20,10 @@
 ; Structure containing variables for PIO transfer functions.
 ; This struct must not be larger than IDEPACK without INTPACK.
-struc MEMPIOVARS
-	.wSectorsInBlock		resb	2	; 0, Block size in sectors
-	.bSectorsLeft			resb	1	; 2, Sectors left to transfer
-	.bSectorsDone			resb	1	; 3, Number of sectors xferred
-							resb	3	; 4, 5, 6
+struc MEMPIOVARS	; Must not be larger than 9 bytes! See IDEPACK in RamVars.inc.
+	.wSectorsInBlock		resb	2	; 0-1, Block size in sectors
+	.fpDPT					resb	4	; 2-5, Far pointer to DPT
+	.bSectorsLeft			resb	1	; 6, Sectors left to transfer
 							resb	1	; 7, IDEPACK.bDeviceControl
-	.fpDPT					resb	4	; 8, Far pointer to DPT
+	.bSectorsDone			resb	1	; 8, Number of sectors xferred
 endstruc
 
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm	(revision 413)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm	(revision 414)
@@ -45,6 +45,6 @@
 %ifdef MODULE_HOTKEYS
 	call	DriveXlate_ToOrBack
-%endif
 	mov		[RAMVARS.xlateVars+XLATEVARS.bXlatedDrv], dl
+%endif
 
 	call	FindDPT_ForDriveNumberInDL	; DS:DI points to our DPT, or NULL if not our drive
@@ -129,5 +129,9 @@
 	mov		[bp+IDEPACK.intpack+INTPACK.si], si
 	mov		[bp+IDEPACK.intpack+INTPACK.bx], bx
+%ifdef MODULE_HOTKEYS
 	mov		[bp+IDEPACK.intpack+INTPACK.dh], dh
+%else
+	mov		[bp+IDEPACK.intpack+INTPACK.dx], dx
+%endif
 	mov		[bp+IDEPACK.intpack+INTPACK.cx], cx
 	mov		[bp+IDEPACK.intpack+INTPACK.ax], ax
@@ -135,9 +139,13 @@
 	pop		WORD [bp+IDEPACK.intpack+INTPACK.flags]
 	call	RamVars_GetSegmentToDS
-	cmp		dl, [RAMVARS.xlateVars+XLATEVARS.bXlatedDrv]
+
+%ifdef MODULE_HOTKEYS
+	cmp		dl, [RAMVARS.xlateVars+XLATEVARS.bXlatedDrv]	; DL is still drive number?
 	je		SHORT .ExchangeInt13hHandlers
-	mov		[bp+IDEPACK.intpack+INTPACK.dl], dl		; Something is returned in DL
+	mov		[bp+IDEPACK.intpack+INTPACK.dl], dl	; Something is returned in DL
 ALIGN JUMP_ALIGN
 .ExchangeInt13hHandlers:
+%endif
+
 %ifdef USE_186
 	push	Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
@@ -192,7 +200,9 @@
 Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH_ALHasDriveNumber:
 	call	Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH_ALHasDriveNumber
+
 %else
 	call	Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH
 %endif
+
 Int13h_ReturnFromHandlerWithoutStoringErrorCode:
 	or		WORD [bp+IDEPACK.intpack+INTPACK.flags], FLG_FLAGS_IF	; Return with interrupts enabled
@@ -265,5 +275,5 @@
 	mov		bx, BDA.bHDLastSt
 	test	al, al
-	js		.HardDisk
+	js		SHORT .HardDisk
 	mov		bl, BDA.bFDRetST & 0xff
 .HardDisk:
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm	(revision 413)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm	(revision 414)
@@ -29,6 +29,7 @@
 ;--------------------------------------------------------------------
 Int19h_BootLoaderHandler:
-	sti											; Allow timer interrupts
-	LOAD_BDA_SEGMENT_TO	es, ax					; Load BDA segment (zero) to ES
+	sti									; Enable interrupts
+	cld									; String instructions to increment pointers
+	LOAD_BDA_SEGMENT_TO	es, ax			; Load BDA segment (zero) to ES
 	; Fall to .PrepareBootLoaderStack
 
