⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 extfunc.asm

📁 <BIOS研发技术剖析>书的源代码,包括完整的BIOS汇编语言源程序.
💻 ASM
📖 第 1 页 / 共 2 页
字号:
        page    ,132
        title   EXTERNAL FUNCTIONS IN SETUP
;---------------------------------------------------------------;
; NOTE: Do not destroy EBP,FS,GS,SS,DS,ES unless otherwise specified.
;---------------------------------------------------------------;
;*****************************************************************;
;*****************************************************************;
;**                                                             **;
;**     (C)Copyright 1985-1996, American Megatrends Inc.        **;
;**                                                             **;
;**                     All Rights Reserved.                    **;
;**                                                             **;
;**             6145-F, Northbelt Parkway, Norcross,            **;
;**                                                             **;
;**             Georgia - 30071, USA. Phone-(770)-246-8600.     **;
;**                                                             **;
;*****************************************************************;
;*****************************************************************;
;*****************************************************************;
;-----------------------------------------------------------------;
; History
;-----------------------------------------------------------------;
; Symbols:
;
; >>>   Modification START
; <<<   Modification END
; +     Code Added
; -     Code Removed
;
; (CORE0218) James Wed 03-03-1999
; Include external functions for setup to display event logs.
;-----------------------------------------------------------------;
; $Header: /BIOS/GENERIC/627/INTEL/440BX/Desktop PIIX4/SYS/EXTFUNC.ASM 5     9/05/97 5:23p Juand $
;
; $Revision: 5 $
;
; $Date: 9/05/97 5:23p $
;*****************************************************************;
;*****************************************************************;
; Revision History
; ----------------
; $Log: /BIOS/GENERIC/627/INTEL/440BX/Desktop PIIX4/SYS/EXTFUNC.ASM $
; 
; 5     9/05/97 5:23p Juand
; Implemented external functions for Standby and Suspend time out
; options.
;
; 3     9/04/97 10:47a Juand
; Changed N/A string and Hex strings for Desktop.
;
; 2     9/03/97 11:26a Juand
; Removed Runtime Functions and used External Functions instead.
;
; 1     8/18/97 4:58p Juand
;
; 6     8/13/97 2:59p Juand
;
; 5     8/06/97 12:26p Juand
;
; 4     8/01/97 11:10a Juand
;
; 3     7/29/97 7:04p Juand
; Added runtime functions for AGP related setup options
;
; 2     7/21/97 2:10p Juand
;
; 1     7/15/97 3:24p Juand
;
; 1     1/31/97 12:46p Debkumar
; New files for 62700.
;
; 2     1/13/97 2:28p Debkumar
; Modified for 6.27.00.
;
; 1     1/02/97 11:40a Debkumar
;
; 5     12/30/96 2:36p Debkumar
; Version 6.26.02
;
; 4     9/03/96 5:15p Mandal
; 6.26 for USA
;
; 1     6/17/96 2:34p Mandal
;
; 3     3/21/96 5:24p Mandal
; (c)1996 and phone no changed.
;
; 2     1/12/96 5:38p Dickh
; Added SourceSafe keywords to track revision history.
;
;*****************************************************************;
;---------------------------------------;
        include setupequ.ext
        include setupmsg.equ
        include makeflag.equ
;---------------------------------------;
;---------------------------------------;
;;Core BIOS Externs
        extrn   _temp_buffer:byte
        extrn   _common_cmos_buffer:byte
        extrn   _old_cmos_buffer:byte
        extrn   get_cmos_reg_mask_x:near
        extrn   get_cmos_buffer_item:near
        extrn   set_cmos_buffer_item:near
        extrn   Get_Language_No:near

        extrn   Get_$_Ptr:near
;---------------------------------------;
;;Chipset BIOS Externs
        extrn   get_vendor_name:near
;---------------------------------------;
cgroup  group   _text
_text   segment word    public  'CODE'
        assume  cs:cgroup
.486p
;---------------------------------------;
        public  _EXTFUNC_STARTS
_EXTFUNC_STARTS label   byte            ; marks start of module
;-----------------------------------------------------------------------;

;; PaiLin debug {
comment !
;---------------------------------------------------------------------------;
;                PCI Grant Timer                                            ;
;---------------------------------------------------------------------------;
Grant_Timer_PCI1 proc near
Grant_Timer_PCI proc near
        push    ax

        mov     di,offset _temp_buffer
        push    di
        push    es
        push    ds
        pop     es
        mov     cx,0fh
        mov     al,STR_RESERVED         ; init 16bytes
        rep     stosb
        mov     al,STR_AUTO
        stosb
        pop     es
        pop     di

        mov     al,Q_PCI_GRANT_TIMER1
        call    get_cmos_buffer_item
        mov     dh, al
        mov     al,Q_PCI_GRANT_TIMER
        call    get_cmos_buffer_item
        mov     dl, al
        pop     ax
        cbw
        add     dx, ax

        mov     al,Q_PCI_GRANT_TIMER
        mov     ah, dl
        call    set_cmos_buffer_item
        mov     al,Q_PCI_GRANT_TIMER1
        mov     ah, dh
        call    set_cmos_buffer_item

        mov     cx, 0
        mov     si,(offset _temp_buffer) + 3
loop_again:
        push    cx
        mov     al, 4
        mul     cl
        mov     cl, al

        mov     ax, dx
        shr     ax, cl
        and     ax, 000fh
        or      al, 30h
        cmp     al, 39h
        jbe     @f
        add     al, 7
@@:
        mov     byte ptr ds:[si], al
        dec     si

        pop     cx
        inc     cx
        cmp     cx, 4
        jb      loop_again

        mov     bx,offset _temp_buffer
        mov     dx,ds
        mov     ah, 00h

        retf
Grant_Timer_PCI endp
Grant_Timer_PCI1        endp
;---------------------------------------------------------------------------;
;                CPU Idle Timer for PCI                                     ;
;---------------------------------------------------------------------------;
Idle_Timer_PCI  proc near
        push    ax

        mov     al,Q_IDLE_TIMER_PCI
        call    get_cmos_buffer_item
        mov     dl, al
        pop     ax
        add     dl, al
        mov     ah, dl
        mov     al,Q_IDLE_TIMER_PCI
        call    set_cmos_buffer_item


        xchg    al,ah
;       aam
;       or      ax,3030h
;       cmp     al,39h
;       jbe     @f
;       add     al,07h
;@@:
;       cmp     ah,39h
;       jbe     @f
;       add     al,07h
;@@:
;       xchg    al,ah
;       mov     bx,offset _temp_buffer
;       mov     ds:[bx],ax
;       xor     al,01
;       mov     ah,00h
;       mov     dx,ds

        mov     dx, ax
        mov     cx, 0
        mov     si,(offset _temp_buffer) + 1
loop_again:
        push    cx
        mov     al, 4
        mul     cl
        mov     cl, al

        mov     ax, dx
        shr     ax, cl
        and     ax, 000fh
        or      al, 30h
        cmp     al, 39h
        jbe     @f
        add     al, 7
@@:
        mov     byte ptr ds:[si], al
        dec     si

        pop     cx
        inc     cx
        cmp     cx, 2
        jb      loop_again

        mov     word ptr ds:[si+3], 0
        mov     bx,offset _temp_buffer
        mov     dx,ds
        mov     ah, 00h

        retf
Idle_Timer_PCI  endp
;---------------------------------------;
end-comment !
;; } PaiLin debug
;---------------------------------------------------------------------------;
;                Share memory size                                          ;
;---------------------------------------------------------------------------;
SHARE_MEMORY_zlist label        byte
db      STR_RESERVED,STR_2MB,STR_4MB,STR_8MB,STR_END
NA_zlist label  byte
db     STR_IT8661F_NA,STR_IT8661F_NA,STR_IT8661F_NA,STR_IT8661F_NA
;db      STR_WIN877_NA,STR_WIN877_NA,STR_WIN877_NA,STR_WIN877_NA

Share_memory    proc near
        mov     ax,cs
        cmp     ax,0f000h
        mov     ah,2
        mov     bx,offset cgroup:SHARE_MEMORY_zlist
        jnz     short setting_done
        mov     al,Q_SHARE_MEMORY
        call    get_cmos_buffer_item
        jnz     setting_done
        mov     ah,3
        mov     bx,offset cgroup:NA_zlist
setting_done:
        mov     dx,cs
        retf
Share_memory    endp
if (MKF_CUSTOMER eq 7788)
;;---------------------------------------------------------------------------;
;;                Share memory size                                         ;
;;---------------------------------------------------------------------------;
DISABLE_ENABLE_zlist label      byte
db      STR_DISABLE,STR_ENABLE
VGA_WRITE_CYCLE proc near
        mov     al,Q_SHARE_MEMORY
        call    get_cmos_buffer_item
        mov     ah,2                    ;default is Normal
        jnz     short @f

        mov     ax,Q_VGA_READ_CYCLE
        call    set_cmos_buffer_item

        mov     ax,Q_VGA_WRITE_CYCLE
        call    set_cmos_buffer_item

        mov     ah,3
@@:
        mov     bx,offset cgroup:DISABLE_ENABLE_zlist
        mov     dx,cs
        retf
VGA_WRITE_CYCLE endp
endif
COMMENT ~
;---------------------------------------------------------------------------;
;                Single_read                                                ;
;---------------------------------------------------------------------------;
SINGLE_READ_zlist label byte
db      STR_DISABLED,STR_ENABLED,str_end

Single_read     proc near
        call    get_vendor_name
        cmp     bl,01
        mov     ah,2                    ;default is Normal
        jne     @f
        mov     al,Q_SINGLE_READ
        xor     ah,ah
        call    set_cmos_buffer_item
        mov     ah,3
@@:
        mov     bx,offset cgroup:SINGLE_READ_zlist
        mov     dx,cs
        retf
Single_read     endp
~

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -