Index: trunk/BIOS_Drive_Information_Tool/Src/AtaInfo.asm
===================================================================
--- trunk/BIOS_Drive_Information_Tool/Src/AtaInfo.asm	(revision 424)
+++ trunk/BIOS_Drive_Information_Tool/Src/AtaInfo.asm	(revision 424)
@@ -0,0 +1,248 @@
+; Project name	:	BIOS Drive Information Tool
+; Description	:	Reads and prints information from ATA ID.
+
+;
+; XTIDE Universal BIOS and Associated Tools 
+; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
+;
+; This program is free software; you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation; either version 2 of the License, or
+; (at your option) any later version.
+; 
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+; GNU General Public License for more details.		
+; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+;
+
+; Section containing code
+SECTION .text
+
+
+;--------------------------------------------------------------------
+; AtaInfo_DisplayAtaInformationForDriveDL
+;	Parameters:
+;		DL:		Drive Number
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		All, except CX and DX
+;--------------------------------------------------------------------
+AtaInfo_DisplayAtaInformationForDriveDL:
+	push	cx
+	push	dx
+
+	; Read ATA Information from the drive
+	call	Bios_ReadAtaInfoFromDriveDLtoBX
+	call	Print_ErrorMessageFromAHifError	; AH=25h is not available on many BIOSes
+	jc		SHORT .SkipAtaInfoSinceError
+
+	; Print Drive Name
+	call	Print_NameFromAtaInfoInBX
+
+	; Print Drive P-CHS parameters
+	call	DisplayPCHSusingAtaInfoFromDSBX
+
+	; Print Drive CHS sector count
+	test	WORD [bx+ATA1.wFields], A1_wFields_54to58
+	jz		SHORT .SkipChsSectors
+	call	DisplayPCHSsectorCountUsingAtaInfoFromDXBX
+.SkipChsSectors:
+
+	; Print Drive LBA28 sector count
+	test	WORD [bx+ATA1.wCaps], A1_wCaps_LBA
+	jz		SHORT .SkipLBA28
+	call	DisplayLBA28sectorCountUsingAtaInfoFromDSBX
+.SkipLBA28:
+
+	; Print Drive LBA48 sector count
+	test	WORD [bx+ATA6.wSetSup83], A6_wSetSup83_LBA48
+	jz		SHORT .SkipLBA48
+	call	DisplayLBA48sectorCountUsingAtaInfoFromDSBX
+.SkipLBA48:
+
+	; Print L-CHS generated by XTIDE Universal BIOS
+	call	DisplayXTUBcompatibilityInfoUsingAtaInfoFromDSBX
+
+	; Print block mode information
+	call	DisplayBlockModeInformationUsingAtaInfoFromDSBX
+
+	; Print PIO mode information
+	call	DisplayPioModeInformationUsingAtaInfoFromDSBX
+
+.SkipAtaInfoSinceError:
+	pop		dx
+	pop		cx
+	ret
+
+
+;--------------------------------------------------------------------
+; DisplayXTUBcompatibilityInfoUsingAtaInfoFromDSBX
+;	Parameters:
+;		BX:		Offset to ATA Information
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, CX, DX, BP, SI, DI
+;--------------------------------------------------------------------
+DisplayPCHSusingAtaInfoFromDSBX:
+	mov		si, bx			; DS == ES
+	call	AtaGeometry_GetPCHStoAXBLBHfromAtaInfoInESSI
+	xchg	cx, ax
+	eMOVZX	dx, bl
+	eMOVZX	ax, bh
+	call	Print_CHSfromCXDXAX
+	mov		bx, si			; Restore BX
+	ret
+
+
+;--------------------------------------------------------------------
+; DisplayPCHSsectorCountUsingAtaInfoFromDXBX
+;	Parameters:
+;		BX:		Offset to ATA Information
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, DX, BP, SI, DI
+;--------------------------------------------------------------------
+DisplayPCHSsectorCountUsingAtaInfoFromDXBX:
+	mov		si, g_szChsSectors
+	call	Print_NullTerminatedStringFromSI
+
+	mov		si, bx
+	mov		ax, [si+ATA1.dwCurSCnt]
+	mov		dx, [si+ATA1.dwCurSCnt+2]
+	xor		bx, bx
+	call	Print_TotalSectorsFromBXDXAX
+	mov		bx, si			; Restore BX
+	ret
+
+
+;--------------------------------------------------------------------
+; DisplayLBA28sectorCountUsingAtaInfoFromDSBX
+;	Parameters:
+;		BX:		Offset to ATA Information
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, DX, BP, SI, DI
+;--------------------------------------------------------------------
+DisplayLBA28sectorCountUsingAtaInfoFromDSBX:
+	mov		si, g_szLBA28
+	call	Print_NullTerminatedStringFromSI
+
+	mov		si, bx
+	mov		ax, [si+ATA1.dwLBACnt]
+	mov		dx, [si+ATA1.dwLBACnt+2]
+	xor		bx, bx
+	call	Print_TotalSectorsFromBXDXAX
+	mov		bx, si			; Restore BX
+	ret
+
+
+;--------------------------------------------------------------------
+; DisplayLBA48sectorCountUsingAtaInfoFromDSBX
+;	Parameters:
+;		BX:		Offset to ATA Information
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, DX, BP, SI, DI
+;--------------------------------------------------------------------
+DisplayLBA48sectorCountUsingAtaInfoFromDSBX:
+	mov		si, g_szLBA48
+	call	Print_NullTerminatedStringFromSI
+
+	mov		si, bx
+	mov		ax, [si+ATA6.qwLBACnt]
+	mov		dx, [si+ATA6.qwLBACnt+2]
+	mov		bx, [si+ATA6.qwLBACnt+4]
+	call	Print_TotalSectorsFromBXDXAX
+	mov		bx, si			; Restore BX
+	ret
+
+
+;--------------------------------------------------------------------
+; DisplayXTUBcompatibilityInfoUsingAtaInfoFromDSBX
+;	Parameters:
+;		BX:		Offset to ATA Information
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, CX, DX, BP, SI, DI
+;--------------------------------------------------------------------
+DisplayXTUBcompatibilityInfoUsingAtaInfoFromDSBX:
+	push	bx
+
+	; Display header
+	mov		ax, g_szXTUBversion
+	mov		si, g_szXTUB
+	call	Print_FormatStringFromSIwithParameterInAX
+
+	; Display translation mode and L-CHS
+	mov		si, bx				; DS == ES
+	mov		dx, TRANSLATEMODE_AUTO
+	call	AtaGeometry_GetLCHStoAXBLBHfromAtaInfoInESSIandTranslateModeInDX
+	dec		ax					; Reserve diagnostics cylinder
+	MIN_U	ax, MAX_LCHS_CYLINDERS
+	call	Print_ModeFromDLandCHSfromAXLBH
+
+	pop		bx
+	ret
+
+
+;--------------------------------------------------------------------
+; DisplayBlockModeInformationUsingAtaInfoFromDSBX
+;	Parameters:
+;		BX:		Offset to ATA Information
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, DX, BP, SI, DI
+;--------------------------------------------------------------------
+DisplayBlockModeInformationUsingAtaInfoFromDSBX:
+	eMOVZX	ax, BYTE [bx+ATA1.bBlockSel]	; ATA2+ has flag on high word
+	mov		dx, [bx+ATA1.bBlckSize]
+	mov		si, g_szBlockMode
+	jmp		Print_FormatStringFromSIwithParametersInAXDX
+
+
+;--------------------------------------------------------------------
+; DisplayPioModeInformationUsingAtaInfoFromDSBX
+;	Parameters:
+;		BX:		Offset to ATA Information
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, CX, DX, BP, SI, DI
+;--------------------------------------------------------------------
+DisplayPioModeInformationUsingAtaInfoFromDSBX:
+	; Load standard timings (up to PIO-2)
+	mov		ax, [bx+ATA1.bPioMode]
+	mov		si, ax
+	shl		si, 1		; Shift for WORD lookup
+	mov		dx, [si+.rgwStandardPioTimings]	; Load min cycle time
+	mov		cx, -1		; IORDY not supported
+
+	; Replace with advanced mode timings (PIO-3 and up)
+	test	BYTE [bx+ATA2.wFields], A2_wFields_64to70
+	jz		SHORT .NoAdvancedPioModesSupported
+
+	mov		si, [bx+ATA2.bPIOSupp]	; Advanced mode flags
+.IncrementPioMode:
+	inc		ax
+	shr		si, 1
+	jnz		SHORT .IncrementPioMode
+	mov		dx, [bx+ATA2.wPIOMinCy]
+	mov		cx, [bx+ATA2.wPIOMinCyF]
+
+.NoAdvancedPioModesSupported:
+	mov		si, g_szPIO
+	jmp		Print_FormatStringFromSIwithParametersInAXDXCX
+
+.rgwStandardPioTimings:
+	dw		PIO_0_MIN_CYCLE_TIME_NS
+	dw		PIO_1_MIN_CYCLE_TIME_NS
+	dw		PIO_2_MIN_CYCLE_TIME_NS
Index: trunk/BIOS_Drive_Information_Tool/Src/Bios.asm
===================================================================
--- trunk/BIOS_Drive_Information_Tool/Src/Bios.asm	(revision 423)
+++ trunk/BIOS_Drive_Information_Tool/Src/Bios.asm	(revision 424)
@@ -31,5 +31,4 @@
 ;		AX, BX, CX
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
 Bios_GetNumberOfHardDrivesToDX:
 	mov		dl, 80h		; First hard drive
@@ -54,5 +53,4 @@
 ;		Nothing
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
 Bios_ReadOldInt13hParametersFromDriveDL:
 	mov		ah, GET_DRIVE_PARAMETERS
@@ -102,5 +100,4 @@
 ;		Nothing
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
 Bios_ReadOldInt13hCapacityFromDriveDL:
 	mov		ah, GET_DISK_TYPE
@@ -123,5 +120,4 @@
 ;		ES
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
 Bios_ReadAtaInfoFromDriveDLtoBX:
 	mov		bx, g_rgbAtaInfo
@@ -146,5 +142,4 @@
 ;		Nothing
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
 Bios_ReadEbiosVersionFromDriveDL:
 	mov		ah, CHECK_EXTENSIONS_PRESENT
@@ -175,5 +170,4 @@
 ;		Nothing
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
 Bios_ReadEbiosInfoFromDriveDLtoDSSI:
 	mov		si, g_edriveInfo
Index: trunk/BIOS_Drive_Information_Tool/Src/Main.asm
===================================================================
--- trunk/BIOS_Drive_Information_Tool/Src/Main.asm	(revision 423)
+++ trunk/BIOS_Drive_Information_Tool/Src/Main.asm	(revision 424)
@@ -28,4 +28,5 @@
 %include "EBIOS.inc"			; From XTIDE Universal BIOS
 FLG_DRVNHEAD_DRV	EQU	(1<<4)	; Required by CustomDPT.inc
+%include "Romvars.inc"			; From XTIDE Universal BIOS
 %include "CustomDPT.inc"		; From XTIDE Universal BIOS
 
@@ -41,6 +42,7 @@
 ; Include library and other sources
 %include "AssemblyLibrary.asm"
-%include "LbaAssist.asm"		; From XTIDE Universal BIOS
+%include "AtaGeometry.asm"		; From XTIDE Universal BIOS
 %include "Strings.asm"
+%include "AtaInfo.asm"
 %include "Bios.asm"
 %include "Print.asm"
@@ -55,4 +57,5 @@
 	call	Print_SetCharacterOutputToSTDOUT
 
+	; Display program name and version
 	mov		si, g_szProgramName
 	call	Print_NullTerminatedStringFromSI
@@ -65,5 +68,13 @@
 
 
-
+;--------------------------------------------------------------------
+; ReadAndDisplayAllHardDrives
+;	Parameters:
+;		Nothing
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		All, except segments
+;--------------------------------------------------------------------
 ReadAndDisplayAllHardDrives:
 	call	Bios_GetNumberOfHardDrivesToDX
@@ -73,5 +84,4 @@
 	jmp		SHORT .DisplayFirstDrive
 
-ALIGN JUMP_ALIGN
 .DisplayNextDriveFromDL:
 	mov		si, g_szPressAnyKey
@@ -80,15 +90,19 @@
 
 .DisplayFirstDrive:
+	; Display drive number
 	mov		si, g_szHeaderDrive
 	call	Print_DriveNumberFromDLusingFormatStringInSI
 
+	; Display ATA information read from drive
 	mov		si, g_szAtaInfoHeader
 	call	Print_NullTerminatedStringFromSI
-	call	DisplayAtaInformationForDriveDL
-
+	call	AtaInfo_DisplayAtaInformationForDriveDL
+
+	; Display INT 13h AH=08h and AH=15h information
 	mov		si, g_szOldInfoHeader
 	call	Print_NullTerminatedStringFromSI
 	call	DisplayOldInt13hInformationForDriveDL
 
+	; Display EBIOS information
 	mov		si, g_szNewInfoHeader
 	call	Print_NullTerminatedStringFromSI
@@ -101,101 +115,18 @@
 
 
-ALIGN JUMP_ALIGN
-DisplayAtaInformationForDriveDL:
-	push	cx
-	push	dx
-
-	call	Bios_ReadAtaInfoFromDriveDLtoBX
-	call	Print_ErrorMessageFromAHifError
-	jc		SHORT .SkipAtaInfoSinceError
-
-	call	Print_NameFromAtaInfoInBX
-
-	mov		cx, [bx+ATA1.wCylCnt]
-	mov		dx, [bx+ATA1.wHeadCnt]
-	mov		ax, [bx+ATA1.wSPT]
-	call	Print_CHSfromCXDXAX
-
-	test	WORD [bx+ATA1.wFields], A1_wFields_54to58
-	jz		SHORT .SkipChsSectors
-	mov		si, g_szChsSectors
-	call	Print_NullTerminatedStringFromSI
-	mov		si, bx
-	mov		ax, [si+ATA1.dwCurSCnt]
-	mov		dx, [si+ATA1.dwCurSCnt+2]
-	xor		bx, bx
-	call	Print_TotalSectorsFromBXDXAX
-	mov		bx, si
-.SkipChsSectors:
-
-	test	WORD [bx+ATA1.wCaps], A1_wCaps_LBA
-	jz		SHORT .SkipLBA28
-	mov		si, g_szLBA28
-	call	Print_NullTerminatedStringFromSI
-	mov		si, bx
-	mov		ax, [si+ATA1.dwLBACnt]
-	mov		dx, [si+ATA1.dwLBACnt+2]
-	xor		bx, bx
-	call	Print_TotalSectorsFromBXDXAX
-	mov		bx, si
-.SkipLBA28:
-
-	test	WORD [bx+ATA6.wSetSup83], A6_wSetSup83_LBA48
-	jz		SHORT .SkipLBA48
-	mov		si, g_szLBA48
-	call	Print_NullTerminatedStringFromSI
-	mov		si, bx
-	mov		ax, [bx+ATA6.qwLBACnt]
-	mov		dx, [bx+ATA6.qwLBACnt+2]
-	mov		bx, [bx+ATA6.qwLBACnt+4]
-	call	Print_TotalSectorsFromBXDXAX
-	mov		bx, si
-.SkipLBA48:
-
-	; Print L-CHS generated by XTIDE Universal BIOS
-	mov		ax, g_szXTUBversion
-	mov		si, g_szXTUB
-	call	Print_VersionStringFromAXusingFormatStringInSI
-	call	DisplayXTUBcompatibilityInfoUsingAtaInfoFromDSBX
-
-.SkipAtaInfoSinceError:
-	pop		dx
-	pop		cx
-	ret
-
-
-ALIGN JUMP_ALIGN
-DisplayXTUBcompatibilityInfoUsingAtaInfoFromDSBX:
-	test	WORD [bx+ATA1.wCaps], A1_wCaps_LBA
-	jz		SHORT .LbaNotSupported
-	test	WORD [bx+ATA6.wSetSup83], A6_wSetSup83_LBA48
-	jz		SHORT .LoadLba28SectorCount
-
-	; Load LBA48 Sector Count
-	mov		ax, [bx+ATA6.qwLBACnt]
-	mov		dx, [bx+ATA6.qwLBACnt+2]
-	mov		bx, [bx+ATA6.qwLBACnt+4]
-	jmp		SHORT .ConvertLbaToLCHS
-.LoadLba28SectorCount:
-	mov		ax, [bx+ATA1.dwLBACnt]
-	mov		dx, [bx+ATA1.dwLBACnt+2]
-	xor		bx, bx
-
-.ConvertLbaToLCHS:
-	call	LbaAssist_ConvertSectorCountFromBXDXAXtoLbaAssistedCHSinDXAXBLBH
-	LIMIT_LBA_CYLINDERS_IN_DXAX_TO_LCHS_CYLINDERS
-	xchg	cx, ax
-	eMOVZX	dx, bl
-	eMOVZX	ax, bh
-	call	Print_CHSfromCXDXAX
-.LbaNotSupported:
-	ret
-
-
-ALIGN JUMP_ALIGN
+;--------------------------------------------------------------------
+; DisplayOldInt13hInformationForDriveDL
+;	Parameters:
+;		DL:		Drive Number
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		All, except CX and DX
+;--------------------------------------------------------------------
 DisplayOldInt13hInformationForDriveDL:
 	push	cx
 	push	dx
 
+	; Print L-CHS from AH=08h
 	call	Bios_ReadOldInt13hParametersFromDriveDL
 	call	Print_ErrorMessageFromAHifError
@@ -203,4 +134,5 @@
 	call	Print_CHSfromCXDXAX
 
+	; Print total sector count from AH=15h
 	mov		si, g_szSectors
 	call	Print_NullTerminatedStringFromSI
@@ -210,4 +142,5 @@
 	call	Print_ErrorMessageFromAHifError
 	jc		SHORT .SkipOldInt13hSinceError
+
 	xchg	ax, dx
 	mov		dx, cx
@@ -220,9 +153,18 @@
 
 
-ALIGN JUMP_ALIGN
+;--------------------------------------------------------------------
+; DisplayNewInt13hInformationFromDriveDL
+;	Parameters:
+;		DL:		Drive Number
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		All, except CX and DX
+;--------------------------------------------------------------------
 DisplayNewInt13hInformationFromDriveDL:
 	push	cx
 	push	dx
 
+	; Display EBIOS version
 	call	Bios_ReadEbiosVersionFromDriveDL
 	call	Print_ErrorMessageFromAHifError
@@ -230,8 +172,10 @@
 	call	Print_EbiosVersionFromBXandExtensionsFromCX
 
+	; Display drive info from AH=48h
 	call	Bios_ReadEbiosInfoFromDriveDLtoDSSI
 	call	Print_ErrorMessageFromAHifError
 	jc		SHORT .SkipNewInt13hSinceError
 
+	; Display CHS
 	test	WORD [si+EDRIVE_INFO.wFlags], FLG_CHS_INFORMATION_IS_VALID
 	jz		SHORT .SkipEbiosCHS
@@ -242,4 +186,5 @@
 .SkipEbiosCHS:
 
+	; Display total sector count
 	push	si
 	mov		si, g_szSectors
@@ -251,7 +196,8 @@
 	call	Print_TotalSectorsFromBXDXAX
 
+	; Display sector size
 	mov		ax, [si+EDRIVE_INFO.wSectorSize]
 	mov		si, g_szNewSectorSize
-	call	Print_SectorSizeFromAXusingFormatStringInSI
+	call	Print_FormatStringFromSIwithParameterInAX
 
 .SkipNewInt13hSinceError:
Index: trunk/BIOS_Drive_Information_Tool/Src/Print.asm
===================================================================
--- trunk/BIOS_Drive_Information_Tool/Src/Print.asm	(revision 423)
+++ trunk/BIOS_Drive_Information_Tool/Src/Print.asm	(revision 424)
@@ -30,5 +30,4 @@
 ;		AX, BX, DI
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
 Print_SetCharacterOutputToSTDOUT:
 	mov		bl, ATTRIBUTES_NOT_USED
@@ -50,5 +49,4 @@
 ;		AX, DX
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
 DosCharOut:
 	xchg	dx, ax
@@ -68,10 +66,9 @@
 ;		AX, BP, SI, DI (CF remains unchanged)
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
 Print_ErrorMessageFromAHifError:
 	jnc		SHORT .NoErrors
 	eMOVZX	ax, ah
 	mov		si, g_szBiosError
-	call	Print_BiosFunctionNumberFromAXusingFormatStringInSI
+	call	Print_FormatStringFromSIwithParameterInAX
 	stc		; Keep the CF set
 ALIGN JUMP_ALIGN
@@ -82,10 +79,7 @@
 ;---------------------------------------------------------------------
 ; Print_DriveNumberFromDLusingFormatStringInSI
-; Print_VersionStringFromAXusingFormatStringInSI
-; Print_BiosFunctionNumberFromAXusingFormatStringInSI
-; Print_SectorSizeFromAXusingFormatStringInSI
 ;	Parameters:
 ;		DL:		Drive Number
-;		AX:		Function number
+;		SI:		Offset to format string
 ;	Returns:
 ;		Nothing
@@ -93,13 +87,76 @@
 ;		AX, BP, DI
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
 Print_DriveNumberFromDLusingFormatStringInSI:
 	eMOVZX	ax, dl
-Print_VersionStringFromAXusingFormatStringInSI:
-Print_BiosFunctionNumberFromAXusingFormatStringInSI:
-Print_SectorSizeFromAXusingFormatStringInSI:
-	mov		bp, sp
-	push	ax
-	jmp		SHORT JumpToFormatNullTerminatedStringFromSI
+	; Fall to Print_FormatStringFromSIwithParameterInAX
+
+
+;---------------------------------------------------------------------
+; Print_FormatStringFromSIwithParameterInAX
+; Print_FormatStringFromSIwithParametersInAXDX
+; Print_FormatStringFromSIwithParametersInAXDXCX
+;	Parameters:
+;		AX:		Format parameter 1
+;		DX:		Format parameter 2
+;		CX:		Format parameter 3
+;		SI:		Offset to format string
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BP, DI
+;--------------------------------------------------------------------
+Print_FormatStringFromSIwithParameterInAX:
+	mov		bp, sp
+	push	ax
+	jmp		JumpToFormatNullTerminatedStringFromSI
+
+Print_FormatStringFromSIwithParametersInAXDX:
+	mov		bp, sp
+	push	ax
+	push	dx
+	jmp		JumpToFormatNullTerminatedStringFromSI
+
+Print_FormatStringFromSIwithParametersInAXDXCX:
+	mov		bp, sp
+	push	ax
+	push	dx
+	push	cx
+	jmp		SHORT JumpToFormatNullTerminatedStringFromSI
+
+
+;---------------------------------------------------------------------
+; Print_ModeFromDLandCHSfromAXBLBH
+;	Parameters:
+;		AX:		Number of L-CHS cylinders (1...1024)
+;		BL:		Number of L-CHS heads (1...255)
+;		BH:		Number of L-CHS sectors per track (1...63)
+;		DL:		CHS Translate Mode
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BP, SI, DI
+;--------------------------------------------------------------------
+Print_ModeFromDLandCHSfromAXLBH:
+	mov		bp, sp
+
+	xor		dh, dh
+	mov		si, dx
+	shl		si, 1		; Shift for WORD lookup
+	push	WORD [si+.rgszXlateModeToString]
+
+	ePUSH_T	si, g_szFormatCHS
+	push	ax			; Cylinders
+	eMOVZX	ax, bl
+	push	ax			; Heads
+	mov		al, bh
+	push	ax			; Sectors per track
+
+	mov		si, g_szXlateAndCHS
+	jmp		SHORT JumpToFormatNullTerminatedStringFromSI
+
+.rgszXlateModeToString:
+	dw		g_szNormal
+	dw		g_szLarge
+	dw		g_szLBA
 
 
@@ -115,5 +172,4 @@
 ;		AX, BP, DI
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
 Print_CHSfromCXDXAX:
 	push	si
@@ -139,5 +195,4 @@
 ;		AX, CX, BP, SI, DI
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
 Print_NameFromAtaInfoInBX:
 	cld
@@ -171,5 +226,4 @@
 ;		AX, BX, BP, DI
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
 Print_TotalSectorsFromBXDXAX:
 	ePUSH_T	di, 0
@@ -200,5 +254,4 @@
 ;		AX, BP, SI, DI
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
 Print_EbiosVersionFromBXandExtensionsFromCX:
 	mov		bp, sp
@@ -219,5 +272,4 @@
 ;		AX, DI
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
 JumpToFormatNullTerminatedStringFromSI:	
 	CALL_DISPLAY_LIBRARY 	FormatNullTerminatedStringFromCSSI
@@ -234,5 +286,4 @@
 ;		AX, DI
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
 Print_NullTerminatedStringFromSI:
 	CALL_DISPLAY_LIBRARY	PrintNullTerminatedStringFromCSSI
Index: trunk/BIOS_Drive_Information_Tool/Src/Strings.asm
===================================================================
--- trunk/BIOS_Drive_Information_Tool/Src/Strings.asm	(revision 423)
+++ trunk/BIOS_Drive_Information_Tool/Src/Strings.asm	(revision 424)
@@ -21,5 +21,5 @@
 SECTION .data
 
-g_szProgramName:	db	"BIOS Drive Information Tool v1.0.1",CR,LF
+g_szProgramName:	db	"BIOS Drive Information Tool v1.0.2",CR,LF
 					db	"(C) 2012 by XTIDE Universal BIOS Team",CR,LF
 					db	"Released under GNU GPL v2",CR,LF
@@ -32,9 +32,14 @@
 g_szAtaInfoHeader:	db	"ATA-information from AH=25h...",CR,LF,NULL
 g_szFormatDrvName:	db	" Name: %s",CR,LF,NULL
+g_szXlateAndCHS:	db	" Mode: %s, %s",NULL
+g_szNormal:			db	"NORMAL",NULL
+g_szLarge:			db	"LARGE ",NULL
+g_szLBA:			db	"LBA   ",NULL
 g_szFormatCHS:		db	" Cylinders    : %5-u, Heads: %3-u, Sectors: %2-u",CR,LF,NULL
 g_szChsSectors:		db	" CHS   sectors: ",NULL
 g_szLBA28:			db	" LBA28 sectors: ",NULL
 g_szLBA48:			db	" LBA48 sectors: ",NULL
-
+g_szBlockMode:		db	" Block set    : %u, Max block: %u sectors",CR,LF,NULL
+g_szPIO:			db	" Max PIO mode : %u, Min cycle time without IORDY %u, with IORDY %d ns",CR,LF,NULL
 g_szXTUB:			db	"XTIDE Universal BIOS %s generates following L-CHS...",CR,LF,NULL
 g_szXTUBversion:	db	ROM_VERSION_STRING	; This one is NULL terminated
