Index: /trunk/XTIDE_Universal_BIOS/Inc/BootMenu.inc
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Inc/BootMenu.inc	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Inc/BootMenu.inc	(revision 294)
@@ -1,4 +1,5 @@
 ; Project name	:	XTIDE Universal BIOS
 ; Description	:	Equates and structs used in Boot Menu.
+
 %ifndef BOOTMENU_INC
 %define BOOTMENU_INC
@@ -19,5 +20,5 @@
 
 ; Boot Menu Information Table. These are generated for all XTIDE Universal
-; BIOS drives. Available only until boot is successfull.
+; BIOS drives. Available only until boot is successful.
 MAX_HARD_DISK_NAME_LENGTH				EQU		30		; Bytes reserved for drive name
 
@@ -30,16 +31,16 @@
 DPT_BOOTMENUINFO_SIZE_MULTIPLIER  equ	BOOTMENUINFO_size / LARGEST_DPT_SIZE
 
-%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS				
+%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
 
-%if MAX_HARD_DISK_NAME_LENGTH % 2 <> 0 
-%error "MAX_HARD_DISK_NAME_LENGTH needs to be a multiple of 2, memory is moved with word operations."
+%if MAX_HARD_DISK_NAME_LENGTH % 2 <> 0
+	%error "MAX_HARD_DISK_NAME_LENGTH needs to be a multiple of 2, memory is moved with word operations."
 %endif
 
 %if BOOTMENUINFO_size % LARGEST_DPT_SIZE <> 0
-%error "BOOTMENUINFO's size must be an even multiple of DPT's size.  Add or remove padding at the bottom of BOOTMENUINFO to bring the two sizes into alignment.  As BOOTMENUINFO is only used at boot time, with plenty of memory to consume, it is OK to waste some space here."
+	%error "BOOTMENUINFO's size must be an even multiple of DPT's size.  Add or remove padding at the bottom of BOOTMENUINFO to bring the two sizes into alignment.  As BOOTMENUINFO is only used at boot time, with plenty of memory to consume, it is OK to waste some space here."
 %endif
 
 %if BOOTMENUINFO.szDrvName <> 0
-%error "BOOTMENUINFO.szDrvName is assumed to be the first member of struc BOOTMENUINFO, in BootMenuPrint_RefreshItem"
+	%error "BOOTMENUINFO.szDrvName is assumed to be the first member of struc BOOTMENUINFO, in BootMenuPrint_RefreshItem"
 %endif
 
Index: /trunk/XTIDE_Universal_BIOS/Inc/BootVars.inc
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Inc/BootVars.inc	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Inc/BootVars.inc	(revision 294)
@@ -10,5 +10,5 @@
 
 
-; Pre-boot variables. These do not exist after successfull boot to OS.
+; Pre-boot variables. These do not exist after successful boot to OS.
 ; Segment is always 0000h, same as BDA segment
 struc BOOTVARS
@@ -95,5 +95,5 @@
 	mov		ss, ax
 	lss		sp, [ss:BOOTVARS.dwPostStack]
-%endif	
+%endif
 %endmacro
 
Index: /trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc	(revision 294)
@@ -37,5 +37,5 @@
 %ifdef MODULE_SERIAL
 ; DPT for Serial devices
-struc DPT_SERIAL 
+struc DPT_SERIAL
 	.dpt						resb	DPT_size
 
@@ -63,7 +63,7 @@
 FLGH_DPT_INTERRUPT_IN_SERVICE	EQU	(1<<3)	; Set when waiting for IRQ
 FLGH_DPT_RESET_nDRDY			EQU	(1<<4)	; Drive ready to accept commands
-FLGH_DPT_RESET_nINITPRMS		EQU	(1<<5)	; Initialize Device Parameters successfull
-FLGH_DPT_RESET_nRECALIBRATE		EQU	(1<<6)	; Recalibrate successfull
-FLGH_DPT_RESET_nSETBLOCK		EQU	(1<<7)	; Initialize Block Mode successfull
+FLGH_DPT_RESET_nINITPRMS		EQU	(1<<5)	; Initialize Device Parameters successful
+FLGH_DPT_RESET_nRECALIBRATE		EQU	(1<<6)	; Recalibrate successful
+FLGH_DPT_RESET_nSETBLOCK		EQU	(1<<7)	; Initialize Block Mode successful
 MASKH_DPT_RESET					EQU	0F0h
 
Index: /trunk/XTIDE_Universal_BIOS/Inc/Int13h.inc
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Inc/Int13h.inc	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Inc/Int13h.inc	(revision 294)
@@ -5,5 +5,5 @@
 
 ; Hard Disk function (INT 13h) return status codes in AH
-RET_HD_SUCCESS			EQU		0h		; Operation succesfull, no error occurred
+RET_HD_SUCCESS			EQU		0h		; Operation successful, no error occurred
 RET_HD_INVALID			EQU		1h		; Invalid value passed or unsupported func
 RET_HD_ADDRMARK			EQU		2h		; Missing address mark
Index: /trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenu.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenu.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenu.asm	(revision 294)
@@ -43,5 +43,5 @@
 	call	RamVars_GetSegmentToDS
 ;;; fall-through
-						
+
 ALIGN JUMP_ALIGN
 BootMenu_GetDriveToDXforMenuitemInCX:
@@ -136,5 +136,5 @@
 BootMenu_GetMenuitemToAXforAsciiHotkeyInAL:
 	call	Char_ALtoUpperCaseLetter
-	xor		ah, ah
+	cbw
 	xchg	ax, cx
 	call	BootMenu_GetLetterForFirstHardDiskToAL
Index: /trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm	(revision 294)
@@ -7,5 +7,5 @@
 ;--------------------------------------------------------------------
 ; BootMenuPrint_RefreshItem
-; 
+;
 ;	Parameters:
 ;		DL:		Untranslated Floppy Drive number
@@ -19,5 +19,5 @@
 	call	BootMenu_GetDriveToDXforMenuitemInCX_And_RamVars_GetSegmentToDS
 	jnc		BootMenuEvent_EventCompleted			; if no menu item selected, out we go
-		
+
 	push	bp
 	mov		bp, sp
@@ -29,13 +29,13 @@
 	mov		si, g_szDriveNumBOOTNFO					; special g_szDriveNum that prints from BDA
 	jmp		.go
-		
+
 .notOurs:
-	mov		si,g_szDriveNum									
+	mov		si,g_szDriveNum
 	mov		bx,g_szForeignHD						; assume a hard disk for the moment
-		
-	test	dl,80h											
+
+	test	dl, dl
 	js		.go
 	mov		bl,((g_szFloppyDrv)-$$ & 0xff)			; and revisit the earlier assumption...
-		
+
 .go:
 	mov		ax, dx									; preserve DL for the floppy drive letter addition
@@ -45,5 +45,5 @@
 	add		al, 'A'									; floppy drive letter (we always push this although
 	push	ax										; the hard disks don't ever use it, but it does no harm)
-		
+
 	jmp		short BootMenuPrint_RefreshInformation.FormatRelay
 
@@ -88,5 +88,5 @@
 	jmp		short BootMenuPrint_RefreshInformation.FormatRelay
 
-		
+
 ;--------------------------------------------------------------------
 ; BootMenuPrint_FloppyMenuitemInformation
@@ -101,6 +101,6 @@
 ALIGN JUMP_ALIGN
 BootMenuPrint_RefreshInformation:
-	CALL_MENU_LIBRARY ClearInformationArea		
-		
+	CALL_MENU_LIBRARY ClearInformationArea
+
 	call	BootMenu_GetDriveToDXforMenuitemInCX_And_RamVars_GetSegmentToDS
 	jnc		BootMenuEvent_EventCompleted				; if no menu selection, abort
@@ -115,5 +115,5 @@
 	inc		dl											; are we a hard disk?
 	dec		dl											; inc/dec will set SF, without modifying CF or DL
-	js		.HardDiskRefreshInformation	
+	js		.HardDiskRefreshInformation
 
 	jnc		.ours										; Based on CF from FindDPT_ForDriveNumberInDL above
@@ -122,8 +122,8 @@
 .ours:
 	call	AH8h_GetDriveParameters
-.around:				
+.around:
 
 	mov		ax, g_szFddSizeOr	        				; .PrintXTFloppyType
-	test	bl, bl										; Two possibilities? (FLOPPY_TYPE_525_OR_35_DD)		
+	test	bl, bl										; Two possibilities? (FLOPPY_TYPE_525_OR_35_DD)
 	jz		SHORT .PushAXAndOutput
 
@@ -131,5 +131,5 @@
 	cmp		bl, FLOPPY_TYPE_35_ED
 	ja		SHORT .PushAXAndOutput
-		
+
 	; Fall to .PrintKnownFloppyType
 
@@ -142,8 +142,8 @@
 ;	Corrupts registers:
 ;		AX, BX, SI, DI
-; 
+;
 ; Floppy Drive Types:
 ;
-;   0  Handled above 
+;   0  Handled above
 ;   1  FLOPPY_TYPE_525_DD          5 1/4   360K
 ;   2  FLOPPY_TYPE_525_HD          5 1/4   1.2M
@@ -153,15 +153,15 @@
 ;   6  FLOPPY_TYPE_35_ED		   3 1/2   2.88M
 ;   >6 Unknwon, handled above
-; 
+;
 ;--------------------------------------------------------------------
 .PrintKnownFloppyType:
 	mov		al, (g_szFddSize - $$) & 0xff
 	push	ax
-		
+
 	mov		al, (g_szFddThreeHalf - $$) & 0xff
 	cmp		bl, FLOPPY_TYPE_525_HD
 	ja		.ThreeHalf
 	mov		al, (g_szFddFiveQuarter - $$) & 0xff
-.ThreeHalf:		
+.ThreeHalf:
 	push	ax											; "5 1/4" or "3 1/2"
 
@@ -170,5 +170,5 @@
 	mul		byte [cs:bx+FloppyTypes.rgbCapacity - 1]    ; -1 since 0 is handled above and not in the table
 
-.PushAXAndOutput:					
+.PushAXAndOutput:
 	push	ax
 
@@ -189,5 +189,5 @@
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
-.HardDiskRefreshInformation:		
+.HardDiskRefreshInformation:
 	jc		.HardDiskMenuitemInfoForForeignDrive		; Based on CF from FindDPT_ForDriveNumberInDL (way) above
 
@@ -196,5 +196,5 @@
 	call	BootMenuInfo_GetTotalSectorCount			; Get Total LBA Size
 	jmp		.ConvertSectorCountInBXDXAXtoSizeAndPushForFormat
-		
+
 .HardDiskMenuitemInfoForForeignDrive:
 	call	DriveXlate_ToOrBack
@@ -208,6 +208,6 @@
 	push	ax						; Size in magnitude
 	push	cx						; Tenths
-	push	dx						; Magnitude character		
-				
+	push	dx						; Magnitude character
+
 	test	di,di
 	jz		short BootMenuPrint_FormatCSSIfromParamsInSSBP
@@ -225,5 +225,5 @@
 ;	Returns:
 ;		BP:		Popped from stack
-;		CF:		Set since menu event was handled successfully		
+;		CF:		Set since menu event was handled successfully
 ;	Corrupts registers:
 ;		AX, DI
@@ -232,9 +232,9 @@
 BootMenuPrint_FormatCSSIfromParamsInSSBP:
 	CALL_DISPLAY_LIBRARY FormatNullTerminatedStringFromCSSI
-	stc				; Successfull return from menu event
+	stc				; Successful return from menu event
 	pop		bp
 	ret
-		
-		
+
+
 ;--------------------------------------------------------------------
 ; BootMenuPrint_ClearScreen
@@ -364,6 +364,6 @@
 	push	cx			; Key attribute for last space
 	mov		si, g_szHotkey
-		
-BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay:	
+
+BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay:
 	jmp		SHORT BootMenuPrint_FormatCSSIfromParamsInSSBP
 
Index: /trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrintCfg.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrintCfg.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrintCfg.asm	(revision 294)
@@ -24,5 +24,5 @@
 ;--------------------------------------------------------------------
 .BootMenuPrintCfg_ForOurDrive:
-	eMOVZX	ax, BYTE [di+DPT.bIdevarsOffset]
+	eMOVZX	ax, [di+DPT.bIdevarsOffset]
 	xchg	bx, ax						; CS:BX now points to IDEVARS
 	; Fall to .PushAndFormatCfgString
@@ -40,9 +40,9 @@
 .PushAddressingMode:
 	AccessDPT_GetUnshiftedAddressModeToALZF
-	;; 
-	;; This multiply both shifts the addressing mode bits down to low order bits, and 
+	;;
+	;; This multiply both shifts the addressing mode bits down to low order bits, and
 	;; at the same time multiplies by the size of the string displacement.  The result is in AH,
 	;; with AL clear, and so we exchange AL and AH after the multiply for the final result.
-	;; 
+	;;
 	mov		cl,(1<<(8-ADDRESSING_MODE_FIELD_POSITION)) * g_szAddressingModes_Displacement
 	mul		cl
@@ -50,5 +50,5 @@
 	add		ax,g_szAddressingModes
 	push	ax
-		
+
 ;--------------------------------------------------------------------
 ; PushBlockMode
@@ -82,10 +82,10 @@
 	mov		al,g_szBusTypeValues_Displacement
 	mul		BYTE [cs:bx+IDEVARS.bDevice]
-		
+
 	shr		ax,1			; divide by 2 since IDEVARS.bDevice is multiplied by 2
-		
+
 	add		ax,g_szBusTypeValues
-	push	ax	
-				
+	push	ax
+
 ;--------------------------------------------------------------------
 ; PushIRQ
@@ -99,5 +99,5 @@
 ;--------------------------------------------------------------------
 .PushIRQ:
-	mov		al, BYTE [cs:bx+IDEVARS.bIRQ]
+	mov		al, [cs:bx+IDEVARS.bIRQ]
 	cbw
 	push	ax
Index: /trunk/XTIDE_Universal_BIOS/Src/Boot/BootSector.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Boot/BootSector.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Boot/BootSector.asm	(revision 294)
@@ -11,6 +11,6 @@
 ;		DS:		RAMVARS segment
 ;	Returns:
-;		ES:BX:	Ptr to boot sector (if successfull)
-;		CF:		Set if boot sector loaded succesfully
+;		ES:BX:	Ptr to boot sector (if successful)
+;		CF:		Set if boot sector loaded successfully
 ;				Cleared if failed to load boot sector
 ;	Corrupts registers:
@@ -46,6 +46,6 @@
 ;	Returns:
 ;		AH:		INT 13h error code
-;		ES:BX:	Ptr to boot sector (if successfull)
-;		CF:		Cleared if read successfull
+;		ES:BX:	Ptr to boot sector (if successful)
+;		CF:		Cleared if read successful
 ;				Set if any error
 ;	Corrupts registers:
@@ -73,5 +73,5 @@
 ;	Returns:
 ;		AH:		INT 13h error code
-;		CF:		Cleared if read successfull
+;		CF:		Cleared if read successful
 ;				Set if any error
 ;	Corrupts registers:
@@ -96,5 +96,5 @@
 ;		AH:		INT 13h error code
 ;		ES:BX:	Ptr to boot sector
-;		CF:		Cleared if read successfull
+;		CF:		Cleared if read successful
 ;				Set if any error
 ;	Corrupts registers:
Index: /trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm	(revision 294)
@@ -6,5 +6,5 @@
 
 
-%macro TEST_USIGN_DPT_AND_JUMP_IF_SERIAL_DEVICE 1
+%macro TEST_USING_DPT_AND_JUMP_IF_SERIAL_DEVICE 1
 	test	BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE
 	jnz		SHORT %1
@@ -42,5 +42,5 @@
 	CMP_USING_IDEVARS_IN_CSBP_AND_JUMP_IF DEVICE_SERIAL_PORT, .FinalizeDptForSerialPortDevice
 	jmp		IdeDPT_Finalize
-.FinalizeDptForSerialPortDevice: 
+.FinalizeDptForSerialPortDevice:
 	jmp		SerialDPT_Finalize
 
@@ -63,5 +63,5 @@
 	%ifdef MODULE_SERIAL				; IDE + JR-IDE/ISA + Serial
 	Device_ResetMasterAndSlaveController:
-		TEST_USIGN_DPT_AND_JUMP_IF_SERIAL_DEVICE ReturnSuccessForSerialPort
+		TEST_USING_DPT_AND_JUMP_IF_SERIAL_DEVICE ReturnSuccessForSerialPort
 		CMP_USING_DPT_AND_JUMP_IF_JRIDE_DEVICE .ResetJrIDE
 		jmp		IdeCommand_ResetMasterAndSlaveController
@@ -75,5 +75,5 @@
 %elifdef MODULE_SERIAL					; IDE + Serial
 Device_ResetMasterAndSlaveController:
-	TEST_USIGN_DPT_AND_JUMP_IF_SERIAL_DEVICE ReturnSuccessForSerialPort
+	TEST_USING_DPT_AND_JUMP_IF_SERIAL_DEVICE ReturnSuccessForSerialPort
 	jmp		IdeCommand_ResetMasterAndSlaveController
 
@@ -152,5 +152,5 @@
 	%ifdef MODULE_SERIAL				; IDE + JR-IDE/ISA + Serial
 	Device_OutputCommandWithParameters:
-		TEST_USIGN_DPT_AND_JUMP_IF_SERIAL_DEVICE .OutputCommandToSerialPort
+		TEST_USING_DPT_AND_JUMP_IF_SERIAL_DEVICE .OutputCommandToSerialPort
 		CMP_USING_DPT_AND_JUMP_IF_JRIDE_DEVICE .OutputCommandToJrIDE
 		jmp		IdeCommand_OutputWithParameters
@@ -164,5 +164,5 @@
 %elifdef MODULE_SERIAL					; IDE + Serial
 Device_OutputCommandWithParameters:
-	TEST_USIGN_DPT_AND_JUMP_IF_SERIAL_DEVICE .OutputCommandToSerialPort
+	TEST_USING_DPT_AND_JUMP_IF_SERIAL_DEVICE .OutputCommandToSerialPort
 	jmp		IdeCommand_OutputWithParameters
 
@@ -198,5 +198,5 @@
 	%ifdef MODULE_SERIAL				; IDE + JR-IDE/ISA + Serial
 	Device_SelectDrive:
-		TEST_USIGN_DPT_AND_JUMP_IF_SERIAL_DEVICE ReturnSuccessForSerialPort
+		TEST_USING_DPT_AND_JUMP_IF_SERIAL_DEVICE ReturnSuccessForSerialPort
 		CMP_USING_DPT_AND_JUMP_IF_JRIDE_DEVICE .SelectJrIdeDrive
 		jmp		IdeCommand_SelectDrive
@@ -210,5 +210,5 @@
 %elifdef MODULE_SERIAL					; IDE + Serial
 Device_SelectDrive:
-	TEST_USIGN_DPT_AND_JUMP_IF_SERIAL_DEVICE ReturnSuccessForSerialPort
+	TEST_USING_DPT_AND_JUMP_IF_SERIAL_DEVICE ReturnSuccessForSerialPort
 	jmp		IdeCommand_SelectDrive
 
Index: /trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm	(revision 294)
@@ -130,5 +130,5 @@
 	; Output Sector Address High (only used by LBA48)
 %ifdef MODULE_EBIOS
-	eMOVZX	ax, BYTE [bp+IDEPACK.bLbaLowExt]	; Zero sector count
+	eMOVZX	ax, [bp+IDEPACK.bLbaLowExt]		; Zero sector count
 	mov		cx, [bp+IDEPACK.wLbaMiddleAndHighExt]
 	call	IDEDEVICE%+OutputSectorCountAndAddress
Index: /trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeError.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeError.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeError.asm	(revision 294)
@@ -23,5 +23,5 @@
 
 %ifndef ASSEMBLE_SHARED_IDE_DEVICE_FUNCTIONS	; JR-IDE/ISA
-	jmp		ContinueFromMemIdeError
+	jmp		ContinueFromMemIdeError		; What's this supposed to do? *FIXME*
 %else
 ContinueFromMemIdeError:
Index: /trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm	(revision 294)
@@ -54,5 +54,5 @@
 ;		AH:		BIOS Error code
 ;		CX:		Number of successfully transferred sectors
-;		CF:		0 if transfer succesfull
+;		CF:		0 if transfer successful
 ;				1 if any error
 ;	Corrupts registers:
@@ -121,5 +121,5 @@
 ;		AH:		BIOS Error code
 ;		CX:		Number of successfully transferred sectors
-;		CF:		0 if transfer succesfull
+;		CF:		0 if transfer successful
 ;				1 if any error
 ;	Corrupts registers:
Index: /trunk/XTIDE_Universal_BIOS/Src/Device/MemoryMappedIDE/MemIdeTransfer.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Device/MemoryMappedIDE/MemIdeTransfer.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Device/MemoryMappedIDE/MemIdeTransfer.asm	(revision 294)
@@ -64,5 +64,5 @@
 ;		AH:		BIOS Error code
 ;		CX:		Number of successfully transferred sectors
-;		CF:		0 if transfer succesfull
+;		CF:		0 if transfer successful
 ;				1 if any error
 ;	Corrupts registers:
@@ -125,5 +125,5 @@
 ;		AH:		BIOS Error code
 ;		CX:		Number of successfully transferred sectors
-;		CF:		0 if transfer succesfull
+;		CF:		0 if transfer successful
 ;				1 if any error
 ;	Corrupts registers:
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm	(revision 294)
@@ -26,26 +26,26 @@
 
 	call	RamVars_GetSegmentToDS
-		
+
 	call	DriveXlate_ToOrBack
 	mov		[RAMVARS.xlateVars+XLATEVARS.bXlatedDrv], dl
-		
+
 	call	FindDPT_ForDriveNumberInDL				; DS:DI points to our DPT, or NULL if not our drive
 	jnc		SHORT .OurFunction						; DPT found, this is one of our drives, and thus our function
 
-	cmp		ah, 0
-	jz		short .OurFunction						; we handle all function 0h requests (resets)
+	test	ah, ah
+	jz		SHORT .OurFunction						; we handle all function 0h requests (resets)
 	cmp		ah, 8
-	jnz		SHORT Int13h_DirectCallToAnotherBios	; non-8h function, handled by foreign bios
+	jne		SHORT Int13h_DirectCallToAnotherBios	; non-8h function, handled by foreign bios
 
 %ifndef MODULE_SERIAL_FLOPPY
-; With floppy support, we handle all traffic for function 08h, as we need to wrap both hard disk and 
-; floppy drive counts.  Without floppy support, we handle only hard disk traffic for function 08h, 
+; With floppy support, we handle all traffic for function 08h, as we need to wrap both hard disk and
+; floppy drive counts.  Without floppy support, we handle only hard disk traffic for function 08h,
 ; and thus need the check below.
 ;
-	test	dl, dl								
+	test	dl, dl
 	jns		SHORT Int13h_DirectCallToAnotherBios
-%endif		
-				
-.OurFunction:	
+%endif
+
+.OurFunction:
 	; Jump to correct BIOS function
 	eMOVZX	bx, ah
@@ -141,5 +141,5 @@
 	test	dl, dl
 	js		short Int13h_UnsupportedFunction
-	mov		ah, 0
+	xor		ah, ah
 	jmp		short Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
 %endif
@@ -172,5 +172,5 @@
 %ifdef MODULE_SERIAL_FLOPPY
 	mov		al, [bp+IDEPACK.intpack+INTPACK.dl]
-Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH_ALHasDriveNumber:	
+Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH_ALHasDriveNumber:
 	call	Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH_ALHasDriveNumber
 %else
@@ -191,5 +191,5 @@
 ;	Returns:
 ;		Depends on function
-;       NOTE: ES:DI needs to be returned from the previous interrupt 
+;       NOTE: ES:DI needs to be returned from the previous interrupt
 ;		      handler, for floppy DPT in function 08h
 ;	Corrupts registers:
@@ -251,9 +251,9 @@
 .HardDisk:
 	LOAD_BDA_SEGMENT_TO	ds, di
-	mov		[bx], ah		
+	mov		[bx], ah
 %else
 Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH:
 	; Store error code to BDA
-	LOAD_BDA_SEGMENT_TO	ds, di		
+	LOAD_BDA_SEGMENT_TO	ds, di
 	mov		[BDA.bHDLastSt], ah
 %endif
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm	(revision 294)
@@ -19,5 +19,5 @@
 ;	Returns with INTPACK:
 ;		AH:		Int 13h return status (from drive requested in DL)
-;		CF:		0 if succesfull, 1 if error
+;		CF:		0 if successful, 1 if error
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
@@ -28,5 +28,5 @@
 %ifdef MODULE_SERIAL_FLOPPY
 ;
-; "Reset" emulatd serial floppy drives, if any.  There is nothing to actually do for this reset,
+; "Reset" emulated serial floppy drives, if any.  There is nothing to actually do for this reset,
 ; but record the proper error return code if one of these floppy drives is the drive requested.
 ;
@@ -39,5 +39,5 @@
 
 	adc		dl, al										; second drive (CF set) if present
-														; If no drive is present, this will result in ffh which 
+														; If no drive is present, this will result in ffh which
 														; won't match a drive
 	call	BackupErrorCodeFromTheRequestedDriveToBH
@@ -48,8 +48,8 @@
 	test	bl, bl										; If we were called with a floppy disk, then we are done,
 	jns		SHORT .SkipHardDiskReset					; don't do hard disks.
-		
+
 	call	ResetForeignHardDisks
 
-	; Resetting our hard disks will modify dl and bl to be idevars offset based instead of drive number based, 
+	; Resetting our hard disks will modify dl and bl to be idevars offset based instead of drive number based,
 	; such that this call must be the last in the list of reset routines called.
 	;
@@ -57,5 +57,5 @@
 	; and we need to override that value if we are xlate'd into 80h with one of our drives.
 	;
-	call	ResetHardDisksHandledByOurBIOS			
+	call	ResetHardDisksHandledByOurBIOS
 
 .SkipHardDiskReset:
@@ -139,5 +139,5 @@
 ;	Parameters:
 ;		DS:DI:	Ptr to DPT for requested drive
-;				If DPT pointer is not available, or error result in BH won't be used anyway, 
+;				If DPT pointer is not available, or error result in BH won't be used anyway,
 ;				enter through .ErrorCodeNotUsed.
 ;		SS:BP:	Ptr to IDEPACK
@@ -148,10 +148,10 @@
 ;--------------------------------------------------------------------
 ResetHardDisksHandledByOurBIOS:
-	mov		bl, 0										; Assume Null IdevarsOffset for now, assuming foreign drive
+	xor		bl, bl										; Assume Null IdevarsOffset for now, assuming foreign drive
 	test	di, di
 	jz		.ErrorCodeNotUsed
 	mov		bl, [di+DPT.bIdevarsOffset]					; replace drive number with Idevars pointer for cmp with dl
-		
-.ErrorCodeNotUsed:										; BH will be garbage on exit if thie entry point is used, 
+
+.ErrorCodeNotUsed:										; BH will be garbage on exit if this entry point is used,
 														; but reset of all drives will still happen
 
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH10h_HReady.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH10h_HReady.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH10h_HReady.asm	(revision 294)
@@ -15,5 +15,5 @@
 ;	Returns with INTPACK:
 ;		AH:		Int 13h return status
-;		CF:		0 if succesfull, 1 if error
+;		CF:		0 if successful, 1 if error
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH11h_HRecal.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH11h_HRecal.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH11h_HRecal.asm	(revision 294)
@@ -15,5 +15,5 @@
 ;	Returns with INTPACK:
 ;		AH:		BIOS Error code
-;		CF:		0 if succesfull, 1 if error
+;		CF:		0 if successful, 1 if error
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
@@ -35,5 +35,5 @@
 ;	Returns:
 ;		AH:		BIOS Error code
-;		CF:		0 if succesfull, 1 if error
+;		CF:		0 if successful, 1 if error
 ;	Corrupts registers:
 ;		AL, BX, CX, DX
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH15h_HSize.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH15h_HSize.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH15h_HSize.asm	(revision 294)
@@ -14,5 +14,5 @@
 ;		SS:BP:	Ptr to IDEPACK
 ;	Returns with INTPACK:
-;		If succesfull:
+;		If successful:
 ;			AH:		Hard Disk: 3 (Hard disk accessible)
 ;                   Floppy:    1 (Floppy disk, without change detection)
@@ -28,26 +28,26 @@
 %ifdef MODULE_SERIAL_FLOPPY
 	mov		cl, 1										; 1 = floppy disk, no change detection
-				
-	test	dl,dl										; DO NOT store the sector count if this is a 
-	jns		.FloppyDrive								; floppy disk, some OS's depend on this not 
+
+	test	dl,dl										; DO NOT store the sector count if this is a
+	jns		.FloppyDrive								; floppy disk, some OS's depend on this not
 														; happening for floppies in order to boot.
 %endif
-		
+
 	call	AH15h_GetSectorCountToBXDXAX
 	mov		[bp+IDEPACK.intpack+INTPACK.cx], dx			; HIWORD to CX
 	xchg	[bp+IDEPACK.intpack+INTPACK.dx], ax			; LOWORD to DX, AL gets drive number
 
-	xor		ah, ah		
-%ifdef MODULE_SERIAL_FLOPPY				
+	xor		ah, ah
+%ifdef MODULE_SERIAL_FLOPPY
 	mov		cl, 3										; 3 = Hard Disk Accessible
 .FloppyDrive:
-		
-	call	Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH_ALHasDriveNumber	; Store success to BDA and CF		
-	mov		BYTE [bp+IDEPACK.intpack+INTPACK.ah], cl
+
+	call	Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH_ALHasDriveNumber	; Store success to BDA and CF
+	mov		[bp+IDEPACK.intpack+INTPACK.ah], cl
 %else
-	call	Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH	; Store success to BDA and CF		
+	call	Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH	; Store success to BDA and CF
 	mov		BYTE [bp+IDEPACK.intpack+INTPACK.ah], 3
-%endif		
-		
+%endif
+
 	jmp		Int13h_ReturnFromHandlerWithoutStoringErrorCode
 
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1h_HStatus.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1h_HStatus.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1h_HStatus.asm	(revision 294)
@@ -23,14 +23,18 @@
 %ifdef MODULE_SERIAL_FLOPPY
 	test	dl, dl
-	jns		.HardDisk
-	mov		ah, [BDA.bFDRetST]		; Unlike for hard disks below, floppy version does not clear the status
+	js		.HardDisk
+	mov		ah, [BDA.bFDRetST]	; Unlike for hard disks below, floppy version does not clear the status
 	jmp		.done
-.HardDisk:	
+.HardDisk:
 %endif
-		
-	xchg	ah, [BDA.bHDLastSt]		; Load and clear last error
-									; Note that AH is cleared with the LOAD_BDA_SEGMENT above
-				
+
+	xchg	ah, [BDA.bHDLastSt]	; Load and clear last error (AH is cleared with the LOAD_BDA_SEGMENT_TO above)
+
 .done:
+%ifndef USE_186
 	call	Int13h_SetErrorCodeToIntpackInSSBPfromAH
 	jmp		Int13h_ReturnFromHandlerWithoutStoringErrorCode
+%else
+	push	Int13h_ReturnFromHandlerWithoutStoringErrorCode
+	jmp		Int13h_SetErrorCodeToIntpackInSSBPfromAH
+%endif
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH23h_HFeatures.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH23h_HFeatures.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH23h_HFeatures.asm	(revision 294)
@@ -24,5 +24,5 @@
 ;	Returns with INTPACK:
 ;		AH:		Int 13h return status
-;		CF:		0 if succesfull, 1 if error
+;		CF:		0 if successful, 1 if error
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
@@ -51,5 +51,5 @@
 ;	Returns:
 ;		AH:		Int 13h return status
-;		CF:		0 if succesfull, 1 if error
+;		CF:		0 if successful, 1 if error
 ;	Corrupts registers:
 ;		AL, BX, CX, DX
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH24h_HSetBlocks.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH24h_HSetBlocks.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH24h_HSetBlocks.asm	(revision 294)
@@ -18,5 +18,5 @@
 ;	Returns with INTPACK:
 ;		AH:		Int 13h return status
-;		CF:		0 if succesfull, 1 if error
+;		CF:		0 if successful, 1 if error
 ;--------------------------------------------------------------------
 AH24h_HandlerForSetMultipleBlocks:
@@ -38,5 +38,5 @@
 ;	Returns:
 ;		AH:		Int 13h return status
-;		CF:		0 if succesfull, 1 if error
+;		CF:		0 if successful, 1 if error
 ;	Corrupts registers:
 ;		AL, BX, CX, DX
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH25h_HDrvID.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH25h_HDrvID.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH25h_HDrvID.asm	(revision 294)
@@ -18,5 +18,5 @@
 ;	Returns with INTPACK:
 ;		AH:		Int 13h return status
-;		CF:		0 if succesfull, 1 if error
+;		CF:		0 if successful, 1 if error
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
@@ -40,5 +40,5 @@
 ;	Returns with INTPACK:
 ;		AH:		Int 13h return status
-;		CF:		0 if succesfull, 1 if error
+;		CF:		0 if successful, 1 if error
 ;	Corrupts registers:
 ;		AL, BX, CX, DX
@@ -53,5 +53,5 @@
 	call	AccessDPT_GetDriveSelectByteToAL
 	mov		bh, al
-	eMOVZX	ax, BYTE [di+DPT.bIdevarsOffset]
+	eMOVZX	ax, [di+DPT.bIdevarsOffset]
 	xchg	bp, ax
 	call	Device_IdentifyToBufferInESSIwithDriveSelectByteInBH
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH2h_HRead.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH2h_HRead.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH2h_HRead.asm	(revision 294)
@@ -20,10 +20,10 @@
 ;				Bits 5...0:	Starting sector number (1...63)
 ;		DH:		Starting head number (0...255)
-;		ES:BX:	Pointer to buffer recieving data
+;		ES:BX:	Pointer to buffer receiving data
 ;	Returns with INTPACK:
 ;		AH:		Int 13h/40h floppy return status
 ;		AL:		Burst error length if AH returns 11h (we never return error code 11h)
 ;				Number of sectors actually read (only valid if CF set for someBIOSes)
-;		CF:		0 if successfull, 1 if error
+;		CF:		0 if successful, 1 if error
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH3h_HWrite.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH3h_HWrite.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH3h_HWrite.asm	(revision 294)
@@ -24,5 +24,5 @@
 ;		AH:		Int 13h/40h floppy return status
 ;		AL:		Number of sectors actually written (only valid if CF set for someBIOSes)
-;		CF:		0 if successfull, 1 if error
+;		CF:		0 if successful, 1 if error
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH4h_HVerify.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH4h_HVerify.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH4h_HVerify.asm	(revision 294)
@@ -23,5 +23,5 @@
 ;		AH:		Int 13h/40h floppy return status
 ;		AL:		Number of sectors actually verified (only valid if CF set for someBIOSes)
-;		CF:		0 if successfull, 1 if error
+;		CF:		0 if successful, 1 if error
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH8h_HParams.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH8h_HParams.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH8h_HParams.asm	(revision 294)
@@ -22,5 +22,5 @@
 ;       ES:DI:  Floppy DPT (for floppies only)
 ;		AH:		Int 13h/40h floppy return status
-;		CF:		0 if successfull, 1 if error
+;		CF:		0 if successful, 1 if error
 ;--------------------------------------------------------------------
 AH8h_HandlerForReadDiskDriveParameters:
@@ -31,6 +31,6 @@
 	jnc		SHORT .MidGame
 	jmp		Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
-		
-.OurDrive:		
+
+.OurDrive:
 	call	AH8h_GetDriveParameters
 
@@ -41,21 +41,21 @@
 %endif
 	;; fall-through
-		
-.MidGame:		
+
+.MidGame:
 	call	RamVars_GetCountOfKnownDrivesToAX		; assume hard disk for now, will discard if for floppies
 
 	test	byte [bp+IDEPACK.intpack+INTPACK.dl], 080h
 	jnz		.Done
-		
+
 	mov		[bp+IDEPACK.intpack+INTPACK.bl], bl
 
 	mov		[bp+IDEPACK.intpack+INTPACK.es], es
-	mov		[bp+IDEPACK.intpack+INTPACK.di], di		
+	mov		[bp+IDEPACK.intpack+INTPACK.di], di
 
 	call	FloppyDrive_GetCountToAX
 
-.Done:	
+.Done:
 	mov		ah, dh
-		
+
 	mov		[bp+IDEPACK.intpack+INTPACK.cx], cx
 	xchg	[bp+IDEPACK.intpack+INTPACK.dx], ax		; recover DL for BDA last status byte determination
@@ -63,5 +63,5 @@
 	xor		ah, ah
 %ifdef MODULE_SERIAL_FLOPPY
-	jmp		Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH_ALHasDriveNumber			
+	jmp		Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH_ALHasDriveNumber
 %else
 	jmp		Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
@@ -118,5 +118,5 @@
 	eSHR_IM	bl,FLGH_DPT_SERIAL_FLOPPY_TYPE_FIELD_POSITION
 %endif
-%endif		
+%endif
 	ret
 
@@ -127,5 +127,5 @@
 ; So we return fixed values out of the ROM for callers who might be expecting this information.
 ;
-; On AT systems, we return the information for a 1.44 MB disk, 
+; On AT systems, we return the information for a 1.44 MB disk,
 ; and on XT systems, we return the information for a 360 KB disk.
 ;
@@ -138,6 +138,6 @@
 
 	db		1h << 1 | 0				; Offset 1: Typical values of 1 for head load time
-									;           DMA used (although it actually is not, but is more restrctive)
-	db		25h						; Offset 2: Inactiviy motor turn-off delay, 
+									;           DMA used (although it actually is not, but is more restrictive)
+	db		25h						; Offset 2: Inactivity motor turn-off delay,
 									; 			Typical value of 25h for 2 second delay
 	db		02h						; Offset 3: Sector size, always 512
@@ -161,5 +161,5 @@
 	db		0f6h					; Offset 8: Fill byte for format
 	db		0fh						; Offset 9: Head setting time
-	db		08h						; Offset A: Wait for motor startpu time
+	db		08h						; Offset A: Wait for motor startup time
 
 %ifdef USE_AT
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm	(revision 294)
@@ -15,5 +15,5 @@
 ;	Returns with INTPACK:
 ;		AH:		Int 13h return status
-;		CF:		0 if succesfull, 1 if error
+;		CF:		0 if successful, 1 if error
 ;--------------------------------------------------------------------
 AH9h_HandlerForInitializeDriveParameters:
@@ -36,5 +36,5 @@
 ;	Returns:
 ;		AH:		Int 13h return status
-;		CF:		0 if succesfull, 1 if error
+;		CF:		0 if successful, 1 if error
 ;	Corrupts registers:
 ;		AL, BX, DX
@@ -45,13 +45,13 @@
 
 %ifdef MODULE_SERIAL
-	; 
-	; no need to do this for serial deveices, and we use the DPT_RESET flag bits
+	;
+	; no need to do this for serial devices, and we use the DPT_RESET flag bits
 	; to store the drive type for serial floppy drives (MODULE_SERIAL_FLOPPY)
 	;
 	xor		ah, ah
 	test	byte [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE	; Clears CF
-	jnz		.ReturnNotSuccessfull
+	jnz		.ReturnNotSuccessful
 %endif
-		
+
 	; Try to select drive and wait until ready
 	or		BYTE [di+DPT.bFlagsHigh], MASKH_DPT_RESET		; Everything uninitialized
@@ -59,5 +59,5 @@
 	mov		[bp+IDEPACK.bDrvAndHead], al
 	call	Device_SelectDrive
-	jc		SHORT .ReturnNotSuccessfull
+	jc		SHORT .ReturnNotSuccessful
 	and		BYTE [di+DPT.bFlagsHigh], ~FLGH_DPT_RESET_nDRDY	; Clear since success
 
@@ -80,8 +80,8 @@
 .InitializeBlockMode:
 	call	InitializeBlockMode
-	jc		SHORT .ReturnNotSuccessfull
+	jc		SHORT .ReturnNotSuccessful
 	and		BYTE [di+DPT.bFlagsHigh], ~FLGH_DPT_RESET_nSETBLOCK	; Keeps CF clear
 
-.ReturnNotSuccessfull:
+.ReturnNotSuccessful:
 	pop		cx
 	pop		si
@@ -96,5 +96,5 @@
 ;	Returns:
 ;		AH:		BIOS Error code
-;		CF:		Cleared if succesfull
+;		CF:		Cleared if successful
 ;				Set if any error
 ;	Corrupts registers:
@@ -121,5 +121,5 @@
 ;	Returns:
 ;		AH:		BIOS Error code
-;		CF:		Cleared if succesfull
+;		CF:		Cleared if successful
 ;				Set if any error
 ;	Corrupts registers:
@@ -146,5 +146,5 @@
 ;	Returns:
 ;		AH:		BIOS Error code
-;		CF:		Cleared if succesfull
+;		CF:		Cleared if successful
 ;				Set if any error
 ;	Corrupts registers:
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AHCh_HSeek.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AHCh_HSeek.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AHCh_HSeek.asm	(revision 294)
@@ -21,5 +21,5 @@
 ;	Returns with INTPACK:
 ;		AH:		BIOS Error code
-;		CF:		0 if succesfull, 1 if error
+;		CF:		0 if successful, 1 if error
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
@@ -44,5 +44,5 @@
 ;	Returns:
 ;		AH:		BIOS Error code
-;		CF:		0 if succesfull, 1 if error
+;		CF:		0 if successful, 1 if error
 ;	Corrupts registers:
 ;		AL, BX, CX, DX
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AHDh_HReset.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AHDh_HReset.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AHDh_HReset.asm	(revision 294)
@@ -15,5 +15,5 @@
 ;	Returns with INTPACK:
 ;		AH:		Int 13h return status
-;		CF:		0 if succesfull, 1 if error
+;		CF:		0 if successful, 1 if error
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
@@ -37,5 +37,5 @@
 ;	Returns:
 ;		AH:		Int 13h return status
-;		CF:		0 if succesfull, 1 if error
+;		CF:		0 if successful, 1 if error
 ;	Corrupts registers:
 ;		AL, SI
@@ -53,7 +53,7 @@
 
 	; Initialize Master and Slave drives
-	mov		al, [di+DPT.bIdevarsOffset]			; pointer to controller we are looking to reset
-	mov		ah, 0								; initialize error code, assume success
-		
+	eMOVZX	ax, [di+DPT.bIdevarsOffset]			; (AL) pointer to controller we are looking to reset
+												; (AH) initialize error code, assume success
+
 	mov		si, IterateAndResetDrives
 	call	FindDPT_IterateAllDPTs
@@ -70,5 +70,5 @@
 ; IterateAndResetDrives: Iteration routine for use with IterateAllDPTs.
 ;
-; When a drive on the controller is found, it is reset, and the error code 
+; When a drive on the controller is found, it is reset, and the error code
 ; merged into overall error code for this controller.  Master will be reset
 ; first.  Note that the iteration will go until the end of the DPT list.
@@ -79,5 +79,5 @@
 	push	ax
 	call	AH9h_InitializeDriveForUse			; Reset Master and Slave (Master will come first in DPT list)
-	pop		ax		
+	pop		ax
 	jnc		.done
 	or		ah, (RET_HD_RESETFAIL << 1) | 1		; OR in Reset Failed error code and CF, will SHR into position later
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH41h_CheckIfExtensionsPresent.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH41h_CheckIfExtensionsPresent.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH41h_CheckIfExtensionsPresent.asm	(revision 294)
@@ -19,5 +19,5 @@
 ;		BX:		AA55h
 ;		CX:		Support bits
-;		CF:		0 if succesfull, 1 if error
+;		CF:		0 if successful, 1 if error
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH42h_ExtendedReadSectors.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH42h_ExtendedReadSectors.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH42h_ExtendedReadSectors.asm	(revision 294)
@@ -18,5 +18,5 @@
 ;	Returns with INTPACK:
 ;		AH:		Int 13h return status
-;		CF:		0 if succesfull, 1 if error
+;		CF:		0 if successful, 1 if error
 ;	Return with Disk Address Packet in INTPACK:
 ;		.wSectorCount	Number of sectors read successfully
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH43h_ExtendedWriteSectors.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH43h_ExtendedWriteSectors.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH43h_ExtendedWriteSectors.asm	(revision 294)
@@ -20,5 +20,5 @@
 ;	Returns with INTPACK:
 ;		AH:		Int 13h return status
-;		CF:		0 if succesfull, 1 if error
+;		CF:		0 if successful, 1 if error
 ;	Return with Disk Address Packet in INTPACK:
 ;		.wSectorCount	Number of sectors written successfully
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH44h_ExtendedVerifySectors.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH44h_ExtendedVerifySectors.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH44h_ExtendedVerifySectors.asm	(revision 294)
@@ -18,5 +18,5 @@
 ;	Returns with INTPACK:
 ;		AH:		Int 13h return status
-;		CF:		0 if succesfull, 1 if error
+;		CF:		0 if successful, 1 if error
 ;	Return with Disk Address Packet in INTPACK:
 ;		.wSectorCount	Number of sectors verified successfully
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH47h_ExtendedSeek.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH47h_ExtendedSeek.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH47h_ExtendedSeek.asm	(revision 294)
@@ -18,5 +18,5 @@
 ;	Returns with INTPACK:
 ;		AH:		Int 13h return status
-;		CF:		0 if succesfull, 1 if error
+;		CF:		0 if successful, 1 if error
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm	(revision 294)
@@ -19,5 +19,5 @@
 ;		AH:		Int 13h return status
 ;		DS:SI:	Ptr to Extended Drive Information Table
-;		CF:		0 if succesfull, 1 if error
+;		CF:		0 if successful, 1 if error
 ;--------------------------------------------------------------------
 AH48h_HandlerForGetExtendedDriveParameters:
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Address.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Address.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Address.asm	(revision 294)
@@ -128,9 +128,13 @@
 ConvertLCHStoLBARegisterValues:
 	; cylToSeek*headsPerCyl (18-bit result)
-	mov		ax, cx					; Copy Cylinder number to AX
-	; We could save a byte here by using CWD instead of the XOR DH, DH in eMOVZX
-	; but I'm not sure how that would affect speed.
+	mov		ax, LBA_ASSIST_SPT		; Load Sectors per Track
+	xchg	cx, ax					; Cylinder number to AX, Sectors per Track to CX
 
-	eMOVZX	dx, BYTE [di+DPT.bLbaHeads]
+%ifdef USE_386
+	movzx	dx, [di+DPT.bLbaHeads]
+%else
+	cwd
+	mov		dl, [di+DPT.bLbaHeads]
+%endif
 	mul		dx						; DX:AX = cylToSeek*headsPerCyl
 
@@ -141,5 +145,4 @@
 
 	; *=sectPerTrack (18-bit by 6-bit multiplication with 24-bit result)
-	mov		cx, LBA_ASSIST_SPT		; Load Sectors per Track
 	xchg	ax, dx					; Hiword to AX, loword to DX
 	mul		cl						; AX = hiword * Sectors per Track
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Prepare.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Prepare.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Prepare.asm	(revision 294)
@@ -34,21 +34,10 @@
 	cmp		ax, BYTE 127
 	ja		SHORT InvalidNumberOfSectorsRequested
-	; Fall to GetEbiosCommandIndexToBX
 
-;--------------------------------------------------------------------
-; GetEbiosCommandIndexToBX
-;	Parameters:
-;		DS:DI:	Ptr to DPT
-;		ES:SI:	Ptr to DAP (Disk Address Packet)
-;	Returns:
-;		BX:		Index to command lookup table
-;	Corrupts registers:
-;		AX, DX
-;--------------------------------------------------------------------
-GetEbiosCommandIndexToBX:
+	; Get EBIOS command index to BX
 	; LBA28 or LBA48 command
-	xor		dx, dx
+	cwd
 	mov		al, [es:si+DAP.qwLBA+3]	; Load LBA48 byte 3 (bits 24...31)
-	and		ax, 00F0h				; Clear LBA28 bits 24...27
+	and		al, 0F0h				; 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
Index: /trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm	(revision 294)
@@ -26,9 +26,9 @@
 	mov		cx, g_szDetectMaster
 	mov		bh, MASK_DRVNHEAD_SET								; Select Master drive
-	call	StartDetectionWithDriveSelectByteInBHandStringInAX	; Detect and create DPT + BOOTNFO
+	call	StartDetectionWithDriveSelectByteInBHandStringInCX	; Detect and create DPT + BOOTNFO
 
 	mov		cx, g_szDetectSlave
 	mov		bh, MASK_DRVNHEAD_SET | FLG_DRVNHEAD_DRV
-	call	StartDetectionWithDriveSelectByteInBHandStringInAX
+	call	StartDetectionWithDriveSelectByteInBHandStringInCX
 
 	pop		cx
@@ -72,10 +72,10 @@
 	mov		al, [es:BDA.bHDCount]
 	add		cl, al						; Add our drives to the system count
-	mov		[es:BDA.bHDCount], cl		
-	or		al, 80h						; Or in hard disk flag		
-	mov		[RAMVARS.bFirstDrv], al		; Store first drive number		
-
-.AddFloppies:		
-%ifdef MODULE_SERIAL_FLOPPY		
+	mov		[es:BDA.bHDCount], cl
+	or		al, 80h						; Or in hard disk flag
+	mov		[RAMVARS.bFirstDrv], al		; Store first drive number
+
+.AddFloppies:
+%ifdef MODULE_SERIAL_FLOPPY
 ;----------------------------------------------------------------------
 ;
@@ -84,5 +84,5 @@
 	dec		ch
 	mov		al, ch
-	js		.NoFloppies						; if no drives are present, we store 0ffh		
+	js		.NoFloppies						; if no drives are present, we store 0ffh
 
 	call	FloppyDrive_GetCountFromBIOS_or_BDA
@@ -92,11 +92,11 @@
 	add		al, ch							; Add our drives to existing drive count
 	cmp		al, 3							; For BDA, max out at 4 drives (ours is zero based)
-	jl		.MaxBDAFloppiesExceeded
-	mov		al, 3							
+	jb		.MaxBDAFloppiesExceeded
+	mov		al, 3
 .MaxBDAFloppiesExceeded:
 	eROR_IM	al, 2							; move to bits 6-7
 	inc		ax								; low order bit, indicating floppy drive exists
 
-	mov		ah, [es:BDA.wEquipment]			; Load Equipment WORD low byte	
+	mov		ah, [es:BDA.wEquipment]			; Load Equipment WORD low byte
 	and		ah, 03eh						; Mask off drive number and drives present bit
 	or		al, ah							; Or in new values
@@ -111,11 +111,11 @@
 	shr		ch, 1							; number of drives, 1 or 2 only, to CF flag (clear=1, set=2)
 	rcl		al, 1							; starting drive number in upper 7 bits, number of drives in low bit
-.NoFloppies:	
+.NoFloppies:
 	mov		[RAMVARS.xlateVars+XLATEVARS.bFlopCntAndFirst], al
 %endif
-		
+
 	ret
 
-%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS		
+%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
 	%if FLG_ROMVARS_SERIAL_SCANDETECT != 8
 		%error "DetectDrives is currently coded to assume that FLG_ROMVARS_SERIAL_SCANDETECT is the same bit as the ALT key code in the BDA.  Changes in the code will be needed if these values are no longer the same."
@@ -125,5 +125,5 @@
 
 ;--------------------------------------------------------------------
-; StartDetectionWithDriveSelectByteInBHandStringInAX
+; StartDetectionWithDriveSelectByteInBHandStringInCX
 ;	Parameters:
 ;		BH:		Drive Select byte for Drive and Head Register
@@ -137,6 +137,6 @@
 ;		AX, BX, CX, DX, SI, DI
 ;--------------------------------------------------------------------
-StartDetectionWithDriveSelectByteInBHandStringInAX:
-	call	DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP
+StartDetectionWithDriveSelectByteInBHandStringInCX:
+	call	DetectPrint_StartDetectWithMasterOrSlaveStringInCXandIdeVarsInCSBP
 	; Fall to .ReadAtaInfoFromHardDisk
 
Index: /trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm	(revision 294)
@@ -28,5 +28,5 @@
 
 ;--------------------------------------------------------------------
-; DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP
+; DetectPrint_StartDetectWithMasterOrSlaveStringInCXandIdeVarsInCSBP
 ;	Parameters:
 ;		CS:CX:	Ptr to "Master" or "Slave" string
@@ -38,5 +38,5 @@
 ;		AX, SI, DI, CX
 ;--------------------------------------------------------------------
-DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP:
+DetectPrint_StartDetectWithMasterOrSlaveStringInCXandIdeVarsInCSBP:
 	mov		ax, [cs:bp+IDEVARS.wPort]    	; for IDE: AX=port address, DH=.bDevice
 	mov		dx, [cs:bp+IDEVARS.bDevice-1]   ; for Serial: AL=port address>>2, AH=baud rate
@@ -48,5 +48,5 @@
 
 	mov		si, g_szDetectOuter				; Load SI with default wrapper string "IDE %s at %s: "
-		
+
 	push	bp								; setup stack for call to
 	mov		bp, sp							; BootMenuPrint_FormatCSSIfromParamsInSSBP
@@ -98,10 +98,10 @@
 	mov		cl, (g_szDetectCOMSmall-$$) & 0xff	; Setup secondary print string for "COMn/XXy00"
 
-.pushAndPrintSerial:	
+.pushAndPrintSerial:
 	mov		si, g_szDetectOuterSerial		; Finally load SI with wrapper string "Serial %s on %s: "
 
 .pushAndPrint:
 %endif
-		
+
 	push	cx								; Push print string
 	push	ax								; Push high order digits, or port address, or N/A
Index: /trunk/XTIDE_Universal_BIOS/Src/Initialization/DriveXlate.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Initialization/DriveXlate.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Initialization/DriveXlate.asm	(revision 294)
@@ -39,8 +39,8 @@
 SwapFloppyDriveOrHardDisk:
 	mov		ah, 80h					; Assume hard disk
-	mov		al, BYTE [RAMVARS.xlateVars+XLATEVARS.bHDSwap]
+	mov		al, [RAMVARS.xlateVars+XLATEVARS.bHDSwap]
 	test	dl, ah					; Hard disk?
 	jnz		SHORT SwapDrive			; If so, jump to swap
-	mov		al, BYTE [RAMVARS.xlateVars+XLATEVARS.bFDSwap]
+	mov		al, [RAMVARS.xlateVars+XLATEVARS.bFDSwap]
 	cbw
 	; Fall to SwapDrive
Index: /trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm	(revision 294)
@@ -127,24 +127,24 @@
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
-FloppyDrive_GetCountToAX:		
+FloppyDrive_GetCountToAX:
 %ifdef MODULE_SERIAL_FLOPPY
 	call	RamVars_UnpackFlopCntAndFirstToAL
 	js		.UseBIOSorBDA				; We didn't add in any drives, counts here are not valid
-		
-	adc		al,1						; adds in the drive count bit, and adds 1 for count vs. 0-index, 
+
+	adc		al,1						; adds in the drive count bit, and adds 1 for count vs. 0-index,
 	jmp		.FinishCalc					; need to clear AH on the way out, and add in minimum drive numbers
 
-.UseBIOSorBDA:	
+.UseBIOSorBDA:
 %endif
 	call	FloppyDrive_GetCountFromBIOS_or_BDA
 
-.FinishCalc:	
+.FinishCalc:
 	mov		ah, [cs:ROMVARS.bMinFddCnt]
 	MAX_U	al, ah
 	cbw
-		
-	ret
-
-ALIGN JUMP_ALIGN		
+
+	ret
+
+ALIGN JUMP_ALIGN
 FloppyDrive_GetCountFromBIOS_or_BDA:
 	push	es
@@ -152,13 +152,13 @@
 ;--------------------------------------------------------------------
 ; Reads Floppy Drive Count from BIOS.
-; Does not work on most XT systems. Call FloppyDrive_GetCountFromBDA
+; Does not work on most XT systems. Call .GetCountFromBDA
 ; if this function fails.
 ;
-; GetCountFromBIOS
+; .GetCountFromBIOS
 ;	Parameters:
 ;		Nothing
 ;	Returns:
 ;		AL:		Number of Floppy Drives
-;		CF:		Cleared if successfull
+;		CF:		Cleared if successful
 ;				Set if BIOS function not supported
 ;	Corrupts registers:
@@ -169,5 +169,4 @@
 .GetCountFromBIOS:
 	push	di
-	push	es
 	push	bx
 	push	cx
@@ -182,5 +181,4 @@
 	pop		cx
 	pop		bx
-	pop		es
 	pop		di
 %endif
@@ -188,13 +186,13 @@
 ;--------------------------------------------------------------------
 ; Reads Floppy Drive Count (0...4) from BIOS Data Area.
-; This function should be used only if FloppyDrive_GetCountFromBIOS fails.
-;
-; GetCountFromBDA
-;	Parameters:
-;		Nothing
-;	Returns:
-;		CL:		Number of Floppy Drives
-;	Corrupts registers:
-;		CH, ES
+; This function should be used only if .GetCountFromBIOS fails.
+;
+; .GetCountFromBDA
+;	Parameters:
+;		Nothing
+;	Returns:
+;		AL:		Number of Floppy Drives
+;	Corrupts registers:
+;		AH, ES
 ;--------------------------------------------------------------------
 %ifndef USE_AT
@@ -203,11 +201,10 @@
 	LOAD_BDA_SEGMENT_TO	es, ax
 	mov		al, [es:BDA.wEquipment]			; Load Equipment WORD low byte
-	mov		ah, al							; Copy it to CH
+	mov		ah, al							; Copy it to AH
 	and		ax, 0C001h						; Leave bits 15..14 and 0
 	eROL_IM	ah, 2							; EW low byte bits 7..6 to 1..0
-	add		al, ah							; CL = Floppy Drive count
+	add		al, ah							; AL = Floppy Drive count
 %endif
 
 	pop		es
 	ret
-		
Index: /trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm	(revision 294)
@@ -62,5 +62,5 @@
 	mov		di, ROMVARS.ideVars0			; CS:SI points to first IDEVARS
 .IdeControllerLoop:
-	mov		al, BYTE [cs:di+IDEVARS.bIRQ]
+	mov		al, [cs:di+IDEVARS.bIRQ]
 	add		di, BYTE IDEVARS_size			; Increment to next controller
 	call	.InstallLowOrHighIrqHandler
@@ -147,5 +147,5 @@
 ;--------------------------------------------------------------------
 Interrupts_UnmaskInterruptControllerForDriveInDSDI:
-	eMOVZX	bx, BYTE [di+DPT.bIdevarsOffset]
+	eMOVZX	bx, [di+DPT.bIdevarsOffset]
 	mov		al, [cs:bx+IDEVARS.bIRQ]
 	test	al, al
Index: /trunk/XTIDE_Universal_BIOS/Src/Main.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Main.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Main.asm	(revision 294)
@@ -13,5 +13,5 @@
 ;					file (so no linker needed, Nasm does it all).
 
-ORG 000h						; Code start offset 0000h
+	ORG 0							; Code start offset 0000h
 
 %define MENUEVENT_INLINE_OFFSETS    ; Only one menu required, save space and inline offsets
@@ -201,5 +201,5 @@
 	%include "IdeTransfer.asm"		; Must be included after IdeCommand.asm
 	%include "IdeWait.asm"
-	%include "IdeError.asm"			; Must be included after IdeWait.asm		
+	%include "IdeError.asm"			; Must be included after IdeWait.asm
 	%include "IdeDPT.asm"
 	%include "IdeIO.asm"
@@ -215,5 +215,5 @@
 	%include "MemIdeTransfer.asm"	; Must be included after IdeCommand.asm
 	%include "IdeWait.asm"
-	%include "IdeError.asm"			; Must be included after IdeWait.asm		
+	%include "IdeError.asm"			; Must be included after IdeWait.asm
 %undef IDEDEVICE
 %endif
Index: /trunk/XTIDE_Universal_BIOS/Src/Strings.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Strings.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/Strings.asm	(revision 294)
@@ -29,5 +29,5 @@
 %endif
 
-; The following strings are used by DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP
+; The following strings are used by DetectPrint_StartDetectWithMasterOrSlaveStringInCXandIdeVarsInCSBP
 ; To support an optimization in that code, these strings must start on the same 256 byte page,
 ; which is checked at assembly time below.
@@ -49,5 +49,5 @@
 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
 	%if ((g_szDetectEnd-$$) & 0xff00) <> ((g_szDetectStart-$$) & 0xff00)
-		%error "g_szDetect* strings must start on the same 256 byte page, required by DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP.  Please move this block up or down within strings.asm"
+		%error "g_szDetect* strings must start on the same 256 byte page, required by DetectPrint_StartDetectWithMasterOrSlaveStringInCXandIdeVarsInCSBP.  Please move this block up or down within strings.asm"
 	%endif
 %endif
Index: /trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm	(revision 294)
@@ -18,5 +18,5 @@
 ;	Returns:
 ;		DL:		Drive number for new drive
-;		DS:DI:	Ptr to Disk Parameter Table (if succesfull)
+;		DS:DI:	Ptr to Disk Parameter Table (if successful)
 ;		CF:		Cleared if DPT created successfully
 ;				Set if any error
@@ -202,24 +202,24 @@
 ;----------------------------------------------------------------------
 ; Update drive counts (hard and floppy)
-;----------------------------------------------------------------------	
-		
+;----------------------------------------------------------------------
+
 %ifdef MODULE_SERIAL_FLOPPY
 ;
 ; These two instructions serve two purposes:
 ; 1. If the drive is a floppy drive (CF set), then we effectively increment the counter.
-; 2. If this is a hard disk, and there have been any floppy drives previously added, then the hard disk is 
+; 2. If this is a hard disk, and there have been any floppy drives previously added, then the hard disk is
 ;    effectively discarded.  This is more of a safety check then code that should ever normally be hit (see below).
-;    Since the floppy DPT's come after the hard disk DPT's, without expensive (code size) code to relocate a DPT, 
+;    Since the floppy DPT's come after the hard disk DPT's, without expensive (code size) code to relocate a DPT,
 ;    this was necessary.  Now, this situation shouldn't happen in normal operation, for a couple of reasons:
-; 		A. xtidecfg always puts configured serial ports at the end fo the IDEVARS list
+; 		A. xtidecfg always puts configured serial ports at the end of the IDEVARS list
 ;       B. the auto serial code is always executed last
 ;       C. the serial server always returns floppy drives last
 ;
 	adc		byte [RAMVARS.xlateVars+XLATEVARS.bFlopCreateCnt], 0
-	jnz		.AllDone	
+	jnz		.AllDone
 %else
 ;
 ; Even without floppy support enabled, we shouldn't try to mount a floppy image as a hard disk, which
-; could lead to unpredictable results since no MBR will be present, etc.  The server doesn't know that 
+; could lead to unpredictable results since no MBR will be present, etc.  The server doesn't know that
 ; floppies are supported, so it is important to still fail here if a floppy is seen during the drive scan.
 ;
@@ -228,6 +228,6 @@
 
 	inc		BYTE [RAMVARS.bDrvCnt]		; Increment drive count to RAMVARS
-		
-.AllDone:				
+
+.AllDone:
 	clc
 	ret
Index: /trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm	(revision 294)
@@ -8,5 +8,5 @@
 ; Checks if drive is handled by this BIOS, and return DPT pointer.
 ;
-; FindDPT_ForDriveNumberInDL		
+; FindDPT_ForDriveNumberInDL
 ;	Parameters:
 ;		DL:		Drive number
@@ -21,8 +21,8 @@
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
-FindDPT_ForDriveNumberInDL:		
+FindDPT_ForDriveNumberInDL:
 	xchg	di, ax								; Save the contents of AX in DI
 
-; 
+;
 ; Check Our Hard Disks
 ;
@@ -33,16 +33,16 @@
 	cmp		dl, ah								; Above last supported?
 	jae		SHORT .HardDiskNotHandledByThisBIOS
-		
+
 	cmp		dl, al								; Below first supported?
 	jae		SHORT .CalcDPTForDriveNumber
 
-ALIGN JUMP_ALIGN				
-.HardDiskNotHandledByThisBIOS:	
+ALIGN JUMP_ALIGN
+.HardDiskNotHandledByThisBIOS:
 ;
 ; Check Our Floppy Disks
-; 
+;
 	call	RamVars_UnpackFlopCntAndFirstToAL
 	js		SHORT .DiskIsNotHandledByThisBIOS
-				
+
 	cbw											; Always 0h (no floppy drive covered above)
 	adc		ah, al								; Add in first drive number and number of drives
@@ -51,11 +51,11 @@
 	jz		SHORT .CalcDPTForDriveNumber
 	cmp		al, dl								; Check first drive in all cases, redundant but OK to repeat
-	jnz		SHORT .DiskIsNotHandledByThisBIOS			
+	jnz		SHORT .DiskIsNotHandledByThisBIOS
 %else
-	cmp		dl, ah								; Above last supported?		
+	cmp		dl, ah								; Above last supported?
 	jae		SHORT .DiskIsNotHandledByThisBIOS
-		
+
 	cmp		dl, al								; Below first supported?
-	jb		SHORT .DiskIsNotHandledByThisBIOS			
+	jb		SHORT .DiskIsNotHandledByThisBIOS
 %endif
 	; fall-through to CalcDPTForDriveNumber
@@ -63,5 +63,5 @@
 ;--------------------------------------------------------------------
 ; Finds Disk Parameter Table for drive number.
-; Note intended to be called except by FindDPT_ForDriveNumber
+; Not intended to be called except by FindDPT_ForDriveNumberInDL
 ;
 ; CalcDPTForDriveNumber
@@ -69,5 +69,5 @@
 ;		DL:		Drive number
 ;		DS:		RAMVARS segment
-;       DI:     Saved copy of AX from entry at FindDPT_ForDriveNumber
+;       DI:     Saved copy of AX from entry at FindDPT_ForDriveNumberInDL
 ;	Returns:
 ;		DS:DI:	Ptr to DPT
@@ -82,5 +82,5 @@
 %ifdef MODULE_SERIAL_FLOPPY
 	mov		ax, [RAMVARS.wDrvCntAndFirst]
-		
+
 	test	dl, dl
 	js		.harddisk
@@ -88,6 +88,6 @@
 	call	RamVars_UnpackFlopCntAndFirstToAL
 	add		dl, ah						; add in end of hard disk DPT list, floppies start immediately after
-		
-ALIGN JUMP_ALIGN				
+
+ALIGN JUMP_ALIGN
 .harddisk:
 	sub		dl, al						; subtract off beginning of either hard disk or floppy list (as appropriate)
@@ -96,9 +96,9 @@
 %endif
 
-.CalcDPTForNewDrive:				
+.CalcDPTForNewDrive:
 	mov		al, LARGEST_DPT_SIZE
-		
+
 	mul		dl
-	add		ax, BYTE RAMVARS_size		; Clears CF (will not oveflow)
+	add		ax, BYTE RAMVARS_size		; Clears CF (will not overflow)
 
 	pop		dx
@@ -107,12 +107,12 @@
 	ret
 
-ALIGN JUMP_ALIGN		
-.DiskIsNotHandledByThisBIOS:			
+ALIGN JUMP_ALIGN
+.DiskIsNotHandledByThisBIOS:
 ;
 ; Drive not found...
 ;
 	xor		ax, ax								; Clear DPT pointer
-	stc											; Is not supported by our BIOS		
-		
+	stc											; Is not supported by our BIOS
+
 	xchg	di, ax								; Restore AX from save at top
 	ret
@@ -136,7 +136,7 @@
 
 ;--------------------------------------------------------------------
-; Iteration routine for FindDPT_ForIdevarsOffsetInDL, 
+; Iteration routine for FindDPT_ForIdevarsOffsetInDL,
 ; for use with IterateAllDPTs
-; 
+;
 ; Returns when DPT is found on the controller with Idevars offset in DL
 ;
@@ -148,9 +148,9 @@
 ;				Set if wrong DPT
 ;--------------------------------------------------------------------
-IterateFindFirstDPTforIdevars:		
+IterateFindFirstDPTforIdevars:
 	cmp		dl, [di+DPT.bIdevarsOffset]			; Clears CF if matched
 	je		.done
 	stc											; Set CF for not found
-.done:	
+.done:
 	ret
 
@@ -171,5 +171,5 @@
 FindDPT_ForNewDriveToDSDI:
 	push	dx
-		
+
 %ifdef MODULE_SERIAL_FLOPPY
 	mov		dx, [RAMVARS.wDrvCntAndFlopCnt]
@@ -178,5 +178,5 @@
 	mov		dl, [RAMVARS.bDrvCnt]
 %endif
-		
+
 	jmp		short FindDPT_ForDriveNumberInDL.CalcDPTForNewDrive
 
@@ -185,5 +185,5 @@
 ;	Parameters:
 ;		DS:DI:	Ptr to DPT to examine
-;       BL:		Bit(s) to test in DPT.bFlagsHigh 
+;       BL:		Bit(s) to test in DPT.bFlagsHigh
 ;	Returns:
 ;		CF:		Clear if wanted DPT found
@@ -193,9 +193,9 @@
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
-IterateToDptWithFlagsHighInBL:		
-	test	BYTE [di+DPT.bFlagsHigh], bl		; Clears CF
+IterateToDptWithFlagsHighInBL:
+	test	[di+DPT.bFlagsHigh], bl				; Clears CF
 	jnz		SHORT .ReturnRightDPT
 	stc
-.ReturnRightDPT:		
+.ReturnRightDPT:
 	ret
 
@@ -212,10 +212,10 @@
 ;--------------------------------------------------------------------
 %ifdef MODULE_SERIAL
-ALIGN JUMP_ALIGN		
-FindDPT_ToDSDIforSerialDevice:			
+ALIGN JUMP_ALIGN
+FindDPT_ToDSDIforSerialDevice:
 	mov		bl, FLGH_DPT_SERIAL_DEVICE
 ; fall-through
 %endif
-				
+
 ;--------------------------------------------------------------------
 ; FindDPT_ToDSDIforFlagsHigh
@@ -231,5 +231,5 @@
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
-FindDPT_ToDSDIforFlagsHighInBL:		
+FindDPT_ToDSDIforFlagsHighInBL:
 	mov		si, IterateToDptWithFlagsHighInBL
 	; Fall to IterateAllDPTs
@@ -257,10 +257,7 @@
 
 	mov		di, RAMVARS_size			; Point DS:DI to first DPT
-		
-	mov		cl, [RAMVARS.bDrvCnt]
-	xor		ch, ch						; Clears CF  
-		
+	eMOVZX	cx, [RAMVARS.bDrvCnt]
 	jcxz	.NotFound					; Return if no drives
-		
+
 ALIGN JUMP_ALIGN
 .LoopWhileDPTsLeft:
Index: /trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm	(revision 294)
@@ -125,12 +125,10 @@
 ALIGN JUMP_ALIGN
 RamVars_GetHardDiskCountFromBDAtoAX:
-	push	es
-
-	LOAD_BDA_SEGMENT_TO	es, ax
 	call	RamVars_GetCountOfKnownDrivesToAX
-	mov		cl, [es:BDA.bHDCount]
+	push	ds
+	LOAD_BDA_SEGMENT_TO	ds, cx
+	mov		cl, [BDA.bHDCount]
 	MAX_U	al, cl
-		
-	pop		es
+	pop		ds
 	ret
 
@@ -151,5 +149,5 @@
 	cbw
 	ret
-	
+
 ;--------------------------------------------------------------------
 ; RamVars_GetIdeControllerCountToCX
@@ -163,5 +161,5 @@
 ALIGN JUMP_ALIGN
 RamVars_GetIdeControllerCountToCX:
-	eMOVZX	cx, BYTE [cs:ROMVARS.bIdeCnt]
+	eMOVZX	cx, [cs:ROMVARS.bIdeCnt]
 	ret
 
@@ -177,9 +175,9 @@
 ;	Corrupts registers:
 ;		Nothing
-;--------------------------------------------------------------------		
+;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
 RamVars_UnpackFlopCntAndFirstToAL:
 	mov		al, [RAMVARS.xlateVars+XLATEVARS.bFlopCntAndFirst]
-	sar		al, 1		
+	sar		al, 1
 	ret
 %endif
Index: /trunk/XTIDE_Universal_BIOS/makefile
===================================================================
--- /trunk/XTIDE_Universal_BIOS/makefile	(revision 293)
+++ /trunk/XTIDE_Universal_BIOS/makefile	(revision 294)
@@ -71,5 +71,5 @@
 DEFINES_XT = ELIMINATE_CGA_SNOW MODULE_SERIAL MODULE_SERIAL_FLOPPY
 DEFINES_XTPLUS = ELIMINATE_CGA_SNOW USE_186 MODULE_SERIAL MODULE_SERIAL_FLOPPY
-DEFINES_AT = USE_186 USE_286 USE_AT MODULE_SERIAL MODULE_SERIAL_FLOPPY
+DEFINES_AT = USE_286 USE_AT MODULE_SERIAL MODULE_SERIAL_FLOPPY
 DEFINES_XT_LARGE = $(DEFINES_XT) MODULE_JRIDE
 DEFINES_XTPLUS_LARGE = $(DEFINES_XTPLUS) MODULE_JRIDE
@@ -87,5 +87,5 @@
 
 # Add -D in front of every preprocessor define declaration
-DEFS = $(DEFINES:%=-D%) 
+DEFS = $(DEFINES:%=-D%)
 DEFS_XT = $(DEFINES_XT:%=-D%) -DROMSIZE=$(ROMSIZE)
 DEFS_XTPLUS = $(DEFINES_XTPLUS:%=-D%) -DROMSIZE=$(ROMSIZE)
@@ -132,13 +132,12 @@
 ############################################
 
-# Make clean debug and release versions
 all: clean small large
 	@echo All done!
 
 small: at xtplus xt jride_8k
-	@echo All  8 kiB binaries built!
+	@echo All 8 kiB binaries built!
 
 large: at_large xtplus_large xt_large
-	@echo All 15 kiB binaries build!
+	@echo All 15 kiB binaries built!
 
 at:
@@ -152,9 +151,9 @@
 xtplus:
 	@$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XTPLUS) -l"$(TARGET)_xtp.lst" -o"$(TARGET)_xtp.bin"
-	@echo * 8k XT plus version "$(TARGET)_xtp.bin" built.
+	@echo * 8k XT Plus version "$(TARGET)_xtp.bin" built.
 
 xtplus_large:
 	@$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XTPLUS_LARGE) -l"$(TARGET)_xtpl.lst" -o"$(TARGET)_xtpl.bin"
-	@echo *15k XT plus version "$(TARGET)_xtpl.bin" built.
+	@echo *15k XT Plus version "$(TARGET)_xtpl.bin" built.
 
 xt:
@@ -176,5 +175,5 @@
 	@echo Deleted "(*.*)" from "$(BUILD_DIR)/"
 
-checksum:  all
+checksum: all
 	@perl ..\tools\checksum.pl $(TARGET)_atl.bin $(ROMSIZE_LARGE)
 	@perl ..\tools\checksum.pl $(TARGET)_xtpl.bin $(ROMSIZE_LARGE)
