;	[]===========================================================[]
;
;	NOTICE: THIS PROGRAM BELONGS TO AWARD SOFTWARE INTERNATIONAL(R)
;	        INC. IT IS CONSIDERED A TRADE SECRET AND IS NOT TO BE 	
;	        DIVULGED OR USED BY PARTIES WHO HAVE NOT RECEIVED	
;	        WRITTEN AUTHORIZATION FROM THE OWNER.
;
; 	[]===========================================================[]
;

;----------------------------------------------------------------------------
;Rev	Date	 Name	Description
;----------------------------------------------------------------------------
;R07	05/12/98 KVN	Added compiler error and show over size in compiler
;			stage when bootext code size is over allocate space
;R06	04/02/98 KVN	Added extra bootext size for biger memory sizing code
;R05	09/30/96 KVN	Fixed INTEL 28F001BXT EEPROM update bios error if modify
;			chiprun.asm then Get_Ct,Set_ct offset be changed
;R04A	09/20/96 KVN	Don't care "Special_Bootext_Off" define
;R04	04/25/96 KVN	Added "Special_Bootext_Off" define
;R03	03/14/96 KVN	Fixed always execute bootrom code of memory sizing
;R02	11/23/95 KVN	Fixed system hang if modify ct_memory_presence routine
;R01	10/18/95 KVN	Added MXIC FLASH PnP feature support
;R00	03/23/95 KVN	Fix MASM bug

		PAGE	56,132
		TITLE	BOOTROM  -- 386 ROM/BIOS BASE
.386P
;[]-----------------------------------[]
;					
;   Award Software 386/486 BIOS		
;    Base + Initialization Rtns
;   Initial Revision 17-Apr-1990	
;					
;[]-----------------------------------[]

		INCLUDE BIOS.CFG
		INCLUDE COMMON.MAC
		INCLUDE ATORGS.MAC
		INCLUDE POST.MAC

		INCLUDE CMOS.EQU
		INCLUDE COMMON.EQU
		INCLUDE 8042.EQU
		INCLUDE 8254.EQU
		INCLUDE 8259.EQU
		INCLUDE 8237.EQU
		INCLUDE 82077.EQU
		INCLUDE MATHCOP.EQU
		INCLUDE port61.EQU
		INCLUDE akbrd.EQU
		INCLUDE adisk.EQU
		INCLUDE cpu.EQU
		include	BtRomSeg.equ	;R01

;R05		extrn	Get_Ct:Near
;R05		extrn	Set_Ct:Near
;R05		extrn	Get_Set_Ct:Near
;R05		extrn	Move_Codes:Near

SEG_0		SEGMENT	USE16 AT 1
		INCLUDE SEG_0.INC
SEG_0		ENDS

G_RAM		SEGMENT USE16 AT 0

		ORG	400H
		INCLUDE G_RAM.INC

G_RAM		ENDS

DGROUP		GROUP	FCODE
FCODE		SEGMENT	USE16 DWORD PUBLIC 'CODE'
		ASSUME	CS:DGROUP

;R00		DB	0e000h dup (0ffh)
;R00		org	0b000h
;R00		include	chipboot.asm
;R00		include	cpurun.asm
;R01		DB	0b000h dup (0ffh)	;R00
;R04A;R04 start
;R04Aifdef	Special_Bootext_Off
;R04A		DB	Special_Bootext_Off dup (0ffh)
;R04Aelse	;Special_Bootext_Off
;R04A;R04 end
		DB	External_BootRom_Seg dup (0ffh)	;R01
;R04Aendif	;Special_Bootext_Off	;R04

FCODE		ENDS

;R00 start
DGROUP		GROUP	FCODE1
FCODE1		SEGMENT	USE16 DWORD PUBLIC 'CODE'
		ASSUME	CS:DGROUP
BootExt_Start:					;R07

;R01		DB	3000h dup (0ffh)
;R01		org	0
		include	chipboot.asm
		include	cpurun.asm
;R03		org	MEMORY_PRESENCE_OFFSET			;R02
;R04A;R04 start
;R04Aifdef	Special_Bootext_Off
;R04A		org	((External_BootRom_Seg-Special_Bootext_Off) and 0f000h) + MEMORY_PRESENCE_OFFSET
;R04Aelse	;Special_Bootext_Off
;R04A;R04 end
;R06		org	MEMORY_PRESENCE_OFFSET-(External_BootRom_Seg and 0fffh)	;R03
;R06 start
memory_Sizing_offset	=	MEMORY_PRESENCE_OFFSET-(External_BootRom_Seg and 0fffh)
ifdef BootExt_Extra_Size
		memory_Sizing_offset = memory_Sizing_offset+BootExt_Extra_Size
endif ;BootExt_Extra_Size
;R07 start
Print_Mem_Sizing_Size	Macro	Mem_Sizing_SIZE,Over_size
	%OUT ERROR, The Boot External code length(Mem_Sizing_SIZE) is too large and over Over_size bytes
	ENDM

Mem_Sizing_SIZE	=	($-offset BootExt_Start)
if (Mem_Sizing_SIZE GE memory_Sizing_offset)
	if2
	Print_Mem_Sizing_Size %Mem_Sizing_SIZE,%(Mem_Sizing_SIZE-memory_Sizing_offset)
	endif
	.err
endif
;R07 end
		org	memory_Sizing_offset
;R06 end
;R04Aendif	;Special_Bootext_Off	;R04
		dw	offset DGROUP:CT_Memory_Presence	;R02
;R04A;R04 start
;R04Aifdef	Special_Bootext_Off
;R04A		org	0e000h - Special_Bootext_Off
;R04Aelse	;Special_Bootext_Off
;R04A;R04 end
		org	0e000h - External_BootRom_Seg	;R01
;R04Aendif	;Special_Bootext_Off	;R04

FCODE1		ENDS
;R00 end

		END
