Index: trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm	(revision 618)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm	(revision 621)
@@ -52,5 +52,5 @@
 	jne		IdeDPT_Finalize
 	jmp		SerialDPT_Finalize
-%else
+%else ; ~USE_386
 	je		SHORT .FinalizeDptForSerialPortDevice
 	jmp		IdeDPT_Finalize
@@ -100,6 +100,6 @@
 ;		AL, BX, CX, DX, SI, DI, ES
 ;--------------------------------------------------------------------
+%ifndef NO_ATAID_CORRECTION
 Device_IdentifyToBufferInESSIwithDriveSelectByteInBH:
-%ifndef NO_ATAID_CORRECTION
 	cmp		cx, XUB_INT13h_SIGNATURE
 	je		SHORT .DoNotFixAtaInformation
@@ -108,5 +108,4 @@
 	ePUSH_T	cx, AtaID_PopESSIandFixIllegalValuesFromESSI	; Here we modify ATA information if necessary
 .DoNotFixAtaInformation:
-%endif
 
 %ifdef MODULE_SERIAL	; IDE + Serial
@@ -115,5 +114,5 @@
 	jne		IdeCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH
 	jmp		SerialCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH
-%else
+%else ; ~USE_386
 	je		SHORT .IdentifyDriveFromSerialPort
 	jmp		IdeCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH
@@ -126,4 +125,22 @@
 %endif
 
+%else ; NO_ATAID_CORRECTION
+%ifdef MODULE_SERIAL	; IDE + Serial
+	cmp		BYTE [cs:bp+IDEVARS.bDevice], DEVICE_SERIAL_PORT
+%ifdef USE_386
+	jne		IdeCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH
+	jmp		SerialCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH
+%else ; ~USE_386
+	je		SHORT .IdentifyDriveFromSerialPort
+	jmp		IdeCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH
+.IdentifyDriveFromSerialPort:
+	jmp		SerialCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH
+%endif
+
+%else					; IDE
+	Device_IdentifyToBufferInESSIwithDriveSelectByteInBH	EQU		IdeCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH
+%endif
+%endif ; NO_ATAID_CORRECTION
+
 
 ;--------------------------------------------------------------------
@@ -149,5 +166,5 @@
 	jz		IdeCommand_OutputWithParameters
 	jmp		SerialCommand_OutputWithParameters
-%else
+%else ; ~USE_386
 	jnz		SHORT .OutputCommandToSerialPort
 	jmp		IdeCommand_OutputWithParameters
@@ -182,5 +199,5 @@
 ;	jz		IdeCommand_ReadLBAlowRegisterToAL
 ;	jmp		SerialCommand_ReadLBAlowRegisterToAL
-;%else
+;%else ; ~USE_386
 ;	jnz		SHORT .ReadFromSerialPort
 ;	jmp		IdeCommand_ReadLBAlowRegisterToAL
@@ -214,5 +231,5 @@
 	jnz		SHORT ReturnSuccessForSerialPort
 	jmp		IdeCommand_SelectDrive
-%else
+%else ; USE_386
 	jz		IdeCommand_SelectDrive
 	; Fall to ReturnSuccessForSerialPort
@@ -225,5 +242,4 @@
 
 %ifdef MODULE_SERIAL
-ALIGN JUMP_ALIGN
 ReturnSuccessForSerialPort:
 	xor		ax, ax
Index: trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialCommand.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialCommand.asm	(revision 618)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialCommand.asm	(revision 621)
@@ -154,5 +154,5 @@
 
 	push	si
-	call	FindDPT_ToDSDIforSerialDevice
+	call	FindDPT_ToDSDIforSerialDevice	; Preserves AX
 	pop		si
 %ifdef MODULE_SERIAL_FLOPPY
@@ -162,5 +162,5 @@
 ; So, if there was a previously found floppy disk, DI will point to that DPT and we use that value for the slave.
 ;
-	cmp		BYTE [RAMVARS.xlateVars+XLATEVARS.bFlopCntAndFirst], 0
+	cmp		[RAMVARS.xlateVars+XLATEVARS.bFlopCntAndFirst], al	; Zero?
 	je		SHORT .notfounddpt
 .founddpt:
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm	(revision 618)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm	(revision 621)
@@ -203,7 +203,17 @@
 ;--------------------------------------------------------------------
 Interrupts_UnmaskInterruptControllerForDriveInDSDI:
-	eMOVZX	bx, [di+DPT.bIdevarsOffset]
+	eMOVZX	bx, [di+DPT.bIdevarsOffset]		; Clears CF on pre-386 CPUs
+%ifndef USE_386
+%ifdef USE_UNDOC_INTEL
+	salc
+	or		al, [cs:bx+IDEVARS.bIRQ]
+%else
 	mov		al, [cs:bx+IDEVARS.bIRQ]
 	test	al, al
+%endif
+%else ; USE_386
+	mov		al, [cs:bx+IDEVARS.bIRQ]
+	test	al, al
+%endif
 	jz		SHORT .Return	; Interrupts disabled
 	cmp		al, 8
Index: trunk/XTIDE_Universal_BIOS/Src/Main.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Main.asm	(revision 618)
+++ trunk/XTIDE_Universal_BIOS/Src/Main.asm	(revision 621)
@@ -96,5 +96,7 @@
 	at	ROMVARS.ideVars0+IDEVARS.wControlBlockPort,	dw	DEVICE_ATA_PRIMARY_PORTCTRL 	; Controller Control Block base port
 	at	ROMVARS.ideVars0+IDEVARS.bDevice,			db	DEVICE_16BIT_ATA
+%ifdef MODULE_IRQ
 	at	ROMVARS.ideVars0+IDEVARS.bIRQ,				db	14
+%endif
 	at	ROMVARS.ideVars0+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags,	dw	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
 	at	ROMVARS.ideVars0+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags,	dw	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
@@ -103,5 +105,7 @@
 	at	ROMVARS.ideVars1+IDEVARS.wControlBlockPort,	dw	DEVICE_ATA_SECONDARY_PORTCTRL
 	at	ROMVARS.ideVars1+IDEVARS.bDevice,			db	DEVICE_16BIT_ATA
+%ifdef MODULE_IRQ
 	at	ROMVARS.ideVars1+IDEVARS.bIRQ,				db	15
+%endif
 	at	ROMVARS.ideVars1+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags,	dw	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
 	at	ROMVARS.ideVars1+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags,	dw	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
@@ -110,5 +114,7 @@
 	at	ROMVARS.ideVars2+IDEVARS.wControlBlockPort,	dw	DEVICE_ATA_TERTIARY_PORTCTRL
 	at	ROMVARS.ideVars2+IDEVARS.bDevice,			db	DEVICE_16BIT_ATA
+%ifdef MODULE_IRQ
 	at	ROMVARS.ideVars2+IDEVARS.bIRQ,				db	0	; Should be 11 on the GSI Inc. Model 2C
+%endif
 	at	ROMVARS.ideVars2+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags,	dw	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
 	at	ROMVARS.ideVars2+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags,	dw	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
@@ -117,5 +123,7 @@
 	at	ROMVARS.ideVars3+IDEVARS.wControlBlockPort,	dw	DEVICE_ATA_QUATERNARY_PORTCTRL
 	at	ROMVARS.ideVars3+IDEVARS.bDevice,			db	DEVICE_16BIT_ATA
+%ifdef MODULE_IRQ
 	at	ROMVARS.ideVars3+IDEVARS.bIRQ,				db	0	; Should be 10 on the GSI Inc. Model 2C
+%endif
 	at	ROMVARS.ideVars3+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags,	dw	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
 	at	ROMVARS.ideVars3+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags,	dw	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
Index: trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrint.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrint.asm	(revision 618)
+++ trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrint.asm	(revision 621)
@@ -123,9 +123,9 @@
 .around:
 
-	mov		ax, g_szFddSizeOr							; .PrintXTFloppyType
+	mov		ax, g_szFddSizeOr
 	test	bl, bl										; Two possibilities? (FLOPPY_TYPE_525_OR_35_DD)
 	jz		SHORT .PushAXAndOutput
 
-	mov		al, (g_szFddUnknown - $$) & 0xff			; .PrintUnknownFloppyType
+	mov		al, (g_szFddUnknown - $$) & 0xff
 	cmp		bl, FLOPPY_TYPE_35_ED
 	ja		SHORT .PushAXAndOutput
@@ -218,6 +218,6 @@
 
 .ConvertSectorCountInBXDXAXtoSizeAndPushForFormat:
+	call	Size_ConvertSectorCountInBXDXAXtoKiB
 	ePUSH_T	cx, g_szCapacityNum		; Push format substring
-	call	Size_ConvertSectorCountInBXDXAXtoKiB
 	mov		cx, BYTE_MULTIPLES.kiB
 	call	Size_GetSizeToAXAndCharToDLfromBXDXAXwithMagnitudeInCX
Index: trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm	(revision 618)
+++ trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm	(revision 621)
@@ -137,5 +137,5 @@
 ;--------------------------------------------------------------------
 ; Iteration routines for FindDPT_MasterOrSingleForIdevarsOffsetInDL and
-; FindDPT_SlaveForIdevarsOffsetInDL, for use with IterateAllDPTs
+; FindDPT_SlaveForIdevarsOffsetInDL, for use with FindDPT_IterateAllDPTs
 ;
 ; Returns when DPT is found on the controller with Idevars offset in DL
@@ -152,15 +152,14 @@
 IterateFindSecondDPTforIdevars:
 	call	IterateFindFirstDPTforIdevars
-	jc		SHORT .WrongController
+	jc		SHORT WrongController
 	mov		si, IterateFindFirstDPTforIdevars
-.WrongController:
+SetCFandReturn:
 	stc
+WrongController:
 	ret
 
 IterateFindFirstDPTforIdevars:
 	cmp		dl, [di+DPT.bIdevarsOffset]			; Clears CF if matched
-	je		.Done
-	stc											; Set CF for not found
-.Done:
+	jne		SHORT SetCFandReturn
 	ret
 
@@ -221,5 +220,5 @@
 ;				Set if DPT not found, or no DPTs present
 ;	Corrupts registers:
-;		SI
+;		BL, SI
 ;--------------------------------------------------------------------
 %ifdef MODULE_SERIAL
@@ -315,5 +314,4 @@
 	loop	.LoopWhileDPTsLeft
 
-ALIGN JUMP_ALIGN
 .NotFound:
 	stc
Index: trunk/XTIDE_Universal_BIOS/makefile
===================================================================
--- trunk/XTIDE_Universal_BIOS/makefile	(revision 618)
+++ trunk/XTIDE_Universal_BIOS/makefile	(revision 621)
@@ -231,6 +231,6 @@
 
 custom:
-	@$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_CUSTOM) -l"$(TARGET)_custom.lst" -o"$(TARGET)_custom.bin"
-	@echo * Custom version "$(TARGET)_custom.bin" built.
+	@$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_CUSTOM) -l"$(TARGET)_cstm.lst" -o"$(TARGET)_cstm.bin"
+	@echo * Custom version "$(TARGET)_cstm.bin" built.
 
 strings: src\Strings.asm
