Index: trunk/Assembly_Library/Inc/Emulate.inc
===================================================================
--- trunk/Assembly_Library/Inc/Emulate.inc	(revision 222)
+++ trunk/Assembly_Library/Inc/Emulate.inc	(revision 223)
@@ -370,34 +370,4 @@
 
 ;--------------------------------------------------------------------
-; Segment override prefix instruction.
-;
-; eSEG
-;	Parameters:
-;		%1:		Name of the segment (ES, CS, SS, DS, FS or GS)
-;	Returns:
-;		Nothing
-;	Corrupts registers:
-;		Nothing
-;--------------------------------------------------------------------
-%macro eSEG 1
-	%ifidni %1, es
-		db	00100110b
-	%elifidni %1, cs
-		db	00101110b
-	%elifidni %1, ss
-		db	00110110b
-	%elifidni %1, ds
-		db	00111110b
-	%elifidni %1, fs
-		db	01100100b
-	%elifidni %1, gs
-		db	01100101b
-	%else
-		%error "Invalid segment override passed to eSEG!"
-	%endif
-%endmacro
-
-
-;--------------------------------------------------------------------
 ; Repeats string instruction with segment override.
 ; This macro prevents 8088/8086 restart bug.
@@ -416,14 +386,14 @@
 %macro eSEG_STR 3
 %ifndef USE_186	; 8088/8086 has string instruction restart bug when more than one prefix
-	 %%Loop:
-	 	%1						; REP is the prefix that can be lost
-	 	eSEG	%2				; SEG is the prefix that won't be lost
-	 	%3						; String instruction
-	 	jcxz	%%End			; Jump to end if no repeats left (preserves FLAGS)
-	 	jmp		SHORT %%Loop	; Loop while repeats left
-	 %%End:
+	%%Loop:
+		%1						; REP is the prefix that can be lost
+		%2						; SEG is the prefix that won't be lost
+		%3						; String instruction
+		jcxz	%%End			; Jump to end if no repeats left (preserves FLAGS)
+		jmp		SHORT %%Loop	; Loop while repeats left
+	%%End:
 %else	; No bug on V20/V30 and later, don't know about 188/186
-	eSEG	%2
-	%1		%3
+	%2
+	%1 %3
 %endif
 %endmacro
Index: trunk/Assembly_Library/Src/Display/CgaSnow.asm
===================================================================
--- trunk/Assembly_Library/Src/Display/CgaSnow.asm	(revision 222)
+++ trunk/Assembly_Library/Src/Display/CgaSnow.asm	(revision 223)
@@ -99,6 +99,5 @@
 	cli				; Interrupt request would mess up timing
 	WAIT_UNTIL_SAFE_CGA_WRITE
-	eSEG	es
-	movsb
+	es movsb
 	sti
 	loop	.MovsbNextByte
Index: trunk/Assembly_Library/Src/Display/DisplayFormat.asm
===================================================================
--- trunk/Assembly_Library/Src/Display/DisplayFormat.asm	(revision 222)
+++ trunk/Assembly_Library/Src/Display/DisplayFormat.asm	(revision 223)
@@ -92,6 +92,5 @@
 ALIGN JUMP_ALIGN
 ReadCharacterAndTestForNull:
-	eSEG	cs
-	lodsb									; Load from CS:SI to AL
+	cs lodsb								; Load from CS:SI to AL
 	test	al, al							; NULL to end string?
 	ret
@@ -321,5 +320,5 @@
 %endif
 
-ALIGN JUMP_ALIGN		
+ALIGN JUMP_ALIGN
 u_FormatUnsignedDecimalWord:
 	mov		ax, [bp]
@@ -339,8 +338,8 @@
 	mov		ax, [bp]
 	test	ax,ax
-	jnz		u_FormatUnsignedDecimalWord		
+	jnz		u_FormatUnsignedDecimalWord
 	mov		[bp], word g_szDashForZero
 ;;; fall-through
-		
+
 ALIGN JUMP_ALIGN
 s_FormatStringFromSegmentCS:
Index: trunk/Assembly_Library/Src/Display/DisplayFormatCompressed.asm
===================================================================
--- trunk/Assembly_Library/Src/Display/DisplayFormatCompressed.asm	(revision 222)
+++ trunk/Assembly_Library/Src/Display/DisplayFormatCompressed.asm	(revision 223)
@@ -157,6 +157,5 @@
 
 .decode:
-	eSEG	cs
-	lodsb						; load next byte of the string
+	cs lodsb					; load next byte of the string
 
 	mov		ch,al				; save a copy for later processing of high order bits
Index: trunk/Assembly_Library/Src/Display/DisplayPrint.asm
===================================================================
--- trunk/Assembly_Library/Src/Display/DisplayPrint.asm	(revision 222)
+++ trunk/Assembly_Library/Src/Display/DisplayPrint.asm	(revision 223)
@@ -5,5 +5,5 @@
 SECTION .text
 
-				
+
 ;--------------------------------------------------------------------
 ; Supports following formatting types:
@@ -104,7 +104,7 @@
 ;		AX, DX
 ;--------------------------------------------------------------------
-		
+
 %ifndef MODULE_STRINGS_COMPRESSED
-		
+
 ALIGN JUMP_ALIGN
 DisplayPrint_WordFromAXWithBaseInBX:
@@ -126,6 +126,5 @@
 .PrintNextDigit:
 	pop		ax					; Pop digit
-	eSEG	cs
-	xlatb
+	cs xlatb
 	call	DisplayPrint_CharacterFromAL
 	loop	.PrintNextDigit
@@ -152,5 +151,4 @@
 ;--------------------------------------------------------------------
 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
-		
 ALIGN JUMP_ALIGN
 DisplayPrint_CharacterBufferFromBXSIwithLengthInCX:
@@ -167,5 +165,4 @@
 	loop	.PrintNextCharacter
 
-	;mov		ds, cx	; Restore DS to BDA. Not needed unless DisplayPrint_CharacterFromAL changes DS.
 	pop		cx
 	pop		si
@@ -173,6 +170,4 @@
 	ret
 %endif
-
-
 
 
@@ -278,6 +273,6 @@
 	pop		cx
 .NothingToRepeat:
-
-	ret
+	ret
+
 
 ;--------------------------------------------------------------------
@@ -292,10 +287,9 @@
 ;		AX, DX
 ;--------------------------------------------------------------------
-
 %ifndef MODULE_STRINGS_COMPRESSED
 ;;;
 ;;; Take care when using this routine with compressed strings (which is why it is disabled).
 ;;; All strings in CSSI should go through the DisplayFormatCompressed code to be decoded.
-;;; 
+;;;
 ALIGN JUMP_ALIGN
 DisplayPrint_NullTerminatedStringFromCSSI:
@@ -304,9 +298,6 @@
 	call	DisplayPrint_NullTerminatedStringFromBXSI
 	pop		bx
-
-	ret
-%endif
-
-		
+	ret
+%endif
 
 
@@ -314,5 +305,5 @@
 ;;; Note that the following routines need to be at the bottom of this file
 ;;; to accomodate short jumps from the next file (DisplayFormat/DisplayFormatCompressed)
-;;; 
+;;;
 
 ;--------------------------------------------------------------------
@@ -329,5 +320,5 @@
 ALIGN JUMP_ALIGN
 DisplayPrint_Newline_FormatAdjustBP:
-	inc		bp					; we didn't need a parameter after all, readjust BP 
+	inc		bp					; we didn't need a parameter after all, readjust BP
 	inc		bp
 	; fall through to DisplayPrint_Newline
@@ -335,5 +326,4 @@
 
 ALIGN JUMP_ALIGN
-		
 DisplayPrint_Newline:
 	mov		al, LF
@@ -364,5 +354,4 @@
 
 
-		
 ;--------------------------------------------------------------------
 ; DisplayPrint_NullTerminatedStringFromBXSI
@@ -396,7 +385,6 @@
 	pop		cx
 	pop		si
-		
-DisplayPrint_Ret:				; random ret to jump to 				
-	ret
-
-
+
+DisplayPrint_Ret:				; random ret to jump to
+	ret
+
Index: trunk/Assembly_Library/Src/Menu/MenuAttributes.asm
===================================================================
--- trunk/Assembly_Library/Src/Menu/MenuAttributes.asm	(revision 222)
+++ trunk/Assembly_Library/Src/Menu/MenuAttributes.asm	(revision 223)
@@ -68,6 +68,5 @@
 	add		si, .rgcColorAttributes
 .LoadAttributeAndReturn:
-	eSEG	cs
-	lodsb								; Load from [CS:SI] to AL
+	cs lodsb							; Load from [CS:SI] to AL
 
 	pop		ds
Index: trunk/Assembly_Library/Src/Menu/MenuBorders.asm
===================================================================
--- trunk/Assembly_Library/Src/Menu/MenuBorders.asm	(revision 222)
+++ trunk/Assembly_Library/Src/Menu/MenuBorders.asm	(revision 223)
@@ -22,6 +22,7 @@
 ;		AX, BX, CX, DX, SI, DI
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN	
+ALIGN JUMP_ALIGN
 MenuBorders_RefreshAll:
+%ifndef USE_186
 	call	MenuBorders_AdjustDisplayContextForDrawingBorders
 	call	MenuBorders_GetNumberOfMiddleCharactersToDX
@@ -31,4 +32,13 @@
 	call	DrawBottomBorderLine
 	jmp		DrawBottomShadowLine
+%else
+	push	DrawBottomShadowLine
+	push	DrawBottomBorderLine
+	push	RefreshInformationBorders
+	push	RefreshItemBorders
+	push	RefreshTitleBorders
+	push	MenuBorders_GetNumberOfMiddleCharactersToDX
+	jmp		MenuBorders_AdjustDisplayContextForDrawingBorders
+%endif
 
 
@@ -71,5 +81,5 @@
 %endif
 
-		
+
 ;--------------------------------------------------------------------
 ; MenuBorders_AdjustDisplayContextForDrawingBorders
@@ -315,14 +325,11 @@
 ALIGN JUMP_ALIGN
 PrintBorderCharactersFromCSSI:
-	eSEG	cs
-	lodsb			; Load from [cs:si+BORDER_CHARS.cLeft] to AL
+	cs lodsb		; Load from [cs:si+BORDER_CHARS.cLeft] to AL
 	call	MenuBorders_PrintSingleBorderCharacterFromAL
 
-	eSEG	cs
-	lodsb			; Load from [cs:si+BORDER_CHARS.cMiddle] to AL
+	cs lodsb		; Load from [cs:si+BORDER_CHARS.cMiddle] to AL
 	call	MenuBorders_PrintMultipleBorderCharactersFromAL
 
-	eSEG	cs
-	lodsb			; Load from [cs:si+BORDER_CHARS.cRight] to AL
+	cs lodsb		; Load from [cs:si+BORDER_CHARS.cRight] to AL
 	; Fall to MenuBorders_PrintSingleBorderCharacterFromAL
 
Index: trunk/Configurator/Inc/emulate.inc
===================================================================
--- trunk/Configurator/Inc/emulate.inc	(revision 222)
+++ trunk/Configurator/Inc/emulate.inc	(revision 223)
@@ -305,34 +305,4 @@
 
 ;--------------------------------------------------------------------
-; Segment override prefix instruction.
-;
-; eSEG
-;	Parameters:
-;		%1:		Name of the segment (ES, CS, SS, DS, FS or GS)
-;	Returns:
-;		Nothing
-;	Corrupts registers:
-;		Nothing
-;--------------------------------------------------------------------
-%macro eSEG 1
-	%ifidni %1, es
-		db	00100110b
-	%elifidni %1, cs
-		db	00101110b
-	%elifidni %1, ss
-		db	00110110b
-	%elifidni %1, ds
-		db	00111110b
-	%elifidni %1, fs
-		db	01100100b
-	%elifidni %1, gs
-		db	01100101b
-	%else
-		%error "Invalid segment override passed to eSEG!"
-	%endif
-%endmacro
-
-
-;--------------------------------------------------------------------
 ; Repeats string instruction with segment override.
 ; This macro prevents 8088/8086 restart bug.
@@ -351,14 +321,14 @@
 %macro eSEG_STR 3
 %ifndef USE_186	; 8088/8086 has string instruction restart bug when more than one prefix
-	 %%Loop:
-	 	%1						; REP is the prefix that can be lost
-	 	eSEG	%2				; SEG is the prefix that won't be lost
-	 	%3						; String instruction
-	 	jcxz	%%End			; Jump to end if no repeats left (preserves FLAGS)
-	 	jmp		SHORT %%Loop	; Loop while repeats left
-	 %%End:
+	%%Loop:
+		%1						; REP is the prefix that can be lost
+		%2						; SEG is the prefix that won't be lost
+		%3						; String instruction
+		jcxz	%%End			; Jump to end if no repeats left (preserves FLAGS)
+		jmp		SHORT %%Loop	; Loop while repeats left
+	%%End:
 %else	; No bug on V20/V30 and later, don't know about 188/186
-	eSEG	%2
-	%1		%3
+	%2
+	%1 %3
 %endif
 %endmacro
Index: trunk/Serial_Server/library/Library.h
===================================================================
--- trunk/Serial_Server/library/Library.h	(revision 222)
+++ trunk/Serial_Server/library/Library.h	(revision 223)
@@ -22,5 +22,5 @@
 
 	virtual void writeSector( void *buff ) = 0;
-	
+
 	virtual void readSector( void *buff ) = 0;
 
@@ -35,5 +35,5 @@
 
 	unsigned long totallba;
-	
+
 	char *shortFileName;
 	int readOnly;
@@ -58,5 +58,5 @@
 #include "../win32/win32serial.h"
 #else
-// there is no standard way to read/write and configure the serial port, OS specifc only
+// there is no standard way to read/write and configure the serial port, OS specific only
 #endif
 
Index: trunk/Serial_Server/makefile
===================================================================
--- trunk/Serial_Server/makefile	(revision 222)
+++ trunk/Serial_Server/makefile	(revision 223)
@@ -7,4 +7,6 @@
 # Use with GNU Make and Microsoft Visual C++ 2010
 #
+# Also works with Open Watcom C/C++ Version 1.9
+#
 
 CL = cl
@@ -14,18 +16,22 @@
 
 build/serdrive.exe:	$(WIN32OBJS)
-	$(CL) /Febuild/serdrive.exe $(WIN32OBJS)
+	@$(CL) /Febuild/serdrive.exe $(WIN32OBJS)
 
 build/%.obj:	win32/%.cpp
-	$(CL) /c $(CLFLAGS) $< /Fo$@
+	@$(CL) /c $(CLFLAGS) $< /Fo$@
 
 build/%.obj:	library/%.cpp
-	$(CL) /c $(CLFLAGS) $< /Fo$@
+	@$(CL) /c $(CLFLAGS) $< /Fo$@
 
 $(WIN32OBJS):	library/library.h win32/win32file.h win32/win32serial.h library/file.h library/flatimage.h
 
 build/checksum_test.exe:	library/checksum.cpp
-	$(CL) /Febuild/checksum_test.exe /Ox library/checksum.cpp /Fobuild/checksum_test.obj -D CHECKSUM_TEST
+	@$(CL) /Febuild/checksum_test.exe /Ox library/checksum.cpp /Fobuild/checksum_test.obj -D CHECKSUM_TEST
 
-clean:	
-	del /q build\*.*
+release:	build/serdrive.exe
+	@echo Compressing with UPX...
+	@upx -qq --ultra-brute build/serdrive.exe
+	@echo Done!
 
+clean:
+	@del /q build\*.*
Index: trunk/XTIDE_Universal_BIOS/Inc/EBIOS.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/EBIOS.inc	(revision 222)
+++ trunk/XTIDE_Universal_BIOS/Inc/EBIOS.inc	(revision 223)
@@ -41,5 +41,5 @@
 	.bSize					resb	1	; 0, Size of this packet in bytes
 	.bReservedAt1			resb	1	; 1, Currently unused, must be zero
-	.wSectorCount			resb	1	; 2, Number of sectors to process (0...127)
+	.wSectorCount			resb	2	; 2, Number of sectors to process (0...127)
 	.dwMemoryAddress:
 	.wOffset				resb	2	; 4, Memory offset for transfer
Index: trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm	(revision 222)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm	(revision 223)
@@ -8,5 +8,5 @@
 	.wWordsLeft				resb	2	; 2, WORDs left to transfer
 	.wWordsDone				resb	2	; 4, Number of sectors xferred
-							resb	1	; 6, 
+							resb	1	; 6,
 							resb	1	; 7, IDEPACK.bDeviceControl
 	.wDataPort				resb	2	; 8, IDE Data Port
@@ -327,5 +327,5 @@
 %ifdef USE_186	; OUTS instruction available
 	shl		cx, 1		; WORD count to BYTE count
-	eSEG	es			; Source is ES segment
+	es					; Source is ES segment
 	rep outsb
 %else			; If 8088/8086
@@ -369,5 +369,5 @@
 ALIGN JUMP_ALIGN
 WordWrite:
-	eSEG	es			; Source is ES segment
+	es					; Source is ES segment
 	rep
 	db		6Fh			; OUTSW (we want this in XT build)
@@ -377,5 +377,5 @@
 DWordWrite:
 	shr		cx, 1		; WORD count to DWORD count
-	eSEG	es			; Source is ES segment
+	es					; Source is ES segment
 	rep
 	db		66h			; Override operand size to 32-bit
Index: trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialCommand.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialCommand.asm	(revision 222)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialCommand.asm	(revision 223)
@@ -151,5 +151,5 @@
 ;
 		mov		bl,dl			; setup BL with proper values for read/write loops (BH comes later)
-		
+
 		mov		al,83h
 		add		dl,SerialCommand_UART_lineControl
@@ -202,5 +202,5 @@
 		mov		cx,4			; writing 3 words (plus 1)
 
-		cli						; interrupts off... 
+		cli						; interrupts off...
 
 		call	SerialCommand_WriteProtocol.entry
@@ -215,8 +215,8 @@
 ;;; more than 128 sectors (and for 128 specifically, the pointer must be segment aligned).
 ;;; See comments below at the point this entry point was called for more details...
-.nextSectorNormalize:			
+.nextSectorNormalize:
 		call	Registers_NormalizeESDI
 %endif
-		
+
 		pop		ax				; load command byte (done before call to .nextSector on subsequent iterations)
 		push	ax
@@ -249,5 +249,5 @@
 .readTimeout:
 		push	ax				; not only does this push preserve AX (which we need), but it also
-								; means the stack has the same number of bytes on it as when we are 
+								; means the stack has the same number of bytes on it as when we are
 								; sending a packet, important for error cleanup and exit
 		mov		ah,1
@@ -256,5 +256,5 @@
 		test	dl,1
 		jz		.readByte1Ready
-		jmp		.readByte2Ready		
+		jmp		.readByte2Ready
 
 ;----------------------------------------------------------------------------
@@ -275,5 +275,5 @@
 		adc		si, 0
 
-.readEntry:		
+.readEntry:
 		mov		dl,bh
 		in		al,dx
@@ -325,5 +325,5 @@
 
 		pop		ax				; sector count and command byte
-		dec		al				; decrememnt sector count
+		dec		al				; decrement sector count
 		push	ax				; save
 		jz		SerialCommand_OutputWithParameters_ReturnCodeInALCF    ; CF=0 from "cmp ax,bp" returning Zero above
@@ -336,9 +336,9 @@
 ;;; This code is no longer needed as we do not support more than 128 sectors, and for 128 the pointer
 ;;; must be segment aligned.  If we ever do want to support more sectors, the code can help...
-		
+
 ;
 ; Normalize buffer pointer for next go round, if needed.
 ;
-; We need to re-nomrlize the pointer in ES:DI after processing every 7f sectors.  That number could 
+; We need to re-normalize the pointer in ES:DI after processing every 7f sectors.  That number could
 ; have been 80 if we knew the offset was on a segment boundary, but this may not be the case.
 ;
@@ -347,6 +347,6 @@
 ;    b) on transitions from FF to FE, very rare case for writing 255 or 256 sectors
 ;    c) on transitions from 80 to 7F, a large read/write
-;    d) on transitions from 00 to FF, very, very rare case of writing 256 secotrs
-;       We don't need to renormalize in this case, but it isn't worth the memory/effort to not do 
+;    d) on transitions from 00 to FF, very, very rare case of writing 256 sectors
+;       We don't need to renormalize in this case, but it isn't worth the memory/effort to not do
 ;       the extra work, and it does no harm.
 ;
@@ -354,5 +354,5 @@
 ; for more than 127 sectors.  Back in the day, it appears that some BIOS could not support more than 127
 ; sectors, so that may be the practical limit for OS and application developers.  The Extended BIOS
-; function also appear to be capped at 127 sectors.  So although this can support the full 256 sectors 
+; function also appear to be capped at 127 sectors.  So although this can support the full 256 sectors
 ; if needed, we are optimized for that 1-127 range.
 ;
@@ -373,5 +373,5 @@
 										; (0-7e kicked out before we get here)
 										; 7f moves to 81 and OF=1, so OF=SF
-										; fe moves to 0 and OF=0, SF=0, so OF=SF 
+										; fe moves to 0 and OF=0, SF=0, so OF=SF
 										; ff moves to 1 and OF=0, SF=0, so OF=SF
 										; 80-fd moves to 82-ff and OF=0, so OF<>SF
@@ -387,7 +387,7 @@
 
 %else
-		
-		jmp		short .nextSector		
-		
+
+		jmp		short .nextSector
+
 %endif
 
@@ -425,5 +425,5 @@
 		jc		.clearBuffer	; note CF from shr above
 
-.clearBufferComplete:			
+.clearBufferComplete:
 		stc
 		mov		al,1
@@ -448,7 +448,7 @@
 ; SerialCommand_WriteProtocol
 ;
-; NOTE: As with its read counterpart, this loop is very time sensitive.  
-; Although it will still function, adding additional instructions will 
-; impact the write througput, especially on slower machines.  
+; NOTE: As with its read counterpart, this loop is very time sensitive.
+; Although it will still function, adding additional instructions will
+; impact the write throughput, especially on slower machines.
 ;
 ;	Parameters:
@@ -514,8 +514,12 @@
 		mov		ah,dl
 		jmp		.writeByte2Ready
-		
+
 .writeTimeout1:
+%ifndef USE_186
 		mov		ax,.writeByte1Ready
 		push	ax				; return address for ret at end of SC_writeTimeout2
+%else
+		push	.writeByte1Ready
+%endif
 ;;; fall-through
 
@@ -527,5 +531,5 @@
 ;               One entry point fills in AH with 20h for write
 ;		DX:		Port address (OK if already incremented to UART_lineStatus)
-;       BX:    
+;       BX:
 ;       Stack:	2 words on the stack below the command/count word
 ;	Returns:
@@ -553,5 +557,5 @@
 		xor		cx,cx
 .readTimeoutLoop:
-		mov		dl,bh				
+		mov		dl,bh
 		in		al,dx
 		test	al,ah
@@ -588,5 +592,5 @@
 ;	Returns:
 ;		AH:		INT 13h Error Code
-;               NOTE: Not set (or checked) during drive detection 
+;               NOTE: Not set (or checked) during drive detection
 ;		CF:		Cleared if success, Set if error
 ;	Corrupts registers:
@@ -596,9 +600,9 @@
 SerialCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH:
 ;
-; To improve boot time, we do our best to avoid looking for slave serial drives when we already know the results 
-; from the looking for a master.  This is particuarly true when doing a COM port scan, as we will end up running
-; through all the COM ports and baud rates a second time.  
-;
-; But drive detection isn't the only case - we also need to get the right drive when called on int13h/25h.  
+; To improve boot time, we do our best to avoid looking for slave serial drives when we already know the results
+; from the looking for a master.  This is particularly true when doing a COM port scan, as we will end up running
+; through all the COM ports and baud rates a second time.
+;
+; But drive detection isn't the only case - we also need to get the right drive when called on int13h/25h.
 ;
 ; The decision tree:
@@ -606,48 +610,48 @@
 ;    Master:
 ;		   bSerialPackedPortAndBaud Non-Zero:   -> Continue with bSerialPackedAndBaud (1)
-;		   bSerialPackedPortAndBaud Zero: 
+;		   bSerialPackedPortAndBaud Zero:
 ;		   			      bLastSerial Zero:     -> Scan (2)
 ;					      bLastSerial Non-Zero: -> Continue with bLastSerial (3)
-;			  				        
+;
 ;    Slave:
-;		   bSerialPackedPortAndBaud Non-Zero: 
+;		   bSerialPackedPortAndBaud Non-Zero:
 ;		   			      bLastSerial Zero:     -> Error - Not Found (4)
 ;					      bLastSerial Non-Zero: -> Continue with bSerialPackedAndBaud (5)
-;          bSerialPackedPortAndBaud Zero:     
+;          bSerialPackedPortAndBaud Zero:
 ;		   			      bLastSerial Zero:     -> Error - Not Found (4)
 ;					      bLastSerial Non-Zero: -> Continue with bLastSerial (6)
 ;
-; (1) This was a port/baud that was explicilty set with the configurator.  In the drive detection case, as this 
-;     is the Master, we are checking out a new controller, and so don't care about the value of bLastSerial.  
+; (1) This was a port/baud that was explicitly set with the configurator.  In the drive detection case, as this
+;     is the Master, we are checking out a new controller, and so don't care about the value of bLastSerial.
 ;     And as with the int13h/25h case, we just go off and get the needed information using the user's setting.
-; (2) We are using the special .ideVarsSerialAuto strucutre.  During drive detection, we would only be here
+; (2) We are using the special .ideVarsSerialAuto structure.  During drive detection, we would only be here
 ;     if bLastSerial is zero (since we only scan if no explicit drives are set), so we go off to scan.
-; (3) We are using the special .ideVarsSerialAuto strucutre.  We won't get here during drive detection, but
+; (3) We are using the special .ideVarsSerialAuto structure.  We won't get here during drive detection, but
 ;     we might get here on an int13h/25h call.  If we have scanned COM drives, they are the ONLY serial drives
 ;     in use, and so bLastSerial will reflect the port/baud setting for the scanned COM drives.
-; (4) No master has been found yet, therefore no slave should be found.  Avoiding the slave reduces boot time, 
+; (4) No master has been found yet, therefore no slave should be found.  Avoiding the slave reduces boot time,
 ;     especially in the full COM port scan case.  Note that this is different from the hardware IDE, where we
 ;     will scan for a slave even if a master is not present.  Note that if ANY master had been previously found,
-;     we will do the slave scan, which isn't harmful, it just wates time.  But the most common case (by a wide
+;     we will do the slave scan, which isn't harmful, it just wastes time.  But the most common case (by a wide
 ;     margin) will be just one serial controller.
 ; (5) A COM port scan for a master had been previously completed, and a drive was found.  In a multiple serial
-;     controller scenario being called with int13h/25h, we need to use the value in bSerialPackedPortAndBaud 
+;     controller scenario being called with int13h/25h, we need to use the value in bSerialPackedPortAndBaud
 ;     to make sure we get the proper drive.
-; (6) A COM port scan for a master had been previously completed, and a drive was found.  We would only get here 
-;     if no serial drive was explicitly set by the user in the configurator or that drive had not been found.  
-;     Instead of performing the full COM port scan for the slave, use the port/baud value stored during the 
+; (6) A COM port scan for a master had been previously completed, and a drive was found.  We would only get here
+;     if no serial drive was explicitly set by the user in the configurator or that drive had not been found.
+;     Instead of performing the full COM port scan for the slave, use the port/baud value stored during the
 ;     master scan.
-;		
-		mov		dl,[cs:bp+IDEVARS.bSerialPackedPortAndBaud]		
+;
+		mov		dl,[cs:bp+IDEVARS.bSerialPackedPortAndBaud]
 		mov		al,	byte [RAMVARS.xlateVars+XLATEVARS.bLastSerial]
-				
+
 		test	bh, FLG_DRVNHEAD_DRV
 		jz		.master
 
-		test	al,al			; Take care of the case that is different between master and slave.  
+		test	al,al			; Take care of the case that is different between master and slave.
 		jz		.error			; Because we do this here, the jz after the "or" below will not be taken
 
 ; fall-through
-.master:		
+.master:
 		test	dl,dl
 		jnz		.identifyDeviceInDL
@@ -655,7 +659,7 @@
 		or		dl,al			; Move bLast into position in dl, as well as test for zero
 		jz		.scanSerial
-		
+
 ; fall-through
-.identifyDeviceInDL:	
+.identifyDeviceInDL:
 
 		push	bp				; setup fake IDEREGS_AND_INTPACK
@@ -680,15 +684,15 @@
 
 		pop		bp
-; 
+;
 ; place packed port/baud in RAMVARS, read by FinalizeDPT and DetectDrives
 ;
 ; Note that this will be set during an int13h/25h call as well.  Which is OK since it is only used (at the
-; top of this routine) for drives found during a COM scan, and we only COM scan if there were no other 
+; top of this routine) for drives found during a COM scan, and we only COM scan if there were no other
 ; COM drives found.  So we will only reaffirm the port/baud for the one COM port/baud that has a drive.
-; 
+;
 		jc		.notFound											; only store bLastSerial if success
 		mov		byte [RAMVARS.xlateVars+XLATEVARS.bLastSerial], dl
 
-.notFound:		
+.notFound:
 		ret
 
@@ -715,8 +719,7 @@
 .nextPort:
 		inc		di				; load next port address
+		xor		dh, dh
 		mov		dl,[cs:di]
-
-		mov		dh,0			; shift from one byte to two
-		eSHL_IM	dx, 2
+		eSHL_IM	dx, 2			; shift from one byte to two
 		jz		.error
 
@@ -762,5 +765,5 @@
 		ret
 
-.error:	
+.error:
 		stc
 %if 0
