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

📄 lib86.t

📁 操作系统设计与实现源码
💻 T
📖 第 1 页 / 共 5 页
字号:
02147	        mov     2(bx),dx02148	        mov     (bx),cx02149	        ret.Ep 18 src/lib/i86/em/fp8087.s02150	1:                              ! we get here on zero exp02151	        mov     ax,6(bx)02152	        and     ax,#017702153	        or      ax,4(bx)02154	        jne     1f              ! zero result02155	        xor     ax,ax02156	        mov     bx,2(bx)02157	        mov     (bx),ax02158	        mov     2(bx),ax02159	        mov     4(bx),ax02160	        ret02161	1:                              ! otherwise unnormalized number02162	        mov     cx,6(bx)02163	        and     cx,#010017702164	        mov     dx,cx02165	        and     cx,#0x800002166	        mov     ax,#-12502167	2:02168	        test    dx,#0x8002169	        jne     1f02170	        dec     ax02171	        shl     4(bx),#102172	        rcl     dx,#102173	        or      dx,cx02174	        jmp     2b02175	1:02176	        mov     cx,4(bx)02177	        mov     bx,2(bx)02178	        mov     (bx),ax02179	        mov     2(bx),cx02180	        and     dx,#010017702181	        or      dx,#0037400     ! load -1 exponent02182	        mov     4(bx),dx02183	        ret02184	02185	.fef8:02186	                                ! this could be simpler, if only the02187	                                ! fxtract instruction was emulated properly02188	        mov     bx,sp02189	        mov     ax,10(bx)02190	        and     ax,#07776002191	        je      1f              ! zero exponent02192	        mov     cx,#402193	        shr     ax,cl02194	        sub     ax,#102202195	        mov     cx,ax           ! exponent in cx02196	        mov     ax,10(bx)02197	        and     ax,#010001702198	        or      ax,#0037740     ! load -1 exponent02199	        push    8(bx)02200	        push    6(bx)02201	        push    4(bx)02202	        mov     bx,2(bx)02203	        pop     2(bx)02204	        pop     4(bx)02205	        pop     6(bx)02206	        mov     8(bx),ax02207	        mov     (bx),cx02208	        ret02209	1:                              ! we get here on zero exp.Op 19 src/lib/i86/em/fp8087.s02210	        mov     ax,10(bx)02211	        and     ax,#01702212	        or      ax,8(bx)02213	        or      ax,6(bx)02214	        or      ax,4(bx)02215	        jne     1f              ! zero result02216	        xor     ax,ax02217	        mov     bx,2(bx)02218	        mov     (bx),ax02219	        mov     2(bx),ax02220	        mov     4(bx),ax02221	        mov     6(bx),ax02222	        mov     8(bx),ax02223	        ret02224	1:                              ! otherwise unnormalized number02225	        mov     cx,10(bx)02226	        and     cx,#010001702227	        mov     dx,cx02228	        and     cx,#0x800002229	        mov     ax,#-102102230	2:02231	        test    dx,#0x1002232	        jne     1f02233	        dec     ax02234	        shl     4(bx),#102235	        rcl     6(bx),#102236	        rcl     8(bx),#102237	        rcl     dx,#102238	        or      dx,cx02239	        jmp     2b02240	1:02241	        and     dx,#010001702242	        or      dx,#0037740     ! load -1 exponent02243	        mov     cx,8(bx)02244	        push    6(bx)02245	        push    4(bx)02246	        mov     bx,2(bx)02247	        mov     (bx),ax02248	        mov     8(bx),dx02249	        mov     6(bx),cx02250	        pop     2(bx)02251	        pop     4(bx)02252	        ret02253	02254	.cif4:02255	        mov     bx,sp02256	        cmp     2(bx),#202257	        jne     1f02258	        wait02259	        filds   4(bx)02260	        wait02261	        fstps   2(bx)02262	        wait02263	        ret02264	1:02265	        wait02266	        fildl   4(bx)02267	        wait02268	        fstps   4(bx)02269	        wait.Ep 20 src/lib/i86/em/fp8087.s02270	        ret02271	02272	.cif8:02273	        mov     bx,sp02274	        cmp     2(bx),#202275	        jne     1f02276	        wait02277	        filds   4(bx)02278	        wait02279	        fstpd   2(bx)02280	        wait02281	        ret02282	1:02283	        wait02284	        fildl   4(bx)02285	        wait02286	        fstpd   2(bx)02287	        wait02288	        ret02289	02290	.cuf4:02291	        mov     bx,sp02292	        cmp     2(bx),#202293	        jne     1f02294	        mov     ax,4(bx)02295	        mov     2(bx),ax02296	        mov     4(bx),#002297	        wait02298	        fildl   2(bx)02299	        wait02300	        fstps   2(bx)02301	        wait02302	        ret02303	1:02304	        wait02305	        fildl   4(bx)02306	        wait02307	        cmp     6(bx),#002308	        jge     1f02309	2:02310	        wait02311	        fisubl  bigmin02312	        wait02313	        fisubl  bigmin02314	1:02315	        wait02316	        fstps   4(bx)02317	        wait02318	        ret02319	02320	.cuf8:02321	        mov     bx,sp02322	        cmp     2(bx),#202323	        jne     1f02324	        mov     6(bx),#002325	1:02326	        wait02327	        fildl   4(bx)02328	        wait02329	        cmp     6(bx),#0.Op 21 src/lib/i86/em/fp8087.s02330	        jge     1f02331	2:02332	        wait02333	        fisubl  bigmin02334	        wait02335	        fisubl  bigmin02336	1:02337	        wait02338	        fstpd   2(bx)02339	        wait02340	        ret02341	02342	.cfi:02343	        mov     bx,sp02344	        push    bx02345	        wait02346	        fstcw   -2(bx)02347	        wait02348	        mov     dx,-2(bx)02349	        or      -2(bx),#0xc00   ! truncating mode02350	        wait02351	        fldcw   -2(bx)02352	        pop     ax02353	        cmp     4(bx),#402354	        jne     2f02355	                                ! loc 4 loc ? cfi02356	        wait02357	        flds    6(bx)02358	        wait02359	        fistpl  6(bx)02360	        wait02361	        cmp     2(bx),#202362	        jne     1f02363	        mov     ax,6(bx)02364	1:02365	        mov     4(bx),dx02366	        wait02367	        fldcw   4(bx)02368	        wait02369	        ret02370	2:02371	                                ! loc 8 loc ? cfi02372	        wait02373	        fldd    6(bx)02374	        wait02375	        fistpl  10(bx)02376	        wait02377	        cmp     2(bx),#202378	        jne     1b02379	        mov     ax,10(bx)02380	        jmp     1b02381	02382	.cfu:02383	        mov     bx,sp02384	        push    bx02385	        wait02386	        fstcw   -2(bx)02387	        wait02388	        mov     dx,-2(bx)02389	        and     -2(bx),#0xf3ff.Ep 22 src/lib/i86/em/fp8087.s02390	        or      -2(bx),#0x400   ! to -infinity02391	        wait02392	        fldcw   -2(bx)02393	        wait02394	        pop     ax02395	        cmp     4(bx),#402396	        jne     2f02397	                                ! loc 4 loc ? cfu02398	        flds    6(bx)02399	        wait02400	        fabs                    ! ???02401	        wait02402	        fiaddl  bigmin02403	        fistpl  6(bx)02404	        wait02405	        mov     ax,8(bx)02406	        sub     ax,bigmin+202407	        mov     8(bx),ax02408	        cmp     2(bx),#202409	        jne     1f02410	        mov     ax,6(bx)02411	1:02412	        mov     4(bx),dx02413	        wait02414	        fldcw   4(bx)02415	        wait02416	        ret02417	2:02418	        wait02419	                                ! loc 8 loc ? cfu02420	        fldd    6(bx)02421	        wait02422	        fabs                    ! ???02423	        wait02424	        fiaddl  bigmin02425	        fistpl  10(bx)02426	        wait02427	        mov     ax,12(bx)02428	        sub     ax,bigmin+202429	        mov     12(bx),ax02430	        cmp     2(bx),#202431	        jne     1b02432	        mov     ax,10(bx)02433	        jmp     1b02434	02435	.cff4:02436	        mov     bx,sp02437	        wait02438	        fldd    2(bx)02439	        wait02440	        fstcw   2(bx)02441	        wait02442	        mov     dx,2(bx)02443	        and     2(bx),#0xf3ff   ! set to rounding mode02444	        wait02445	        fldcw   2(bx)02446	        wait02447	        fstps   6(bx)02448	        mov     2(bx),dx02449	        wait.Op 23 src/lib/i86/em/fp8087.s02450	        fldcw   2(bx)02451	        wait02452	        ret02453	02454	.cff8:02455	        mov     bx,sp02456	        wait02457	        flds    2(bx)02458	        wait02459	        fstpd   2(bx)02460	        wait02461	        ret02462	02463	.cmf4:02464	        mov     bx,sp02465	        push    bx              ! room for 8087 status word02466	        xor     cx,cx02467	        wait02468	        flds    6(bx)02469	        wait02470	        flds    2(bx)02471	        wait02472	        fcompp                  ! compare and pop operands02473	        wait02474	        fstsw   -2(bx)02475	        wait02476	        mov     ax,-2(bx)02477	        sahf02478	        je      1f02479	        jb      2f02480	        dec     cx02481	        jmp     1f02482	2:02483	        inc     cx02484	1:02485	        mov     ax,cx02486	        pop     bx02487	        ret02488	02489	02490	.cmf8:02491	        mov     bx,sp02492	        push    bx              ! room for 8087 status word02493	        xor     cx,cx02494	        wait02495	        fldd    10(bx)02496	        wait02497	        fldd    2(bx)02498	        wait02499	        fcompp                  ! compare and pop operands02500	        wait02501	        fstsw   -2(bx)02502	        wait02503	        mov     ax,-2(bx)02504	        sahf02505	        je      1f02506	        jb      2f02507	        dec     cx02508	        jmp     1f02509	2:.Ep 24 src/lib/i86/em/fp8087.s02510	        inc     cx02511	1:02512	        mov     ax,cx02513	        pop     bx02514	        ret++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++			src/lib/i86/em/gto.s	 	 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++02600	.define .gto02601	.text02602	02603	.gto:02604	        mov     bp,4(bx)02605	        mov     sp,2(bx)02606	        jmp     @(bx)++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++			src/lib/i86/em/iaar.s	 	 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++02700	.define .iaar02701	.text02702	02703	.iaar:02704	        pop     cx02705	        pop     dx02706	        cmp     dx,#202707	.extern .unknown02708	        jne     .unknown02709	        pop     bx      ! descriptor address02710	        pop     ax      ! index02711	        sub     ax,(bx)02712	        mul     4(bx)02713	        pop     bx      ! array base02714	        add     bx,ax02715	        push    cx02716	        ret.Op 25 src/lib/i86/em/ilar.s++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++			src/lib/i86/em/ilar.s	 	 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++02800	.define .ilar02801	.text02802	02803	.ilar:02804	        pop     cx02805	        pop     dx02806	.extern .unknown02807	        cmp     dx,#202808	        jne     .unknown02809	        pop     bx      ! descriptor address02810	        pop     ax      ! index02811	        push    cx02812	.extern .lar202813	        jmp    .lar2++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++			src/lib/i86/em/inn.s	 	 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++02900	.define .inn02901	.text02902	02903	        ! #bytes in cx02904	        ! bit # in ax02905	.inn:02906	        xor     dx,dx02907	        mov     bx,#802908	        div     bx02909	        mov     bx,sp02910	        add     bx,#202911	        add     bx,ax02912	        cmp     ax,cx02913	        jae     1f02914	        movb    al,(bx)02915	        mov     bx,dx02916	        testb   al,bits(bx)02917	        jz      1f02918	        mov     ax,#102919	        jmp     2f02920	1:02921	        xor     ax,ax02922	2:02923	        pop     bx02924	        add     sp,cx02925	        ! ax is result02926	        jmp     (bx)02927	02928	        .data02929	bits:02930	        .data1 1,2,4,8,16,32,64,128.Ep 26 src/lib/i86/em/ior.s++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++			src/lib/i86/em/ior.s	 	 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++03000	.define .ior03001	.text03002	03003	        ! #bytes in cx03004	.ior:03005	        pop     bx              ! return address03006	        mov     dx,di03007	        mov     di,sp03008	        add     di,cx03009	        sar     cx,#103010	1:03011	        pop     ax03012	        or      ax,(di)03013	        stos03014	        loop    1b03015	        mov     di,dx03016	        jmp     (bx)

⌨️ 快捷键说明

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