windows-nt/Source/XPSP1/NT/base/mvdm/wow16/drivers/neccomm2/delay.asm

212 lines
7.4 KiB
NASM
Raw Permalink Normal View History

2020-09-26 03:20:57 -05:00
;#########################################################################
;## <09>c<EFBFBD>d<EFBFBD>k<EFBFBD>`<60>x<EFBFBD>@<40><><EFBFBD>[<5B>`<60><> ##
;## <09>@<40>w<EFBFBD><EFBFBD><EFBFBD><EA82BD><EFBFBD>Ԃ<EFBFBD><D482><EFBFBD><EFBFBD>҂ƒ<D282><C283>[<5B>`<60><><EFBFBD>i<EFBFBD>P<EFBFBD>ʂ<EFBFBD><CA82><EFBFBD><EFBFBD>j ##
;## ##
;## <09><EFBFBD>ƂȂ<C682><C882>b<EFBFBD>o<EFBFBD>t<EFBFBD>N<EFBFBD><4E><EFBFBD>b<EFBFBD>N ##
;## <09>u<EFBFBD>R<EFBFBD>O<EFBFBD>F<EFBFBD>P<EFBFBD>O<EFBFBD>l<EFBFBD>gZ (PC-9801UV21) ##
;## <09>Q<EFBFBD>W<EFBFBD>U<EFBFBD>F<EFBFBD>P<EFBFBD>Q<EFBFBD>l<EFBFBD>gZ (PC-9801RX2) ##
;## <09>R<EFBFBD>W<EFBFBD>U<EFBFBD>F<EFBFBD>Q<EFBFBD>O<EFBFBD>l<EFBFBD>gZ (PC-98RL N-MODE) ##
;## <09>m<EFBFBD>o<EFBFBD>b<EFBFBD>F<EFBFBD>R<EFBFBD>R<EFBFBD>l<EFBFBD>gZ (PC-H98 Model70) ##
;## ##
;## <09>@<40><><EFBFBD>F<EFBFBD><46><EFBFBD>s<EFBFBD>@<40>̏ꍇ<CC8F>A<EFBFBD><EFBFBD>N<EFBFBD><4E><EFBFBD>b<EFBFBD>N<EFBFBD>ȊO<C88A>ł́A<CD81><41><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EB8DB7><EFBFBD>ł܂<C582> ##
;## ##
;## <09><><EFBFBD>́F<CD81>b<EFBFBD>w<EFBFBD>Ɂ@<40>҂<EFBFBD><D282><EFBFBD><EFBFBD>ԁi<D481><69><EFBFBD><EFBFBD><EFBFBD>j<EFBFBD><6A><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>B ##
;## <09>o<EFBFBD>́F<CD81>Ȃ<EFBFBD> ##
;## <09>j<EFBFBD>󂷂郌<F382B782>W<EFBFBD>X<EFBFBD>^<5E>F<EFBFBD>b<EFBFBD>w<EFBFBD>A<EFBFBD>t<EFBFBD><74><EFBFBD>O ##
;## ##
;##---------------------------------------------------------------------##
;##<23>@<40>@<40>ύX<CF8D><58><EFBFBD><EFBFBD> ##
;## DATE | Ver | ##
;## -------------------------------------------------------------- ##
;## 90-04-24 | 1.00 | Original ##
;## ##
;#########################################################################
;---------------------- <09>k<EFBFBD>n<EFBFBD>n<EFBFBD>o<EFBFBD><6F><EFBFBD><EFBFBD> --------------------------------------
_V30_DELAY_ EQU 550 ;<3B>u<EFBFBD>R<EFBFBD>O<EFBFBD>@<40><><EFBFBD><EFBFBD><EFBFBD>͂<EFBFBD><CD82><EFBFBD><EFBFBD>ł<EFBFBD><C582><EFBFBD><EFBFBD><EFBFBD>
_286_DELAY_ EQU 1070 ;<3B>Q<EFBFBD>W<EFBFBD>U<EFBFBD>@<40><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
_386_DELAY_ EQU 1600 ;<3B>R<EFBFBD>W<EFBFBD>U<EFBFBD>@
_DELAY_COUNT_ EQU 307 ;<3B>m<EFBFBD>o<EFBFBD>b
;--------------------------------------------------------------------------
;########################################################################
;# <09>f<EFBFBD>[<5B>^<5E><> #
;########################################################################
;;;;; _BIOS_FLAG1_ DB 0 ;[0:458H]<5D>̓<EFBFBD><CC93>e (del 90.10.6)
;;;;; _BIOS_FLAG2_ DB 0 ;[0:480H]<5D>̓<EFBFBD><CC93>e (del 90.10.6)
;;;;; _CPU_ DW 0 ;<3B><><EFBFBD>s<EFBFBD>@<40>́A<CC81>_<EFBFBD>~<7E>[<5B><><EFBFBD>[<5B>v<EFBFBD><76><EFBFBD><EFBFBD> (del 90.10.6)
;;;;; _TIME_ DW 0 ;<3B>ڕW<DA95><57><EFBFBD><EFBFBD> (del 90.10.6)
;;;;; _MUKASI_ DW 0 ;<3B><><EFBFBD>‘O<C291>̎<EFBFBD><CC8E><EFBFBD> (del 90.10.6)
;************************************************************************
;* <09>^<5E>C<EFBFBD><43><EFBFBD>X<EFBFBD>^<5E><><EFBFBD>p<EFBFBD>F<EFBFBD>҂<EFBFBD><D282><EFBFBD><EFBFBD>Ԑ<EFBFBD><D490><EFBFBD><EFBFBD>Ɏg<C98E>p<EFBFBD><70><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD>~<7E>[<5B><><EFBFBD>[<5B>v<EFBFBD><76><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
;* <09>h<EFBFBD>^<5E>n<EFBFBD><6E><EFBFBD>J<EFBFBD>o<EFBFBD><6F><EFBFBD>[<5B>^<5E>C<EFBFBD><43><EFBFBD>̕ۏ؂Ɏg<C98E>p<EFBFBD><70><EFBFBD><EFBFBD><EFBFBD>B *
;* <09><><EFBFBD><EFBFBD><EFBFBD>ł́A<CD81><41><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\<5C>`<60>q<EFBFBD>s<EFBFBD>h<EFBFBD>b<EFBFBD>|<7C>[<5B>g<EFBFBD><67><EFBFBD>p<EFBFBD><70><EFBFBD><EFBFBD><EFBFBD>B *
;* <09><><EFBFBD><EFBFBD><EFBFBD>\<5C>F <09>R<EFBFBD>D<EFBFBD>Q<EFBFBD>U<EFBFBD>@<40>@ <09>ʂ<EFBFBD> *
;* <09>ő<EFBFBD><C591>l<EFBFBD>F <09>P<EFBFBD>O<EFBFBD>U<EFBFBD>D<EFBFBD>W<EFBFBD>@ <09><><EFBFBD><EFBFBD> *
;* <09>A<EFBFBD>h<EFBFBD><68><EFBFBD>X<EFBFBD>F <09>O<EFBFBD>O<EFBFBD>T<EFBFBD>b <09>g<EFBFBD>i<EFBFBD><69><EFBFBD>[<5B>h<EFBFBD>j *
;************************************************************************
_ARTIC_LOW_ EQU 005CH ;<3B>^<5E>C<EFBFBD><43><EFBFBD>X<EFBFBD>^<5E><><EFBFBD>p<EFBFBD>h<EFBFBD>^<5E>n port
MSR_DELAY:
PUSH AX ;<3B>g<EFBFBD>p<EFBFBD><70><EFBFBD><EFBFBD>W<EFBFBD>X<EFBFBD>^<5E><><EFBFBD>ޔ<EFBFBD>
PUSH BX ;<3B>g<EFBFBD>p<EFBFBD><70><EFBFBD><EFBFBD>W<EFBFBD>X<EFBFBD>^<5E><><EFBFBD>ޔ<EFBFBD>
PUSH DX ;<3B>g<EFBFBD>p<EFBFBD><70><EFBFBD><EFBFBD>W<EFBFBD>X<EFBFBD>^<5E><><EFBFBD>ޔ<EFBFBD>
push es ; (90.10.6)
PUSH DS ;<3B>f<EFBFBD>[<5B>^<5E>Z<EFBFBD>O<EFBFBD><4F><EFBFBD><EFBFBD><EFBFBD>g<EFBFBD><67><EFBFBD>W<EFBFBD>X<EFBFBD>^<5E><><EFBFBD>ޔ<EFBFBD>
push ds ; (90.10.6)
pop es ; (90.10.6)
;************************************************************************
;* <09>b<EFBFBD>o<EFBFBD>t<EFBFBD>̂<EFBFBD><CC82><EFBFBD><EFBFBD>킯 *
;* <09>|<7C>|<7C>|<7C>|<7C>|<7C>|<7C>|<7C>a<EFBFBD>h<EFBFBD>n<EFBFBD>r<EFBFBD>e<EFBFBD>k<EFBFBD>`<60>f<EFBFBD><66><EFBFBD>Q<EFBFBD>Ƃ<EFBFBD><C682><EFBFBD> *
;************************************************************************
mov ax, 40h ;
mov ds, ax ;
;----------------<2D>m<EFBFBD>o<EFBFBD>b<EFBFBD><62><EFBFBD>ǂ<EFBFBD><C782><EFBFBD><EFBFBD>𔻒f------------------------------------
MOV AL,BYTE PTR DS:[58H] ;40:58<35>̓<EFBFBD><CC93>e<EFBFBD><65>AL<41>ɓ<EFBFBD><C993><EFBFBD><EFBFBD><EFBFBD>
MOV BYTE PTR ES:_BIOS_FLAG1_,AL
;----------------<2D><><EFBFBD>s<EFBFBD>@<40>̂ǂ̂b<CC82>o<EFBFBD>t<EFBFBD><74><EFBFBD>𔻒f------------------------------
MOV AL,BYTE PTR DS:[80H] ;40:80<38>̓<EFBFBD><CC93>e<EFBFBD><65>AL<41>ɓ<EFBFBD><C993><EFBFBD><EFBFBD><EFBFBD>
MOV BYTE PTR ES:_BIOS_FLAG2_,AL
MOV AL,BYTE PTR DS:[5BH] ;40:5B<35>̓<EFBFBD><CC93>e<EFBFBD><65>AL<41>ɓ<EFBFBD><C993><EFBFBD><EFBFBD><EFBFBD> (93.03.09)
MOV BYTE PTR ES:_BIOS_FLAG3_,AL ;(93.03.09)
POP DS ;<3B>f<EFBFBD>[<5B>^<5E>Z<EFBFBD>O<EFBFBD><4F><EFBFBD><EFBFBD><EFBFBD>g<EFBFBD><67><EFBFBD>W<EFBFBD>X<EFBFBD>^<5E>𕜋A
AND BYTE PTR _BIOS_FLAG1_,80H ;<3B><><EFBFBD>V<EFBFBD>r<EFBFBD>b<EFBFBD>g<EFBFBD>ȊO<C88A><4F><EFBFBD>O<EFBFBD>Ń}<7D>X<EFBFBD>N<EFBFBD><4E><EFBFBD><EFBFBD>
JNZ _NPC_
AND BYTE PTR ES:_BIOS_FLAG3_,04H ;(93.03.09)
JNZ _NPC_ ;(93.03.09)
AND BYTE PTR _BIOS_FLAG2_,03H ;<3B><>0,1<>r<EFBFBD>b<EFBFBD>g<EFBFBD>ȊO<C88A><4F>0<EFBFBD>Ń}<7D>X<EFBFBD>N<EFBFBD><4E><EFBFBD><EFBFBD>
JZ _V30_ ;<3B><>0,1<>r<EFBFBD>b<EFBFBD>g<EFBFBD><67><EFBFBD>00<30><30>Ȃ<EFBFBD><C882>΂u<CE82>R<EFBFBD>O
CMP BYTE PTR _BIOS_FLAG2_,01H ;<3B><>0,1<>r<EFBFBD>b<EFBFBD>g<EFBFBD><67><EFBFBD>01<30><31>Ȃ<EFBFBD><C882>΂Q<CE82>W<EFBFBD>U
JE _I286_
;########################################################################
;# <09><><EFBFBD>s<EFBFBD>@<40>̎<EFBFBD> #
;########################################################################
_I386_: ;<3B>b<EFBFBD>o<EFBFBD>t<EFBFBD>͂R<CD82>W<EFBFBD>U
MOV WORD PTR _CPU_,_386_DELAY_ ;386<38>̎<EFBFBD><CC8E><EFBFBD>CPU=_386_DELAY_<59>ɂ<EFBFBD><C982><EFBFBD>
JMP short _EXIT_CPU_
_V30_: ;<3B>b<EFBFBD>o<EFBFBD>t<EFBFBD>͂u<CD82>R<EFBFBD>O
MOV WORD PTR _CPU_,_V30_DELAY_ ;V30<33>̎<EFBFBD><CC8E><EFBFBD>CPU=_V30_DELAY_<59>ɂ<EFBFBD><C982><EFBFBD>
JMP short _EXIT_CPU_
_I286_: ;<3B>b<EFBFBD>o<EFBFBD>t<EFBFBD>͂Q<CD82>W<EFBFBD>U
MOV WORD PTR _CPU_,_286_DELAY_ ;286<38>̎<EFBFBD><CC8E><EFBFBD>CPU=_286_DELAY_<59>ɂ<EFBFBD><C982><EFBFBD>
_EXIT_CPU_:
;---------------------------------------------- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̏<EFBFBD><CC8F><EFBFBD><EFBFBD>ŁA<C581>P<EFBFBD><50><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
; <09>Ȃ<EFBFBD><C882><EFBFBD>ɂ<EFBFBD><C982><EFBFBD>
;
PUSH CX ;<3B>J<EFBFBD>E<EFBFBD><45><EFBFBD>^<5E>̓<EFBFBD><CC93>e<EFBFBD><65><EFBFBD>ޔ<EFBFBD>
MOV CX,_CPU_ ;<3B>b<EFBFBD>w<EFBFBD><77><EFBFBD>Q<EFBFBD>b<EFBFBD>o<EFBFBD>t<EFBFBD>Q
; ~~~~<7E><><EFBFBD>̒l<CC92><6C><EFBFBD>@<40><EFBFBD>Ƃɕς<C995><CF82><EFBFBD>
_LOOP2_: ;
LOOP _LOOP2_ ;CX=CX-1 : IF ( CX == 0 ) GOTO _LOOP2_
POP CX ;<3B>J<EFBFBD>E<EFBFBD><45><EFBFBD>^<5E>̓<EFBFBD><CC93>e<EFBFBD>𕜋A
;
;----------------------------------------------
LOOP _EXIT_CPU_ ;CX=CX-1 : IF ( CX == 0 ) GOTO LOOP1
pop es
POP DX ;<3B>ޔ<EFBFBD><DE94><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>W<EFBFBD>X<EFBFBD>^<5E>𕜋A
POP BX ;<3B>ޔ<EFBFBD><DE94><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>W<EFBFBD>X<EFBFBD>^<5E>𕜋A
POP AX ;<3B>ޔ<EFBFBD><DE94><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>W<EFBFBD>X<EFBFBD>^<5E>𕜋A
RET ;RETURN
;########################################################################
;# <09>m<EFBFBD>o<EFBFBD>b<EFBFBD>̎<EFBFBD> #
;########################################################################
_NPC_:
CALL _NPC_DELAY_ ;<3B>P<EFBFBD><50><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>[<5B>`<60><>
LOOP _NPC_ ;CX=CX-1
; : IF ( CX == 0 ) GOTO LOOP1
pop es ;(INS.91.1.14)
POP DX ;<3B>ޔ<EFBFBD><DE94><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>W<EFBFBD>X<EFBFBD>^<5E>𕜋A
POP BX ;<3B>ޔ<EFBFBD><DE94><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>W<EFBFBD>X<EFBFBD>^<5E>𕜋A
POP AX ;<3B>ޔ<EFBFBD><DE94><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>W<EFBFBD>X<EFBFBD>^<5E>𕜋A
RET
_NPC_DELAY_:
PUSH CX
MOV DX,_ARTIC_LOW_ ;<3B>`<60>q<EFBFBD>s<EFBFBD>h<EFBFBD>b<EFBFBD>|<7C>[<5B>g<EFBFBD>̓<EFBFBD><CC93>e<EFBFBD><65>
;<3B>c<EFBFBD>w<EFBFBD>ɂ<EFBFBD><C982><EFBFBD><EFBFBD><EFBFBD>
IN AX,DX ;<3B>`<60>q<EFBFBD>s<EFBFBD>h<EFBFBD>b<EFBFBD>|<7C>[<5B>g<EFBFBD><67><EFBFBD><EFBFBD><EFBFBD>`<60>w<EFBFBD><77>
;<3B>f<EFBFBD>[<5B>^<5E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
MOV BX,AX ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԃ<EFBFBD><D482>ۑ<EFBFBD>
MOV CX,_DELAY_COUNT_ ;<3B>ݒ莞<DD92>Ԃ<EFBFBD><D482>b<EFBFBD>w<EFBFBD>ɓ<EFBFBD><C993><EFBFBD><EFBFBD><EFBFBD>
ADD CX,BX ;<3B>ڕW<DA95><57><EFBFBD>Ԑݒ<D490>
MOV _TIME_,CX ;<3B>ڕW<DA95><57><EFBFBD>Ԃ<EFBFBD><D482>b<EFBFBD>`<60>j<EFBFBD>d<EFBFBD>Ɋi<C98A>[
JNC _POPO_
;******************************************************************************
;* 0 7FFF FFFF *
;* 1========<3D><>-----------------1-----------<2D>~==========<3D><>============1 *
;* <20><> <20><> <09>@ <20><> *
;*<2A>@<40>@<40>@<40>@<40>@<40>@<40>ڕW<DA95><57><EFBFBD>ԁF<D481>b<EFBFBD>`<60>j<EFBFBD>d <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԁF<D481>a<EFBFBD>w<EFBFBD>@<40>@<40><><EFBFBD>ݎ<EFBFBD><DD8E>ԁF<D481>`<60>w <20>@ *
;* *
;* *
;* <20>̎<EFBFBD> *
;* *
;******************************************************************************
MOV _MUKASI_,BX ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBF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BFBD>‘O<C291>̎<EFBFBD><CC8E>Ԃ<EFBFBD>_MUKASI_<49><5F>
; <20><><EFBFBD><EFBFBD><EFBFBD>Ă<EFBFBD><C482><EFBFBD>
JMP _YOMU1_ ;<3B><><EFBFBD>[<5B>v
;******************************************************************************
;* 0 7FFF FFFF *
;* 1--------<2D>~============<3D><>====1=============<3D><>---------------------1 *
;* <20><> <20><> <20><> *
;*<2A>@<40>@<40><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԁF<D481>a<EFBFBD>w<EFBFBD>@<40>@<40>@<40><><EFBFBD>ݎ<EFBFBD><DD8E>ԁF<D481>`<60>w<EFBFBD>@<40>@<40>@<40>@<40>ڕW<DA95><57><EFBFBD>ԁF<D481>b<EFBFBD>`<60>j<EFBFBD>d *
;* *
;* *
;* <20>̎<EFBFBD> *
;* *
;******************************************************************************
_POPO_:
IN AX,DX ;<3B><><EFBFBD>ݎ<EFBFBD><DD8E>Ԃ<EFBFBD><D482>`<60>w<EFBFBD>ɓ<EFBFBD><C993><EFBFBD><EFBFBD><EFBFBD>
CMP _TIME_,AX ;<3B>ڕW<DA95><57><EFBFBD>Ԃ܂łȂ<C582><C882><EFBFBD><EFBFBD><EFBFBD><EFBFBD>H
JA _POPO_ ;<3B>m<EFBFBD><6D><EFBFBD>F<EFBFBD>܂<EFBFBD><DC82>ڕW<DA95><57><EFBFBD>Ԃł͂Ȃ<CD82>
POP CX
RET ;END NPC_RTN