Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm	(revision 285)
+++ 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 285)
+++ 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 285)
+++ 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 285)
+++ 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 285)
+++ 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
