Index: /trunk/XTIDE_Universal_BIOS/Src/Boot/BootInfo.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Boot/BootInfo.asm	(revision 127)
+++ /trunk/XTIDE_Universal_BIOS/Src/Boot/BootInfo.asm	(revision 128)
@@ -73,5 +73,5 @@
 	stosw
 	loop	.CopyNextWord
-	xor		ax, ax
+	xor		ax, ax						; Zero AX and clear CF
 	stosb								; Terminate with NULL
 
@@ -79,5 +79,4 @@
 	pop		si
 	pop		ds
-	clc
 	ret
 
@@ -94,5 +93,5 @@
 ;	Corrupts registers:
 ;		Nothing
-;--------------------------------------------------------------------	
+;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
 BootInfo_GetTotalSectorCount:
Index: /trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenu.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenu.asm	(revision 127)
+++ /trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenu.asm	(revision 128)
@@ -24,5 +24,26 @@
 	cmp		cx, BYTE NO_ITEM_SELECTED
 	je		SHORT BootMenu_DisplayAndReturnSelection	; Clear screen and display menu
-	jmp		SHORT BootMenu_ConvertMenuitemFromCXtoDriveInDX
+	; Fall through to BootMenu_ConvertMenuitemFromCXtoDriveInDX
+
+;--------------------------------------------------------------------
+; BootMenu_ConvertMenuitemFromCXtoDriveInDX
+;	Parameters:
+;		CX:		Index of menuitem selected from Boot Menu
+;		DS:		RAMVARS segment
+;	Returns:
+;		DX:		Drive number to be used for booting
+;	Corrupts registers:
+;		CX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+BootMenu_ConvertMenuitemFromCXtoDriveInDX:
+	mov		dx, cx					; Copy menuitem index to DX
+	call	FloppyDrive_GetCountToCX
+	cmp		dx, cx					; Floppy drive?
+	jb		SHORT .ReturnFloppyDriveInDX
+	sub		dx, cx					; Remove floppy drives from index
+	or		dl, 80h
+.ReturnFloppyDriveInDX:
+	ret
 
 
@@ -77,6 +98,6 @@
 ALIGN JUMP_ALIGN
 BootMenu_GetHeightToAHwithItemCountInAL:
+	add		al, BOOT_MENU_HEIGHT_WITHOUT_ITEMS
 	xchg	cx, ax
-	add		cl, BOOT_MENU_HEIGHT_WITHOUT_ITEMS
 	CALL_DISPLAY_LIBRARY GetColumnsToALandRowsToAH
 	sub		ah, MENU_SCREEN_BOTTOM_LINES*2	; Leave space for bottom info
@@ -109,4 +130,5 @@
 	ret
 
+
 ;--------------------------------------------------------------------
 ; Returns letter for first hard disk. Usually it will be 'c' but it
@@ -130,26 +152,4 @@
 
 ;--------------------------------------------------------------------
-; BootMenu_ConvertMenuitemFromCXtoDriveInDX
-;	Parameters:
-;		CX:		Index of menuitem selected from Boot Menu
-;		DS:		RAMVARS segment
-;	Returns:
-;		DX:		Drive number to be used for booting
-;	Corrupts registers:
-;		CX
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-BootMenu_ConvertMenuitemFromCXtoDriveInDX:
-	mov		dx, cx					; Copy menuitem index to DX
-	call	FloppyDrive_GetCountToCX
-	cmp		dx, cx					; Floppy drive?
-	jb		SHORT .ReturnFloppyDriveInDX
-	sub		dx, cx					; Remove floppy drives from index
-	or		dl, 80h
-.ReturnFloppyDriveInDX:
-	ret
-
-
-;--------------------------------------------------------------------
 ; BootMenu_GetMenuitemToDXforDriveInDL
 ;	Parameters:
@@ -163,6 +163,6 @@
 BootMenu_GetMenuitemToDXforDriveInDL:
 	xor		dh, dh						; Drive number now in DX
-	test	dl, 80h
-	jz		SHORT .ReturnItemIndexInDX	; Return if floppy drive (HD bit not set)
+	test	dl, dl
+	jns		SHORT .ReturnItemIndexInDX	; Return if floppy drive (HD bit not set)
 	call	FloppyDrive_GetCountToCX
 	and		dl, ~80h					; Clear HD bit
@@ -187,6 +187,6 @@
 ALIGN JUMP_ALIGN
 BootMenu_IsDriveInSystem:
-	test	dl, 80h								; Floppy drive?
-	jz		SHORT .IsFloppyDriveIsInSystem
+	test	dl, dl								; Floppy drive?
+	jns		SHORT .IsFloppyDriveIsInSystem
 	call	RamVars_GetHardDiskCountFromBDAtoCX	; Hard Disk count to CX
 	or		cl, 80h								; Set Hard Disk bit to CX
Index: /trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuEvent.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuEvent.asm	(revision 127)
+++ /trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuEvent.asm	(revision 128)
@@ -157,6 +157,6 @@
 	call	RamVars_GetSegmentToDS
 	call	BootMenu_ConvertMenuitemFromCXtoDriveInDX
-	test	dl, 80h					; Floppy drive?
-	jz		SHORT .DrawFloppyDrive
+	test	dl, dl					; Floppy drive?
+	jns		SHORT .DrawFloppyDrive
 	jmp		[cs:bx+ITEM_TYPE_REFRESH.HardDisk]
 ALIGN JUMP_ALIGN
Index: /trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm	(revision 127)
+++ /trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm	(revision 128)
@@ -22,5 +22,23 @@
 	CALL_DISPLAY_LIBRARY PrintNewlineCharacters
 	mov		si, ROMVARS.szVersion
-	jmp		BootMenuPrint_NullTerminatedStringFromCSSIandSetCF
+	; Fall through to BootMenuPrint_NullTerminatedStringFromCSSIandSetCF
+
+
+;--------------------------------------------------------------------
+; BootMenuPrint_NullTerminatedStringFromCSSIandSetCF
+;	Parameters:
+;		CS:SI:	Ptr to NULL terminated string to print
+;	Returns:
+;		CF:		Set since menu event was handled successfully
+;	Corrupts registers:
+;		AX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+BootMenuPrint_NullTerminatedStringFromCSSIandSetCF:
+	push	di
+	CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromCSSI
+	pop		di
+	stc
+	ret
 
 
@@ -53,5 +71,4 @@
 BootMenuPrint_FloppyMenuitem:
 	push	bp
-
 	mov		bp, sp
 	mov		si, g_szFDLetter
@@ -109,5 +126,5 @@
 .HardDiskMenuitemForForeignDrive:
 	mov		si, g_szforeignHD
-	jmp		BootMenuPrint_NullTerminatedStringFromCSSIandSetCF
+	jmp		SHORT BootMenuPrint_NullTerminatedStringFromCSSIandSetCF
 
 
@@ -177,5 +194,4 @@
 .PrintKnownFloppyType:
 	push	bp
-
 	mov		bp, sp
 	mov		si, g_szFddSize
@@ -320,22 +336,4 @@
 
 ;--------------------------------------------------------------------
-; BootMenuPrint_NullTerminatedStringFromCSSIandSetCF
-;	Parameters:
-;		CS:SI:	Ptr to NULL terminated string to print
-;	Returns:
-;		CF:		Set since menu event was handled successfully
-;	Corrupts registers:
-;		AX
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-BootMenuPrint_NullTerminatedStringFromCSSIandSetCF:
-	push	di
-	CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromCSSI
-	pop		di
-	stc
-	ret
-
-
-;--------------------------------------------------------------------
 ; BootMenuPrint_ClearInformationArea
 ;	Parameters:
Index: /trunk/XTIDE_Universal_BIOS/Src/Boot/BootPrint.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Boot/BootPrint.asm	(revision 127)
+++ /trunk/XTIDE_Universal_BIOS/Src/Boot/BootPrint.asm	(revision 128)
@@ -21,6 +21,8 @@
 
 	mov		ax, g_szHDD
-	test	dl, 80h
-	eCMOVZ	ax, g_szFDD
+	test	dl, dl
+	js		SHORT .NotFDD
+	mov		ax, g_szFDD
+.NotFDD:
 	push	ax
 
Index: /trunk/XTIDE_Universal_BIOS/Src/Boot/BootSector.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Boot/BootSector.asm	(revision 127)
+++ /trunk/XTIDE_Universal_BIOS/Src/Boot/BootSector.asm	(revision 128)
@@ -23,6 +23,6 @@
 	jc		SHORT .FailedToLoadFirstSector
 
-	test	dl, 80h
-	jz		SHORT .AlwaysBootFromFloppyDriveForBooterGames
+	test	dl, dl
+	jns		SHORT .AlwaysBootFromFloppyDriveForBooterGames
 	cmp		WORD [es:bx+510], 0AA55h		; Valid boot sector?
 	jne		SHORT .FirstHardDiskSectorNotBootable
@@ -84,6 +84,8 @@
 .ResetBootDriveFromDL:
 	xor		ax, ax							; AH=0h, Disk Controller Reset
-	test	dl, 80h							; Floppy drive?
-	eCMOVNZ	ah, 0Dh							; AH=Dh, Reset Hard Disk (Alternate reset)
+	test	dl, dl							; Floppy drive?
+	jns		SHORT .SkipAltReset
+	mov		ah, 0Dh							; AH=Dh, Reset Hard Disk (Alternate reset)
+.SkipAltReset:
 	int		INTV_DISK_FUNC
 	ret
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm	(revision 127)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm	(revision 128)
@@ -1,8 +1,3 @@
-; File name		:	AH0h_HReset.asm
-; Project name	:	IDE BIOS
-; Created date	:	27.9.2007
-; Last update	:	13.1.2011
-; Author		:	Tomi Tilli,
-;				:	Krister Nordvall (optimizations)
+; Project name	:	XTIDE Universal BIOS
 ; Description	:	Int 13h function AH=0h, Disk Controller Reset.
 
@@ -36,6 +31,6 @@
 	eMOVZX	bx, dl						; Copy requested drive to BL, zero BH to assume no errors
 	call	ResetFloppyDrivesWithInt40h
-	test	bl, 80h
-	jz		SHORT .SkipHardDiskReset
+	test	bl, bl
+	jns		SHORT .SkipHardDiskReset
 	call	ResetForeignHardDisks
 	call	AH0h_ResetHardDisksHandledByOurBIOS
@@ -56,5 +51,5 @@
 ;	Corrupts registers:
 ;		AX, DL, DI
-;--------------------------------------------------------------------	
+;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
 ResetFloppyDrivesWithInt40h:
@@ -75,5 +70,5 @@
 ;	Corrupts registers:
 ;		AX, DL, DI
-;--------------------------------------------------------------------	
+;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
 ResetForeignHardDisks:
@@ -94,5 +89,5 @@
 ;	Corrupts registers:
 ;		DI
-;--------------------------------------------------------------------	
+;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
 GetDriveNumberForForeignBiosesToDL:
Index: /trunk/XTIDE_Universal_BIOS/Src/Initialization/DriveXlate.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Initialization/DriveXlate.asm	(revision 127)
+++ /trunk/XTIDE_Universal_BIOS/Src/Initialization/DriveXlate.asm	(revision 128)
@@ -141,5 +141,5 @@
 ;	Corrupts registers:
 ;		AX
-;--------------------------------------------------------------------	
+;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
 DriveXlate_Reset:
@@ -160,9 +160,9 @@
 ;	Corrupts registers:
 ;		Nothing
-;--------------------------------------------------------------------	
+;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
 DriveXlate_SetDriveToSwap:
-	test	dl, 80h				; Floppy drive?
-	jnz		SHORT .SetHardDiskToSwap
+	test	dl, dl				; Floppy drive?
+	js		SHORT .SetHardDiskToSwap
 .SetFloppyDriveToSwap:
 	mov		[RAMVARS.xlateVars+XLATEVARS.bFDSwap], dl
@@ -187,11 +187,11 @@
 ;	Corrupts registers:
 ;		Nothing
-;--------------------------------------------------------------------	
+;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
 DriveXlate_DoesFunctionReturnSomethingInDL:
 	cmp		ah, 08h			; AH=08h, Read Disk Drive Parameters?
 	je		SHORT DriveXlate_FunctionReturnsSomethingInDL
-	test	dl, 80h
-	jz		SHORT DriveXlate_DoesFloppyFunctionReturnSomethingInDL
+	test	dl, dl
+	jns		SHORT DriveXlate_DoesFloppyFunctionReturnSomethingInDL
 	; Fall to DriveXlate_DoesHardDiskFunctionReturnSomethingInDL
 
@@ -211,5 +211,5 @@
 ;	Corrupts registers:
 ;		Nothing
-;--------------------------------------------------------------------	
+;--------------------------------------------------------------------
 ; ALIGN JUMP_ALIGN
 DriveXlate_DoesHardDiskFunctionReturnSomethingInDL:
Index: /trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm	(revision 127)
+++ /trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm	(revision 128)
@@ -232,7 +232,7 @@
 	; Make sure that more drives can be accepted
 	mov		dl, [es:BDA.bHDCount]	; Load number of hard disks
-	test	dl, 80h					; Hard disks at maximum?
+	test	dl, dl					; Hard disks at maximum?
 	stc								; Assume error
-	jnz		SHORT .TooManyDrives	;  If so, return
+	js		SHORT .TooManyDrives	;  If so, return
 
 	; Store drive number to DPT
Index: /trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm	(revision 127)
+++ /trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm	(revision 128)
@@ -130,6 +130,6 @@
 	cmp		ah, 08h			; Read Disk Drive Parameters?
 	jne		SHORT RamVars_IsDriveHandledByThisBIOS
-	test	dl, 80h			; We dot not handle floppy drives
-	jz		SHORT .FunctionIsNotHandledByOurBIOS
+	test	dl, dl			; We do not handle floppy drives
+	jns		SHORT .FunctionIsNotHandledByOurBIOS
 ALIGN JUMP_ALIGN
 .FunctionIsHandledByOurBIOS:
