操作系统设计与实现源码
源代码在线查看: dis88.9
%!PS-Adobe-1.0 %%Creator: devps (Pipeline Associates, Inc.) %%CreationDate: Thu Sep 19 09:46:13 1996 %%Pages: (atend) %%DocumentFonts: (atend) /devps 180 dict def devps begin /res 10.000000 def /y_offset 843 def /X{exch}bind def /mm {transform round X round X itransform} bind def /r{rmoveto}bind def /m{moveto}bind def /l{lineto}bind def /rl{rlineto}bind def /st{stroke}bind def /gs{gsave}bind def /gr{grestore}bind def /cp{currentpoint}bind def /np{newpath}bind def /ct{curveto}bind def systemdict /setpacking known { /savepacking currentpacking def true setpacking } if /m0{0 0 moveto}bind def /xc{//res div}bind def /yc{//res neg div //y_offset add}bind def /lc{yc X xc X l st}bind def /mc{yc X xc X m}bind def /el{gs /a X def a div 1 X scale cp np a xc 2 div 0 360 arc st gr}bind def /ar{cp 7 2 roll np xc 5 1 roll atan 3 1 roll atan X arc st}bind def /sp{yc X xc X 6 2 roll yc X xc X 6 2 roll yc X xc X 6 2 roll ct}bind def /V{//res neg div //y_offset add currentpoint pop X m}bind def /H{//res div 0 transform X round X itransform pop currentpoint X pop moveto}bind def /h{//res div 0 r}bind def /v{//res neg div 0 X r}bind def /S{X H show}bind def /A{H //res div 1 index stringwidth pop sub 1 index length div 0 3 2 roll ashow}bind def /psize 10 def /height 0 def /cheight { height 0 ne { height } { psize } ifelse } bind def /slant 0 def /FF{findfont X dup 30 div 0 mm pop setlinewidth /psize X def [psize 0 cheight slant sin slant cos div mul cheight 0 0] makefont setfont}bind def /shade{gs /dy X def /dx X def np m 0 /dy rl /dx 0 rl 0 /dy neg rl /dx neg 0 rl closepath .9 setgray fill gr}bind def 1 setlinecap /resolution res 72 mul def /startFig { /SavedState save def userdict maxlength dict begin currentpoint transform DocumentInitState setmiterlimit setgray setdash setlinejoin setlinecap setlinewidth setmatrix itransform moveto /ury exch def /urx exch def /lly exch def /llx exch def /y exch 72 mul resolution div def /x exch 72 mul resolution div def currentpoint /cy exch def /cx exch def /sx x urx llx sub div def /sy y ury lly sub div def sx sy scale cx sx div llx sub cy sy div ury sub translate /DefFigCTM matrix currentmatrix def /initmatrix { DefFigCTM setmatrix } def /defaultmatrix { DefFigCTM exch copy } def /initgraphics { DocumentInitState setmiterlimit setgray setdash setlinejoin setlinecap setlinewidth setmatrix DefFigCTM setmatrix } def /showpage { initgraphics } def }bind def /clipFig { currentpoint 6 2 roll newpath 4 copy 4 2 roll moveto 6 -1 roll exch lineto exch lineto exch lineto closepath clip newpath moveto }bind def /doclip { llx lly urx ury clipFig } def /endFig { end SavedState restore }bind def /globalstart { fontnum psize slant height resolution currentpoint pagesave restore gsave }bind def /globalend { grestore moveto /resolution exch def /height exch def /slant exch def /psize exch def /fontnum exch def F /pagesave save def }bind def /fontnum 1 def systemdict /setpacking known { savepacking setpacking} if end /BP{ save mark devps begin m0 /DocumentInitState [ matrix currentmatrix currentlinewidth currentlinecap currentlinejoin currentdash currentgray currentmiterlimit ] cvx def }bind def /EP{ end cleartomark restore showpage}def /R{/Times-Roman FF}def /B{/Times-Bold FF}def /I{/Times-Italic FF}def /L{/Helvetica FF}def %%EndProlog %%Page: 1 1 BP /slant 0 def /height 0 def 858 V 12 B 936(Command:)S 1584(dis88)S 1882(\261)S 1972(disassembler)S 2668([IBM])S 996 V 936(Syntax:)S 1584(dis88)S 12 R 1882([)S 12 B 1923(\261o)S 12 R 2043(])S 12 I 2114(in\256le)S 12 R 2386([)S 12 I 2427(out\256le)S 12 R 2729(])S 1134 V 12 B 936(Flags:)S 1584(\261o)S 12 R 1764(List)S 1983(the)S 2161(object)S 2487(code)S (along)268 2745 A 3043(with)S 3289(the)S 3467(assembly)S 3947(code)S 1272 V 12 B 936(Examples:)S 12 R 1584(dis88)S 1875(a.out)S 2143(>listing)S 2916(#)S 3006(Disassemble)S 12 I 3649(a.out)S 1410 V 12 R 1584(dis88)S 1875(\261o)S 2025(a.out)S 2293(listing)S 2916(#)S (Ditto,)280 3006 A 3316(but)S 3500(with)S 3746(object)S 4072(code)S 1584 V 12 I 1116(Dis88)S 12 R 1443(disassembles)S (8088)240 2113 A 2391(object)S 2725(code)S 2991(to)S 3124(the)S 3311(assembly)S (language)436 3800 A 4275(format)S 4638(used)S 4898(by)S 1722 V 10 R 936(MINIX)S 12 R 1239(.)S 1335(It)S 1445(makes)S 1789(full)S 1993(use)S 2189(of)S 2325(symbol)S 2715(table)S 2986(information,)S (supports)409 3623 A 4067(separate)S 4500(instruction)S 1860 V 936(and)S 1160(data)S (space,)299 1412 A 1761(and)S 1986(generates)S 2495(synthetic)S 2983(labels)S 3317(when)S 3630(needed.)S 4053(It)S 4179(does)S 4451(not)S (support)362 4656 A 1998 V (8087)240 936 A 1206(mnemonics,)S 1823(symbolic)S 2296(data)S 2528(segment)S 2961(references,)S 3521(or)S 3652(the)S 3830(ESC)S 4081(mnemonic.)S 2172 V 1116(The)S 1334(program)S 1774(is)S (invoked)388 1885 A 2303(by:)S 2379 V 10 L 1086(dis88)S 1355([\261o])S 1551(in\256le)S 1787([out\256le])S 2586 V 12 R 936(The)S 1154(\261o)S 1304(\257ag)S 1515(causes)S 1861(object)S 2187(code)S 2445(to)S 2569(be)S 2713(listed.)S 3036(If)S 3148(no)S 3298(out\256le)S 3637(is)S 3748(given,)S 12 I (stdout)295 4076 A 12 R 4401(is)S 4512(used.)S 2760 V 1116(The)S 1336(text)S 1550(segment)S 1985(of)S 2118(an)S 2264(object)S 2592(\256le)S 2779(is)S 2893(always)S 3263(padded)S 3644(to)S 3771(an)S 3918(even)S 4179(address.)S 4635(In)S 4769(addi-)S 2898 V 936(tion,)S 1194(if)S 1309(the)S 1497(\256le)S 1692(has)S (split)209 1893 A 2142(I/D)S (space,)299 2345 A 2684(the)S 2872(text)S 3094(segment)S (will)190 3537 A 3767(be)S 3921(padded)S 4308(to)S 4441(a)S 4534(paragraph)S 3036 V (boundary)455 936 A 1433(\(i.e.,)S 1694(an)S 1850(address)S 2255(divisible)S 2714(by)S 2876(16\).)S 3109(Due)S 3353(to)S 3489(padding,)S 3950(the)S 4141(disassembler)S 4810(may)S 3174 V (produce)389 936 A 1355(a)S 1439(few)S 1652(spurious,)S 2121(but)S 2305(harmless,)S 2796(instructions)S 3391(at)S 3509(the)S 3687(end)S 3891(of)S 4022(the)S 4200(text)S 4412(segment.)S 3348 V (Because)403 1116 A 1572(the)S 1773(information)S 2398(to)S 2545(which)S (initialized)486 2895 A 3435(data)S 3691(refers)S (cannot)322 4023 A 4399(generally)S 4904(be)S 3486 V 936(inferred)S 1359(from)S 1633(context,)S 2056(the)S 2241(data)S 2480(segment)S 2920(is)S 3038(treated)S (literally.)409 3406 A 3852(Byte)S 4117(values)S 4463(\(in)S 4635(hexade-)S 3624 V 936(cimal\))S 1297(are)S 1496(output,)S 1884(and)S (long)214 2108 A 2372(stretches)S 2847(of)S 2998(null)S 3236(data)S 3488(are)S 3687(represented)S 4296(by)S 4466(appropriate)S 3762 V 12 I 936(.zerow)S 12 R (pseudo-ops.)579 1307 A 1939(Disassembly)S 2610(of)S 2763(the)S 2963(bss)S 3169(segment,)S 3654(on)S 3826(the)S 4026(other)S 4327(hand,)S 4643(is)S 4776(quite)S 3900 V 936(straightforward,)S (because)383 1753 A (uninitialized)606 2174 A 2818(data)S 3058(is)S 3177(all)S 3337(zero)S 3584(by)S (de\256nition.)493 3743 A 4275(No)S 4462(data)S 4703(is)S 4823(out-)S 4038 V 936(put)S 1120(in)S 1244(the)S 1422(bss)S 1606(segment,)S 2069(but)S 2253(symbolic)S 2726(labels)S 3039(are)S 3218(output)S 3556(as)S 3687(appropriate.)S 4212 V 1116(The)S 1364(output)S 1732(of)S 1893(operands)S 2389(in)S 2543(symbolic)S 3046(form)S 3342(is)S 3484(complicated)S 4137(somewhat)S 4689(by)S 4870(the)S 4350 V 936(existence)S 1420(of)S 1554(assembler)S 2072(symbolic)S 2548(constants)S 3031(and)S 3238(segment)S 3674(override)S 4110(opcodes.)S 4567(Thus,)S 4870(the)S 4488 V 936(program's)S 1467(symbol)S (lookup)334 1855 A 2222(routine)S 2598(attempts)S 3042(to)S 3169(apply)S 3470(a)S 3557(certain)S (amount)362 3921 A 4317(of)S (intelligence)566 4452 A 4626 V 936(when)S 1239(it)S 1348(is)S 1470(asked)S 1786(to)S 1920(\256nd)S 2147(a)S 2241(symbol.)S 2666(If)S 2788(it)S (cannot)322 2896 A 3258(match)S 3594(on)S 3754(a)S 3848(symbol)S 4243(of)S 4384(the)S 4572(preferred)S 4764 V 936(type,)S 1220(it)S 1334(may)S 1588(output)S 1942(a)S 2042(symbol)S 2443(of)S 2590(some)S 2891(other)S 3186(type,)S 3470(depending)S 4018(on)S 4185(preassigned)S 4803(\(and)S 4902 V 936(somewhat)S 1465(arbitrary\))S 1963(rankings)S 2417(within)S (each)222 2765 A 3025(type.)S 3301(Finally,)S 3712(if)S 3825(all)S 3985(else)S 4212(fails,)S 4490(it)S (will)190 4596 A 4823(out-)S 5040 V 936(put)S 1127(a)S 1218(string)S 1531(containing)S 2078(the)S 2264(address)S (sought)321 2665 A 3024(as)S 3163(a)S 3255(hex)S 3467(constant.)S 3938(For)S 4144(user)S (convenience,)634 4384 A 5178 V 936(the)S 1114(targets)S 1468(of)S 1599(branches)S 2059(are)S 2238(also)S 2463(output,)S 2831(in)S 2955(comments,)S 3512(as)S 3643(hexadecimal)S 4285(constants.)S 5454 V 12 B 936(Error)S 1268(Messages)S 5766 V 12 R 1116(Various)S 1542(error)S 1821(messages)S 2320(may)S 2570(be)S 2726(generated)S 3239(as)S 3382(a)S 3478(result)S 3790(of)S 3934(problems)S (encountered)591 4427 A 5904 V 936(during)S 1281(the)S 1459(disassembly.)S 2140(They)S 2418(are)S 2597(listed)S 2890(below)S 6111 V (Cannot)348 1116 A (access)310 1494 A (input)248 1834 A 2112(\256le)S 3096(\261)S (Input)255 3240 A 3525(\256le)S (cannot)322 3710 A 4062(be)S 4206(opened)S 4584(or)S 4715(read)S 6249 V (Cannot)348 1116 A 1494(open)S 1758(output)S 2096(\256le)S 3096(\261)S 3240(Output)S 3606(\256le)S (cannot)322 3791 A 4143(be)S 4287(created)S 6387 V (Input)255 1116 A 1401(\256le)S 1586(not)S 1770(in)S 1894(object)S 2220(format)S 3096(\261)S 3240(Bad)S 3464(magic)S 3790(number)S 6525 V 1116(Not)S 1370(an)S (8086/8088)514 1556 A 2142(object)S 2510(\256le)S 3264(\261)S 3408(CPU)S 3716(ID)S 3918(of)S 4092(the)S 4313(\256le)S 4541(header)S 4937(is)S 6663 V 3240(incorrect)S 6801 V 1116(Reloc)S 1489(table)S 1816(over\257ow)S 3218(\261)S 3362(Relocation)S 3977(table)S (exceeds)383 4304 A (1500)240 4778 A 6939 V 3240(entries)S 7077 V 1116(Symbol)S 1521(table)S 1787(over\257ow)S 3096(\261)S 3240(Symbol)S 3645(table)S (exceeds)383 3911 A (1500)240 4324 A 4594(entries)S 8427 V EP %%Page: 2 2 BP /slant 0 def /height 0 def 1130 V 12 B 936(2)S 1380 V 12 R 1116(Lseek)S 1465(error)S 3126(\261)S (Input)255 3270 A 3585(\256le)S 3801(corrupted)S (\(should)362 4326 A 4749(never)S 1518 V 3240(happen\))S 1656 V 1116(Warning:)S 1603(no)S 1753(symbols)S 3096(\261)S 3240(Symbol)S 3645(table)S 3911(is)S 4022(missing)S 4428(\(use)S 4660(ast\))S 1794 V (Cannot)348 1116 A 1504(reopen)S (input)248 1873 A 2161(\256le)S 3126(\261)S (Input)255 3270 A 3565(\256le)S 3760(was)S 3989(removed)S 4453(during)S 4809(exe-)S 1932 V 3240(cution)S 2208 V 12 B 936(Author)S 2520 V 12 I 1116(Dis88)S 12 R 1475(was)S (written)345 1704 A 2089(and)S (copyrighted)577 2303 A 2920(by)S 3080(G.)S 3238(M.)S 3416(Harding)S 3854(and)S 4069(is)S 4191(included)S 4648(here)S 4898(by)S 2658 V 936(permission.)S 1532(It)S 1642(may)S 1885(be)S 2034(freely)S 2353(redistributed)S 3001(provided)S 3465(that)S 3682(complete)S 4160(source)S 4510(code,)S 4802(with)S 2796 V 936(all)S (copyright)463 1091 A 1588(notices,)S (accompanies)625 1995 A 2654(any)S 2862(redistribution.)S 3579(This)S 3828(provision)S 4318(also)S 4547(applies)S 4924(to)S 2934 V 936(any)S 1145(modi\256cations)S (you)180 1838 A 2053(may)S 2296(make.)S 2623(You)S 2866(are)S 3050(urged)S 3360(to)S 3488(comment)S 3972(such)S 4227(changes,)S 4680(giving,)S 3072 V 936(as)S 1067(a)S 1151(minimum,)S (your)221 1681 A 1932(name)S 2224(and)S 2428(complete)S 2902(address.)S 8427 V EP %%Trailer %%DocumentFonts: Times-Roman Times-Bold Times-Italic Helvetica %%Pages: 2