Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm	(revision 235)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm	(revision 242)
@@ -29,18 +29,18 @@
 
 	mov		cx, g_szDetectSlave
-	mov		bh, MASK_DRVNHEAD_SET | FLG_DRVNHEAD_DRV  
+	mov		bh, MASK_DRVNHEAD_SET | FLG_DRVNHEAD_DRV
 	call	StartDetectionWithDriveSelectByteInBHandStringInAX
-		
+
 	pop		cx
 
 	add		bp, BYTE IDEVARS_size			; Point to next IDEVARS
 
-%ifdef MODULE_SERIAL		
+%ifdef MODULE_SERIAL
 	jcxz	.done							; Set to zero on .ideVarsSerialAuto iteration (if any)
 %endif
-		
+
 	loop	.DriveDetectLoop
 
-%ifdef MODULE_SERIAL		
+%ifdef MODULE_SERIAL
 ;
 ; if serial drive detected, do not scan (avoids duplicate drives and isn't needed - we already have a connection)
@@ -49,10 +49,10 @@
 	jc		.done
 
-	mov		bp, ROMVARS.ideVarsSerialAuto	; Point to our special IDEVARS sructure, just for serial scans		
-				
+	mov		bp, ROMVARS.ideVarsSerialAuto	; Point to our special IDEVARS structure, just for serial scans
+
 	mov		al,[cs:ROMVARS.wFlags]			; Configurator set to always scan?
 	or		al,[es:BDA.bKBFlgs1]			; Or, did the user hold down the ALT key?
 	and		al,8							; 8 = alt key depressed, same as FLG_ROMVARS_SERIAL_ALWAYSDETECT
-	jnz		.DriveDetectLoop							
+	jnz		.DriveDetectLoop
 %endif
 
@@ -61,8 +61,8 @@
 
 %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."
+	%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."
 %endif
 
-		
+
 ;--------------------------------------------------------------------
 ; StartDetectionWithDriveSelectByteInBHandStringInAX
@@ -110,5 +110,5 @@
 	;call	ReadAtapiInfoFromDrive		; Assume CD-ROM
 	;jnc	SHORT _CreateBiosTablesForCDROM
-	
+
 	;jmp	short DetectDrives_DriveNotFound
 ;;; fall-through instead of previous jmp instruction
@@ -122,7 +122,7 @@
 ;		AX, SI
 ;--------------------------------------------------------------------
-DetectDrives_DriveNotFound:		
+DetectDrives_DriveNotFound:
 	mov		si, g_szNotFound
-	jmp		BootMenuPrint_NullTerminatedStringFromCSSIandSetCF		
+	jmp		BootMenuPrint_NullTerminatedStringFromCSSIandSetCF
 
 
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm	(revision 235)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm	(revision 242)
@@ -22,6 +22,6 @@
 	ePUSH_T	ax, ROMVARS.szTitle			; Bios title string
 	push	cs							; BIOS segment
-		
-DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay:		
+
+DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay:
 	jmp		BootMenuPrint_FormatCSSIfromParamsInSSBP
 
@@ -32,5 +32,5 @@
 ;		CS:CX:	Ptr to "Master" or "Slave" string
 ;		CS:BP:	Ptr to IDEVARS
-;       SI:		Ptr to template string 
+;       SI:		Ptr to template string
 ;	Returns:
 ;		Nothing
@@ -44,9 +44,9 @@
 											;			  DL=COM number character, DH=.bDevice
 
-	push	bp								; setup stack for call to 
+	push	bp								; setup stack for call to
 	mov		bp, sp							; BootMenuPrint_FormatCSSIfromParamsInSSBP
 
 	push 	cx								; Push "Master" or "Slave"
-		
+
 	mov		cl, (g_szDetectPort-$$) & 0xff	; Setup print string for standard IDE
 											; Note that we modify only the low order bits of CX a lot here,
@@ -55,11 +55,11 @@
 											; on the same 256 byte page, which is checked in strings.asm.
 
-	cmp		dx, DEVICE_SERIAL_PORT << 8  	; Check if this is a serial device, 
+	cmp		dx, DEVICE_SERIAL_PORT << 8  	; Check if this is a serial device,
 										 	; And also check if DL is zero, check with the jz below
-											; This optimization requires that DEVICE_SERIAL_PORT be 
+											; This optimization requires that DEVICE_SERIAL_PORT be
 											; the highest value in the DEVICE_* series, ensuring that
 											; anything less in the high order bits is a different device.
 
-	jl		.pushAndPrint					; CX = string to print, AX = port address, DX won't be used
+	jb		.pushAndPrint					; CX = string to print, AX = port address, DX won't be used
 
 	mov		cl, (g_szDetectCOM-$$) & 0xff	; Setup print string for COM ports
@@ -68,13 +68,13 @@
 
 	push	dx								; Push COM number character
-											; If the strnig is going to be "Auto", we will push a NULL (zero)
-											; here for the COM port number, which will be eaten by the 
-											; print routine (DisplayPrint_CharacterFromAL), resulting in 
+											; If the string is going to be "Auto", we will push a NULL (zero)
+											; here for the COM port number, which will be eaten by the
+											; print routine (DisplayPrint_CharacterFromAL), resulting in
 											; just "COM" being printed without a character after it.
-				
+
  	mov		cl, (g_szDetectCOMAuto-$$) & 0xff	; Setup secondary print string for "Auto"
-		
+
 	jz		.pushAndPrint					; CX = string to print, AX and DX won't be used
-		
+
 	mov		cl, (g_szDetectCOMLarge-$$) & 0xff	; Setup secondary print string for "COMn/xx.yK"
 
@@ -82,18 +82,18 @@
 	cbw										; clear AH, AL will always be less than 128
 	xchg	si,ax							; move AX to SI for divide
-	mov		ax,1152							; baud rate to displa is 115200/divisor, the "00" is handled
+	mov		ax,1152							; baud rate to display is 115200/divisor, the "00" is handled
 											; in the print strings
-	xor		dx,dx							; clear top 16-bits of dividend
+	cwd										; clear top 16-bits of dividend
 	div		si								; and divide...  Now AX = baud rate/100, DX = 0 (always a clean divide)
-		
+
 	mov		si,10							; Now separate the whole portion from the fractional for "K" display
 	div		si								; and divide...  Now AX = baud rate/1000, DX = low order digit
-		
-	cmp		ax,si							; <= 10: "2400", "9600", etc.; >10: "19.2K", "38.4K", etc.
+
+	cmp		ax,si							; < 10: "2400", "9600", etc.; >= 10: "19.2K", "38.4K", etc.
 	jae		.pushAndPrint
 
 	mov		cl, (g_szDetectCOMSmall-$$) & 0xff	; Setup secondary print string for "COMn/XXy00"
-		
-.pushAndPrint:	
+
+.pushAndPrint:
 	push	cx								; Push print string
 	push	ax								; Push high order digits, or port address, or N/A
@@ -102,5 +102,5 @@
 	mov		si, g_szDetectOuter				; Finally load SI with wrapper string "IDE %s at %s: "
 
-	jmp		short DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay	
+	jmp		short DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay
 
 
@@ -127,5 +127,2 @@
 	ret
 
-
-
-
