{"id":3903,"date":"2025-07-14T15:56:04","date_gmt":"2025-07-14T07:56:04","guid":{"rendered":"https:\/\/www.aoisnow.net\/blog\/?p=3903"},"modified":"2025-07-14T15:57:12","modified_gmt":"2025-07-14T07:57:12","slug":"tont-31073-%e5%9c%a8-x86-%e7%b3%bb%e7%bb%9f%e4%b8%8a%e4%bd%bf%e7%94%a8%e5%b0%a4%e8%be%be%e5%a4%a7%e5%b8%88%ef%bc%88yoda%ef%bc%89%e5%8f%af%e8%83%bd%e5%af%b9%e6%82%a8%e7%9a%84%e7%b3%bb%e7%bb%9f%e7%9a%84","status":"publish","type":"post","link":"https:\/\/www.aoisnow.net\/blog\/archives\/3903","title":{"rendered":"TONT 31073 \u5728 x86 \u7cfb\u7edf\u4e0a\u4f7f\u7528\u5c24\u8fbe\u5927\u5e08\uff08Yoda\uff09\u53ef\u80fd\u5bf9\u60a8\u7cfb\u7edf\u7684\u5065\u5eb7\u6709\u5bb3"},"content":{"rendered":"<p>\u539f\u6587\u5730\u5740\uff1a<a href=\"https:\/\/devblogs.microsoft.com\/oldnewthing\/20060525-04\/?p=31073\" target=\"_blank\" rel=\"noopener\">https:\/\/devblogs.microsoft.com\/oldnewthing\/20060525-04\/?p=31073<\/a><\/p>\n<blockquote><p>In former times very cross-platform NTVDM was. If you view NTVDM.EXE in a hex editor, you\u2019ll find the message \u201cUsing Yoda on an x86 may be hazardous to your systems\u2019 health\u201d buried inside it.<\/p><\/blockquote>\n<p>\u5f88\u4e45\u4ee5\u524d\uff0cNTVDM \u7684\u8de8\u5e73\u53f0\u7a0b\u5ea6\u662f\u975e\u5e38\u9ad8\u7684\u3002\u5982\u679c\u4f60\u5728\u5341\u516d\u8fdb\u5236\u7f16\u8f91\u5668\u91cc\u67e5\u770b NTVDM.EXE \u7684\u5185\u5bb9\uff0c\u4f60\u4f1a\u770b\u5230\u91cc\u9762\u85cf\u7740\u8fd9\u4e48\u4e00\u53e5\u8bdd\uff1a\u201c\u5728 x86 \u7cfb\u7edf\u4e0a\u4f7f\u7528\u5c24\u8fbe\u5927\u5e08\u53ef\u80fd\u5bf9\u60a8\u7cfb\u7edf\u7684\u5065\u5eb7\u6709\u5bb3\u201d\u3002<\/p>\n<blockquote><p>Yoda was the name of the internal debugger that was used to debug the MS-DOS emulator, also known as the Virtual DOS Machine or VDM. (Buried inside the Yoda source code are such wonderful variables as \u201cluke\u201d and \u201cchewy\u201d.)<\/p><\/blockquote>\n<p>Yoda \u662f\u7528\u6765\u8c03\u8bd5 MS-DOS \u6a21\u62df\u5668\u7684\u5185\u90e8\u8c03\u8bd5\u5668\u7684\u540d\u5b57\uff0cMS-DOS \u6a21\u62df\u5668\u53c8\u79f0\u4f5c DOS \u865a\u62df\u673a\uff08VDM\uff09\u3002\uff08\u5728 Yoda \u7684\u6e90\u4ee3\u7801\u91cc\u8fd8\u6df1\u85cf\u7740\u5176\u5b83\u5999\u5999\u7684\u53d8\u91cf\u540d\uff0c\u6bd4\u5982 luke \u548c chewy\uff08\u8bd1\u6ce8\uff1a\u90fd\u662f\u300a\u661f\u7403\u5927\u6218\u300b\u6897\uff09\uff09\u3002<\/p>\n<blockquote><p>The Intel 80386 has a mode known as \u201cVirtual-8086 mode\u201d or just \u201cV86 mode\u201d wherein the CPU ran as if it were an 8086, except that if the program did anything interesting like issue a privileged instruction, call a software interrupt, or fault, control would return to the protected-mode supervisor for handling. (Win386 used this same CPU mode to support multiple MS-DOS sessions.)<\/p><\/blockquote>\n<p>Intel 80386 \u5904\u7406\u5668\u6709\u4e2a\u201c\u865a\u62df 8086 \u6a21\u5f0f\u201d\uff08\u6216\u8005\u7b80\u79f0\u4e3a V86 \u6a21\u5f0f\uff09\uff0c\u5728\u6b64\u6a21\u5f0f\u4e0b\uff0cCPU \u5c06\u6309\u7167 8086\uff08\u5b9e\u6a21\u5f0f\uff09\u7684\u65b9\u5f0f\u8fd0\u884c\uff0c\u4e0d\u8fc7\u53ea\u8981\u6709\u7a0b\u5e8f\u8bd5\u56fe\u6267\u884c\u5982\u7279\u6743\u6307\u4ee4\u3001\u8f6f\u4ef6\u4e2d\u65ad\u6216\u51fa\u9519\u4e4b\u7c7b\u7684\u884c\u4e3a\uff0c\u5c31\u4f1a\u8fd4\u56de\u5230\u4fdd\u62a4\u6a21\u5f0f\u7684\u7ba1\u7406\u4e4b\u4e0b\u6765\u5904\u7406\u8fd9\u4e00\u5207\u3002\uff08Win386 \u4e5f\u4f7f\u7528\u8fd9\u4e00 CPU \u6a21\u5f0f\u6765\u652f\u63f4\u591a\u4e2a MS-DOS \u4f1a\u8bdd\u3002\uff09<\/p>\n<blockquote><p>When running on an 80386-class processor, NTVDM used this mode to do its emulation, making the CPU do the heavy lifting of decoding instructions and emulating them, which took place at very close to full speed. On the other hand, NTVDM on the non-x86 processors (Alpha, PPC, MIPS, etc.) had to implement an entire 8086 emulator, with all the decoding and execution performed in software. Yoda was the debugger you used if you needed to debug the emulator.<\/p><\/blockquote>\n<p>\u5f53\u8fd0\u884c\u5728 80386 \u7ea7\u7684\u5904\u7406\u5668\u4e0a\u65f6\uff0cNTVDM \u4f7f\u7528\u865a\u62df 8086 \u6a21\u5f0f\u6765\u8fdb\u884c\u6a21\u62df\u5de5\u4f5c\uff0c\u8ba9 CPU \u6765\u627f\u62c5\u89e3\u7801\u6307\u4ee4\u3001\u6a21\u62df\u884c\u4e3a\u4e4b\u7c7b\u7684\u7e41\u91cd\u5de5\u4f5c\uff0c\u5e76\u4e14\u57fa\u672c\u4e0a\u53ef\u4ee5\u5168\u901f\u8fd0\u884c\u3002\u4f46\u53e6\u4e00\u65b9\u9762\uff0c\u5728\u975e x86 \u5904\u7406\u5668\u4e0a\uff08\u5982 Alpha\u3001PPC\u3001MIPS \u7b49\u7b49\uff09\u5c31\u8981\u5b9e\u73b0\u4e00\u6574\u4e2a 8086 \u6a21\u62df\u5668\uff0c\u5bf9\u6307\u4ee4\u7684\u89e3\u7801\u548c\u6267\u884c\u5de5\u4f5c\u5b8c\u5168\u4f9d\u8d56\u8f6f\u4ef6\u6a21\u62df\u3002Yoda \u5c31\u662f\u90a3\u4e2a\u7528\u6765\u8c03\u8bd5\u8fd9\u4e2a\u6a21\u62df\u5668\u7684\u8c03\u8bd5\u5668\u3002<\/p>\n<blockquote><p>And that\u2019s why NTVDM has a message warning you not to use Yoda on an x86. Because on an x86, there is no instruction emulator. There is nothing to debug.<\/p><\/blockquote>\n<p>\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48 NTVDM \u91cc\u6709\u4e00\u6761\u8b66\u544a\u4e0d\u8981\u5728 x86 \u7cfb\u7edf\u4e0a\u4f7f\u7528 Yoda \u7684\u539f\u56e0\u2014\u2014\u5728 x86 \u7cfb\u7edf\u4e0a\u5e76\u6ca1\u6709\u4e00\u4e2a x86 \u6307\u4ee4\u6a21\u62df\u5668\u7684\u5b58\u5728\uff0c\u4e48\u5f97\u8c03\u8bd5\u5de5\u4f5c\u53ef\u505a\u3002<\/p>\n<blockquote><p>(My thanks to Andrew McLaren and Tony Gaston for providing historical background.)<\/p><\/blockquote>\n<p>\uff08\u611f\u8c22 Andrew McLaren \u548c Tony Gaston \u63d0\u4f9b\u5386\u53f2\u80cc\u666f\u4fe1\u606f\u3002\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u539f\u6587\u5730\u5740\uff1ahttps:\/\/devblogs.microsoft.com\/oldnewthing\/2006052 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-3903","post","type-post","status-publish","format-standard","hentry","category-tont_history"],"_links":{"self":[{"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/posts\/3903","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/comments?post=3903"}],"version-history":[{"count":0,"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/posts\/3903\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/media?parent=3903"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/categories?post=3903"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/tags?post=3903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}