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

📄 lib86.t

📁 操作系统设计与实现源码
💻 T
📖 第 1 页 / 共 5 页
字号:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++			src/lib/i86/em/isar.s	 	 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++03100	.define .isar03101	.text03102	03103	.isar:03104	        pop     cx03105	        pop     ax03106	        cmp     ax,#203107	.extern .unknown03108	        jne     .unknown03109	        pop     bx      ! descriptor address03110	        pop     ax      ! index03111	        push    cx03112	.extern .sar203113	        jmp    .sar2++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++			src/lib/i86/em/lar2.s	 	 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++03200	.define .lar203201	.text03202	03203	.lar2:03204	                                ! bx, descriptor address03205	                                ! ax, index03206	        pop     cx03207	        pop     dx              ! base address03208	        push    cx03209	        push    si.Op 27 src/lib/i86/em/lar2.s03210	        mov     si,dx03211	        sub     ax,(bx)03212	        mov     cx,4(bx)03213	        imul    cx03214	        add     si,ax03215	        sar     cx,#103216	        jnb     1f03217	        xorb    ah,ah03218	        lodsb03219	        pop     si03220	        pop     bx03221	        push    ax03222	        jmp     (bx)03223	1:03224	        pop     dx              ! saved si03225	        mov     ax,4(bx)03226	        pop     bx              ! return address03227	        sub     sp,ax03228	        mov     ax,di           ! save di03229	        mov     di,sp03230	        rep03231	        mov03232	        mov     di,ax03233	        mov     si,dx03234	        jmp     (bx)++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++			src/lib/i86/em/lfr6.s	 	 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++03300	.define .lfr603301	.text03302	.extern .retarea03303	03304	.lfr6:03305	        pop     bx03306	        push    .retarea+403307	        push    .retarea+203308	        push    .retarea03309	        jmp     (bx).Ep 28 src/lib/i86/em/lfr8.s++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++			src/lib/i86/em/lfr8.s	 	 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++03400	.define .lfr803401	.text03402	.extern .retarea03403	03404	.lfr8:03405	        pop     bx03406	        push    .retarea+603407	        push    .retarea+403408	        push    .retarea+203409	        push    .retarea03410	        jmp     (bx)++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++			src/lib/i86/em/loi.s	 	 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++03500	.define .loi03501	.define .los03502	.text03503	03504	        ! #bytes in cx03505	        ! address in bx03506	        ! save si/di. they might be register variables03507	.los:03508	        mov     dx,si03509	        mov     si,bx03510	        pop     bx03511	        mov     ax,cx03512	        sar     cx,#103513	        jnb     1f03514	        xorb    ah,ah03515	        lodsb03516	        mov     si,dx03517	        push    ax03518	        jmp     (bx)03519	1:03520	        sub     sp,ax03521	        jmp     1f03522	03523	.loi:03524	        ! only called with size > 403525	        mov     dx,si03526	        mov     si,bx03527	        pop     bx03528	        sub     sp,cx03529	        sar     cx,#103530	1:03531	        mov     ax,di03532	        mov     di,sp03533	        rep03534	        mov.Op 29 src/lib/i86/em/loi.s03535	        mov     si,dx03536	        mov     di,ax03537	        jmp     (bx)++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++			src/lib/i86/em/mli4.s	 	 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++03600	.define .mli403601	.text03602	03603	yl=203604	yh=403605	        ! x * y03606	        ! xl in ax03607	        ! xh in dx03608	03609	.mli4:03610	        mov     bx,sp03611	        push    dx03612	        mov     cx,ax03613	        mul     yh(bx)           ! xl*yh03614	        pop     dx03615	        push    ax03616	        mov     ax,dx03617	        mul     yl(bx)          ! xh * yl03618	        pop     dx03619	        add     dx,ax           ! xh*yl+xl*yh03620	        mov     ax,cx03621	        mov     cx,dx03622	        mul     yl(bx)           ! xl*yl03623	        add     dx,cx03624	        ret     4++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++			src/lib/i86/em/mon.s	 	 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++03700	.define .mon03701	.text03702	03703	.mon:03704	.extern .stop03705	        call    .stop.Ep 30 src/lib/i86/em/nop.s++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++			src/lib/i86/em/nop.s	 	 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++03800	.define .nop03801	.text03802	.nop:03803	        ret++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++			src/lib/i86/em/rck.s	 	 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++03900	.define .rck03901	.text03902	03903	        ! descriptor address in bx03904	        ! value in ax, must be left there03905	.rck:03906	        cmp     ax,(bx)03907	        jl      2f03908	        cmp     ax,2(bx)03909	        jg      2f03910	        ret03911	2:03912	        push    ax03913	ERANGE = 103914	.extern .error03915	        mov     ax,#ERANGE03916	        call    .error03917	        pop     ax03918	        ret++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++			src/lib/i86/em/ret6.s	 	 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++04000	.define .ret604001	.text04002	.extern .retarea04003	04004	.ret6:04005	        pop     bx04006	        pop     .retarea04007	        pop     .retarea+204008	        pop     .retarea+404009	        jmp     (bx).Op 31 src/lib/i86/em/ret8.s++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++			src/lib/i86/em/ret8.s	 	 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++04100	.define .ret804101	.text04102	.extern .retarea04103	04104	.ret8:04105	        pop     bx04106	        pop     .retarea04107	        pop     .retarea+204108	        pop     .retarea+404109	        pop     .retarea+604110	        jmp     (bx)++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++			src/lib/i86/em/retarea.s	 	 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++04200	.define .retarea04201	04202	.bss04203	.retarea:04204	        .zerow 8/2++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++			src/lib/i86/em/return.s	 	 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++04300	.define .sdret, .dsret, .sret, .dret, .cret 04301	.text04302	04303	.dsret:04304	        pop     di04305	.sret:04306	        pop     si04307	.cret:04308	        mov     sp,bp04309	        pop     bp04310	        ret04311	04312	.sdret:04313	        pop     si04314	.dret:04315	        pop     di04316	        jmp     .cret.Ep 32 src/lib/i86/em/rmi4.s++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++			src/lib/i86/em/rmi4.s	 	 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++04400	.define .rmi404401	.text04402	04403	yl=604404	yh=804405	xl=1004406	xh=1204407	04408	.rmi4:04409	        push    si04410	        push    di04411	        mov     si,sp           ! copy of sp04412	        mov     bx,yl(si)04413	        mov     ax,yh(si)04414	        cwd04415	        cmp     dx,ax04416	        jne     7f04417	        and     dx,dx04418	        jge     1f04419	        neg     bx04420	        je      7f04421	1:04422	        xor     dx,dx04423	        mov     cx,xl(si)04424	        mov     ax,xh(si)04425	        and     ax,ax04426	        jge     2f04427	        neg     ax04428	        neg     cx04429	        sbb     ax,dx04430	2:04431	        div     bx04432	        xchg    ax,cx04433	        div     bx              ! dx= result(low), 0=result(high)04434	        xor     bx,bx04435	9:04436	        cmp     xh(si),#004437	        jge     1f04438	        neg     bx04439	        neg     dx04440	        sbb     bx,#004441	1:04442	                        ! bx is high order result04443	                        ! dx is low order result04444	        mov     ax,dx04445	        mov     dx,bx   ! result in ax/dx04446	        pop     di04447	        pop     si04448	        ret     804449	04450	7:04451	        mov     di,ax04452	        xor     bx,bx04453	        and     di,di04454	        jge     1f.Op 33 src/lib/i86/em/rmi4.s04455	        neg     di04456	        neg     yl(si)04457	        sbb     di,bx04458	1:04459	        mov     ax,xl(si)04460	        mov     dx,xh(si)04461	        and     dx,dx04462	        jge     1f04463	        neg     dx04464	        neg     ax04465	        sbb     dx,bx04466	1:04467	        mov     cx,#1604468	1:04469	        shl     ax,#104470	        rcl     dx,#104471	        rcl     bx,#104472	        cmp     di,bx04473	        ja      3f04474	        jb      2f04475	        cmp     yl(si),dx04476	        jbe     2f04477	3:04478	        loop    1b04479	                ! dx=result(low), bx=result(high)04480	        jmp     9b04481	2:04482	        sub     dx,yl(si)04483	        sbb     bx,di04484	        inc     ax04485	        loop    1b04486	1:04487	                ! dx=result(low), bx=result(high)04488	        jmp     9b++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++			src/lib/i86/em/rmu4.s	 	 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++04500	.define .rmu404501	.text04502	04503	yl=604504	yh=804505	xl=1004506	xh=1204507	04508	.rmu4:04509	        push    si04510	        push    di04511	        mov     si,sp           ! copy of sp04512	        mov     bx,yl(si)04513	        mov     ax,yh(si)04514	        or      ax,ax04515	        jne     7f04516	1:04517	        xor     dx,dx04518	        mov     cx,xl(si)04519	        mov     ax,xh(si).Ep 34 src/lib/i86/em/rmu4.s04520	2:04521	        div     bx04522	        xchg    ax,cx04523	        div     bx04524	        xor     bx,bx04525	9:04526	                        ! bx is high order result04527	                        ! dx is low order result04528	        mov     ax,dx04529	        mov     dx,bx04530	        pop     di04531	        pop     si04532	        ret     8       ! result in ax/dx04533	04534	7:04535	        mov     di,ax04536	        xor     bx,bx04537	        mov     ax,xl(si)04538	        mov     dx,xh(si)04539	        mov     cx,#1604540	1:04541	        shl     ax,#104542	        rcl     dx,#104543	        rcl     bx,#104544	        cmp     di,bx04545	        ja      3f04546	        jb      2f04547	        cmp     yl(si),dx04548	        jbe     2f04549	3:04550	        loop    1b04551	                ! dx=result(low), bx=result(high)04552	        jmp     9b04553	2:04554	        sub     dx,yl(si)04555	        sbb     bx,di04556	        inc     ax04557	        loop    1b04558	1:04559	                ! dx=result(low), bx=result(high)04560	        jmp     9b++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++			src/lib/i86/em/sar2.s	 	 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++04600	.define .sar204601	.text04602	04603	.sar2:04604	                                ! bx, descriptor address04605	                                ! ax, index04606	        pop     cx04607	        pop     dx              ! base address04608	        push    cx04609	        xchg    di,dx           ! di = base address, dx is saved di.Op 35 src/lib/i86/em/sar2.s04610	        sub     ax,(bx)04611	        mov     cx,4(bx)04612	        push    dx04613	        imul    cx04614	        pop     dx04615	        add     di,ax04616	        sar     cx,#104617	        jnb     1f04618	        pop     bx04619	        pop     ax04620	        stosb04621	        mov     di,dx04622	        jmp     (bx)

⌨️ 快捷键说明

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