Index: trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc	(revision 347)
+++ trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc	(revision 358)
@@ -85,3 +85,23 @@
 
 
+;--------------------------------------------------------------------
+; LIMIT_LBA_CYLINDERS_IN_DXAX_TO_LCHS_CYLINDERS
+;	Parameters:
+;		DX:AX:	Number of LBA cylinders
+;	Returns:
+;		AX:		Number of L-CHS cylinders
+;	Corrupts registers:
+;		Nothing
+;--------------------------------------------------------------------
+%macro LIMIT_LBA_CYLINDERS_IN_DXAX_TO_LCHS_CYLINDERS 0
+	test	dx, dx
+	jnz		SHORT %%LoadMaxValueToAX
+	cmp		ax, MAX_LCHS_CYLINDERS
+	jbe		SHORT %%NoNeedToModify
+%%LoadMaxValueToAX:
+	mov		ax, MAX_LCHS_CYLINDERS
+%%NoNeedToModify:
+%endmacro
+
+
 %endif ; CUSTOMDPT_INC
Index: trunk/XTIDE_Universal_BIOS/Inc/Version.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/Version.inc	(revision 358)
+++ trunk/XTIDE_Universal_BIOS/Inc/Version.inc	(revision 358)
@@ -0,0 +1,21 @@
+; Project name	:	XTIDE Universal BIOS
+; Description	:	Version information.
+%ifndef VERSION_INC
+%define VERSION_INC
+
+
+%define TITLE_STRING_START	"-=XTIDE Universal BIOS "
+%ifdef USE_AT
+	%define	TITLE_STRING_END	"(AT=-)",NULL
+%elifdef USE_186
+	%define	TITLE_STRING_END	"(XT+=-)",NULL
+%else
+	%define	TITLE_STRING_END	"(XT=-)",NULL
+%endif
+
+%define	TITLE_STRING			TITLE_STRING_START, TITLE_STRING_END
+%define	ROM_VERSION_STRING		"v2.0.0",BETA,"1 (",__DATE__,")",NULL
+%define	FLASH_SIGNATURE			"XTIDE200"	; Do not terminate with NULL
+
+
+%endif ; VERSION_INC
Index: trunk/XTIDE_Universal_BIOS/Src/Main.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Main.asm	(revision 347)
+++ trunk/XTIDE_Universal_BIOS/Src/Main.asm	(revision 358)
@@ -19,4 +19,5 @@
 	; Included .inc files
 	%include "AssemblyLibrary.inc"	; Assembly Library. Must be included first!
+	%include "Version.inc"
 	%include "IntController.inc"	; For Interrupt Controller equates
 	%include "ATA_ID.inc"			; For ATA Drive Information structs
@@ -44,15 +45,7 @@
 	at	ROMVARS.bRomSize,	db	CNT_ROM_BLOCKS	; ROM size in 512B blocks
 	at	ROMVARS.rgbJump,	jmp	Initialize_FromMainBiosRomSearch
-	at	ROMVARS.rgbSign,	db	"XTIDE200"		; Signature for flash program
-	at	ROMVARS.szTitle
-		db	"-=XTIDE Universal BIOS"
-%ifdef USE_AT
-		db	" (AT)=-",NULL
-%elifdef USE_186
-		db	" (XT+)=-",NULL
-%else
-		db	" (XT)=-",NULL
-%endif
-	at	ROMVARS.szVersion,	db	"v2.0.0",BETA,"1 (",__DATE__,")",NULL
+	at	ROMVARS.rgbSign,	db	FLASH_SIGNATURE
+	at	ROMVARS.szTitle,	db	TITLE_STRING
+	at	ROMVARS.szVersion,	db	ROM_VERSION_STRING
 
 ;;; For OR'ing into wFlags below
@@ -187,4 +180,5 @@
 	%include "FindDPT.asm"			; For finding DPTs
 	%include "AccessDPT.asm"		; For accessing DPTs
+	%include "LbaAssist.asm"		; For generating L-CHS parameters to LBA drives
 	%include "BootMenuInfo.asm"		; For creating BOOTMENUINFO structs
 	%include "AtaID.asm"			; For ATA Identify Device information
Index: trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm	(revision 347)
+++ trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm	(revision 358)
@@ -58,12 +58,6 @@
 
 	call	AccessDPT_GetLbaSectorCountToBXDXAX
-	call	AccessDPT_ConvertSectorCountFromBXDXAXtoLbaAssistedCHSinDXAXBLBH
-	test	dx, dx
-	jnz		SHORT .LimitAXtoMaxLCHScylinders
-	cmp		ax, MAX_LCHS_CYLINDERS
-	jb		SHORT .returnLCHS
-.LimitAXtoMaxLCHScylinders:
-	mov		ax, MAX_LCHS_CYLINDERS
-.returnLCHS:
+	call	LbaAssist_ConvertSectorCountFromBXDXAXtoLbaAssistedCHSinDXAXBLBH
+	LIMIT_LBA_CYLINDERS_IN_DXAX_TO_LCHS_CYLINDERS
 	ret
 
@@ -157,89 +151,2 @@
 	and		al, MASKL_DPT_ADDRESSING_MODE
 %endmacro
-
-
-;--------------------------------------------------------------------
-; LBA assist calculation:
-; this is how to fit a big drive into INT13's skimpy size requirements,
-; with a maximum of 8.4G available.
-;
-; total LBAs (as obtained by words 60+61)
-; divided by 63 (sectors per track) (save as value A)
-; Sub 1 from A
-; divide A by 1024 + truncate.
-; == total number of heads to use.
-; add 1
-; this value must be either 16, 32, 64, 128, or 256 (round up)
-; then take the value A above and divide by # of heads
-; to get the # of cylinders to use.
-;
-;
-; so a LBA28 drive will have 268,435,456 as maximum LBAs
-;
-; 10000000h / 63   = 410410h (total cylinders or tracks)
-;   410410h / 1024 = 1041h, which is way more than 256 heads, but 256 is max.
-;   410410h / 256  = 4104h cylinders
-;
-; there's a wealth of information at: http://www.mossywell.com/boot-sequence
-; they show a slightly different approach to LBA assist calulations, but
-; the method here provides compatibility with phoenix BIOS
-;
-; we're using the values from 60+61 here because we're topping out at 8.4G
-; anyway, so there's no need to use the 48bit LBA values.
-;
-; AccessDPT_ConvertSectorCountFromBXDXAXtoLbaAssistedCHStoDXAXBLBH:
-;	Parameters:
-;		BX:DX:AX:	Total number of sectors
-;	Returns:
-;		DX:AX:	Number of cylinders
-;		BH:		Number of sectors per track (always 63)
-;		BL:		Number of heads (16, 32, 64, 128 or 255)
-;	Corrupts registers:
-;		CX
-;--------------------------------------------------------------------
-AccessDPT_ConvertSectorCountFromBXDXAXtoLbaAssistedCHSinDXAXBLBH:
-	push	bp
-	push	si
-
-	; Value A = Total sector count / 63
-	xor		cx, cx
-	push	cx		; Push zero for bits 48...63
-	push	bx
-	push	dx
-	push	ax						; 64-bit sector count now in stack
-	mov		cl, LBA_ASSIST_SPT
-	mov		bp, sp					; SS:BP now points sector count
-	call	Math_DivQWatSSBPbyCX	; Temporary value A now in stack
-
-	; BX = Number of heads =  A / 1024
-	mov		ax, [bp]
-	mov		dx, [bp+2]
-	mov		bx, [bp+4]
-	call	Size_DivideSizeInBXDXAXby1024andIncrementMagnitudeInCX
-
-	; Heads must be 16, 32, 64, 128 or 256 (round up)
-	mov		bx, 256						; Max number of heads
-	test	dx, dx						; 65536 or more heads?
-	jnz		SHORT .GetNumberOfCylinders
-	mov		cx, 128						; Half BX for rounding up
-.FindMostSignificantBitForHeadSize:
-	cmp		ax, cx
-	jae		SHORT .GetNumberOfCylinders
-	shr		cx, 1
-	shr		bx, 1						; Halve number of heads
-	jmp		SHORT .FindMostSignificantBitForHeadSize
-
-	; DX:AX = Number of cylinders = A / number of heads
-.GetNumberOfCylinders:
-	mov		cx, bx
-	call	Math_DivQWatSSBPbyCX
-	mov		ax, [bp]
-	mov		dx, [bp+2]					; Cylinders now in DX:AX
-
-	; Return LBA assisted CHS
-	add		sp, BYTE 8					; Clean stack
-	sub		bl, bh						; Limit heads to 255
-	mov		bh, LBA_ASSIST_SPT
-	pop		si
-	pop		bp
-	ret
Index: trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm	(revision 347)
+++ trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm	(revision 358)
@@ -113,5 +113,5 @@
 .KeepTotalSectorsFromAtaID:
 	mov		bx, [di+DPT.twLbaSectors+4]		; Restore BX
-	call	AccessDPT_ConvertSectorCountFromBXDXAXtoLbaAssistedCHSinDXAXBLBH
+	call	LbaAssist_ConvertSectorCountFromBXDXAXtoLbaAssistedCHSinDXAXBLBH
 	mov		[di+DPT.bLbaHeads], bl
 	jmp		SHORT .StoreBlockMode
Index: trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/LbaAssist.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/LbaAssist.asm	(revision 358)
+++ trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/LbaAssist.asm	(revision 358)
@@ -0,0 +1,94 @@
+; Project name	:	XTIDE Universal BIOS
+; Description	:	Functions for generating L-CHS parameters for
+;					LBA drives.
+;
+;					This file is shared with BIOS Drive Information Tool.
+
+; Section containing code
+SECTION .text
+
+;--------------------------------------------------------------------
+; LBA assist calculation:
+; this is how to fit a big drive into INT13's skimpy size requirements,
+; with a maximum of 8.4G available.
+;
+; total LBAs (as obtained by words 60+61)
+; divided by 63 (sectors per track) (save as value A)
+; Sub 1 from A
+; divide A by 1024 + truncate.
+; == total number of heads to use.
+; add 1
+; this value must be either 16, 32, 64, 128, or 256 (round up)
+; then take the value A above and divide by # of heads
+; to get the # of cylinders to use.
+;
+;
+; so a LBA28 drive will have 268,435,456 as maximum LBAs
+;
+; 10000000h / 63   = 410410h (total cylinders or tracks)
+;   410410h / 1024 = 1041h, which is way more than 256 heads, but 256 is max.
+;   410410h / 256  = 4104h cylinders
+;
+; there's a wealth of information at: http://www.mossywell.com/boot-sequence
+; they show a slightly different approach to LBA assist calulations, but
+; the method here provides compatibility with phoenix BIOS
+;
+; we're using the values from 60+61 here because we're topping out at 8.4G
+; anyway, so there's no need to use the 48bit LBA values.
+;
+; LbaAssist_ConvertSectorCountFromBXDXAXtoLbaAssistedCHSinDXAXBLBH:
+;	Parameters:
+;		BX:DX:AX:	Total number of sectors
+;	Returns:
+;		DX:AX:	Number of cylinders
+;		BH:		Number of sectors per track (always 63)
+;		BL:		Number of heads (16, 32, 64, 128 or 255)
+;	Corrupts registers:
+;		CX
+;--------------------------------------------------------------------
+LbaAssist_ConvertSectorCountFromBXDXAXtoLbaAssistedCHSinDXAXBLBH:
+	push	bp
+	push	si
+
+	; Value A = Total sector count / 63
+	xor		cx, cx
+	push	cx		; Push zero for bits 48...63
+	push	bx
+	push	dx
+	push	ax						; 64-bit sector count now in stack
+	mov		cl, LBA_ASSIST_SPT
+	mov		bp, sp					; SS:BP now points sector count
+	call	Math_DivQWatSSBPbyCX	; Temporary value A now in stack
+
+	; BX = Number of heads =  A / 1024
+	mov		ax, [bp]
+	mov		dx, [bp+2]
+	mov		bx, [bp+4]
+	call	Size_DivideSizeInBXDXAXby1024andIncrementMagnitudeInCX
+
+	; Heads must be 16, 32, 64, 128 or 256 (round up)
+	mov		bx, 256						; Max number of heads
+	test	dx, dx						; 65536 or more heads?
+	jnz		SHORT .GetNumberOfCylinders
+	mov		cx, 128						; Half BX for rounding up
+.FindMostSignificantBitForHeadSize:
+	cmp		ax, cx
+	jae		SHORT .GetNumberOfCylinders
+	shr		cx, 1
+	shr		bx, 1						; Halve number of heads
+	jmp		SHORT .FindMostSignificantBitForHeadSize
+
+	; DX:AX = Number of cylinders = A / number of heads
+.GetNumberOfCylinders:
+	mov		cx, bx
+	call	Math_DivQWatSSBPbyCX
+	mov		ax, [bp]
+	mov		dx, [bp+2]					; Cylinders now in DX:AX
+
+	; Return LBA assisted CHS
+	add		sp, BYTE 8					; Clean stack
+	sub		bl, bh						; Limit heads to 255
+	mov		bh, LBA_ASSIST_SPT
+	pop		si
+	pop		bp
+	ret
