fib.rar

  • PUDN用户
    了解作者
  • Asm
    开发工具
  • 80KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 2
    下载次数
  • 2009-06-30 14:47
    上传日期
fibonatchi assembly code explanation
fib.rar
  • fib.pdf
    99.6KB
内容介绍
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> <meta name="generator" content="pdf2htmlEX"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <link rel="stylesheet" href="https://static.pudn.com/base/css/base.min.css"> <link rel="stylesheet" href="https://static.pudn.com/base/css/fancy.min.css"> <link rel="stylesheet" href="https://static.pudn.com/prod/directory_preview_static/622b88b115da9b288bdde6b1/raw.css"> <script src="https://static.pudn.com/base/js/compatibility.min.js"></script> <script src="https://static.pudn.com/base/js/pdf2htmlEX.min.js"></script> <script> try{ pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({}); }catch(e){} </script> <title></title> </head> <body> <div id="sidebar" style="display: none"> <div id="outline"> </div> </div> <div id="pf1" class="pf w0 h0" data-page-no="1"><div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/622b88b115da9b288bdde6b1/bg1.jpg"><div class="t m0 x1 h2 y1 ff1 fs0 fc0 sc0 ls0 ws0">Fib<span class="_ _0"></span>onacci<span class="_ _1"> </span>Num<span class="_ _2"></span>b<span class="_ _0"></span>ers</div><div class="t m0 x2 h3 y2 ff1 fs1 fc0 sc0 ls0 ws0">An<span class="_ _3"> </span>Exercise<span class="_ _3"> </span>in<span class="_ _3"> </span>Assem<span class="_ _2"></span>bly<span class="_ _3"> </span>Language<span class="_ _3"> </span>Programming</div><div class="t m0 x3 h4 y3 ff2 fs1 fc0 sc0 ls0 ws0">Andreas<span class="_ _4"> </span>Klapp<span class="_ _0"></span>enec<span class="_ _2"></span>k<span class="_ _2"></span>er</div><div class="t m0 x4 h4 y4 ff2 fs1 fc0 sc0 ls0 ws0">Septem<span class="_ _2"></span>b<span class="_ _0"></span>er<span class="_ _4"> </span>7,<span class="_ _4"> </span>2004</div><div class="t m0 x5 h2 y5 ff1 fs0 fc0 sc0 ls0 ws0">1<span class="_ _5"> </span>In<span class="_ _2"></span>tro<span class="_ _0"></span>duction</div><div class="t m0 x5 h5 y6 ff3 fs2 fc0 sc0 ls0 ws0">Leonardo<span class="_ _6"> </span>Pisano<span class="_ _6"> </span>(1170&#8211;1250)<span class="_ _6"> </span>w<span class="_ _2"></span>as<span class="_ _6"> </span>a<span class="_ _6"> </span>scholar<span class="_ _6"> </span>born<span class="_ _6"> </span>in<span class="_ _6"> </span>Pisa<span class="_ _6"> </span>in<span class="_ _4"> </span>Italy<span class="_ _7"></span>,<span class="_ _6"> </span>who<span class="_ _6"> </span>is<span class="_ _6"> </span>prob-</div><div class="t m0 x5 h5 y7 ff3 fs2 fc0 sc0 ls0 ws0">ably<span class="_ _6"> </span>b<span class="_ _0"></span>etter<span class="_ _6"> </span>known<span class="_ _6"> </span>b<span class="_ _2"></span>y<span class="_ _6"> </span>his<span class="_ _4"> </span>nic<span class="_ _2"></span>kname<span class="_ _6"> </span>Fib<span class="_ _0"></span>onacci.<span class="_ _1"> </span>During<span class="_ _6"> </span>the<span class="_ _6"> </span>&#64257;rst<span class="_ _6"> </span>30<span class="_ _4"> </span>y<span class="_ _2"></span>ears<span class="_ _6"> </span>of<span class="_ _6"> </span>his</div><div class="t m0 x5 h5 y8 ff3 fs2 fc0 sc0 ls0 ws0">liv<span class="_ _2"></span>e,<span class="_ _4"> </span>he<span class="_ _6"> </span>tra<span class="_ _2"></span>veled<span class="_ _6"> </span>extensiv<span class="_ _2"></span>ely<span class="_ _6"> </span>through<span class="_ _6"> </span>North<span class="_ _4"> </span>Africa,<span class="_ _6"> </span>where<span class="_ _6"> </span>he<span class="_ _6"> </span>learned<span class="_ _6"> </span>numerous</div><div class="t m0 x5 h5 y9 ff3 fs2 fc0 sc0 ls0 ws0">mathematical<span class="_ _3"> </span>skills<span class="_ _8"> </span>of<span class="_ _8"> </span>Arab<span class="_ _3"> </span>origin.<span class="_ _9"> </span>In<span class="_ _8"> </span>1202,<span class="_ _3"> </span>Fib<span class="_ _0"></span>onacci<span class="_ _8"> </span>returned<span class="_ _3"> </span>to<span class="_ _8"> </span>Pisa<span class="_ _3"> </span>and</div><div class="t m0 x5 h5 ya ff3 fs2 fc0 sc0 ls0 ws0">wrote<span class="_ _4"> </span>his<span class="_ _4"> </span>famous<span class="_ _4"> </span>b<span class="_ _0"></span>o<span class="_"> </span>ok<span class="_ _8"> </span>on<span class="_ _4"> </span>arithmetic<span class="_ _4"> </span>and<span class="_ _4"> </span>algebra,<span class="_ _8"> </span>the<span class="_ _4"> </span><span class="ff4">Lib<span class="_ _2"></span>er<span class="_ _8"> </span>ab<span class="_ _2"></span>aci<span class="ff3">.<span class="_ _a"> </span>The<span class="_ _4"> </span>b<span class="_ _0"></span>ook</span></span></div><div class="t m0 x5 h5 yb ff3 fs2 fc0 sc0 ls0 ws0">w<span class="_ _2"></span>as<span class="_ _b"> </span>v<span class="_ _2"></span>ery<span class="_ _b"> </span>in&#64258;uen<span class="_ _2"></span>tial<span class="_ _b"> </span>on<span class="_ _b"> </span>the<span class="_ _c"> </span>further<span class="_ _c"> </span>mathematical<span class="_ _b"> </span>develop<span class="_ _2"></span>ment<span class="_ _c"> </span>of<span class="_ _b"> </span>Europe,<span class="_ _b"> </span>despite</div><div class="t m0 x5 h5 yc ff3 fs2 fc0 sc0 ls0 ws0">the<span class="_ _b"> </span>fact<span class="_ _d"> </span>that<span class="_ _b"> </span>it<span class="_ _d"> </span>had<span class="_ _b"> </span>to<span class="_ _d"> </span>b<span class="_"> </span>e<span class="_ _d"> </span>copied<span class="_ _d"> </span>b<span class="_ _2"></span>y<span class="_ _b"> </span>hand<span class="_ _d"> </span>(the<span class="_ _b"> </span>printing<span class="_ _b"> </span>press<span class="_ _d"> </span>w<span class="_ _2"></span>as<span class="_ _d"> </span>not<span class="_ _b"> </span>introduced</div><div class="t m0 x5 h5 yd ff3 fs2 fc0 sc0 ls0 ws0">un<span class="_ _2"></span>til<span class="_ _6"> </span>the<span class="_ _6"> </span>15th<span class="_ _d"> </span>century).</div><div class="t m0 x6 h5 ye ff3 fs2 fc0 sc0 ls0 ws0">Among<span class="_ _c"> </span>many<span class="_ _c"> </span>other<span class="_ _c"> </span>things,<span class="_ _c"> </span>the<span class="_ _c"> </span>b<span class="_ _0"></span>ook<span class="_ _b"> </span>con<span class="_ _2"></span>tained<span class="_ _c"> </span>the<span class="_ _c"> </span>following<span class="_ _c"> </span>famous<span class="_ _c"> </span>problem:</div><div class="t m0 x7 h5 yf ff3 fs2 fc0 sc0 ls0 ws0">A<span class="_ _6"> </span>man<span class="_ _4"> </span>puts<span class="_ _6"> </span>a<span class="_ _4"> </span>pair<span class="_ _4"> </span>of<span class="_ _6"> </span>rabbits<span class="_ _4"> </span>in<span class="_ _6"> </span>a<span class="_ _4"> </span>place<span class="_ _6"> </span>surrounded<span class="_ _4"> </span>on<span class="_ _6"> </span>all<span class="_ _4"> </span>sides<span class="_ _6"> </span>by</div><div class="t m0 x7 h5 y10 ff3 fs2 fc0 sc0 ls0 ws0">a<span class="_ _6"> </span>wall.<span class="_ _1"> </span>Ho<span class="_ _2"></span>w<span class="_ _6"> </span>many<span class="_ _6"> </span>pairs<span class="_ _6"> </span>of<span class="_ _6"> </span>rabbits<span class="_ _4"> </span>can<span class="_ _6"> </span>b<span class="_ _0"></span>e<span class="_ _6"> </span>pro<span class="_ _0"></span>duced<span class="_ _6"> </span>from<span class="_ _6"> </span>that<span class="_ _4"> </span>pair</div><div class="t m0 x7 h5 y11 ff3 fs2 fc0 sc0 ls0 ws0">in<span class="_ _4"> </span>a<span class="_ _4"> </span>year,<span class="_ _4"> </span>assuming<span class="_ _4"> </span>that<span class="_ _4"> </span>every<span class="_ _6"> </span>month<span class="_ _4"> </span>eac<span class="_ _2"></span>h<span class="_ _4"> </span>pair<span class="_ _4"> </span>b<span class="_ _0"></span>egets<span class="_ _4"> </span>a<span class="_ _4"> </span>new<span class="_ _4"> </span>pair</div><div class="t m0 x7 h5 y12 ff3 fs2 fc0 sc0 ls0 ws0">whic<span class="_ _2"></span>h<span class="_ _6"> </span>from<span class="_ _6"> </span>the<span class="_ _d"> </span>second<span class="_ _6"> </span>mon<span class="_ _2"></span>th<span class="_ _6"> </span>on<span class="_ _6"> </span>becomes<span class="_ _6"> </span>pro<span class="_ _0"></span>ductiv<span class="_ _2"></span>e?</div><div class="t m0 x5 h5 y13 ff3 fs2 fc0 sc0 ls0 ws0">The<span class="_ _d"> </span>problem<span class="_ _6"> </span>ga<span class="_ _2"></span>ve<span class="_ _d"> </span>rise<span class="_ _d"> </span>to<span class="_ _d"> </span>the<span class="_ _6"> </span>Fib<span class="_ _0"></span>onacci<span class="_ _d"> </span>sequence<span class="_ _d"> </span>(0<span class="ff5">,<span class="_ _e"> </span></span>1<span class="ff5">,<span class="_ _e"> </span></span>1<span class="ff5">,<span class="_ _e"> </span></span>2<span class="ff5">,<span class="_ _f"> </span></span>3<span class="ff5">,<span class="_ _f"> </span></span>5<span class="ff5">,<span class="_ _e"> </span></span>8<span class="ff5">,<span class="_ _e"> </span></span>13<span class="ff5">,<span class="_ _f"> </span></span>21<span class="ff5">,<span class="_ _e"> </span></span>34<span class="ff5">,<span class="_ _e"> </span>.<span class="_ _f"> </span>.<span class="_ _e"> </span>.</span>)</div><div class="t m0 x5 h5 y14 ff3 fs2 fc0 sc0 ls0 ws0">in<span class="_ _4"> </span>whic<span class="_ _2"></span>h<span class="_ _4"> </span>eac<span class="_ _2"></span>h<span class="_ _4"> </span>term<span class="_ _4"> </span>is<span class="_ _6"> </span>the<span class="_ _4"> </span>sum<span class="_ _4"> </span>of<span class="_ _4"> </span>the<span class="_ _6"> </span>previous<span class="_ _4"> </span>t<span class="_ _2"></span>wo,<span class="_ _4"> </span>so<span class="_ _6"> </span>it<span class="_ _4"> </span>is<span class="_ _4"> </span>determined<span class="_ _4"> </span>b<span class="_ _2"></span>y<span class="_ _4"> </span>the</div><div class="t m0 x5 h5 y15 ff3 fs2 fc0 sc0 ls0 ws0">recurrence<span class="_ _6"> </span><span class="ff5">f<span class="_ _10"> </span></span>(<span class="ff5">n</span>)<span class="_ _d"> </span>=<span class="_ _d"> </span><span class="ff5">f<span class="_ _10"> </span></span>(<span class="ff5">n<span class="_ _c"> </span><span class="ff6">&#8722;<span class="_ _b"> </span></span></span>1)<span class="_ _c"> </span>+<span class="_ _c"> </span><span class="ff5">f<span class="_ _10"> </span></span>(<span class="ff5">n<span class="_ _c"> </span><span class="ff6">&#8722;<span class="_ _c"> </span></span></span>2)<span class="_ _4"> </span>with<span class="_ _6"> </span><span class="ff5">f<span class="_ _10"></span></span>(0)<span class="_ _d"> </span>=<span class="_ _d"> </span>0<span class="_ _6"> </span>and<span class="_ _6"> </span><span class="ff5">f<span class="_ _10"> </span></span>(1)<span class="_ _d"> </span>=<span class="_ _d"> </span>1.<span class="_ _1"> </span>Fibonacci</div><div class="t m0 x5 h5 y16 ff3 fs2 fc0 sc0 ls0 ws0">could<span class="_ _6"> </span>not<span class="_ _4"> </span>possibly<span class="_ _4"> </span>foresee<span class="_ _6"> </span>the<span class="_ _6"> </span>tremendous<span class="_ _4"> </span>impact<span class="_ _6"> </span>of<span class="_ _6"> </span>his<span class="_ _4"> </span>little<span class="_ _6"> </span>rabbit<span class="_ _6"> </span>sequence.</div><div class="t m0 x5 h5 y17 ff3 fs2 fc0 sc0 ls0 ws0">Numerous<span class="_ _8"> </span>curious<span class="_ _8"> </span>applications<span class="_ _8"> </span>are<span class="_ _8"> </span>listed<span class="_ _8"> </span>in<span class="_ _8"> </span>the<span class="_ _8"> </span>Neil<span class="_ _8"> </span>Sloane&#8217;s<span class="_ _3"> </span>encyclopedia<span class="_ _8"> </span>of</div><div class="t m0 x5 h5 y18 ff3 fs2 fc0 sc0 ls0 ws0">in<span class="_ _2"></span>teger<span class="_ _6"> </span>sequences,</div><div class="t m0 x8 h6 y19 ff7 fs2 fc1 sc0 ls0 ws0">http://www.research.att.com/</div><div class="t m0 x9 h7 y1a ff8 fs3 fc1 sc0 ls0 ws0">&#8764;</div><div class="t m0 xa h5 y19 ff7 fs2 fc1 sc0 ls0 ws0">njas/sequences/index.html<span class="ff3 fc0">,</span></div><div class="t m0 x5 h5 y1b ff3 fs2 fc0 sc0 ls0 ws0">and<span class="_ _d"> </span>coun<span class="_ _2"></span>tless<span class="_ _d"> </span>pap<span class="_ _0"></span>ers<span class="_ _b"> </span>ab<span class="_ _0"></span>out<span class="_ _d"> </span>this<span class="_ _b"> </span>sequence<span class="_ _d"> </span>hav<span class="_ _2"></span>e<span class="_ _d"> </span>been<span class="_ _d"> </span>published<span class="_ _d"> </span>in<span class="_ _d"> </span><span class="ff4">The<span class="_ _d"> </span>Fib<span class="_ _2"></span>onac<span class="_ _2"></span>ci</span></div><div class="t m0 x5 h5 y1c ff4 fs2 fc0 sc0 ls0 ws0">Quarterly<span class="ff3">.</span></div><div class="t m0 x6 h5 y1d ff3 fs2 fc0 sc0 ls0 ws0">W<span class="_ _7"></span>e<span class="_ _b"> </span>derive<span class="_ _c"> </span>an<span class="_ _b"> </span>assembly<span class="_ _c"> </span>language<span class="_ _b"> </span>program<span class="_ _b"> </span>that<span class="_ _b"> </span>calculates<span class="_ _b"> </span>the<span class="_ _b"> </span>Fibonacci<span class="_ _b"> </span>num-</div><div class="t m0 x5 h5 y1e ff3 fs2 fc0 sc0 ls0 ws0">b<span class="_ _0"></span>ers.<span class="_ _4"> </span>The<span class="_ _d"> </span>program<span class="_ _d"> </span>is<span class="_ _b"> </span>sp<span class="_ _0"></span>eci&#64257;ed<span class="_ _b"> </span>in<span class="_ _d"> </span>Don<span class="_ _d"> </span>Kn<span class="_ _2"></span>uth&#8217;s<span class="_ _d"> </span><span class="ff4">Liter<span class="_ _2"></span>ate<span class="_ _d"> </span>Pr<span class="_ _2"></span>o<span class="_ _2"></span>gr<span class="_ _2"></span>amming<span class="_ _6"> </span><span class="ff3">style<span class="_ _b"> </span>that</span></span></div><div class="t m0 x5 h5 y1f ff3 fs2 fc0 sc0 ls0 ws0">mak<span class="_ _2"></span>es<span class="_ _11"> </span>a<span class="_ _11"> </span>program<span class="_ _3"> </span>more<span class="_ _11"> </span>readable<span class="_ _3"> </span>for<span class="_ _11"> </span>h<span class="_ _2"></span>umans.<span class="_ _12"> </span>Literate<span class="_ _3"> </span>programming<span class="_ _11"> </span>can<span class="_ _11"> </span>be</div><div class="t m0 x5 h5 y20 ff3 fs2 fc0 sc0 ls0 ws0">applied<span class="_ _8"> </span>for<span class="_ _3"> </span>an<span class="_ _2"></span>y<span class="_ _3"> </span>programming<span class="_ _8"> </span>language,<span class="_ _3"> </span>but<span class="_ _3"> </span>it<span class="_ _8"> </span>is<span class="_ _3"> </span>esp<span class="_ _0"></span>ecially<span class="_ _8"> </span>nice<span class="_ _8"> </span>for<span class="_ _3"> </span>assembly</div><div class="t m0 x5 h5 y21 ff3 fs2 fc0 sc0 ls0 ws0">language<span class="_ _d"> </span>programs<span class="_ _6"> </span>that<span class="_ _6"> </span>are<span class="_ _d"> </span>hard<span class="_ _6"> </span>to<span class="_ _6"> </span>understand<span class="_ _d"> </span>without<span class="_ _6"> </span>commen<span class="_ _2"></span>ts.</div><div class="t m0 x6 h5 y22 ff3 fs2 fc0 sc0 ls0 ws0">The<span class="_ _11"> </span>basic<span class="_ _11"> </span>philosoph<span class="_ _2"></span>y<span class="_ _11"> </span>of<span class="_ _11"> </span>literate<span class="_ _11"> </span>programming<span class="_ _11"> </span>is<span class="_ _11"> </span>that<span class="_ _11"> </span>a<span class="_ _11"> </span>&#64257;le<span class="_ _11"> </span>con<span class="_ _2"></span>tains<span class="_ _11"> </span>the</div><div class="t m0 x5 h5 y23 ff3 fs2 fc0 sc0 ls0 ws0">do<span class="_ _0"></span>cumen<span class="_ _2"></span>tation<span class="_ _b"> </span>and<span class="_ _d"> </span>the<span class="_ _d"> </span>program<span class="_ _b"> </span>co<span class="_ _0"></span>de.<span class="_ _8"> </span>The<span class="_ _b"> </span>do<span class="_ _0"></span>cumentation<span class="_ _b"> </span>pro<span class="_"> </span>duces<span class="_ _d"> </span>a<span class="_ _d"> </span>L</div><div class="t m0 xb h8 y24 ff9 fs3 fc0 sc0 ls0 ws0">A</div><div class="t m0 xc h5 y23 ff3 fs2 fc0 sc0 ls0 ws0">T</div><div class="t m0 xd h5 y25 ff3 fs2 fc0 sc0 ls0 ws0">E</div><div class="t m0 xe h5 y23 ff3 fs2 fc0 sc0 ls0 ws0">X<span class="_ _b"> </span>or</div><div class="t m0 x5 h5 y26 ff3 fs2 fc0 sc0 ls0 ws0">plain<span class="_ _d"> </span>T</div><div class="t m0 xf h5 y27 ff3 fs2 fc0 sc0 ls0 ws0">E</div><div class="t m0 x10 h5 y26 ff3 fs2 fc0 sc0 ls0 ws0">X<span class="_ _d"> </span>do<span class="_ _0"></span>cument,<span class="_ _d"> </span>and<span class="_ _6"> </span>this<span class="_ _d"> </span>note<span class="_ _6"> </span>is<span class="_ _6"> </span>an<span class="_ _d"> </span>example.</div><div class="t m0 x11 h5 y28 ff3 fs2 fc0 sc0 ls0 ws0">1</div><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a></div><div class="pi" data-data='{"ctm":[1.568627,0.000000,0.000000,1.568627,0.000000,0.000000]}'></div></div> </body> </html>
评论
    相关推荐