Index: trunk/Assembly_Library/Inc/Delay.inc
===================================================================
--- trunk/Assembly_Library/Inc/Delay.inc	(revision 567)
+++ trunk/Assembly_Library/Inc/Delay.inc	(revision 568)
@@ -5,6 +5,6 @@
 
 ;--------------------------------------------------------------------
-; Clears prefetch queue by jumping to next instruction.
-; This delays much more than nop instruction of fast systems.
+; Clears prefetch queue by jumping to the next instruction.
+; This delays much more than the nop instruction on fast systems.
 ;
 ; JMP_DELAY
Index: trunk/Assembly_Library/Inc/Emulate.inc
===================================================================
--- trunk/Assembly_Library/Inc/Emulate.inc	(revision 567)
+++ trunk/Assembly_Library/Inc/Emulate.inc	(revision 568)
@@ -74,5 +74,6 @@
 ;--------------------------------------------------------------------
 %macro eSALC 0
-	db		0D6h
+;	db		0D6h
+	salc
 %endmacro
 
Index: trunk/Assembly_Library/Src/Menu/Dialog/DialogFile.asm
===================================================================
--- trunk/Assembly_Library/Src/Menu/Dialog/DialogFile.asm	(revision 567)
+++ trunk/Assembly_Library/Src/Menu/Dialog/DialogFile.asm	(revision 568)
@@ -623,15 +623,6 @@
 	mov		cx, STRING_DIALOG_IO_size
 	call	Memory_ReserveCXbytesFromStackToDSSI
-	call	.InitializeStringDialogIoInDSSIforInputtingFileName
-
-	CALL_MENU_LIBRARY GetStringWithIoInDSSI
-	mov		al, [si+STRING_DIALOG_IO.bUserCancellation]
-	add		sp, BYTE STRING_DIALOG_IO_size
-	test	al, al		; User cancellation?
-	jnz		SHORT ReturnWithoutHandlingKeystroke
-	jmp		CloseFileDialogAfterSuccessfulSelection
-
-ALIGN JUMP_ALIGN
-.InitializeStringDialogIoInDSSIforInputtingFileName:
+
+;;;	InitializeStringDialogIoInDSSIforInputtingFileName
 	call	InitializeNullStringsToDialogInputInDSSI
 	mov		WORD [si+DIALOG_INPUT.fszTitle], g_szEnterNewFileOrDirectory
@@ -642,5 +633,12 @@
 	mov		[si+STRING_DIALOG_IO.fpReturnBuffer], ax
 	mov		[si+STRING_DIALOG_IO.fpReturnBuffer+2], es
-	ret
+;;;
+
+	CALL_MENU_LIBRARY GetStringWithIoInDSSI
+	mov		al, [si+STRING_DIALOG_IO.bUserCancellation]
+	add		sp, BYTE STRING_DIALOG_IO_size
+	test	al, al		; User cancellation?
+	jnz		SHORT ReturnWithoutHandlingKeystroke
+	jmp		CloseFileDialogAfterSuccessfulSelection
 
 
Index: trunk/Assembly_Library/Src/Menu/Dialog/DialogString.asm
===================================================================
--- trunk/Assembly_Library/Src/Menu/Dialog/DialogString.asm	(revision 567)
+++ trunk/Assembly_Library/Src/Menu/Dialog/DialogString.asm	(revision 568)
@@ -99,6 +99,10 @@
 	mov		cx, [si+STRING_DIALOG_IO.wBufferSize]
 	les		di, [si+STRING_DIALOG_IO.fpReturnBuffer]
-	call	.GetCharacterFilterFunctionToDX
+	mov		dx, [si+STRING_DIALOG_IO.fnCharFilter]
+	test	dx, dx
+	jnz		SHORT .CharacterFilterFunctionInDX
+	mov		dx, Char_CharIsValid
 
+.CharacterFilterFunctionInDX:
 	call	Keyboard_ReadUserInputtedStringToESDIWhilePrinting
 	jz		SHORT .UserCancellation
@@ -108,22 +112,2 @@
 .UserCancellation:
 	ret
-
-;--------------------------------------------------------------------
-; .GetCharacterFilterFunctionToDX
-;	Parameters
-;		DS:SI:	Ptr to STRING_DIALOG_IO
-;		SS:BP:	Ptr to DIALOG
-;	Returns:
-;		CS:DX:	Ptr to character filter function
-;	Corrupts registers:
-;		Nothing
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-.GetCharacterFilterFunctionToDX:
-	mov		dx, [si+STRING_DIALOG_IO.fnCharFilter]
-	test	dx, dx
-	jnz		SHORT .ReturnFilterFunctionInDX
-	mov		dx, Char_CharIsValid
-ALIGN JUMP_ALIGN, ret
-.ReturnFilterFunctionInDX:
-	ret
Index: trunk/Assembly_Library/Src/Menu/Dialog/DialogWord.asm
===================================================================
--- trunk/Assembly_Library/Src/Menu/Dialog/DialogWord.asm	(revision 567)
+++ trunk/Assembly_Library/Src/Menu/Dialog/DialogWord.asm	(revision 568)
@@ -93,5 +93,5 @@
 ;		Nothing (User input stored to WORD_DIALOG_IO)
 ;	Corrupts registers:
-;		AX, BX, DX, SI, DI
+;		AX, BX, CX, DX, SI, DI
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
@@ -100,5 +100,5 @@
 	eMOVZX	bx, [si+WORD_DIALOG_IO.bNumericBase]
 ALIGN JUMP_ALIGN
-.GetUserInputIntilValidOrCancelled:
+.GetUserInputUntilValidOrCancelled:
 	call	Keyboard_ReadUserInputtedWordWhilePrinting
 	jz		SHORT .UserCancellation
@@ -116,18 +116,5 @@
 .InputtedWordNotInRange:
 	call	Keyboard_PlayBellForUnwantedKeystroke
-	call	.ClearInputtedWordFromDialog
-	jmp		SHORT .GetUserInputIntilValidOrCancelled
-
-;--------------------------------------------------------------------
-; .ClearInputtedWordFromDialog
-;	Parameters
-;		SS:BP:	Ptr to DIALOG
-;	Returns:
-;		Nothing
-;	Corrupts registers:
-;		AX, CX, DX, DI
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-.ClearInputtedWordFromDialog:
+	; Clear inputted word from dialog
 	CALL_DISPLAY_LIBRARY GetSoftwareCoordinatesToAX
 	xchg	dx, ax
@@ -138,4 +125,4 @@
 
 	xchg	ax, dx
-	JMP_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
-
+	CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
+	jmp		SHORT .GetUserInputUntilValidOrCancelled
Index: trunk/Assembly_Library/Src/Menu/MenuBorders.asm
===================================================================
--- trunk/Assembly_Library/Src/Menu/MenuBorders.asm	(revision 567)
+++ trunk/Assembly_Library/Src/Menu/MenuBorders.asm	(revision 568)
@@ -56,5 +56,5 @@
 	push	RefreshTitleBorders
 	push	MenuBorders_GetNumberOfMiddleCharactersToDX
-	jmp		MenuBorders_AdjustDisplayContextForDrawingBorders
+	jmp		SHORT MenuBorders_AdjustDisplayContextForDrawingBorders
 %endif
 
@@ -120,5 +120,5 @@
 	CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
 
-	mov		si, ATTRIBUTE_CHARS.cBordersAndBackground
+	xor		si, si		; SI = ATTRIBUTE_CHARS.cBordersAndBackground
 	jmp		MenuAttribute_SetToDisplayContextFromTypeInSI
 
@@ -141,37 +141,7 @@
 
 ;--------------------------------------------------------------------
+; RefreshItemBorders
 ; RefreshTitleBorders
-;	Parameters
-;		DX:		Number of times to repeat middle character
-;		SS:BP:	Ptr to MENU
-;	Returns:
-;		Nothing
-;	Corrupts registers:
-;		AX, BX, CX, SI, DI
-;--------------------------------------------------------------------
-ALIGN MENU_JUMP_ALIGN
-RefreshTitleBorders:
-	call	DrawTopBorderLine
-	eMOVZX	cx, [bp+MENUINIT.bTitleLines]
-	jmp		SHORT DrawTextBorderLinesByCXtimes
-
-;--------------------------------------------------------------------
 ; RefreshInformationBorders
-;	Parameters
-;		DX:		Number of times to repeat middle character
-;		SS:BP:	Ptr to MENU
-;	Returns:
-;		Nothing
-;	Corrupts registers:
-;		AX, BX, CX, SI, DI
-;--------------------------------------------------------------------
-ALIGN MENU_JUMP_ALIGN
-RefreshInformationBorders:
-	call	DrawSeparationBorderLine
-	eMOVZX	cx, [bp+MENUINIT.bInfoLines]
-	jmp		SHORT DrawTextBorderLinesByCXtimes
-
-;--------------------------------------------------------------------
-; RefreshItemBorders
 ;	Parameters
 ;		DX:		Number of times to repeat middle character
@@ -186,10 +156,23 @@
 	call	DrawSeparationBorderLine
 	call	MenuScrollbars_GetMaxVisibleItemsOnPageToCX
-	; Fall to DrawTextBorderLinesByCXtimes
-
-;--------------------------------------------------------------------
+	jmp		SHORT DrawTextBorderLinesByCXtimes
+
+ALIGN MENU_JUMP_ALIGN
+RefreshTitleBorders:
+	call	DrawTopBorderLine
+	mov		cl, [bp+MENUINIT.bTitleLines]
+	jmp		SHORT DrawTextBorderLinesByCLtimes
+
+ALIGN MENU_JUMP_ALIGN
+RefreshInformationBorders:
+	call	DrawSeparationBorderLine
+	mov		cl, [bp+MENUINIT.bInfoLines]
+	; Fall to DrawTextBorderLinesByCLtimes
+
+;--------------------------------------------------------------------
+; DrawTextBorderLinesByCLtimes
 ; DrawTextBorderLinesByCXtimes
 ;	Parameters
-;		CX:		Number of border lines to draw
+;		CL/CX:	Number of border lines to draw
 ;		DX:		Number of times to repeat middle character
 ;		SS:BP:	Ptr to MENU
@@ -199,4 +182,6 @@
 ;		AX, CX, SI, DI
 ;--------------------------------------------------------------------
+DrawTextBorderLinesByCLtimes:
+	xor		ch, ch
 DrawTextBorderLinesByCXtimes:
 	jcxz	.NoBorderLinesToDraw
@@ -213,5 +198,4 @@
 ; DrawSeparationBorderLine
 ; DrawBottomBorderLine
-; DrawTimeoutCounterOverBottomBorderLine
 ; DrawBottomShadowLine
 ; DrawTextBorderLine
@@ -242,8 +226,9 @@
 
 	call	DrawTimeoutCounterString
+	push	dx
 	sub		dx, BYTE MENU_TIMEOUT_STRING_CHARACTERS
 	mov		si, g_BottomBorderWithTimeoutCharacters
 	call	PrintBorderCharactersFromCSSIandShadowCharacter
-	add		dx, BYTE MENU_TIMEOUT_STRING_CHARACTERS
+	pop		dx
 	ret
 
@@ -403,5 +388,7 @@
 	mov		si, ATTRIBUTE_CHARS.cNormalTimeout
 	cmp		di, BYTE MENU_TIMEOUT_SECONDS_FOR_HURRY
-	eCMOVB	si, ATTRIBUTE_CHARS.cHurryTimeout
+	jnb		SHORT .NormalTimeout
+	dec		si			; SI = ATTRIBUTE_CHARS.cHurryTimeout
+.NormalTimeout:
 	call	MenuAttribute_GetToAXfromTypeInSI
 
Index: trunk/Assembly_Library/Src/Menu/MenuScrollbars.asm
===================================================================
--- trunk/Assembly_Library/Src/Menu/MenuScrollbars.asm	(revision 567)
+++ trunk/Assembly_Library/Src/Menu/MenuScrollbars.asm	(revision 568)
@@ -116,21 +116,7 @@
 ALIGN MENU_JUMP_ALIGN
 MenuScrollbars_MoveHighlightedItemByAX:
-	mov		cx, [bp+MENUINIT.wHighlightedItem]
-	add		cx, ax
-	; Fall to .RotateItemInCX
-
-;--------------------------------------------------------------------
-; .RotateItemInCX
-;	Parameters
-;		CX:		Possibly under of overflown item to be rotated
-;		SS:BP:	Ptr to MENU
-;	Returns:
-;		CX:		Valid item index
-;	Corrupts registers:
-;		DX
-;--------------------------------------------------------------------
-;.RotateItemInCX:
 	mov		dx, [bp+MENUINIT.wItems]
-	test	cx, cx
+	add		ax, [bp+MENUINIT.wHighlightedItem]
+	xchg	cx, ax
 	js		SHORT .RotateNegativeItemInCX
 	sub		cx, dx
Index: trunk/Assembly_Library/Src/Serial/SerialServer.asm
===================================================================
--- trunk/Assembly_Library/Src/Serial/SerialServer.asm	(revision 567)
+++ trunk/Assembly_Library/Src/Serial/SerialServer.asm	(revision 568)
@@ -83,7 +83,7 @@
 
 %ifdef USE_UNDOC_INTEL
-		eSALC	; Clear AL using CF
+		salc	; Clear AL using CF
 %else
-		xor		ax,ax
+		xor		al, al
 %endif
 		inc		dx				; divisor high
@@ -108,7 +108,7 @@
 		pop		dx				; base, interrupts disabled
 %ifdef USE_UNDOC_INTEL
-		eSALC	; Clear AL using CF
+		salc	; Clear AL using CF
 %else
-		xor		ax,ax
+		xor		al, al
 %endif
 		out		dx,al
