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

📄 lib386.txt

📁 操作系统设计与实现源码
💻 TXT
📖 第 1 页 / 共 5 页
字号:
04709	        wait
04710	        ret

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
			src/lib/i386/em/em_ngf8.s	 	 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

04800	.sect .text; .sect .rom; .sect .data; .sect .bss
04801	.define .ngf8
04802	
04803	        .sect .text
04804	.ngf8:
04805	        mov     bx,sp
04806	        fldd    4(bx)
04807	        fchs
04808	        fstpd   4(bx)
04809	        wait
04810	        ret

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
			src/lib/i386/em/em_ngi.s	 	 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

04900	.sect .text; .sect .rom; .sect .data; .sect .bss
04901	.sect .text
04902	.define .ngi
04903	
04904	        ! #bytes in eax
04905	.ngi:
04906	        pop     ebx              ! return address
04907	        cmp     eax,4
04908	        jne     1f
04909	        pop     ecx
04910	        neg     ecx
04911	        push    ecx
04912	        jmp     ebx
04913	1:
04914	.extern EODDZ
04915	.extern .trp
04916	        mov     eax,EODDZ
04917	        push    ebx
04918	        jmp     .trp

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
			src/lib/i386/em/em_nop.s	 	 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

05000	.sect .text; .sect .rom; .sect .data; .sect .bss
05001	.sect .text
05002	.define .nop
05003	.extern printd, printc, hol0
05004	
05005	.nop:
05006	        mov     eax,(hol0)
05007	        call    printd
05008	        movb    al,'\n'
05009	        jmp     printc

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
			src/lib/i386/em/em_print.s	 	 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

05100	.sect .text; .sect .rom; .sect .data; .sect .bss
05101	.sect .text
05102	.define printc,printd,prints
05103	
05104	        ! argument in eax
05105	        ! uses ebx
05106	prints:
05107	        xchg    eax,ebx
05108	1:
05109	        movb    al,(ebx)
05110	        inc     ebx
05111	        testb   al,al
05112	        jz      2f
05113	        call    printc
05114	        jmp     1b
05115	2:
05116	        ret
05117	
05118	        ! argument in eax
05119	        ! uses ecx and edx
05120	printd:
05121	        xor     edx,edx
05122	        mov     ecx,10
05123	        div     ecx
05124	        test    eax,eax
05125	        jz      1f
05126	        push    edx
05127	        call    printd
05128	        pop     edx
05129	1:
05130	        xchg    eax,edx
05131	        addb    al,'0'
05132	
05133	        ! argument in eax
05134	printc:
05135	        push    eax
05136	        mov     ebx,esp
05137	        mov     eax,1
05138	        push    eax
05139	        push    ebx
05140	        push    eax
05141	        call    __write
05142	        pop     ebx
05143	        pop     ebx
05144	        pop     ebx
05145	        pop     ebx
05146	        ret

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
			src/lib/i386/em/em_rck.s	 	 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

05200	.sect .text; .sect .rom; .sect .data; .sect .bss
05201	.sect .text
05202	.define .rck
05203	
05204	        ! descriptor address in ebx
05205	        ! value in eax, must be left there
05206	.rck:
05207	        cmp     eax,(ebx)
05208	        jl      2f
05209	        cmp     eax,4(ebx)
05210	        jg      2f
05211	        ret
05212	2:
05213	        push    eax
05214	.extern ERANGE
05215	.extern .error
05216	        mov     eax,ERANGE
05217	        call    .error
05218	        pop     eax
05219	        ret

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
			src/lib/i386/em/em_rmi.s	 	 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

05300	.sect .text; .sect .rom; .sect .data; .sect .bss
05301	.sect .text
05302	.define .rmi
05303	
05304	        ! #bytes in eax
05305	.rmi:
05306	        pop     ebx              ! return address
05307	        cmp     eax,4
05308	        jne     1f
05309	        pop     eax
05310	        cwd
05311	        pop     ecx
05312	        idiv    ecx
05313	        push    edx
05314	        jmp     ebx
05315	1:
05316	.extern EODDZ
05317	.extern .trp
05318	        mov     eax,EODDZ
05319	        push    ebx
05320	        jmp     .trp

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
			src/lib/i386/em/em_rmu.s	 	 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

05400	.sect .text; .sect .rom; .sect .data; .sect .bss
05401	.sect .text
05402	.define .rmu
05403	
05404	        ! #bytes in eax
05405	.rmu:
05406	        pop     ebx              ! return address
05407	        cmp     eax,4
05408	        jne     1f
05409	        pop     eax
05410	        xor     edx,edx
05411	        pop     ecx
05412	        idiv    ecx
05413	        push    edx
05414	        jmp     ebx
05415	1:
05416	.extern EODDZ
05417	.extern .trp
05418	        mov     eax,EODDZ
05419	        push    ebx
05420	        jmp     .trp

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
			src/lib/i386/em/em_rol.s	 	 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

05500	.sect .text; .sect .rom; .sect .data; .sect .bss
05501	.sect .text
05502	.define .rol
05503	
05504	        ! #bytes in eax
05505	.rol:
05506	        pop     edx              ! return address
05507	        cmp     eax,4
05508	        jne     1f
05509	        pop     eax
05510	        pop     ecx
05511	        rol     eax,cl
05512	        push    eax
05513	        jmp     edx
05514	1:
05515	.extern EODDZ
05516	.extern .trp
05517	        mov     eax,EODDZ
05518	        push    edx
05519	        jmp     .trp

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
			src/lib/i386/em/em_ror.s	 	 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

05600	.sect .text; .sect .rom; .sect .data; .sect .bss
05601	.sect .text
05602	.define .ror
05603	
05604	        ! #bytes in eax
05605	.ror:
05606	        pop     edx              ! return address
05607	        cmp     eax,4
05608	        jne     1f
05609	        pop     eax
05610	        pop     ecx
05611	        ror     eax,cl
05612	        push    eax
05613	        jmp     edx
05614	1:
05615	.extern EODDZ
05616	.extern .trp
05617	        mov     eax,EODDZ
05618	        push    edx
05619	        jmp     .trp

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
			src/lib/i386/em/em_sar4.s	 	 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

05700	.sect .text; .sect .rom; .sect .data; .sect .bss
05701	.sect .text
05702	.define .sar4
05703	
05704	.sar4:
05705	                                ! ebx, descriptor address
05706	                                ! eax, index
05707	        sub     eax,(ebx)
05708	        mov     ecx,8(ebx)
05709	        imul    ecx
05710	        pop     ebx
05711	        pop     edx             ! base address
05712	        add     edx,eax
05713	        sar     ecx,1
05714	        jnb     1f
05715	        pop     eax
05716	        movb    (edx),al
05717	        jmp     ebx
05718	1:
05719	        sar     ecx,1
05720	        jnb     1f
05721	        pop     eax
05722	        o16 mov (edx),ax
05723	        jmp     ebx
05724	1:
05725	        xchg    edi,edx         ! edi = base address, edx is saved edi
05726	        mov     eax,esi
05727	        mov     esi,esp
05728	        rep movs
05729	        mov     esp,esi
05730	        mov     esi,eax
05731	        mov     edi,edx
05732	        jmp     ebx

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
			src/lib/i386/em/em_sbf4.s	 	 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

05800	.sect .text; .sect .rom; .sect .data; .sect .bss
05801	.define .sbf4
05802	
05803	        .sect .text
05804	.sbf4:
05805	        mov     bx,sp
05806	        flds    8(bx)
05807	        fsubs   4(bx)
05808	        fstps   8(bx)
05809	        wait
05810	        ret

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
			src/lib/i386/em/em_sbf8.s	 	 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

05900	.sect .text; .sect .rom; .sect .data; .sect .bss
05901	.define .sbf8
05902	
05903	        .sect .text
05904	.sbf8:
05905	        mov     bx,sp
05906	        fldd    12(bx)
05907	        fsubd   4(bx)
05908	        fstpd   12(bx)
05909	        wait
05910	        ret

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
			src/lib/i386/em/em_sbi.s	 	 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

06000	.sect .text; .sect .rom; .sect .data; .sect .bss
06001	.sect .text
06002	.define .sbi
06003	
06004	        ! #bytes in ecx , top of stack in eax
06005	.sbi:
06006	        pop     ebx              ! return subress
06007	        cmp     ecx,4
06008	        jne     1f
06009	        pop     ecx
06010	        sub     eax,ecx
06011	        neg     eax
06012	        jmp     ebx
06013	1:
06014	.extern EODDZ
06015	.extern .trp
06016	        mov     eax,EODDZ
06017	        push    ebx
06018	        jmp     .trp

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
			src/lib/i386/em/em_set.s	 	 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

06100	.sect .text; .sect .rom; .sect .data; .sect .bss
06101	.sect .text
06102	.define .set
06103	
06104	        ! #bytes in ecx
06105	        ! bit # in eax
06106	.set:
06107	        pop     ebx              ! return address
06108	        xor     edx,edx
06109	!ifdef create set
06110	        sub     esp,ecx
06111	        push    ebx
06112	        push    edi
06113	        mov     ebx,esp
06114	        xor     edi,edi
06115	        sar     ecx,2
06116	1:
06117	        mov     8(ebx)(edi),edx
06118	        add     edi,4
06119	        loop    1b
06120	!endif
06121	        mov     ebx,8
06122	        div     ebx
06123	        cmp     eax,edi
06124	        jae     2f
06125	        mov     edi,edx
06126	        movb    dl,bits(edi)
06127	        mov     edi,esp
06128	        add     edi,eax
06129	        orb     8(edi),dl
06130	        pop     edi
06131	        ret
06132	2:
06133	.extern ESET
06134	.extern .trp
06135	        pop     edi
06136	        mov     eax,ESET
06137	        jmp     .trp
06138	
06139	        .sect .rom
06140	bits:
06141	        .data1   1,2,4,8,16,32,64,128

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
			src/lib/i386/em/em_sli.s	 	 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

06200	.sect .text; .sect .rom; .sect .data; .sect .bss
06201	.sect .text
06202	.define .sli
06203	
06204	        ! #bytes in eax
06205	.sli:
06206	        pop     edx              ! return address
06207	        cmp     eax,4
06208	        jne     1f
06209	        pop     eax
06210	        pop     ecx
06211	        sal     eax,cl
06212	        push    eax
06213	        jmp     edx
06214	1:
06215	.extern EODDZ
06216	.extern .trp
06217	        mov     eax,EODDZ
06218	        push    edx
06219	        jmp     .trp

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
			src/lib/i386/em/em_sri.s	 	 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

06300	.sect .text; .sect .rom; .sect .data; .sect .bss
06301	.sect .text
06302	.define .sri
06303	
06304	        ! #bytes in eax

⌨️ 快捷键说明

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