{"id":508,"date":"2026-03-07T19:59:56","date_gmt":"2026-03-07T11:59:56","guid":{"rendered":"http:\/\/8.129.82.128\/?p=508"},"modified":"2026-03-07T20:11:55","modified_gmt":"2026-03-07T12:11:55","slug":"8086%e6%b1%87%e7%bc%9612","status":"publish","type":"post","link":"http:\/\/8.129.82.128\/?p=508","title":{"rendered":"8086\u6c47\u7f16#12"},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"zh-CN\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>\u7b2c\u5341\u4e8c\u7ae0\u81f3\u7b2c\u5341\u4e03\u7ae0 &#8211; \u6c47\u7f16\u8bed\u8a00\u63d0\u7eb2<\/title>\n    <style>\n        #asm-wrapper {\n            all: initial;\n            display: block;\n            width: 100%;\n            min-height: 100vh;\n            margin: 0;\n            padding: 30px 25px;\n            box-sizing: border-box;\n            font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Microsoft YaHei\", sans-serif !important;\n            line-height: 1.8;\n            background: linear-gradient(180deg, #d4ecf7 0%, #a8e6cf 50%, #88d8b0 100%) !important;\n            color: #2c3e50 !important;\n        }\n        #asm-wrapper * { box-sizing: border-box; margin: 0; padding: 0; }\n        #asm-wrapper h1 { text-align: center; color: #1a5276 !important; font-size: 1.8em; border-bottom: 3px solid #27ae60 !important; padding-bottom: 15px; margin-bottom: 30px; }\n        #asm-wrapper h2 { color: #1e8449 !important; border-left: 4px solid #27ae60 !important; padding-left: 15px; margin-top: 30px; }\n        #asm-wrapper h3 { color: #196f3d !important; margin-top: 20px; }\n        #asm-wrapper p { margin: 10px 0; }\n        #asm-wrapper ul, #asm-wrapper ol { margin: 10px 0; padding-left: 25px; }\n        #asm-wrapper li { margin: 5px 0; }\n        #asm-wrapper strong { color: #e74c3c !important; font-weight: 700 !important; }\n        #asm-wrapper pre { background: #1e3d2f !important; color: #a8e6cf !important; padding: 15px 20px; border-radius: 8px; overflow-x: auto; font-size: 0.85em; line-height: 1.6; margin: 15px 0; border: 2px solid #27ae60; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }\n        #asm-wrapper pre code { background: none !important; padding: 0; color: inherit !important; border: none; }\n        #asm-wrapper table { width: 100%; border-collapse: collapse; margin: 15px 0; font-size: 0.9em; }\n        #asm-wrapper th, #asm-wrapper td { border: 1px solid #7f8c8d; padding: 10px 12px; text-align: left; }\n        #asm-wrapper th { background: #27ae60 !important; color: white !important; }\n        #asm-wrapper tr:nth-child(even) { background: #d5f5e3 !important; }\n        #asm-wrapper img { max-width: 100%; height: auto; display: block; margin: 25px 0; padding: 15px; background: white !important; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.15); border: 2px solid #27ae60; }\n        #asm-wrapper hr { border: none; border-top: 2px dashed #27ae60; margin: 30px 0; }\n<\/style>\n<\/head>\n<body>\n    <div id=\"asm-wrapper\">\n        <h1>\u7b2c\u5341\u4e8c\u7ae0 \u5185\u4e2d\u65ad \/ \u7b2c\u5341\u4e09\u7ae0 int\u6307\u4ee4 \/ \u7b2c\u5341\u56db\u7ae0 \u7aef\u53e3 \/ \u7b2c\u5341\u4e94\u7ae0 \u5916\u4e2d\u65ad \/ \u7b2c\u5341\u516d\u7ae0 \u76f4\u63a5\u5b9a\u5740\u8868 \/ \u7b2c\u5341\u4e03\u7ae0 \u4f7f\u7528BIOS\u8fdb\u884c\u952e\u76d8\u8f93\u5165\u548c\u78c1\u76d8\u8bfb\u5199<\/h1>\n        <hr>\n        \u7b2c\u5341\u4e8c\u7ae0 <![endif]><strong>\u5185\u4e2d\u65ad<\/strong><strong><\/strong><\/p>\n<p><![if !supportLists]>\u7b2c\u5341\u4e09\u7ae0 <![endif]><strong>int\u6307\u4ee4<\/strong><strong><\/strong><\/p>\n<p><![if !supportLists]>\u7b2c\u5341\u56db\u7ae0 <![endif]><strong>\u7aef\u53e3<\/strong><strong><\/strong><\/p>\n<p><![if !supportLists]>\u7b2c\u5341\u4e94\u7ae0 <![endif]><strong>\u5916\u4e2d\u65ad<\/strong><strong><\/strong><\/p>\n<p><![if !supportLists]>\u7b2c\u5341\u516d\u7ae0 <![endif]><strong>\u76f4\u63a5\u5b9a\u5740\u8868<\/strong><strong><\/strong><\/p>\n<p><![if !supportLists]>\u7b2c\u5341\u4e03\u7ae0 <![endif]><strong>\u4f7f\u7528BIOS\u8fdb\u884c\u952e\u76d8\u8f93\u5165\u548c\u78c1\u76d8\u8bfb\u5199<\/strong><strong><\/strong><\/p>\n<p><![if !supportLists]>\u4e00\u3001<![endif]><strong>\u76f4\u63a5\u5b9a\u5740\u8868<\/strong><strong><\/strong><\/p>\n<p><![if !supportLists]>1. <![endif]>\u79fb\u4f4d\u6307\u4ee4(14.3)<\/p>\n<pre><code><![if !supportLists]>(1) <![endif]>\u903b\u8f91\u5de6\u79fb shl opr,cnt<\/code><\/pre>\n<p><img decoding=\"async\" width=\"185\"  height=\"37\"  src=\"http:\/\/8.129.82.128\/wp-content\/uploads\/2026\/03\/asm202405\u7248\u63d0\u7eb269547.png\"  align=\"left\"  hspace=\"12\" >\u529f\u80fd:<\/p>\n<p>(i)\u5c06\u4e00\u4e2a\u5bc4\u5b58\u5668\u6216\u5185\u5b58\u5355\u5143\u4e2d\u7684\u6570\u636e\u5411\u5de6\u79fb\u4f4d<\/p>\n<p>(ii)\u5c06\u6700\u540e\u79fb\u51fa\u7684\u4e00\u4f4d\u5199\u5165CF\u4e2d<\/p>\n<p><img decoding=\"async\" width=\"191\"  height=\"35\"  src=\"http:\/\/8.129.82.128\/wp-content\/uploads\/2026\/03\/asm202405\u7248\u63d0\u7eb269593.png\"  align=\"left\"  hspace=\"12\" >(iii)\u6700\u4f4e\u4f4d\u75280\u586b\u5145<\/p>\n<pre><code>(2)\u903b\u8f91\u53f3\u79fb shr opr,cnt<\/code><\/pre>\n<p><img decoding=\"async\" width=\"168\"  height=\"40\"  src=\"http:\/\/8.129.82.128\/wp-content\/uploads\/2026\/03\/asm202405\u7248\u63d0\u7eb269627.png\"  align=\"left\"  hspace=\"12\" >\u4e0eshl\u6240\u6267\u884c\u7684\u64cd\u4f5c\u6070\u597d\u76f8\u53cd,\u4f46\u662f\u6700\u9ad8\u4f4d\u75280\u586b\u5145<\/p>\n<pre><code>(3)\u5faa\u73af\u5de6\u79fb rol opr,cnt<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"164\"  height=\"37\"  src=\"http:\/\/8.129.82.128\/wp-content\/uploads\/2026\/03\/asm202405\u7248\u63d0\u7eb269673.png\"  align=\"left\"  hspace=\"12\" >\u5c06\u79fb\u51fa\u6765\u7684\u4f4d\u653e\u5728\u4f4e\u4f4d\uff0c\u4e0d\u4f1a\u88650\uff0c\u5176\u4ed6\u4e0e\u903b\u8f91\u5de6\u79fb\u76f8\u4f3c<\/p>\n<pre><code><![if !supportLists]>(4) <![endif]>\u5faa\u73af\u53f3\u79fb ror opr,cnt<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"188\"  height=\"38\"  src=\"http:\/\/8.129.82.128\/wp-content\/uploads\/2026\/03\/asm202405\u7248\u63d0\u7eb269717.png\"  align=\"left\"  hspace=\"12\" >\u4e0erol\u76f8\u53cd<\/p>\n<p><![if !supportLists]>(5) <![endif]>\u7b97\u672f\u5de6\u79fb sal opr,cnt<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"176\"  height=\"43\"  src=\"http:\/\/8.129.82.128\/wp-content\/uploads\/2026\/03\/asm202405\u7248\u63d0\u7eb269742.png\"  align=\"left\"  hspace=\"12\" >\u4e0e\u903b\u8f91\u5de6\u79fb\u4e00\u81f4<\/p>\n<p><![if !supportLists]>(6) <![endif]>\u7b97\u672f\u53f3\u79fb sar opr,cnt<\/p>\n<p>\u4e0e\u903b\u8f91\u53f3\u79fb\u76f8\u4f3c,\u4f46\u662f\u7b26\u53f7\u4f4d\u4fdd\u6301\u4e0d\u53d8<\/p>\n<p><![if !supportLists]>(7) <![endif]><img loading=\"lazy\" decoding=\"async\" width=\"182\"  height=\"39\"  src=\"http:\/\/8.129.82.128\/wp-content\/uploads\/2026\/03\/asm202405\u7248\u63d0\u7eb269786.png\"  align=\"left\"  hspace=\"12\" >\u5e26\u8fdb\u4f4d\u5faa\u73af\u5de6\u79fb rcl opr,cnt<\/p>\n<p>\u6700\u9ad8\u4f4d\u653e\u5165CF,\u6700\u4f4e\u4f4d\u5c06\u539f\u6709CF\u7684\u503c\u79fb\u5165<\/p>\n<p><![if !supportLists]>(8) <![endif]><img loading=\"lazy\" decoding=\"async\" width=\"174\"  height=\"33\"  src=\"http:\/\/8.129.82.128\/wp-content\/uploads\/2026\/03\/asm202405\u7248\u63d0\u7eb269828.png\"  align=\"left\"  hspace=\"12\" >\u5e26\u8fdb\u4f4d\u5faa\u73af\u53f3\u79fb rcr opr,cnt<\/p>\n<p>\u4e0ercl\u76f8\u53cd<\/p>\n<p>*s\/sh=shift,l=left,r=right,a=arithmetic,r\/ro=rotate,c=carry<\/p>\n<p>\u5c06X\u903b\u8f91\u5de6\u79fb1\u4f4d\u76f8\u5f53\u4e8e\u6267\u884cX=X*2,\u53f3\u79fb1\u4f4d,\u76f8\u5f53\u4e8e\u6267\u884cX=X\/2<\/p>\n<p>\u5f53\u79fb\u52a8\u4f4d\u6570\u5927\u4e8e1\u65f6\uff0c\u5fc5\u987b\u5c06\u79fb\u52a8\u4f4d\u6570\u653e\u5728cl\u4e2d<\/p>\n<p>\u68c0\u6d4b\u70b914.2<\/p>\n<p>\u7f16\u7a0b\uff0c\u7528\u52a0\u6cd5\u548c\u79fb\u4f4d\u6307\u4ee4\u8ba1\u7b97(ax)=(ax)*10<\/p>\n<p>\u63d0\u793a\uff1a(ax)*10=(ax)*2+(ax)*8<\/p>\n<pre><code>assume cs:code \ncode segment \nstart:  mov bx,ax\n        shl ax,1;\u5de6\u79fb1\u4f4d(ax)=(ax)*2\n        mov cl,3\n        shl bx,cl       ;\u5de6\u79fb3\u4f4d(bx)=(ax)*8\n        add ax,bx       ;(ax)=(ax)*2+(ax)*8\n        mov ax,4c00h \n        int 21h \ncode ends <\/code><\/pre>\n<p>end start <\/p>\n<p><![if !supportLists]>2. <![endif]>\u63cf\u8ff0\u4e86\u5355\u5143\u957f\u5ea6\u7684\u6807\u53f7(16.1~16.2):\u683c\u5f0f:<\/p>\n<pre><code>\u6807\u53f7 db\/dw\/dd \u6570\u636e<\/code><\/pre>\n<p>\u5728\u6807\u53f7\u5904\u5b9a\u4e49\u6570\u636e\uff0c\u6807\u53f7\u4e0d\u9700\u8981\u5192\u53f7\uff0c\u8fd9\u4e9b\u6807\u53f7\u79f0\u4f5c\u6570\u636e\u6807\u53f7\uff0c\u6307\u540d\u4e86\u6570\u636e\u7684\u5355\u5143\u548c\u957f\u5ea6\u3002<\/p>\n<pre><code>assume cs:code<\/code><\/pre>\n<p>code segment<\/p>\n<pre><code>a db 1,2,3,4,5,6,7,8\nb dw 0<\/code><\/pre>\n<p>&#8230;&#8230;<\/p>\n<p>\u8fd9\u4e9b\u6807\u53f7(\u5982\u4e0a\u9762\u7684a,b)\u4e0d\u4f46\u8868\u793a\u5185\u5b58\u5730\u5740,\u8fd8\u8868\u793a\u4e86\u5185\u5b58\u5355\u5143\u7684\u957f\u5ea6\u3002\u6807\u53f7a\u63cf\u8ff0\u4e86\u5730\u5740code:0,\u5e76\u4e14\u4ece\u8fd9\u4e2a\u5730\u5740\u5f00\u59cb,\u4e4b\u540e\u7684\u5185\u5b58\u5355\u5143\u90fd\u662f\u5b57\u5355\u5143\u3002<\/p>\n<p>\u4f7f\u7528\u65f6\u4f5c\u4e3a\u4e00\u4e2a\u5730\u5740\u4f7f\u7528,\u53ef\u4ee5\u5f53\u4f5c\u53d8\u91cf(\u5728\u7f16\u8bd1\u65f6\u8f6c\u4e3a\u7528[&#8230;]\u8868\u793a\u7684\u5f62\u5f0f),\u5728\u6307\u4ee4\u4e2d\u4ee3\u8868\u4e00\u4e2a\u6bb5\u4e2d\u7684\u5185\u5b58\u5355\u5143\u3002<\/p>\n<p>\u5730\u5740\u6807\u53f7\u4ec5\u4ec5\u53ea\u80fd\u8868\u793a\u4e00\u4e2a\u5730\u5740\uff0c\u4e14\u53ea\u80fd\u5728\u4ee3\u7801\u6bb5\u4e2d\u4f7f\u7528<\/p>\n<p>\u82e5\u8981\u5728\u5176\u4ed6\u6bb5\u4e2d\u4f7f\u7528\u5730\u5740\u6807\u53f7,\u5728\u4ee3\u7801\u6bb5\u4e2d\u76f4\u63a5\u7528\u6570\u636e\u6807\u53f7\u8bbf\u95ee\u6570\u636e\uff0c\u9700\u8981\u7528assume\u5c06\u6807\u53f7\u6240\u5728\u6bb5\u4e0e\u67d0\u4e00\u4e2a\u6bb5\u5bc4\u5b58\u5668\u5173\u8054\u8d77\u6765\uff0c\u5426\u5219\u7f16\u8bd1\u5668\u65e0\u6cd5\u786e\u5b9a\u6807\u53f7\u7684\u6bb5\u5730\u5740\u6240\u5728\u6bb5\u5bc4\u5b58\u5668\u3002<\/p>\n<p>\u53ef\u4ee5\u5c06\u6807\u53f7\u5f53\u4f5c\u6570\u636e\u5b9a\u4e49\uff0c\u6b64\u65f6\u7f16\u8bd1\u5668\u5c06\u6807\u53f7\u6240\u8868\u793a\u7684\u5730\u5740\u5f53\u4f5c\u6570\u636e\u7684\u503c<\/p>\n<pre><code>a db 1,2,3,4,5,6,7,8\nb dw 0\nc dw a,b\nd dd a,b<\/code><\/pre>\n<p>\u6b64\u65f6c\u4e2d\u5b58\u50a8\u4e86a\u548cb\u7684\u504f\u79fb\u5730\u5740<\/p>\n<pre><code>d\u4e2d\u5b58\u50a8\u4e86a\u548cb\u7684\u6bb5\u5730\u5740\u548c\u504f\u79fb\u5730\u5740\uff0c\u76f8\u5f53\u4e8e d dw offset a,seg a,offset b,seg b<\/code><\/pre>\n<p>seg\u64cd\u4f5c\u7b26\u7528\u4e8e\u53d6\u6bb5\u5730\u5740<\/p>\n<p>\u68c0\u6d4b\u70b916.1<\/p>\n<p>\u4e0b\u9762\u7684\u7a0b\u5e8f\u5c06code\u6bb5\u4e2da\u5904\u76848\u4e2a\u6570\u503c\u7d2f\u52a0\uff0c\u7ed3\u679c\u5b58\u50a8\u5230b\u5904\u7684\u53cc\u5b57\u8282\u4e2d\uff0c\u8865\u5168\u7a0b\u5e8f\u3002<\/p>\n<pre><code>assume cs:code<\/code><\/pre>\n<p>code segment<\/p>\n<pre><code>a dw 1,2,3,4,5,6,7,8\nb dd 0\nstart:mov si,0\nmov cx,8\ns:mov ax,<u>a[si]<\/u><u><\/u>\nadd <u>a[16]<\/u>,ax<\/code><\/pre>\n<p>adc <u>a[18]<\/u>,0<\/p>\n<pre><code>add si,<u>2<\/u>\nloop s\nmov ax,4c00h\nint 21h<\/code><\/pre>\n<p>code ends<\/p>\n<p>end start<\/p>\n<p>\u68c0\u6d4b\u70b916.2<\/p>\n<p>\u4e0b\u9762\u7684\u7a0b\u5e8f\u5c06data\u6bb5\u4e2da\u5904\u76848\u4e2a\u6570\u503c\u7d2f\u52a0\uff0c\u7ed3\u679c\u5b58\u50a8\u5230b\u5904\u7684\u53cc\u5b57\u8282\u4e2d\uff0c\u8865\u5168\u7a0b\u5e8f\u3002<\/p>\n<pre><code>assume cs:code,es:data<\/code><\/pre>\n<p>data segment<\/p>\n<pre><code>a db 1,2,3,4,5,6,7,8\nb dw 0<\/code><\/pre>\n<p>data ends<\/p>\n<p>code segment<\/p>\n<pre><code>start:<u> mov ax,data   <\/u>\nmov es,ax       <\/u><u><\/u>\nmov si,0\nmov cx,8\ns:mov al,a[si]\nmov ah,0\nadd b,ax\ninc si\nloop s<\/code><\/pre>\n<p> <\/p>\n<pre><code>mov ax,4c00h\nint 21h<\/code><\/pre>\n<p>code ends<\/p>\n<p>end start<\/p>\n<p><![if !supportLists]>3. <![endif]>\u76f4\u63a5\u5b9a\u5740\u8868(16.3)\uff1a\u67e5\u8868\u89e3\u51b3\u95ee\u9898<\/p>\n<p>*\u5b9a\u4e49:\u53ef\u4ee5\u901a\u8fc7\u4f9d\u636e\u6570\u636e,\u76f4\u63a5\u8ba1\u7b97\u51fa\u6240\u8981\u67e5\u627e\u7684\u5143\u7d20\u7684\u4f4d\u7f6e\u7684\u8868\u53eb\u505a\u76f4\u63a5\u5b9a\u5740\u8868<\/p>\n<p>*\u60c5\u5883:\u663e\u793a\u7ed9\u5b9a\u5b57\u8282\u578b\u6570\u636e\u7684\u5341\u516d\u8fdb\u5236\u5f62\u5f0f<\/p>\n<p>\u6570\u503c0~9\u4e0e\u6570\u5b57\u5b57\u7b26&#8217;0&#8217;~&#8217;9&#8217;\u7684\u5bf9\u5e94\u5173\u7cfb<\/p>\n<p>\u6570\u503c+30H=\u5bf9\u5e94\u5b57\u7b26\u7684ASCII\u503c<\/p>\n<p>\u6570\u503c10~15\u4e0e\u5b57\u7b26&#8217;A&#8217;~&#8217;F&#8217;\u4e4b\u95f4\u7684\u5bf9\u5e94\u5173\u7cfb<\/p>\n<p>\u6570\u503c+37H=\u5bf9\u5e94\u5b57\u7b26\u7684ASCII\u503c<\/p>\n<p>*\u65b9\u6848:\u5efa\u7acb\u5b57\u7b26\u8868\uff0c\u5b58\u653e&#8217;0&#8217;~&#8217;F&#8217;\uff0c\u53ef\u4ee5\u901a\u8fc7\u6570\u503c\u627e\u5230\u5bf9\u5e94\u7684\u5b57\u7b26<\/p>\n<pre><code>\u5982:table db '0123456789ABCDEF'<\/code><\/pre>\n<p>\u5c06ah\u4e2d\u7684\u6570\u5b57\u663e\u793a\u51fa\u6765:<\/p>\n<pre><code>mov bl,ah\nmov bh,0\nmov ah,table[bx]<\/code><\/pre>\n<p>*\u603b\u7ed3:\u5f53\u4e24\u4e2a\u6570\u636e\u96c6\u5408\u4e4b\u95f4\u53ef\u4ee5\u5efa\u7acb\u5bf9\u5e94\u7684\u6620\u5c04\u65f6\uff0c\u53ef\u4ee5\u8fdb\u884c\u7f16\u6392\uff0c\u5f62\u6210\u4e00\u4e2a\u8868\uff0c\u53ef\u4ee5\u7528\u67e5\u8868\u7684\u65b9\u6cd5\u6839\u636e\u7ed9\u51fa\u7684\u6570\u636e\u5f97\u5230\u5176\u5728\u53e6\u4e00\u4e2a\u96c6\u5408\u4e2d\u7684\u5bf9\u5e94\u6570\u636e<\/p>\n<p>*\u5206\u7c7b:\u4ee3\u7801\u7684\u76f4\u63a5\u5b9a\u5740\u8868\u3001\u6570\u636e\u7684\u76f4\u63a5\u5b9a\u5740\u8868<\/p>\n<p>*\u4ee3\u7801\u7684\u76f4\u63a5\u5b9a\u5740\u8868:\u53ef\u4ee5\u5b58\u50a8\u5b50\u7a0b\u5e8f\u4e2d\u591a\u4e2a\u529f\u80fd\u53f7\u7684\u5730\u5740,\u9700\u8981\u4f7f\u7528\u65f6\u8ba1\u7b97\u4e00\u4e0b\u8868\u4e2d\u5143\u7d20\u7684\u4f4d\u7f6e,\u7136\u540e\u627e\u5230\u5176\u4e2d\u5b58\u50a8\u7684\u529f\u80fd\u7684\u5730\u5740,\u7136\u540e\u8df3\u8f6c<\/p>\n<pre><code>\u5982: dw func1,func2,func3,func4<\/code><\/pre>\n<p>\u53ef\u4ee5\u6839\u636e\u529f\u80fd\u53f71\\2\\3\\4\u6765\u627e\u5230\u5bf9\u5e94\u7684\u5730\u5740,\u9700\u8981\u6269\u5145\u65f6\u53ea\u9700\u8981\u6dfb\u52a0\u8868\u9879<\/p>\n<p><![if !supportLists]>\u4e8c\u3001<![endif]><strong>\u5185\u4e2d\u65ad(Chapter 12&#038;13)<\/strong><strong><\/strong><\/p>\n<p><![if !supportLists]>1. <![endif]>\u4e2d\u65ad<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"278\"  height=\"108\"  src=\"http:\/\/8.129.82.128\/wp-content\/uploads\/2026\/03\/asm202405\u7248\u63d0\u7eb271874.png\"  align=\"left\"  hspace=\"12\" >\u4e2d\u65ad\u4fe1\u606f\u662fCPU\u4ece\u5185\u90e8\u6216\u5916\u90e8\u68c0\u6d4b\u5230\u53d1\u6765\u7684\u7279\u6b8a\u4fe1\u606f,\u6b64\u65f6CPU\u4e0d\u518d\u63a5\u7740\u6267\u884c\u4e0b\u9762\u7684\u6307\u4ee4\uff0c\u800c\u662f\u53bb\u5904\u7406\u4e2d\u65ad\u4fe1\u606f<\/p>\n<p>\u5916\u4e2d\u65ad:\u5916\u90e8\u8bbe\u5907\u53d1\u751f\u7684\u4e8b\u4ef6\u5f15\u8d77\u4e2d\u65ad<\/p>\n<p>\u5185\u4e2d\u65ad:CPU\u5185\u90e8\u53d1\u751f\u7684\u4e8b\u4ef6\u5f15\u8d77\u7684\u4e2d\u65ad<\/p>\n<p><![if !supportLists]>2. <![endif]>\u5185\u4e2d\u65ad\u7684\u4ea7\u751f:<\/p>\n<p><![if !supportLists]>(1) <![endif]>\u9664\u6cd5\u9519\u8bef,\u5982\u6267\u884cdiv\u4ea7\u751f\u6ea2\u51fa<\/p>\n<p><![if !supportLists]>(2) <![endif]>\u5355\u6b65\u6267\u884c<\/p>\n<p><![if !supportLists]>(3) <![endif]>\u6267\u884cinto\u6307\u4ee4<\/p>\n<p><![if !supportLists]>(4) <![endif]>\u6267\u884cint\u6307\u4ee4<\/p>\n<p><![if !supportLists]>3. <![endif]>CPU\u5904\u7406\u4e2d\u65ad\u9700\u8981\u4e2d\u65ad\u7c7b\u578b\u7801,\u4e2d\u65ad\u7c7b\u578b\u7801\u7528\u4e8e\u6807\u8bc6\u4e2d\u65ad\u4fe1\u606f\u6765\u6e90\u3002\u4e2d\u65ad\u7c7b\u578b\u7801\u4e3a\u4e00\u5b57\u8282\uff0c\u53ef\u4ee5\u8868\u793a256\u79cd\u4e2d\u65ad\u4fe1\u606f<\/p>\n<p><![if !supportLists]>4. <![endif]>\u4e2d\u65ad\u4fe1\u606f\u7684\u6765\u6e90\u53eb\u505a\u4e2d\u65ad\u6e90<\/p>\n<p><![if !supportLists]>5. <![endif]>4\u79cd\u4e2d\u65ad\u7684\u4e2d\u65ad\u7c7b\u578b\u7801:<\/p>\n<p><![if !supportLists]>(1) <![endif]>\u9664\u6cd5\u9519\u8bef:0 (2)\u5355\u6b65\u6267\u884c:1 (3)\u6267\u884cinto\u6307\u4ee4:4 <\/p>\n<p>(4)\u6267\u884cint\u6307\u4ee4:\u683c\u5f0fint n \u7528\u4e8e\u8c03\u7528n\u53f7\u4e2d\u65ad\uff0cn\u4e3a\u5b57\u8282\u578b\u7acb\u5373\u6570<\/p>\n<p>6.\u7528\u4e8e\u5904\u7406\u4e2d\u65ad\u4fe1\u606f\u7684\u7a0b\u5e8f\u53eb\u505a\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\uff0cCPU\u5728\u6536\u5230\u4e2d\u65ad\u4fe1\u606f\u540e\u4f1a\u6267\u884c\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f<\/p>\n<p>7.\u4e2d\u65ad\u5411\u91cf\u8868<\/p>\n<p>\u4e2d\u65ad\u5411\u91cf\u8868\u662f\u4e2d\u65ad\u5411\u91cf\u7684\u5217\u8868,\u4e2d\u65ad\u5411\u91cf\u5c31\u662f\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u5165\u53e3\u5730\u5740\u3002<\/p>\n<p>\u77e5\u9053\u4e2d\u65ad\u7c7b\u578b\u7801\u5c31\u53ef\u4ee5\u5b9a\u4f4d\u4e2d\u65ad\u5411\u91cf\u8868\u8868\u9879\uff0c8086CPU\u7684\u4e2d\u65ad\u5411\u91cf\u8868\u5b58\u653e\u5728\u5185\u5b58\u5730\u57400\u5904\uff0c\u8303\u56f4:0000:0000~0000:03ff\u51711024\u5b57\u8282\u3002\u4e00\u4e2a\u8868\u9879\u5b58\u653e\u4e00\u4e2a\u4e2d\u65ad\u5411\u91cf\uff0c\u5360\u7528\u4e24\u4e2a\u5b57,\u9ad8\u5b57\u5b58\u653e\u6bb5\u5730\u5740,\u4f4e\u5b57\u5b58\u653e\u504f\u79fb\u5730\u5740<\/p>\n<p>\u68c0\u6d4b\u70b912.1<\/p>\n<p>(1)\u7528debug\u67e5\u770b\u5185\u5b58\uff0c\u60c5\u51b5\u5982\u4e0b\uff1a<\/p>\n<p>0000:0000  68 10 A7 00 8B 01 70 00-16 00 9D 03 8B 01 70 00<\/p>\n<p>\u52193\u53f7\u4e2d\u65ad\u6e90\u5bf9\u5e94\u7684\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u5165\u53e3\u7684\u504f\u79fb\u5730\u5740\u7684\u5185\u5b58\u5355\u4f4d\u7684\u5730\u5740\u4e3a\uff1a<u> 0070:018b <\/u><u><\/u><\/p>\n<p>(2)\u5b58\u50a8N\u53f7\u4e2d\u65ad\u6e90\u5bf9\u5e94\u7684\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u5165\u53e3\u7684\u504f\u79fb\u5730\u5740\u7684\u5185\u5b58\u5355\u5143\u7684\u5730\u5740\u4e3a\uff1a<u> 4N <\/u><u><\/u><\/p>\n<p>\u5b58\u50a8N\u53f7\u4e2d\u65ad\u6e90\u5bf9\u5e94\u7684\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u5165\u53e3\u7684\u6bb5\u5730\u5740\u7684\u5185\u5b58\u5355\u5143\u7684\u5730\u5740\u4e3a\uff1a<u> 4N+2 <\/u><u><\/u><\/p>\n<p><![if !supportLists]>8. <![endif]>\u4e2d\u65ad\u8fc7\u7a0b<\/p>\n<p>&#183;\u7531CPU\u81ea\u52a8\u5b8c\u6210,\u5148\u627e\u5230\u4e2d\u65ad\u5411\u91cf,\u8bbe\u7f6eCS\u548cIP\u3002\u8be5\u8fc7\u7a0b\u53eb\u505a\u4e2d\u65ad\u8fc7\u7a0b<\/p>\n<p><![if !supportLists]>(1) <![endif]>\u53d6\u5f97\u4e2d\u65ad\u7c7b\u578b\u7801n<\/p>\n<p><![if !supportLists]>(2) <![endif]>\u6807\u5fd7\u5bc4\u5b58\u5668\u7684\u503c\u5165\u6808(\u4e2d\u65ad\u8fc7\u7a0b\u53ef\u80fd\u6539\u53d8\u6807\u5fd7\u5bc4\u5b58\u5668\u7684\u503c)pushf<\/p>\n<p><![if !supportLists]>(3) <![endif]>\u8bbe\u7f6e\u6807\u5fd7\u5bc4\u5b58\u5668\u7684\u7b2c8\u4f4dTF\u548c\u7b2c9\u4f4dIF\u7684\u503c\u4e3a0TF=0,IF=0<\/p>\n<p><![if !supportLists]>(4) <![endif]>CS\u5165\u6808push CS<\/p>\n<p><![if !supportLists]>(5) <![endif]>IP\u5165\u6808push IP<\/p>\n<p><![if !supportLists]>(6) <![endif]>\u8bbe\u7f6e\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u7684\u5165\u53e3\u5730\u5740(IP)=(N*4),(CS)=(N*4+2)<\/p>\n<p>\u5728\u6267\u884c\u5b8c\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u540e\uff0c\u9700\u8981\u6062\u590d\u5728\u8fdb\u5165\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u4e4b\u524d\u7684CPU\u73b0\u573a\uff0c\u56e0\u6b64\u9700\u8981\u5728\u4fee\u6539\u6807\u5fd7\u5bc4\u5b58\u5668\u524d\u5c06\u4ed6\u4eec\u7684\u503c\u4fdd\u5b58\u5165\u6808<\/p>\n<p><![if !supportLists]>9. <![endif]>\u7f16\u5236\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f<\/p>\n<p>&#183;\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u8981\u5e38\u9a7b\u5185\u5b58,\u56e0\u6b64\u8981\u9009\u62e9\u4e00\u4e2a\u4f4d\u7f6e<\/p>\n<p>\u89e3\u51b3\u65b9\u6cd5:[\u7b80\u4fbf]\u627e\u5230\u4e00\u5757\u5176\u4ed6\u7a0b\u5e8f\u4e0d\u4f1a\u7528\u7684\u5185\u5b58,\u59820000:0200~0000:02ff\u6ca1\u6709\u88ab\u4f7f\u7528<\/p>\n<p>\u6ce8\u610f:\u5728\u5de5\u7a0b\u4e0a\u4e0d\u8981\u8fd9\u6837\u505a\uff0c\u8981\u53bb\u5176\u4ed6\u5b89\u5168\u7684\u5185\u5b58\u4e2d\u5b58\u653e(\u9664\u975e\u81ea\u5df1\u7f16\u5199\u64cd\u4f5c\u7cfb\u7edf)<\/p>\n<p>&#183;\u8981\u5728\u4e2d\u65ad\u5411\u91cf\u8868\u4e2d\u767b\u8bb0<\/p>\n<p>&#183;\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u7684\u7f16\u5199\u65b9\u6cd5:<\/p>\n<p><![if !supportLists]>(1) <![endif]>\u4fdd\u5b58\u7528\u5230\u7684\u5bc4\u5b58\u5668<\/p>\n<p><![if !supportLists]>(2) <![endif]>\u5904\u7406\u4e2d\u65ad<\/p>\n<p><![if !supportLists]>(3) <![endif]>\u6062\u590d\u7528\u5230\u7684\u5bc4\u5b58\u5668<\/p>\n<p><![if !supportLists]>(4) <![endif]>\u7528IRET\u6307\u4ee4\u8fd4\u56de<\/p>\n<p>iret\u6307\u4ee4\u7684\u529f\u80fd:<\/p>\n<pre><code>pop IP\npop CS<\/code><\/pre>\n<p>popf<\/p>\n<p>iret\u901a\u5e38\u7528\u4e8e\u4e2d\u65ad\u8fc7\u7a0b\u7ed3\u675f\u540e\u7684\u8fd4\u56de\uff0c\u7528\u4e8e\u6062\u590dCS\u548cIP\u4ee5\u53ca\u6807\u5fd7\u5bc4\u5b58\u5668\uff0c\u4ee5\u4fbf\u4e8e\u56de\u5230\u539f\u6765\u7684\u4f4d\u7f6e\u3002<\/p>\n<p>&#183;\u5904\u74060\u53f7\u4e2d\u65ad<\/p>\n<p>\u53ef\u4ee5\u7f16\u5199\u4e00\u4e2ado0\u7684\u5b89\u88c5\u7a0b\u5e8f,\u524d\u9762\u5b58\u50a8\u4e86\u5b89\u88c5\u7a0b\u5e8f,\u540e\u9762\u5b58\u50a8do0,\u6267\u884c\u540e\u5c06do0\u5b89\u88c5\u5230\u5185\u5b58<\/p>\n<p>(1)\u5b89\u88c5\u7684\u6280\u5de7:\u53ef\u4ee5\u7528\u6807\u53f7\u786e\u5b9a\u7a0b\u5e8f\u7684\u957f\u77ed\uff0c\u5229\u7528\u7f16\u8bd1\u5668\u8ba1\u7b97do0\u7684\u957f\u77ed<\/p>\n<pre><code><strong>mov cx,offset do0end-offset do0<\/strong><strong><\/strong><\/code><\/pre>\n<p>&#8230;<\/p>\n<p>do0:<\/p>\n<p>&#8230;<\/p>\n<p>do0end:nop<\/p>\n<p>\u7f16\u8bd1\u5668\u53ef\u4ee5\u5c06\u4e00\u4e9b\u8868\u8fbe\u5f0f\u5728\u7f16\u8bd1\u65f6\u8ba1\u7b97,\u59820*4+2<\/p>\n<p>+ &#8211; * \\\u90fd\u662f\u7f16\u8bd1\u5668\u8bc6\u522b\u7684\u8fd0\u7b97\u7b26\u53f7\uff0c\u7f16\u8bd1\u5668\u53ef\u4ee5\u7528\u5b83\u4eec\u8fdb\u884c\u5e38\u6570\u7684\u51cf\u6cd5<\/p>\n<pre><code>\u5982mov ax,(5+3)*5\/10\u7b49\u4ef7\u4e8e mov ax,4<\/code><\/pre>\n<p><![if !supportLists]>(2) <![endif]>\u5728\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u4e2d\u4f7f\u7528\u7684\u5e38\u91cf\u548c\u53d8\u91cf\u5e94\u5b58\u50a8\u5728\u5904\u7406\u7a0b\u5e8f\u4e2d,\u4e0d\u80fd\u5728\u5b89\u88c5\u7a0b\u5e8f\u5f00\u8f9f\u4e00\u4e2a\u6570\u636e\u6bb5\u5b58\u50a8\u3002\u5728\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u4e2d\u53ef\u4ee5\u7528\u4e00\u6bb5\u533a\u57df\u5b58\u50a8\u6570\u636e\uff0c\u5728\u5f00\u59cb\u65f6\u7528jmp\u6307\u4ee4\u8df3\u5230\u7a0b\u5e8f\u771f\u6b63\u7684\u5f00\u59cb\u4f4d\u7f6e\uff0c\u5982:<\/p>\n<pre><code>do0:jmp short do0start\ndb \"overflow!\"\ndo0start:mov ax,cs\nmov ds,ax\nmov si,202h\nmov ax,0b800h\nmov es,ax\nmov di,12*160+36*2\nmov cx,9\ns:mov al,[si]\nmov es:[di],al\ninc si\nadd di,2\nloop s\nmov ax,4c00h\nint 21h<\/code><\/pre>\n<p>do0end:nop<\/p>\n<p><![if !supportLists]>10. <![endif]>\u5355\u6b65\u4e2d\u65ad(debug\u7684t\u547d\u4ee4\u4f7f\u7528)<\/p>\n<p><![if !supportLists]>(1) <![endif]>TF(\u9677\u9631\u6807\u5fd7,trap flag):\u7528\u4e8e\u8c03\u8bd5\u65f6\u7684\u5355\u6b65\u65b9\u5f0f\u64cd\u4f5c\u3002\u5f53TF=1\u65f6,\u6bcf\u6761\u6307\u4ee4\u6267\u884c\u5b8c\u6bd5\u540e\u4ea7\u751f\u9677\u9631\uff0c\u7531\u7cfb\u7edf\u63a7\u5236\u8ba1\u7b97\u673a,\u5f53TF=0\u65f6\uff0cCPU\u6b63\u5e38\u5de5\u4f5c\uff0c\u4e0d\u4ea7\u751f\u9677\u9631<\/p>\n<p><![if !supportLists]>(2) <![endif]>IF(\u4e2d\u65ad\u6807\u5fd7,interrupt flag)\u5f53IF=1\u65f6\uff0c\u5141\u8bb8CPU\u76f8\u5e94\u53ef\u5c4f\u853d\u4e2d\u65ad\u8bf7\u6c42\uff0c\u5f53IF=0\u65f6\uff0c\u5173\u95ed\u4e2d\u65ad\uff0c\u4e0d\u54cd\u5e94\u3002<\/p>\n<p><![if !supportLists]>(3) <![endif]>\u5355\u6b65\u4e2d\u65ad\u7684\u8fc7\u7a0b:<\/p>\n<p>\u2460\u53d6\u5f97\u4e2d\u65ad\u7c7b\u578b\u78011<\/p>\n<p>\u2461\u6807\u5fd7\u5bc4\u5b58\u5668\u5165\u6808,TF\u548cIF\u8bbe\u4e3a0<\/p>\n<p>\u2462CS\u3001IP\u5165\u6808<\/p>\n<p>&#9315;(IP)=(1*4),(CS)=(1*4+2)<\/p>\n<p>\u82e5TF=1,\u5219\u5728\u6267\u884c\u5355\u6b65\u4e2d\u65ad\u65f6\u53c8\u518d\u6b21\u5f15\u53d1\u5355\u6b65\u4e2d\u65ad\uff0c\u4fbf\u4f1a\u5faa\u73af\u4e0b\u53bb.\u56e0\u6b64\u5728\u5904\u7406\u5355\u6b65\u4e2d\u65ad\u65f6\u8981\u628aTF\u8bbe\u4e3a0<\/p>\n<p><![if !supportLists]>11. <![endif]>\u4e2d\u65ad\u4e0d\u54cd\u5e94<\/p>\n<p>\u5728\u6267\u884c\u5b8c\u5411SS\u5bc4\u5b58\u5668\u4f20\u9001\u6570\u636e\u7684\u6307\u4ee4\u540e,CPU\u4e0d\u54cd\u5e94\u4e2d\u65ad<\/p>\n<p>\u539f\u56e0:SS:SP\u6307\u5411\u6808\u9876\uff0c\u5bf9\u4ed6\u4eec\u7684\u8bbe\u7f6e\u8981\u8fde\u7eed\u5b8c\u6210\u3002\u8981\u4fdd\u8bc1\u6808\u64cd\u4f5c\u7684\u6b63\u786e<\/p>\n<p>\u6240\u4ee5\u8bbe\u7f6eSP\u7684\u6307\u4ee4\u5e94\u7d27\u8ddf\u5728\u8bbe\u7f6eSS\u7684\u6307\u4ee4\u4e4b\u540e<\/p>\n<p>12.int\u6307\u4ee4<\/p>\n<pre><code>int\u6307\u4ee4\u7684\u683c\u5f0f:int n<\/code><\/pre>\n<p>\u76f8\u5f53\u4e8e\u5f15\u53d1\u4e00\u4e2an\u53f7\u4e2d\u65ad\u7684\u8fc7\u7a0b:<\/p>\n<p><![if !supportLists]>(1) <![endif]>\u53d6\u4e2d\u65ad\u7c7b\u578b\u7801n<\/p>\n<p><![if !supportLists]>(2) <![endif]>\u6807\u5fd7\u5bc4\u5b58\u5668\u5165\u6808,IF=0,TF=0<\/p>\n<p><![if !supportLists]>(3) <![endif]>CS\u3001IP\u5165\u6808<\/p>\n<p><![if !supportLists]>(4) <![endif]>(IP)=(n*4),(CS)=(n*4+2)<\/p>\n<p>\u7cfb\u7edf\u4f1a\u5c06\u4e00\u4e9b\u5b50\u7a0b\u5e8f\u4ee5\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f(\u4e2d\u65ad\u4f8b\u7a0b)\u7684\u5f62\u5f0f\u63d0\u4f9b\u3002<\/p>\n<p><![if !supportLists]>12. <![endif]>\u7f16\u5199\u4f9b\u7a0b\u5e8f\u8c03\u7528\u7684\u4e2d\u65ad\u4f8b\u7a0b<\/p>\n<p><![if !supportLists]>(1) <![endif]>\u4fdd\u5b58\u8981\u7528\u5230\u7684\u5bc4\u5b58\u5668<\/p>\n<p><![if !supportLists]>(2) <![endif]>\u5904\u7406\u4e2d\u65ad<\/p>\n<p><![if !supportLists]>(3) <![endif]>\u6062\u590d\u5bc4\u5b58\u5668<\/p>\n<p><![if !supportLists]>(4) <![endif]>\u7528iret\u8fd4\u56de<\/p>\n<p>\u68c0\u6d4b\u70b913.1<\/p>\n<p>7ch\u4e2d\u65ad\u4f8b\u7a0b\u5982\u4e0b\uff1a<\/p>\n<pre><code>lp:push bp\nmov bp,sp\ndec cx<\/code><\/pre>\n<p>jcxz lpret<\/p>\n<pre><code>add [bp+2],bx\nlpret:pop bp <\/code><\/pre>\n<p>iret<\/p>\n<p>bx\u5b58\u653e\u4f4d\u79fb<\/p>\n<p> (1)\u5728\u4e0a\u9762\u7684\u5185\u5bb9\u4e2d\uff0c\u6211\u4eec\u75287ch\u4e2d\u65ad\u4f8b\u7a0b\u5b9e\u73b0loop\u7684\u529f\u80fd\uff0c\u5219\u4e0a\u9762\u76847ch\u4e2d\u65ad\u4f8b\u7a0b\u6240\u80fd\u8fdb\u884c\u7684\u6700\u5927\u8f6c\u79fb\u4f4d\u79fb\u662f\u591a\u5c11\uff1f<\/p>\n<p>\u7b54:\u6700\u5927\u4f4d\u79fb\u662fFFFFH<\/p>\n<p>(2)\u75287ch\u4e2d\u65ad\u4f8b\u7a0b\u5b8c\u6210jmp near ptr s\u6307\u4ee4\u529f\u80fd\uff0c\u7528bx\u5411\u4e2d\u65ad\u4f8b\u7a0b\u4f20\u9001\u8f6c\u79fb\u4f4d\u79fb\u3002<\/p>\n<p>\u5e94\u7528\u4e3e\u4f8b\uff1a\u5728\u5c4f\u5e55\u7684\u7b2c12\u884c\uff0c\u663e\u793adata\u6bb5\u4e2d\u4ee50\u7ed3\u5c3e\u7684\u5b57\u7b26\u4e32\u3002<\/p>\n<pre><code>assume cs:code<\/code><\/pre>\n<p>data segment<\/p>\n<pre><code>db 'conversation',0<\/code><\/pre>\n<p>data ends<\/p>\n<p>code segment<\/p>\n<p>start:<\/p>\n<pre><code>mov ax,data\nmov ds,ax\nmov si,0\nmov ax,0b800h\nmov es,ax\nmov di,12*160\ns:cmp byte ptr [si],0\nje ok\nmov al,[si]\nmov es:[di],al\ninc si\nadd di,2\nmov bx,offset s-offset ok\nint 7ch\nok:mov ax,4c00h\nint 21h<\/code><\/pre>\n<p>code ends<\/p>\n<p>end start<\/p>\n<pre><code>jmp near ptr s\u6307\u4ee4\u7684\u529f\u80fd\u4e3a\uff1a(ip)=(ip)+16\u4f4d\u79fb\uff0c\u5b9e\u73b0\u6bb5\u5185\u8fd1\u8f6c\u79fb,\u7b54\u6848:\npush bp\nmov bp,sp\nadd [bp+2],bx;ok\u7684\u504f\u79fb\u5730\u5740+bx\u5f97\u5230s\u7684\u504f\u79fb\u5730\u5740\npop bp<\/code><\/pre>\n<p>iret<\/p>\n<p><![if !supportLists]>13. <![endif]>bios\u548cdos\u4e2d\u65ad\u4f8b\u7a0b<\/p>\n<p>bios\u5bb9\u91cf:8KB,\u5730\u5740:FE000H\u5f00\u59cb<\/p>\n<p>bios\u4e2d\u7684\u5185\u5bb9:<\/p>\n<p><![if !supportLists]>(1) <![endif]>\u786c\u4ef6\u7cfb\u7edf\u7684\u68c0\u6d4b\u521d\u59cb\u5316\u7a0b\u5e8f<\/p>\n<p><![if !supportLists]>(2) <![endif]>\u5916\u90e8\u4e2d\u65ad\u548c\u5185\u90e8\u4e2d\u65ad\u7684\u4e2d\u65ad\u4f8b\u7a0b<\/p>\n<p><![if !supportLists]>(3) <![endif]>\u7528\u4e8e\u5bf9\u786c\u4ef6\u8bbe\u5907\u8fdb\u884cI\/O\u64cd\u4f5c\u7684\u4e2d\u65ad\u4f8b\u7a0b<\/p>\n<p><![if !supportLists]>(4) <![endif]>\u5176\u4ed6\u548c\u786c\u4ef6\u7cfb\u7edf\u76f8\u5173\u7684\u4e2d\u65ad\u4f8b\u7a0b<\/p>\n<p>bios\u548cdos\u4e2d\u65ad\u7684\u5b89\u88c5\uff1a<\/p>\n<p><![if !supportLists]>(1) <![endif]>\u5f00\u673a\u540e,CPU\u52a0\u7535\u521d\u59cb\u5316,(cs)=0FFFFH,(ip)=0,\u5728FFFF:0\u5904\u6709\u4e00\u6761\u8df3\u8f6c\u6307\u4ee4\uff0c\u6267\u884c\u540eCPU\u8fdb\u5165BOIS\u4e2d\u7684\u786c\u4ef6\u7cfb\u7edf\u7684\u68c0\u6d4b\u521d\u59cb\u5316\u7a0b\u5e8f<\/p>\n<p><![if !supportLists]>(2) <![endif]>\u5efa\u7acb\u4e2d\u65ad\u5411\u91cf<\/p>\n<p><![if !supportLists]>(3) <![endif]>\u5b8c\u6210\u786c\u4ef6\u7cfb\u7edf\u68c0\u6d4b\u548c\u521d\u59cb\u5316\u540e,\u8c03\u7528int 19h\u8fdb\u884c\u64cd\u4f5c\u7cfb\u7edf\u5f15\u5bfc,\u8ba1\u7b97\u673a\u7531\u64cd\u4f5c\u7cfb\u7edf\u63a7\u5236<\/p>\n<p><![if !supportLists]>(4) <![endif]>dos\u542f\u52a8\u5e76\u5efa\u7acb\u4e2d\u65ad\u5411\u91cf<\/p>\n<p>\u68c0\u6d4b\u70b913.2<\/p>\n<p>\u5224\u65ad\u4e0b\u9762\u8bf4\u6cd5\u7684\u6b63\u8bef\uff1a<\/p>\n<p>(1)\u6211\u4eec\u53ef\u4ee5\u7f16\u7a0b\u6539\u53d8FFFF:0\u5904\u7684\u6307\u4ee4\uff0c\u4f7f\u5f97CPU\u4e0d\u53bb\u6267\u884cBIOS\u4e2d\u7684\u786c\u4ef6\u7cfb\u7edf\u68c0\u6d4b\u548c\u521d\u59cb\u5316\u7a0b\u5e8f\u3002<\/p>\n<p>\u7b54\uff1a\u9519\u8bef\uff0cFFFF:0\u5904\u7684\u5185\u5bb9\u65e0\u6cd5\u6539\u53d8\u3002<\/p>\n<pre><code>(2)int 19h\u4e2d\u65ad\u4f8b\u7a0b\uff0c\u53ef\u4ee5\u7531DOS\u63d0\u4f9b\u3002<\/code><\/pre>\n<p>\u7b54\uff1a\u9519\u8bef\uff0c\u5148\u8c03\u7528int 19h\uff0c\u540e\u542f\u52a8DOS\u3002<\/p>\n<p>BIOS\u768410h\u4e2d\u65ad:ah=\u529f\u80fd\u53f7<\/p>\n<p>&#183;(ah)=2\u8bbe\u7f6e\u5149\u6807<\/p>\n<p>bh=\u9875\u53f7<\/p>\n<p>dh=\u884c\u53f7(0~24)<\/p>\n<p>dl=\u5217\u53f7(0~79)<\/p>\n<p>&#183;(ah)=9\u5728\u5149\u6807\u4f4d\u7f6e\u663e\u793a\u5b57\u7b26<\/p>\n<p>al=\u5b57\u7b26<\/p>\n<p>bl=\u989c\u8272\u5c5e\u6027(\u4e0e\u663e\u5b58\u5c5e\u6027\u5b57\u8282\u683c\u5f0f\u76f8\u540c)<\/p>\n<p>bh=\u9875\u53f7<\/p>\n<p>cx=\u5b57\u7b26\u91cd\u590d\u4e2a\u6570<\/p>\n<p>DOS\u768421h\u4e2d\u65ad:ah=\u529f\u80fd\u53f7<\/p>\n<p>&#183;(ah)=4ch\u7a0b\u5e8f\u8fd4\u56de<\/p>\n<p>al=\u8fd4\u56de\u7ed3\u679c<\/p>\n<p>&#183;(ah)=09H\u5728\u5149\u6807\u4f4d\u7f6e\u663e\u793a\u5b57\u7b26\u4e32<\/p>\n<p>ds:bx=\u5b57\u7b26\u4e32\u5730\u5740(\u4ee5$\u7ed3\u5c3e)<\/p>\n<p><![if !supportLists]>\u4e09\u3001<![endif]><strong>\u7aef\u53e3\u548c\u5916\u8bbe(14.0~14.2\u300114.4\u3001Chapter 15&#038;17)<\/strong><strong><\/strong><\/p>\n<p><![if !supportLists]>1. <![endif]>\u7aef\u53e3\u53ca\u5176\u4f7f\u7528(14.0~14.1)<\/p>\n<p><![if !supportLists]>(1) <![endif]>\u5728\u4e3b\u677f\u4e0a\u7684\u5404\u7c7b\u82af\u7247(\u63a5\u53e3\u5361\u3001\u63a5\u53e3\u82af\u7247\u7b49)\u4e2d,\u90fd\u6709\u4e00\u7ec4\u53ef\u4ee5\u4f9bCPU\u8bfb\u5199\u7684\u5bc4\u5b58\u5668\uff0c\u5b83\u4eec<\/p>\n<p>\u2460\u90fd\u4e0eCPU\u7684\u603b\u7ebf\u76f8\u8fde<\/p>\n<p>\u2461CPU\u5bf9\u4ed6\u4eec\u8fdb\u884c\u8bfb\u6216\u5199\u7684\u64cd\u4f5c\u65f6\u90fd\u901a\u8fc7\u63a7\u5236\u7ebf\u5411\u5b83\u4eec\u6240\u5728\u7684\u82af\u7247\u53d1\u51fa\u7aef\u53e3\u8bfb\u5199\u547d\u4ee4<\/p>\n<p>CPU\u4f1a\u5bf9\u8fd9\u4e9b\u5bc4\u5b58\u5668\u8fdb\u884c\u7edf\u4e00\u7f16\u5236\uff0c\u4f5c\u4e3a\u7aef\u53e3\uff0c\u5efa\u7acb\u4e00\u4e2a\u7aef\u53e3\u5730\u5740\u7a7a\u95f4\u3002\u6bcf\u4e2a\u7aef\u53e3\u5728\u7aef\u53e3\u5730\u5740\u7a7a\u95f4\u90fd\u6709\u4e00\u4e2a\u5730\u5740\u3002(\u7aef\u53e3\u5730\u5740\u7a7a\u95f4\u670964K,\u5373\u7aef\u53e3\u53f7\u7684\u8303\u56f4\u4e3a0~65535)<\/p>\n<p><![if !supportLists]>(2) <![endif]>\u7aef\u53e3\u7684\u8bfb\u5199:\u53ea\u6709\u4e24\u6761\u6307\u4ee4:in out<\/p>\n<p>\u7aef\u53e3\u5730\u5740\u901a\u8fc7\u5730\u5740\u603b\u7ebf\u4f20\u9001<\/p>\n<p>&#183;\u7aef\u53e3\u7684\u8bbf\u95ee<\/p>\n<p>in al,60h<\/p>\n<p>\u6267\u884c\u65f6\u76f8\u5173\u64cd\u4f5c:<\/p>\n<p>(i)CPU\u901a\u8fc7\u5730\u5740\u7ebf\u5c06\u5730\u5740\u4fe1\u606f60H\u53d1\u51fa<\/p>\n<p>(ii)CPU\u901a\u8fc7\u63a7\u5236\u7ebf\u7ffb\u51fa\u7aef\u53e3\u8bfb\u547d\u4ee4,\u9009\u4e2d\u7aef\u53e3\u6240\u5728\u82af\u7247\uff0c\u5e76\u901a\u77e5\u8981\u4ece\u4e2d\u53d6\u51fa\u6570\u636e<\/p>\n<p>(iii)\u7aef\u53e3\u6240\u5728\u82af\u7247\u5c0660h\u7aef\u53e3\u4e2d\u7684\u6570\u636e\u901a\u8fc7\u6570\u636e\u7ebf\u9001\u5165CPU<\/p>\n<p>*\u7aef\u53e3\u5206\u914d:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"422\"  height=\"181\"  src=\"http:\/\/8.129.82.128\/wp-content\/uploads\/2026\/03\/asm202405\u7248\u63d0\u7eb275859.png\"  align=\"left\"  hspace=\"12\" > <\/p>\n<p>\u5bf9\u4e8e0~255\u4ee5\u5185\u7684\u7aef\u53e3\u8fdb\u884c\u8bfb\u5199\uff0c\u7aef\u53e3\u53f7\u7528\u7acb\u5373\u6570\u7ed9\u51fa<\/p>\n<p>\u5bf9\u4e8e256~65535\u7684\u7aef\u53e3\u53f7\uff0c\u8981\u5728dx\u4e2d\u5b58\u653e<\/p>\n<p>in\u548cout\u6307\u4ee4\u53ea\u80fd\u4f7f\u7528ax\u6216al\u6765\u5b58\u653e\u4ece\u7aef\u53e3\u8bfb\u5165\u7684\u6570\u636e\u6216\u8981\u53d1\u9001\u5230\u7aef\u53e3\u7684\u6570\u636e\u3002\u8bbf\u95ee8\u4f4d\u7aef\u53e3\u7528al\uff0c\u8bbf\u95ee16\u4f4d\u7aef\u53e3\u7528ax.\u683c\u5f0f\u5982\u4e0b:<\/p>\n<p>in al\/ax,\u7aef\u53e3\u53f7<\/p>\n<p>out \u7aef\u53e3\u53f7,al\/ax<\/p>\n<p>\u7aef\u53e3\u53f7\u57280~255\u65f6<\/p>\n<p>in al\/ax,idata <\/p>\n<p>out idata,al\/ax<\/p>\n<p>\u7aef\u53e3\u53f7\u5728256~65535\u65f6<\/p>\n<p>in al\/ax,dx<\/p>\n<p>out dx,al\/ax<\/p>\n<p><![if !supportLists]>2. <![endif]>CMOS RAM\u82af\u7247(14.2\u300114.4)<\/p>\n<p><![if !supportLists]>(1) <![endif]>\u5305\u542b\u4e00\u4e2a\u5b9e\u65f6\u949f\u548c\u4e00\u4e2a\u6709128\u4e2a\u5b58\u50a8\u5355\u5143\u7684RAM\u5b58\u50a8\u5668(\u65e9\u671f\u4e3a64\u4e2a)<\/p>\n<p><![if !supportLists]>(2) <![endif]>\u8be5\u82af\u7247\u9760\u7535\u6c60\u9a71\u52a8\u3002\u5173\u673a\u540e\u5185\u90e8\u65f6\u949f\u4ecd\u7136\u53ef\u4ee5\u5de5\u4f5c\uff0cRAM\u4fe1\u606f\u4e0d\u4e22\u5931<\/p>\n<p><![if !supportLists]>(3) <![endif]>\u5185\u90e8\u5b9e\u65f6\u949f\u5360\u7528\u5185\u90e8\u7684RAM\u76840~0dh\u5355\u5143\u4fdd\u5b58\u65f6\u95f4\u4fe1\u606f\uff0c\u5176\u4f59\u5355\u5143\u5927\u90e8\u5206\u7528\u4e8e\u4fdd\u5b58\u7cfb\u7edf\u914d\u7f6e\u4fe1\u606f\uff0c\u4f9b\u542f\u52a8\u65f6BIOS\u8bfb\u53d6<\/p>\n<p><![if !supportLists]>(4) <![endif]>\u5185\u90e8\u6709\u4e24\u4e2a\u7aef\u53e370h\u548c71h<\/p>\n<p><![if !supportLists]>(5) <![endif]>70h\u4e3a\u5730\u5740\u7aef\u53e3\uff0c\u5b58\u653e\u8981\u8bbf\u95ee\u7684CMOS RAM\u5355\u5143\u7684\u5730\u5740\uff0c71h\u4e3a\u6570\u636e\u7aef\u53e3\uff0c\u5b58\u653e\u4ece\u9009\u5b9a\u7684CMOS RAM\u4e2d\u8bfb\u53d6\u7684\u6570\u636e\uff0c\u6216\u8981\u5411\u5176\u4e2d\u5199\u5165\u7684\u6570\u636e\u3002<\/p>\n<p>\u5982:\u8bfbCMOS RAM 2\u53f7\u5355\u5143:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"255\"  height=\"41\"  src=\"http:\/\/8.129.82.128\/wp-content\/uploads\/2026\/03\/asm202405\u7248\u63d0\u7eb276338.png\"  align=\"left\"  hspace=\"12\" >\u2460\u5c062\u9001\u5165\u7aef\u53e370h<\/p>\n<p>\u2461\u4ece\u7aef\u53e371h\u8bfb\u51fa2\u53f7\u5355\u5143\u7684\u5185\u5bb9<\/p>\n<p>&#183;\u63d0\u53d6\u5f53\u524d\u65f6\u95f4<\/p>\n<p>\u5f53\u524d\u65f6\u95f4\u5728CMOS RAM\u4e2d\u75286\u4e2a\u5b57\u8282\u5b58\u653e(6\u4e2a\u4fe1\u606f\u957f\u5ea6\u90fd\u662f\u4e00\u5b57\u8282)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"317\"  height=\"40\"  src=\"http:\/\/8.129.82.128\/wp-content\/uploads\/2026\/03\/asm202405\u7248\u63d0\u7eb276410.png\"  align=\"left\"  hspace=\"12\" >\u59825\u670815\u65e5=>   1 5 0 5 =0010 0101 0000 0101<\/p>\n<p>\u4f7f\u7528\u7684\u662fBCD\u7801\u5b58\u653e<\/p>\n<p>\u68c0\u6d4b\u70b9 14.1<\/p>\n<p>\uff081\uff09\u7f16\u7a0b\uff0c\u8bfb\u53d6CMOS RAM\u76842\u53f7\u5355\u5143\u5185\u5bb9\u3002 <\/p>\n<p> <\/p>\n<pre><code>assume cs:code \ncode segment \nstart:  mov al,2        ;\u8d4b\u503cal <\/code><\/pre>\n<p>        out 70h,al      ;\u5c06al\u9001\u5165\u7aef\u53e370h <\/p>\n<p>        in al,71h       ;\u4ece\u7aef\u53e371h\u5904\u8bfb\u51fa\u5355\u5143\u5185\u5bb9 <\/p>\n<pre><code>        mov ax,4c00h \n        int 21h \ncode ends <\/code><\/pre>\n<p>end start<\/p>\n<p>\uff082\uff09\u7f16\u7a0b\uff0c\u5411CMOS RAM\u76842\u53f7\u5355\u5143\u5199\u51650\u3002 <\/p>\n<p> <\/p>\n<pre><code>assume cs:code \ncode segment \nstart:  mov al,2        ;\u8d4b\u503cal <\/code><\/pre>\n<p>        out 70h,al      ;\u5c06al\u9001\u5165\u7aef\u53e370h <\/p>\n<pre><code>        mov al,0        ;\u8d4b\u503cal <\/code><\/pre>\n<p>        out 71h,al      ;\u5411\u7aef\u53e371h\u5199\u5165\u6570\u636eal <\/p>\n<pre><code>        mov ax,4c00h \n        int 21h \ncode ends <\/code><\/pre>\n<p>end start<\/p>\n<p><![if !supportLists]>3. <![endif]>\u5916\u4e2d\u65ad(Chapter15)<\/p>\n<p><![if !supportLists]>(1) <![endif]>\u5916\u4e2d\u65ad\u6e90\u7684\u5206\u7c7b<\/p>\n<p>\u2460\u53ef\u5c4f\u853d\u4e2d\u65ad:CPU\u53ef\u4ee5\u4e0d\u54cd\u5e94\u7684\u5916\u4e2d\u65ad\u3002\u5f53IF=1\u65f6\uff0cCPU\u54cd\u5e94\u53ef\u5c4f\u853d\u4e2d\u65ad\uff0c\u5f53IF=0\u65f6\u5219\u4e0d\u54cd\u5e94\u53ef\u5c4f\u853d\u4e2d\u65ad<\/p>\n<p>\u53ef\u5c4f\u853d\u4e2d\u65ad\u7684\u4e2d\u65ad\u7c7b\u578b\u7801\u901a\u8fc7\u6570\u636e\u603b\u7ebf\u9001\u5165<\/p>\n<p>\u5728\u4e2d\u65ad\u8fc7\u7a0b\u4e2d\u5c06IF\u7f6e\u4e3a0\u662f\u4e3a\u4e86\u9632\u6b62\u88ab\u5176\u4ed6\u7684\u53ef\u5c4f\u853d\u4e2d\u65ad\u5e72\u6270<\/p>\n<p>\u82e5\u8981\u5728\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u4e2d\u5904\u7406\u53ef\u5c4f\u853d\u4e2d\u65ad,\u53ef\u4ee5\u5c06IF\u7f6e\u4e3a1<\/p>\n<p>\u8bbe\u7f6eIF\u7684\u6307\u4ee4:sti \u8bbe\u7f6eIF=1\uff1bcli\u8bbe\u7f6eIF=0<\/p>\n<p>\u2461\u4e0d\u53ef\u5c4f\u853d\u4e2d\u65ad:CPU\u5fc5\u987b\u54cd\u5e94\u7684\u4e2d\u65ad\u3002\u5f53CPU\u68c0\u6d4b\u5230\u4e0d\u53ef\u5c4f\u853d\u4e2d\u65ad\u65f6\uff0c\u5728\u6267\u884c\u5b8c\u5f53\u524d\u6307\u4ee4\u540e\u7acb\u5373\u54cd\u5e94\u3002<\/p>\n<p>\u4e0d\u53ef\u5c4f\u853d\u4e2d\u65ad\u7684\u4e2d\u65ad\u7c7b\u578b\u7801\u4e3a2<\/p>\n<p>\u51e0\u4e4e\u6240\u6709\u7684\u5916\u8bbe\u5f15\u53d1\u7684\u5916\u4e2d\u65ad\u90fd\u662f\u53ef\u5c4f\u853d\u4e2d\u65ad<\/p>\n<p><![if !supportLists]>(2) <![endif]>PC\u952e\u76d8\u7684\u5904\u7406\u8fc7\u7a0b<\/p>\n<p>&#183;\u952e\u76d8\u7684\u6bcf\u4e2a\u952e\u76f8\u5f53\u4e8e\u4e00\u4e2a\u5f00\u5173,\u952e\u76d8\u4e2d\u6709\u4e00\u4e2a\u82af\u7247\u5bf9\u952e\u76d8\u4e0a\u6bcf\u4e00\u4e2a\u952e\u7684\u5f00\u5173\u72b6\u6001\u8fdb\u884c\u626b\u63cf\u3002<\/p>\n<p>&#183;\u6309\u4e0b\u952e\u65f6\uff0c\u5f00\u5173\u63a5\u901a\uff0c\u8be5\u82af\u7247\u4ea7\u751f\u4e00\u4e2a\u626b\u63cf\u7801\uff0c\u626b\u63cf\u7801\u8bf4\u660e\u4e86\u952e\u76d8\u4e0a\u6240\u6309\u952e\u7684\u4f4d\u7f6e\uff0c\u626b\u63cf\u7801\u88ab\u9001\u5165\u82af\u7247\u7684\u7aef\u53e360h\u4e2d\uff0c\u677e\u5f00\u6309\u952e\u65f6\u4e5f\u4ea7\u751f\u4e00\u4e2a\u626b\u63cf\u7801\uff0c\u6b64\u65f6\u626b\u63cf\u7801\u4e5f\u88ab\u9001\u516560h\u4e2d<\/p>\n<p>&#183;\u6309\u4e0b\u65f6\u4ea7\u751f\u7684\u626b\u63cf\u7801\u53eb\u505a\u901a\u7801,\u677e\u5f00\u65f6\u7684\u626b\u63cf\u7801\u53eb\u505a\u65ad\u7801<\/p>\n<p>\u65ad\u7801=\u901a\u7801+80h<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"411\"  height=\"86\"  src=\"http:\/\/8.129.82.128\/wp-content\/uploads\/2026\/03\/asm202405\u7248\u63d0\u7eb277389.png\"  align=\"left\"  hspace=\"12\" ><img loading=\"lazy\" decoding=\"async\" width=\"406\"  height=\"243\"  src=\"http:\/\/8.129.82.128\/wp-content\/uploads\/2026\/03\/asm202405\u7248\u63d0\u7eb277390.png\"  align=\"left\"  hspace=\"12\" >&#183;\u952e\u76d8\u8f93\u5165\u5230\u8fbe60h\u65f6\uff0c\u76f8\u5173\u82af\u7247\u5411CPU\u53d1\u90019H\u4e2d\u65ad\uff0c\u8be5\u4e2d\u65ad\u53ef\u4ee5\u5c4f\u853d\u3002<\/p>\n<p>&#183;BIOS\u63d0\u4f9bint 9\u4e2d\u65ad\u4f8b\u7a0b\uff0c\u7528\u6765\u8fdb\u884c\u57fa\u672c\u7684\u952e\u76d8\u8f93\u5165\u5904\u7406\uff0c\u5de5\u4f5c\u6d41\u7a0b\u5982\u4e0b:<\/p>\n<p>\u2460\u8bfb\u51fa60h\u7aef\u53e3\u4e2d\u7684\u626b\u63cf\u7801<\/p>\n<p>\u2461\u82e5\u662f\u5b57\u7b26\u952e\u7684\u626b\u63cf\u7801\uff0c\u5c06\u626b\u63cf\u7801\u548c\u5b83\u6240\u5bf9\u5e94\u7684\u5b57\u7b26\u7801(ASCII\u7801)\u9001\u5165\u5185\u5b58\u4e2d\u7684BIOS\u952e\u76d8\u7f13\u51b2\u533a,\u82e5\u662f\u63a7\u5236\u952e,\u5c06\u5176\u8f6c\u6362\u4e3a\u72b6\u6001\u5b57\u8282\u5199\u5165\u5185\u5b58\u4e2d\u5b58\u50a8\u72b6\u6001\u5b57\u8282\u7684\u5355\u51430040:17<\/p>\n<p>\u2462\u5bf9\u952e\u76d8\u7cfb\u7edf\u8fdb\u884c\u63a7\u5236<\/p>\n<p>BIOS\u7684\u952e\u76d8\u7f13\u51b2\u533a\u53ef\u4ee5\u5b58\u50a815\u4e2a\u952e\u76d8\u8f93\u5165\uff0c\u4e00\u4e2a\u952e\u76d8\u8f93\u5165\u5360\u4e861\u4e2a\u5b57,\u9ad8\u5b57\u8282\u653e\u626b\u63cf\u7801,\u4f4e\u5b57\u8282\u653e\u5b57\u7b26\u7801<\/p>\n<p>\u952e\u76d8\u72b6\u6001\u5b57\u8282\u5404\u4f4d\u8bb0\u5f55\u7684\u4fe1\u606f:<\/p>\n<table class=MsoTableGrid  border=1  cellspacing=0 ><tr><td width=79  valign=top ><p>\u4f4d<\/p>\n<\/td><td width=74  valign=top ><p>0<\/p>\n<\/td><td width=77  valign=top ><p>1<\/p>\n<\/td><td width=52  valign=top ><p>2<\/p>\n<\/td><td width=43  valign=top ><p>3<\/p>\n<\/td><td width=100  valign=top ><p>4<\/p>\n<\/td><td width=71  valign=top ><p>5<\/p>\n<\/td><td width=85  valign=top ><p>6<\/p>\n<\/td><td width=72  valign=top ><p>7<\/p>\n<\/td><\/tr><tr><td width=79  valign=top ><p>\u4ee3\u8868\u7684\u952e<\/p>\n<\/td><td width=74  valign=top ><p>\u53f3shift<\/p>\n<\/td><td width=77  valign=top ><p>\u5de6shift<\/p>\n<\/td><td width=52  valign=top ><p>ctrl<\/p>\n<\/td><td width=43  valign=top ><p>alt<\/p>\n<\/td><td width=100  valign=top ><p>ScrollLock<\/p>\n<\/td><td width=71  valign=top ><p>NumLock<\/p>\n<\/td><td width=85  valign=top ><p>CapsLock<\/p>\n<\/td><td width=72  valign=top ><p>Insert<\/p>\n<\/td><\/tr><tr><td width=79  valign=top ><p>\u8bf4\u660e<\/p>\n<\/td><td width=74  valign=top ><p> <\/p>\n<\/td><td width=77  valign=top ><p> <\/p>\n<\/td><td width=52  valign=top ><p> <\/p>\n<\/td><td width=43  valign=top ><p> <\/p>\n<\/td><td width=100  valign=top ><p>Scroll<\/p>\n<\/td><td width=71  valign=top ><p>\u6570\u5b57\u952e<\/p>\n<\/td><td width=85  valign=top ><p>\u5927\u5199\u9501<\/p>\n<\/td><td width=72  valign=top ><p>\u5220\u9664\u952e<\/p>\n<\/td><\/tr><\/table><p>\u7f6e\u4e3a1\u8868\u793a\u6309\u4e0b\u8fd9\u4e9b\u952e\u8bbe\u7f6e\u4e86\u72b6\u6001<\/p>\n<p><![if !supportLists]>(3) <![endif]>\u5b9a\u5236\u952e\u76d8\u8f93\u5165<\/p>\n<p>\u5ef6\u65f6\u4f8b\u7a0b\u7684\u8bbe\u8ba1:<\/p>\n<p>\u8ba9CPU\u6267\u884c\u7a7a\u5faa\u73af\uff0c\u5faa\u73af\u7684\u6b21\u6570\u5fc5\u987b\u5feb\u3002\u6b64\u5904\u7528\u4e24\u4e2a16\u4f4d\u5bc4\u5b58\u5668\u5b58\u653e32\u4f4d\u7684\u5faa\u73af\u6b21\u6570<\/p>\n<pre><code>mov dx,1000h\nmov ax,0\ns:sub ax,1<\/code><\/pre>\n<p>sbb dx,0<\/p>\n<pre><code>cmp ax,0\njne s\ncmp dx,0\njne s<\/code><\/pre>\n<p>\u62d3\u5c55\u4f8b\u7a0b\uff1a\u5728\u65b0\u7684int 9\u8c03\u7528\u539f\u6709\u7684int 9<\/p>\n<p>\u6b64\u5904\u91c7\u53d6\u6a21\u62dfint\u6307\u4ee4\u7684\u7b56\u7565:<\/p>\n<p>pushf<\/p>\n<pre><code>pop ax\nand ah,11111100b ;IF\u548cTF\u4e3a\u6807\u5fd7\u5bc4\u5b58\u5668\u7684\u7b2c9\u4f4d\u548c\u7b2c8\u4f4d\npush ax<\/code><\/pre>\n<p>popf<\/p>\n<pre><code>call dword ptr ...;CS\u3001IP\u5165\u6808<\/code><\/pre>\n<p>\u68c0\u6d4b\u70b915.1<\/p>\n<p>\uff081\uff09 \u4ed4\u7ec6\u5206\u6790\u4e00\u4e0b\u4e66\u4e2d\u7684in9\u4e2d\u65ad\u4f8b\u7a0b\uff0c\u770b\u770b\u662f\u5426\u53ef\u4ee5\u7cbe\u7b80\u4e00\u4e0b\uff1f<\/p>\n<p>\u5176\u5b9e\u5728\u6211\u4eec\u7684int 9\u4e2d\u65ad\u4f8b\u7a0b\u4e2d\uff0c\u6a21\u62dfint\u6307\u4ee4\u8c03\u7528\u539fint 9\u4e2d\u65ad\u4f8b\u7a0b\u7684\u7a0b\u5e8f\u6bb5\u662f\u53ef\u4ee5\u7cbe\u7b80\u7684\uff0c\u56e0\u4e3a\u5728\u8fdb\u5165\u4e2d\u65ad\u4f8b\u7a0b\u540e\uff0cIF\u548cTF\u90fd\u5df2\u7f6e0\uff0c\u6ca1\u6709\u5fc5\u8981\u518d\u8fdb\u884c\u8bbe\u7f6e\u4e86\uff0c\u5bf9\u4e8e\u7a0b\u5e8f\u6bb5\uff1a<\/p>\n<p>pushf;\u6807\u5fd7\u5bc4\u5b58\u5668\u5165\u6808<\/p>\n<p>pushf<\/p>\n<pre><code>pop bx\nand bh,11111100b;IF\u548cTF\u4e3aflag\u7684\u7b2c9\u4f4d\u548c\u7b2c8\u4f4d\npush bx<\/code><\/pre>\n<p>popf;TF=0\uff0cIF=0<\/p>\n<pre><code>call dword ptr ds:[0];CS\u3001IP\u5165\u6808;(IP)=ds:[0],(CS)=ds:[2]<\/code><\/pre>\n<p> <\/p>\n<p>\u53ef\u4ee5\u7cbe\u7b80\u4e3a\uff1a<\/p>\n<p>pushf<\/u><u>;\u6807\u5fd7\u5bc4\u5b58\u5668\u5165\u6808<\/p>\n<pre><code>call dword ptr ds:[0]<\/u>;CS\u3001IP\u5165\u6808;(IP)=ds:[0],(CS)=ds:[2]<\/code><\/pre>\n<p>\u4e24\u6761\u6307\u4ee4\u3002<\/p>\n<p>\uff082\uff09 \u4ed4\u7ec6\u5206\u6790\u7a0b\u5e8f\u4e2d\u7684\u4e3b\u7a0b\u5e8f\uff0c\u770b\u770b\u6709\u4ec0\u4e48\u6f5c\u5728\u7684\u95ee\u9898\uff1f<\/p>\n<p>\u5728\u4e3b\u7a0b\u5e8f\u4e2d\uff0c\u5982\u679c\u5728\u8bbe\u7f6e\u6267\u884c\u8bbe\u7f6eint 9\u4e2d\u65ad\u4f8b\u7a0b\u7684\u6bb5\u5730\u5740\u548c\u504f\u79fb\u5730\u5740\u7684\u6307\u4ee4\u4e4b\u95f4\u53d1\u751f\u4e86\u952e\u76d8\u4e2d\u6bb5\uff0c\u5219CPU\u5c06\u8f6c\u53bb\u4e00\u4e2a\u9519\u8bef\u7684\u5730\u5740\u6267\u884c\uff0c\u5c06\u53d1\u751f\u9519\u8bef\u3002<\/p>\n<p>\u627e\u51fa\u8fd9\u6837\u7684\u7a0b\u5e8f\u6bb5\uff0c\u6539\u5199\u4ed6\u4eec\uff0c\u6392\u9664\u6f5c\u5728\u7684\u95ee\u9898\u3002<\/p>\n<p> <\/p>\n<p>;\u5728\u4e2d\u65ad\u5411\u91cf\u8868\u4e2d\u8bbe\u7f6e\u65b0\u7684int 9\u4e2d\u65ad\u4f8b\u7a0b\u7684\u5165\u53e3\u5730\u5740<\/p>\n<p>cli;\u8bbe\u7f6eIF\uff1d0\u5c4f\u853d\u4e2d\u65ad<\/p>\n<pre><code>mov word ptr es:[9*4],offset int9\nmov es:[9*4+2],cs<\/code><\/pre>\n<p>sti;\u8bbe\u7f6eIF\uff1d1\u4e0d\u5c4f\u853d\u4e2d\u65ad<\/p>\n<p> <\/p>\n<p> <\/p>\n<p>\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\u66f4\u6539\u540e\u7684int 9\u4e2d\u65ad\u4f8b\u7a0b\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d<\/p>\n<p>;\u529f\u80fd\uff1a\u5728\u5c4f\u5e55\u4e2d\u95f4\u4f9d\u6b21\u663e\u793a&#8217;a&#8217;~&#8217;z&#8217;\uff0c\u5e76\u8ba9\u4eba\u770b\u6e05\u3002\u5728\u663e\u793a\u8fc7\u7a0b\u4e2d\u6309\u4e0bEsc\u952e\u540e\uff0c\u6539\u53d8\u663e\u793a\u7684\u989c\u8272\u3002<\/p>\n<pre><code>assume cs:code<\/code><\/pre>\n<p>stack segment<\/p>\n<pre><code>db 128 dup (0)<\/code><\/pre>\n<p>stack ends<\/p>\n<p>data segment<\/p>\n<pre><code>dw 0,0<\/code><\/pre>\n<p>data ends<\/p>\n<p>code segment<\/p>\n<pre><code>start:mov ax,stack\nmov ss,ax\nmov sp,128<\/code><\/pre>\n<p> <\/p>\n<p>;\u5c06\u539f\u6765\u7684int 9\u4e2d\u65ad\u4f8b\u7a0b\u7684\u5165\u53e3\u5730\u5740\u4fdd\u5b58\u5728ds:0\u3001ds:2\u5355\u5143\u4e2d<\/p>\n<pre><code>mov ax,data\nmov ds,ax<\/code><\/pre>\n<p> <\/p>\n<pre><code>mov ax,0\nmov es,ax<\/code><\/pre>\n<p> <\/p>\n<pre><code>push es:[9*4]\npop ds:[0]\npush es:[9*4+2]\npop ds:[2]<\/code><\/pre>\n<p> <\/p>\n<p>;\u5728\u4e2d\u65ad\u5411\u91cf\u8868\u4e2d\u8bbe\u7f6e\u65b0\u7684int 9\u4e2d\u65ad\u4f8b\u7a0b\u7684\u5165\u53e3\u5730\u5740<\/p>\n<p>cli;\u8bbe\u7f6eIF\uff1d0\u5c4f\u853d\u4e2d\u65ad<\/p>\n<pre><code>mov word ptr es:[9*4],offset int9\nmov word ptr es:[9*4+2],cs<\/code><\/pre>\n<p>sti;\u8bbe\u7f6eIF\uff1d1\u4e0d\u5c4f\u853d\u4e2d\u65ad<\/p>\n<p> <\/p>\n<p>;\u4f9d\u6b21\u663e\u793a&#8217;a&#8217;~&#8217;z&#8217;<\/p>\n<pre><code>mov ax,0b800h\nmov es,ax\nmov ah,'a'\ns:mov es:[160*12+40*2],ah;\u7b2c12\u884c\u7b2c40\u5217\ninc ah\ncmp ah,'z'<\/code><\/pre>\n<p>jnb s<\/p>\n<p> <\/p>\n<p>;\u5c06\u4e2d\u65ad\u5411\u91cf\u8868\u4e2dint 9\u4e2d\u65ad\u4f8b\u7a0b\u7684\u5165\u53e3\u6062\u590d\u4e3a\u539f\u6765\u7684\u5730\u5740<\/p>\n<pre><code>mov ax,0\nmov es,ax<\/code><\/pre>\n<p> <\/p>\n<pre><code>push ds:[0]\npop ss:[9*4]\npush ds:[2]\npop es:[9*4+2]<\/code><\/pre>\n<p> <\/p>\n<p>;\u7ed3\u675f<\/p>\n<pre><code>mov ax,4c00h\nint 21h<\/code><\/pre>\n<p> <\/p>\n<p>;\u5faa\u73af\u5ef6\u65f6\uff0c\u5faa\u73af100000h\u6b21<\/p>\n<pre><code>delay:push ax\npush dx\nmov dx,1000h\nmov ax,0\ndelay1:sub ax,1<\/code><\/pre>\n<p>sbb dx,0;(dx)=(dx)-0-CF<\/p>\n<pre><code>cmp ax,0\njne delay1\ncmp dx,0\njne delay1\npop dx\npop ax<\/code><\/pre>\n<p>ret<\/p>\n<p> <\/p>\n<p>;\u4ee5\u4e0b\u4e3a\u65b0\u7684int 9\u4e2d\u65ad\u4f8b\u7a0b<\/p>\n<pre><code>int9:push ax\npush bx\npush es<\/code><\/pre>\n<p> <\/p>\n<p>in al,60h;\u4ece\u7aef\u53e360h\u8bfb\u51fa\u952e\u76d8\u8f93\u5165<\/p>\n<p> <\/p>\n<p>;\u5bf9int\u6307\u4ee4\u8fdb\u884c\u6a21\u62df\uff0c\u8c03\u7528\u539f\u6765\u7684int 9\u4e2d\u65ad\u4f8b\u7a0b<\/p>\n<p>pushf;\u6807\u5fd7\u5bc4\u5b58\u5668\u5165\u6808<\/p>\n<pre><code>call dword ptr ds:[0];CS\u3001IP\u5165\u6808;(IP)=ds:[0],(CS)=ds:[2]<\/code><\/pre>\n<p> <\/p>\n<p>;\u5982\u679c\u662fESC\u626b\u63cf\u7801\uff0c\u6539\u53d8\u663e\u793a\u989c\u8272<\/p>\n<pre><code>cmp al,1;\u548cesc\u7684\u626b\u63cf\u780101\u6bd4\u8f83\njne int9ret;\u4e0d\u7b49\u4e8eesc\u65f6\u8f6c\u79fb<\/code><\/pre>\n<p> <\/p>\n<pre><code>mov ax,0b800h\nmov es,ax\ninc byte ptr es:[160*12+40*2+1];\u5c06\u5c5e\u6027\u503c+1\uff0c\u6539\u53d8\u989c\u8272<\/code><\/pre>\n<p> <\/p>\n<pre><code>int9ret:pop es\npop bx\npop ax<\/code><\/pre>\n<p>iret<\/p>\n<p> <\/p>\n<p>code ends<\/p>\n<p>end start<\/p>\n<p><![if !supportLists]>4. <![endif]>\u4f7f\u7528BIOS\u8fdb\u884c\u952e\u76d8\u8f93\u5165\u548c\u78c1\u76d8\u8bfb\u5199(Chapter17)<\/p>\n<p><![if !supportLists]>(1) <![endif]>int9\u4e2d\u65ad\u4f8b\u7a0b\u5bf9\u952e\u76d8\u8f93\u5165\u7684\u5904\u7406<\/p>\n<p>\u952e\u76d8\u7f13\u51b2\u533a\u4e2d\u670916\u4e2a\u5b57\u5355\u5143,\u53ef\u4ee5\u5b58\u50a815\u4e2a\u6309\u952e\u7684\u626b\u63cf\u7801\u548c\u5bf9\u5e94\u7684ASCII\u7801<\/p>\n<p><![if !supportLists]>(2) <![endif]>\u4f7f\u7528int 16h\u4e2d\u65ad\u4f8b\u7a0b\u8bfb\u53d6\u952e\u76d8\u7f13\u51b2\u533a<\/p>\n<p>\u53c2\u6570:(ah)=\u529f\u80fd\u53f7<\/p>\n<p>\u529f\u80fd\u53f70:\u4ece\u952e\u76d8\u7f13\u51b2\u533a\u4e2d\u8bfb\u53d6\u4e00\u4e2a\u952e\u76d8\u8f93\u5165\uff0c\u5e76\u5c06\u5176\u4ece\u952e\u76d8\u7f13\u51b2\u533a\u4e2d\u5220\u9664<\/p>\n<p>\u8fd4\u56de:(ah)=\u626b\u63cf\u7801,(al)=ASCII\u7801<\/p>\n<p>\u82e5\u53d1\u73b0\u7f13\u51b2\u533a\u7a7a\uff0c\u5219\u5faa\u73af\u7b49\u5f85\uff0c\u76f4\u5230\u7f13\u51b2\u533a\u4e2d\u6709\u6570\u636e<\/p>\n<p>\u68c0\u6d4b\u70b917.1<\/p>\n<p>\u201c\u5728int 16h\u4e2d\u65ad\u4f8b\u7a0b\u4e2d\uff0c\u4e00\u5b9a\u6709\u8bbe\u7f6eIF=1\u7684\u6307\u4ee4\u3002\u201d\u8fd9\u79cd\u8bf4\u6cd5\u5bf9\u5417\uff1f<\/p>\n<pre><code>\u6b63\u786e\uff0c\u5f53\u952e\u76d8\u7f13\u51b2\u533a\u4e3a\u7a7a\u65f6\uff0c\u5982\u679c\u8bbe\u7f6eIF=0\uff0cint 9\u4e2d\u65ad\u65e0\u6cd5\u6267\u884c\uff0c\u5faa\u73af\u7b49\u5f85\u4f1a\u6b7b\u9501\u3002<\/code><\/pre>\n<p>(3)\u5b57\u7b26\u4e32\u7684\u8f93\u5165<\/p>\n<p>\u6700\u57fa\u672c\u7684\u5b57\u7b26\u4e32\u8f93\u5165\u7a0b\u5e8f\u7684\u529f\u80fd:<\/p>\n<p><![if !supportLists]>&#9312;\uff0e<![endif]>\u8f93\u5165\u65f6\u663e\u793a\u5b57\u7b26\u4e32<\/p>\n<p><![if !supportLists]>&#9313;\uff0e<![endif]>\u5728\u8f93\u5165\u56de\u8f66\u7b26\u65f6\u8f93\u5165\u7ed3\u675f<\/p>\n<p><![if !supportLists]>&#9314;\uff0e<![endif]>\u80fd\u5220\u9664\u5df2\u7ecf\u8f93\u5165\u7684\u5b57\u7b26<\/p>\n<p>\u8bbe\u8ba1\u7a0b\u5e8f:<\/p>\n<p>\u2460\u8c03\u7528int 16h\u8bfb\u53d6\u8f93\u5165<\/p>\n<p>\u2461\u5b57\u7b26\u5c31\u8fdb\u5165\u5b57\u7b26\u6808\uff0c\u663e\u793a\u5b57\u7b26\u6808\u4e2d\u7684\u6240\u6709\u5b57\u7b26\uff0c\u7ee7\u7eed\u6267\u884c\u2460<\/p>\n<p>\u2462\u9000\u683c\u952e\u6309\u4e0b\u540e\u4ece\u5b57\u7b26\u6808\u4e2d\u5f39\u51fa\u4e00\u4e2a\u5b57\u7b26\uff0c\u663e\u793a\u5b57\u7b26\u6808\u4e2d\u7684\u6240\u6709\u5b57\u7b26\uff0c\u7ee7\u7eed\u6267\u884c\u2460<\/p>\n<p>&#9315;\u82e5\u662fEnter,\u5411\u5b57\u7b26\u6808\u4e2d\u538b\u51650\uff0c\u8fd4\u56de<\/p>\n<p>(4)\u5e94\u7528int 13h\u8bfb\u5199\u78c1\u76d8<\/p>\n<p>\u5165\u53e3\u53c2\u6570<\/p>\n<p>(ah)=\u529f\u80fd\u53f7<\/p>\n<p>2\u8868\u793a\u8bfb,3\u8868\u793a\u5199<\/p>\n<p>(al)=\u64cd\u4f5c\u7684\u6247\u533a\u6570<\/p>\n<p>(ch)=\u78c1\u9053\u53f7<\/p>\n<p>(cl)=\u6247\u533a\u53f7<\/p>\n<p>(dh)=\u78c1\u5934\u53f7(\u5bf9\u4e8e\u8f6f\u76d8\u662f\u9762)<\/p>\n<p>(dl)=\u9a71\u52a8\u5668\u53f7<\/p>\n<p>\u8f6f\u9a71\u4ece0\u5f00\u59cb,0(A:),1(B:)<\/p>\n<p>\u786c\u76d8\u4ece80h\u5f00\u59cb80h(C:),81h(D:)<\/p>\n<p>es:bx\u6307\u5411\u63a5\u6536\u4ece\u6247\u533a\u8bfb\u5165\u6570\u636e\u7684\u5185\u5b58\u533a(\u6216\u5c06\u5199\u5165\u78c1\u76d8\u7684\u6570\u636e)<\/p>\n<p>\u8fd4\u56de\u53c2\u6570:<\/p>\n<p>\u64cd\u4f5c\u6210\u529f\uff1a(ah)=0,(al)=\u8bfb\u5165(\u5199\u5165)\u6247\u533a\u6570<\/p>\n<p>\u64cd\u4f5c\u5931\u8d25\uff1a(ah)=\u51fa\u9519\u4ee3\u7801<\/p>\n<p>\u78c1\u76d8\u7684\u5b9e\u9645\u8bbf\u95ee\u7531\u78c1\u76d8\u63a7\u5236\u5668\u8fdb\u884c,\u53ef\u4ee5\u901a\u8fc7\u63a7\u5236\u78c1\u76d8\u63a7\u5236\u5668\u8bbf\u95ee\u78c1\u76d8\u3002\u53ea\u80fd\u4ee5\u6247\u533a\u4e3a\u5355\u4f4d\u8bfb\u5199\u78c1\u76d8\u3002\u8bfb\u5199\u6247\u533a\u8981\u7ed9\u51fa\u9762(\u78c1\u5934)\u53f7\u3001\u78c1\u9053\u53f7\u548c\u6247\u533a\u53f7\u3002\u9762\u53f7\u548c\u78c1\u9053\u53f7\u4ece0\u5f00\u59cb\uff0c\u6247\u533a\u53f7\u4ece1\u5f00\u59cb\u3002<\/p>\n<p><![if !supportLists]>\u56db\u3001<![endif]><strong>\u8bfe\u7a0b\u5b9e\u9a8c<\/strong><strong><\/strong><\/p>\n<p><strong>\u5b9e\u9a8c12 \u7f16\u51990\u53f7\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f<\/strong><strong><\/strong><\/p>\n<p>\u7f16\u51990\u53f7\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\uff0c\u4f7f\u5f97\u5728\u9664\u6cd5\u6ea2\u51fa\u53d1\u751f\u65f6\uff0c\u5728\u5c4f\u5e55\u4e2d\u95f4\u663e\u793a\u5b57\u7b26\u4e32\u201cdivide error!\u201d\uff0c\u7136\u540e\u8fd4\u56deDOS<\/p>\n<p><strong>Program ex-12-1\u81ea\u4e3b\u89e3\u6cd5<\/strong><strong><\/strong><\/p>\n<pre><code>assume cs<strong>:<\/strong>code<br>code segment<br>start<strong>:<\/strong><strong><br><\/strong>    <i>;\u8bbe\u7f6e\u76f8\u5173\u5bc4\u5b58\u5668\u4f20\u9001\u4ee3\u7801<\/i><i><br><\/i>    <strong>mov<\/strong> ax,cs    <i>;do0\u6240\u5728\u6e90\u4f4d\u7f6e<\/i><i><br><\/i>    <strong>mov<\/strong> ds,ax    <br>    <strong>mov<\/strong> si,offset do0<br>    <strong>mov<\/strong> ax,0<br>    <strong>mov<\/strong> es,ax<br>    <strong>mov<\/strong> di,200h<br>    <strong>mov<\/strong> cx,offset do0end<strong>-<\/strong>offset do0<br>    <i>;(cx)=do0\u957f\u5ea6<\/i><i><br><\/i>    <strong>cld<\/strong><strong><br><\/strong>    <strong>rep<\/strong> <strong>movsb<\/strong><strong><br><\/strong>    <i>;\u8bbe\u7f6e\u4e2d\u65ad\u5411\u91cf<\/i><i><br><\/i>    <strong>mov<\/strong> ax,0<br>    <strong>mov<\/strong> ds,ax<br>    <strong>mov<\/strong> word ptr ds<strong>:<\/strong>[2],0h<br>    <strong>mov<\/strong> word ptr ds<strong>:<\/strong>[0],200h<br>    <strong>mov<\/strong> ax,4c00h<br>    <strong>int<\/strong> 21h<br><i>;--------------------------------<\/i><i><br><\/i><i>;\u4ee5\u4e0b\u4ee3\u7801\u9001\u51650:200<\/i><i><br><\/i>do0<strong>:<\/strong><strong><br><\/strong>    <strong>jmp<\/strong> do0start<br>    string db <strong>'<\/strong>divide error!<strong>'<\/strong> <i>;13Byte<\/i><i><br><\/i>    do0start<strong>:<\/strong><strong><br><\/strong>        <strong>mov<\/strong> ax,0b800h<br>        <strong>mov<\/strong> es,ax<br>        <strong>mov<\/strong> di,<strong>(<\/strong>40<strong>*<\/strong>25<strong>+<\/strong>12<strong>)*<\/strong>2<br>        <strong>mov<\/strong> ax,0h<br>        <strong>mov<\/strong> ds,ax<br>        <strong>mov<\/strong> si,203h    <br>        <i>;string\u7684\u4f4d\u7f6e,\u7b49\u4ef7\u4e8e200h+(offset string-offset do0)<\/i><i><br><\/i>        <strong>mov<\/strong> cx,13<br>        loop1<strong>:<\/strong><strong><br><\/strong>            <strong>mov<\/strong> ah,2<br>            <strong>mov<\/strong> al,ds<strong>:<\/strong>[si]<br>            <strong>inc<\/strong> si<br>            <strong>mov<\/strong> es<strong>:<\/strong>[di],ax<br>            <strong>add<\/strong> di,2<br>            <strong>loop<\/strong> loop1<br>        <strong>mov<\/strong> ax,4c00h<br>        <strong>int<\/strong> 21h<br>    do0end<strong>:<\/strong><strong>nop<\/strong><strong><br><\/strong>code ends<br>end start<\/code><\/pre>\n<p><strong>Program ex-12-2 \u53c2\u8003\u89e3\u6cd5<\/strong><strong><\/strong><\/p>\n<pre><code>assume cs:code <\/code><\/pre>\n<p>code segment<\/p>\n<pre><code>start:  mov ax,cs\n        mov ds,ax\n        mov si,offset do0               ;\u8bbe\u7f6eds:si\u6307\u5411\u6e90\u5730\u5740<\/code><\/pre>\n<p> <\/p>\n<pre><code>        mov ax,0\n        mov es,ax\n        mov di,200h                     ;\u8bbe\u7f6ees:di\u6307\u5411\u76ee\u6807\u5730\u5740<\/code><\/pre>\n<p> <\/p>\n<pre><code>        mov cx,offset do0end-offset do0 ;\u8bbe\u7f6ecx\u4e3a\u4f20\u8f93\u957f\u5ea6<\/code><\/pre>\n<p> <\/p>\n<p>        cld                             ;\u8bbe\u7f6e\u4f20\u8f93\u65b9\u5411\u4e3a\u6b63<\/p>\n<p>        rep movsb<\/p>\n<p> <\/p>\n<pre><code>        mov ax,0\n        mov es,ax\n        mov word ptr es:[0*4],200h\n        mov word ptr es:[0*4+2],0       ;\u8bbe\u7f6e\u4e2d\u65ad\u5411\u91cf\u8868<\/code><\/pre>\n<p>         <\/p>\n<pre><code>        mov ax,4c00h\n        int 21h<\/code><\/pre>\n<p> <\/p>\n<pre><code>do0:    jmp short do0start\n        db 'divide error!'<\/code><\/pre>\n<p> <\/p>\n<pre><code>do0start:mov ax,cs\n         mov ds,ax\n         mov si,202h                    ;\u8bbe\u7f6eds:si\u6307\u5411\u5b57\u7b26\u4e32<\/code><\/pre>\n<p> <\/p>\n<pre><code>         mov ax,0b800h\n         mov es,ax\n         mov di,12*160+34*2             ;\u8bbe\u7f6ees:di\u6307\u5411\u663e\u5b58\u7a7a\u95f4\u7684\u4e2d\u95f4\u4f4d\u7f6e<\/code><\/pre>\n<p> <\/p>\n<pre><code>         mov cx,13                      ;\u8bbe\u7f6ecx\u4e3a\u5b57\u7b26\u4e32\u957f\u5ea6\ns:       mov al,[si]\n         mov es:[di],al\n         inc si\n         add di,2\n         loop s<\/code><\/pre>\n<p> <\/p>\n<pre><code>         mov ax,4c00h\n         int 21h<\/code><\/pre>\n<p> <\/p>\n<p>do0end:  nop<\/p>\n<p>code ends<\/p>\n<p>end start<\/p>\n<p> <\/p>\n<p><strong>\u5b9e\u9a8c13 \u7f16\u5199\u3001\u5e94\u7528\u4e2d\u65ad\u4f8b\u7a0b<\/strong><strong><\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"345\"  height=\"87\"  src=\"http:\/\/8.129.82.128\/wp-content\/uploads\/2026\/03\/asm202405\u7248\u63d0\u7eb282725.png\"  align=\"left\"  hspace=\"12\" >(1)\u7f16\u5199\u5e76\u5b89\u88c5int 7ch\u4e2d\u65ad\u4f8b\u7a0b\uff0c\u529f\u80fd\u4e3a\u663e\u793a\u4e00\u4e2a\u75280\u7ed3\u675f\u7684\u5b57\u7b26\u4e32\uff0c\u4e2d\u65ad\u4f8b\u7a0b\u5b89\u88c5\u57280:200\u5904\u3002<\/p>\n<p> <\/p>\n<p> <\/p>\n<p>\u6548\u679c\u56fe<\/p>\n<p> <\/p>\n<p><strong>Program ex-13-1 \u53c2\u8003\u89e3\u6cd5<\/strong><strong><\/strong><\/p>\n<pre><code>;\u540d\u79f0\uff1aint 7ch\u4e2d\u65ad\u4f8b\u7a0b<\/code><\/pre>\n<p>;\u529f\u80fd\uff1a\u663e\u793a\u4e00\u4e2a0\u7ed3\u675f\u7684\u5b57\u7b26\u4e32\uff0c\u4e2d\u65ad\u4f8b\u7a0b\u5b89\u88c5\u57280:200\u5904<\/p>\n<p>;\u53c2\u6570\uff1a(dh)=\u884c\u53f7\uff0c(dl)=\u5217\u53f7\uff0c(cl)=\u989c\u8272\uff0cds:si\u6307\u5411\u5b57\u7b26\u4e32\u9996\u5730\u5740<\/p>\n<pre><code>assume cs:code   \ncode segment  \nstart:  mov ax,cs  \n        mov ds,ax  \n        mov si,offset show_str          ;\u8bbe\u7f6eds:si\u6307\u5411\u6e90\u5730\u5740  \n        mov ax,0  \n        mov es,ax  \n        mov di,200h                     ;\u8bbe\u7f6ees:di\u6307\u5411\u76ee\u6807\u5730\u5740  \n        mov cx,offset show_strend-offset show_str ;\u8bbe\u7f6ecx\u4e3a\u4f20\u8f93\u957f\u5ea6  <\/code><\/pre>\n<p>        cld                             ;\u8bbe\u7f6e\u4f20\u8f93\u65b9\u5411\u4e3a\u6b63  <\/p>\n<p>        rep movsb  <\/p>\n<pre><code>        mov ax,0  \n        mov es,ax  \n        mov word ptr es:[7ch*4],200h  \n        mov word ptr es:[7ch*4+2],0     ;\u8bbe\u7f6e\u4e2d\u65ad\u5411\u91cf\u8868  \n        mov ax,4c00h  \n        int 21h  <\/code><\/pre>\n<p>;\u540d\u79f0\uff1ashow_str <\/p>\n<p>;\u529f\u80fd\uff1a\u5728\u6307\u5b9a\u7684\u4f4d\u7f6e\uff0c\u7528\u6307\u5b9a\u7684\u989c\u8272\uff0c\u663e\u793a\u4e00\u4e2a\u75280\u7ed3\u675f\u7684\u5b57\u7b26\u4e32\u3002 <\/p>\n<p>;\u53c2\u6570\uff1a(dh)=\u884c\u53f7(\u53d6\u503c\u8303\u56f40~24)\uff1b <\/p>\n<p>;      (dl)=\u5217\u53f7(\u53d6\u503c\u8303\u56f40~79)\uff1b <\/p>\n<p>;      (cl)=\u989c\u8272\uff1b <\/p>\n<p>;      ds:si\u6307\u5411\u5b57\u7b26\u4e32\u7684\u9996\u5730\u5740\u3002 <\/p>\n<p>;\u8fd4\u56de\uff1a\u65e0\u3002 <\/p>\n<pre><code>show_str:push ax \n        push bx \n        push es \n        push si \n        mov ax,0b800h \n        mov es,ax \n        mov ax,160 \n        mul dh \n        mov bx,ax        ;bx=160*dh \n        mov ax,2 \n        mul dl           ;ax=dl*2 \n        add bx,ax        ;mov bx,(160*dh+dl*2)\u8bbe\u7f6ees:bx\u6307\u5411\u663e\u5b58\u9996\u5730\u5740 \n        mov al,cl        ;\u628a\u989c\u8272cl\u8d4b\u503cal \n        mov cl,0 \nshow0:  mov ch,[si] <\/code><\/pre>\n<p>        jcxz show1       ;(ds:si)=0\u65f6\uff0c\u8f6c\u5230show1\u6267\u884c         <\/p>\n<pre><code>        mov es:[bx],ch \n        mov es:[bx].1,al \n        inc si           ;ds:si\u6307\u5411\u4e0b\u4e00\u4e2a\u5b57\u7b26\u5730\u5740 \n        add bx,2         ;es:bx\u6307\u5411\u4e0b\u4e00\u4e2a\u663e\u5b58\u5730\u5740 \n        jmp show0 \nshow1:  pop si \n        pop es \n        pop bx \n        pop ax <\/code><\/pre>\n<p>        iret <\/p>\n<pre><code>        mov ax,4c00h  \n        int 21h  \nshow_strend:nop  \ncode ends  <\/code><\/pre>\n<p>end start <\/p>\n<p> <\/p>\n<p>;\u5b9e\u9a8c13(1)\u5e94\u7528\u4e3e\u4f8b<\/p>\n<pre><code>assume cs:code<\/code><\/pre>\n<p>data segment<\/p>\n<pre><code>db 'welcome to masm!',0<\/code><\/pre>\n<p>data ends<\/p>\n<p>code segment<\/p>\n<pre><code>start:mov dh,10\nmov dl,10\nmov cl,2\nmov ax,data\nmov ds,ax\nmov si,0\nint 7ch\nmov ax,4c00h\nint 21h<\/code><\/pre>\n<p>code ends<\/p>\n<p>end start<\/p>\n<p>\uff082\uff09\u7f16\u5199\u5e76\u5b89\u88c5int 7ch\u4e2d\u65ad\u4f8b\u7a0b\uff0c\u529f\u80fd\u4e3a\u5b8c\u6210loop\u6307\u4ee4\u529f\u80fd<\/p>\n<p><strong>Program ex-13-2 \u53c2\u8003\u89e3\u6cd5<\/strong><\/p>\n<pre><code>;\u540d\u79f0\uff1aint 7ch\u4e2d\u65ad\u4f8b\u7a0b <\/code><\/pre>\n<p>;\u529f\u80fd\uff1a\u5b8c\u6210loop\u6307\u4ee4\u529f\u80fd\uff0c\u4e2d\u65ad\u4f8b\u7a0b\u5b89\u88c5\u57280:200\u5904 <\/p>\n<p>;\u53c2\u6570\uff1a(cx)=\u5faa\u73af\u6b21\u6570\uff0c(bx)=\u4f4d\u79fb <\/p>\n<pre><code>assume cs:code   \ncode segment  \nstart:  mov ax,cs  \n        mov ds,ax  \n        mov si,offset lp               ;\u8bbe\u7f6eds:si\u6307\u5411\u6e90\u5730\u5740  \n        mov ax,0  \n        mov es,ax  \n        mov di,200h                     ;\u8bbe\u7f6ees:di\u6307\u5411\u76ee\u6807\u5730\u5740  \n        mov cx,offset lpend-offset lp   ;\u8bbe\u7f6ecx\u4e3a\u4f20\u8f93\u957f\u5ea6  <\/code><\/pre>\n<p>        cld                             ;\u8bbe\u7f6e\u4f20\u8f93\u65b9\u5411\u4e3a\u6b63  <\/p>\n<p>        rep movsb  <\/p>\n<pre><code>        mov ax,0  \n        mov es,ax  \n        mov word ptr es:[7ch*4],200h  \n        mov word ptr es:[7ch*4+2],0     ;\u8bbe\u7f6e\u4e2d\u65ad\u5411\u91cf\u8868  \n        mov ax,4c00h  \n        int 21h  \nlp:     push bp\n        mov bp,sp \n        dec cx <\/code><\/pre>\n<p>        jcxz lpret <\/p>\n<pre><code>        add [bp+2],bx \nlpret:  pop bp  <\/code><\/pre>\n<p>        iret <\/p>\n<pre><code>        mov ax,4c00h  \n        int 21h  \nlpend:nop  \ncode ends  <\/code><\/pre>\n<p>end start <\/p>\n<p> <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"317\"  height=\"90\"  src=\"http:\/\/8.129.82.128\/wp-content\/uploads\/2026\/03\/asm202405\u7248\u63d0\u7eb285374.png\"  align=\"left\"  hspace=\"12\" >;\u5b9e\u9a8c13(2)\u5e94\u7528\u4e3e\u4f8b<\/p>\n<pre><code>assume cs:code   \ncode segment  \nstart:  mov ax,0b800h\n        mov es,ax\n        mov di,160*12\n        mov bx,offset s-offset se ;\u8bbe\u7f6e\u4ece\u6807\u53f7se\u5230\u6807\u53f7s\u7684\u8f6c\u79fb\u4f4d\u79fb\n        mov cx,80\ns:      mov byte ptr es:[di],'!'\n        add di,2\n        int 7ch                   ;(cx)\u22600\uff0c\u8f6c\u79fb\u5230\u6807\u53f7s\u5904<\/code><\/pre>\n<p>se:     nop<\/p>\n<pre><code>        mov ax,4c00h  \n        int 21h  \ncode ends  <\/code><\/pre>\n<p>end start<\/p>\n<p>(3)\u8865\u5168\u4e0b\u9762\u7684\u7a0b\u5e8f\uff0c\u5206\u522b\u5728\u5c4f\u5e55\u7684\u7b2c2\u30014\u30016\u30018\u884c\u663e\u793a4\u53e5\u82f1\u6587\u8bd7\uff0c\u8865\u5168\u4ee3\u7801\u3002<\/p>\n<pre><code>assume cs:code<\/code><\/pre>\n<p>code segment<\/p>\n<pre><code>  s1:  db 'Good,better,best,','$'\n  s2:  db 'Never let it rest,','$'\n  s3:  db 'Till good is better,','$'\n  s4:  db 'And better,best.','$'\n  s :  dw offset s1,offset s2,offset s3,offset s4\n  row: db 2,4,6,8<\/code><\/pre>\n<p> <\/p>\n<pre><code>start:  mov ax,cs\n        mov ds,ax\n        mov bx,offset s\n        mov si,offset row\n        mov cx,4\nok:     mov bh,0        ;\u7b2c0\u9875\n        mov dh,<u>[si]  <\/u>   ;dh\u4e2d\u653e\u884c\u53f7\n        mov dl,0        ;dl\u4e2d\u653e\u5217\u53f7\n        mov ah,2        ;\u7f6e\u5149\u6807\n        int 10h<\/code><\/pre>\n<p> <\/p>\n<pre><code>        mov dx,<u>[bx]  <\/u>   ;ds:dx\u6307\u5411\u5b57\u7b26\u4e32\u9996\u5730\u5740\n        mov ah,9        ;\u5728\u5149\u6807\u4f4d\u7f6e\u663e\u793a\u5b57\u7b26\n        int 21h\n        <u>inc si       <\/u>   ;\u884c\u53f7\u9012\u589e\n        <u>add bx,2     <\/u>   ;\u6307\u5411\u4e0b\u4e00\u5b57\u7b26\u4e32\n        loop ok<\/code><\/pre>\n<p> <\/p>\n<pre><code>        mov ax,4c00h\n        int 21h<\/code><\/pre>\n<p>code ends<\/p>\n<p>end start<\/p>\n<p><strong>\u5b9e\u9a8c14  \u8bbf\u95eeCMOS RAM<\/strong><strong><\/strong><\/p>\n<p>\u7f16\u7a0b\uff0c\u4ee5\u201c\u5e74\/\u6708\/\u65e5 \u65f6:\u5206:\u79d2\u201d\u7684\u683c\u5f0f\uff0c\u663e\u793a\u5f53\u524d\u7684\u65e5\u671f\u3001\u65f6\u95f4<\/p>\n<p><strong>Program ex-14-1 \u53c2\u8003\u89e3\u6cd5<\/strong><strong><\/strong><\/p>\n<pre><code>assume cs:code\ncode segment  \nstart:  mov ax,0\n        mov al,9\n        mov si,0\n        mov cx,6\ns:      push cx\n        push ax<\/code><\/pre>\n<p>        out 70h,al        ;\u5c06al\u9001\u5165\u7aef\u53e370h<\/p>\n<p>        in al,71h         ;\u4ece\u7aef\u53e371h\u5904\u8bfb\u51fa\u5355\u5143\u5185\u5bb9<\/p>\n<pre><code>        mov ah,al\n        mov cl,4\n        shr ah,cl\n        and al,00001111b  ;al\u5206\u6210\u4e24\u4e2a\u8868\u793aBCD\u7801\u503c\u7684\u6570\u636e\n        add ah,30h\n        add al,30h        ;BCD\u7801+30h=10\u8fdb\u5236\u6570\u5bf9\u5e94\u7684ASCII\u7801\n        mov bx,0b800h\n        mov es,bx\n        mov byte ptr es:[160*12+40*2][si],ah     ;\u663e\u793a\u5341\u4f4d\u6570\u7801\n        mov byte ptr es:[160*12+40*2+2][si],al   ;\u663e\u793a\u4e2a\u4f4d\u6570\u7801\n        pop ax\n        dec ax            ;\u6307\u5411\u524d\u4e00\u6570\u636e\u5355\u5143\n        jmp s1\ns0:     pop cx\n        add si,6\n        loop s\n        mov ax,4c00h  \n        int 21h \ns1:     cmp ax,10\n        ja s0\n        cmp ax,0\n        je s0\n        cmp ax,6\n        ja s2         ;ax>6,\u4e3a\u5e74\/\u6708\/\u65e5\n        je s3         ;ax=6,\u4e3a\u65e5\u7ed3\u5c3e\n        jb s4         ;ax<6,\u4e3a\u65f6:\u5206:\u79d2\ns2:     mov byte ptr es:[160*12+40*2+4][si],'\/'  ;\u6dfb\u52a0'\/'\n        jmp s0\ns3:     sub ax,2\n        jmp s0\ns4:     sub ax,1\n        mov byte ptr es:[160*12+40*2+4][si],':'  ;\u6dfb\u52a0':'\n        jmp s0\ncode ends <\/code><\/pre>\n<p>end start<\/p>\n<p><strong>\u5b9e\u9a8c15 \u5b89\u88c5\u65b0\u7684int 9\u4e2d\u65ad\u4f8b\u7a0b\uff08\u6309'A'\u952e\u540e\u663e\u793a\u6ee1\u5c4f\u5e55\u7684'A'\uff09<\/strong><strong><\/strong><\/p>\n<p>;\u4efb\u52a1\uff1a\u5b89\u88c5\u4e00\u4e2a\u65b0\u7684int 9\u4e2d\u65ad\u4f8b\u7a0b<\/p>\n<p>;\u529f\u80fd\uff1a\u5728DOS\u4e0b\uff0c\u6309'A'\u952e\u540e\u9664\u975e\u4e0d\u518d\u677e\u5f00\uff0c\u5982\u679c\u677e\u5f00\uff0c\u5c31\u663e\u793a\u6ee1\u5c4f\u5e55\u7684'A'\uff0c\u5176\u4ed6\u952e\u7167\u5e38\u5904\u7406<\/p>\n<pre><code>assume cs:code<\/code><\/pre>\n<p>stack segment<\/p>\n<pre><code>db 128 dup (0)<\/code><\/pre>\n<p>stack ends<\/p>\n<p>code segment<\/p>\n<pre><code>start:mov ax,stack\nmov ss,ax\nmov sp,128\npush cs\npop ds\nmov ax,0\nmov es,ax\nmov si,offset int9;\u8bbe\u7f6eds:si\u6307\u5411\u6e90\u5730\u5740\nmov di,204h;\u8bbe\u7f6ees:di\u6307\u5411\u76ee\u6807\u5730\u5740\nmov cx,offset int9end-offset int9;\u8bbe\u7f6ecx\u4e3a\u4f20\u8f93\u957f\u5ea6<\/code><\/pre>\n<p>cld;\u8bbe\u7f6e\u4f20\u8f93\u65b9\u5411\u4e3a\u6b63<\/p>\n<p>rep movsb<\/p>\n<p>;\u5c06\u539f\u6765\u7684int 9\u4e2d\u65ad\u4f8b\u7a0b\u7684\u5165\u53e3\u5730\u5740\u4fdd\u5b58\u5728ds:200\u3001ds:202\u5355\u5143\u4e2d<\/p>\n<pre><code>push es:[9*4]\npop es:[200h]\npush es:[9*4+2]\npop es:[202h]<\/code><\/pre>\n<p>;\u5728\u4e2d\u65ad\u5411\u91cf\u8868\u4e2d\u8bbe\u7f6e\u65b0\u7684int 9\u4e2d\u65ad\u4f8b\u7a0b\u7684\u5165\u53e3\u5730\u5740<\/p>\n<p>cli;\u8bbe\u7f6eIF\uff1d0\u5c4f\u853d\u4e2d\u65ad<\/p>\n<pre><code>mov word ptr es:[9*4],204h\nmov word ptr es:[9*4+2],0<\/code><\/pre>\n<p>sti;\u8bbe\u7f6eIF\uff1d1\u4e0d\u5c4f\u853d\u4e2d\u65ad<\/p>\n<p>;\u7ed3\u675f<\/p>\n<pre><code>mov ax,4c00h\nint 21h<\/code><\/pre>\n<p>;\u65b0\u7684int 9\u4e2d\u65ad\u4f8b\u7a0b<\/p>\n<pre><code>int9:push ax\npush bx\npush cx\npush es<\/code><\/pre>\n<p>in al,60h;\u4ece\u7aef\u53e360h\u8bfb\u51fa\u952e\u76d8\u8f93\u5165<\/p>\n<p>;\u5bf9int\u6307\u4ee4\u8fdb\u884c\u6a21\u62df\uff0c\u8c03\u7528\u539f\u6765\u7684int 9\u4e2d\u65ad\u4f8b\u7a0b<\/p>\n<p>pushf;\u6807\u5fd7\u5bc4\u5b58\u5668\u5165\u6808<\/p>\n<pre><code>call dword ptr cs:[200h];CS,IP\u5165\u6808,(IP)=cs:[200h],(CS)=0<\/code><\/pre>\n<p>;\u5982\u679c\u662fA\u65ad\u7801\uff0c\u6539\u53d8\u5f53\u524d\u5c4f\u5e55\u7684\u663e\u793a\u5b57\u7b26<\/p>\n<pre><code>cmp al,9eh;\u548cA\u7684\u65ad\u7801(1eh+80h)\u6bd4\u8f83\njne int9ret;\u4e0d\u7b49\u4e8eA\u65f6\u8f6c\u79fb\nmov ax,0b800h\nmov es,ax\nmov bx,0\nmov cx,2000\ns:mov byte ptr es:[bx],41h;\u5c06A\u7684ASCII\u7801\u5199\u5165\uff0c\u6539\u53d8\u5b57\u7b26\nadd bx,2\nloop s\nint9ret:pop es\npop cx\npop bx\npop ax<\/code><\/pre>\n<p>iret<\/p>\n<p>int9end:nop<\/p>\n<p>code ends<\/p>\n<p>end start<\/p>\n<p><strong>\u5b9e\u9a8c16 \u5305\u542b\u591a\u4e2a\u529f\u80fd\u5b50\u7a0b\u5e8f\u7684\u4e2d\u65ad\u4f8b\u7a0b<\/strong><strong><\/strong><\/p>\n<p>\u5b89\u88c5\u4e00\u4e2a\u65b0\u7684int 7ch\u4e2d\u65ad\u4f8b\u7a0b\uff0c\u4e3a\u663e\u793a\u8f93\u51fa\u63d0\u4f9b\u529f\u80fd\u5b50\u7a0b\u5e8f\u3002<\/p>\n<p>\uff081\uff09\u6e05\u5c4f\uff1b<\/p>\n<p>\uff082\uff09\u8bbe\u7f6e\u524d\u666f\u8272\uff1b<\/p>\n<p>\uff083\uff09\u8bbe\u7f6e\u80cc\u666f\u8272\uff1b<\/p>\n<p>\uff084\uff09\u5411\u4e0a\u6eda\u52a8\u4e00\u884c\uff1b<\/p>\n<p>\u5165\u53e3\u53c2\u6570\u8bf4\u660e\u5982\u4e0b\u3002<\/p>\n<p>\uff081\uff09\u7528ah\u5bc4\u5b58\u5668\u4f20\u9012\u529f\u80fd\u53f7\uff1a0\u8868\u793a\u6e05\u5c4f\uff0c1\u8868\u793a\u8bbe\u7f6e\u524d\u666f\u8272\uff0c2\u8868\u793a\u8bbe\u7f6e\u80cc\u666f\u8272\uff0c3\u8868\u793a\u5411\u4e0a\u6eda\u52a8\u4e00\u884c\uff1b<\/p>\n<p>\uff082\uff09\u5bf9\u4e8e2\u30013\u53f7\u529f\u80fd\uff0c\u7528al\u4f20\u9001\u989c\u8272\u503c\uff0c(al)&#8712;{0,1,2,3,4,5,6,7}\u3002<\/p>\n<p> <\/p>\n<p>;\u4efb\u52a1\uff1a\u5b89\u88c5\u4e00\u4e2a\u65b0\u7684int 7ch\u4e2d\u65ad\u4f8b\u7a0b <\/p>\n<p>;\u529f\u80fd\uff1a\u4e3a\u663e\u793a\u8f93\u51fa\u63d0\u4f9b\u529f\u80fd\u5b50\u7a0b\u5e8f<\/p>\n<p>;\u53c2\u6570\uff1aah\u4f20\u9012\u529f\u80fd\u53f7\uff1b0\u8868\u793a\u6e05\u5c4f\uff0c1\u8868\u793a\u8bbe\u7f6e\u524d\u666f\u8272\uff0c2\u8868\u793a\u8bbe\u7f6e\u80cc\u666f\u8272\uff0c3\u8868\u793a\u5411\u4e0a\u6eda\u52a8\u4e00\u884c,\u5bf9\u4e8e2\u30013\u53f7\u529f\u80fd\uff0c\u7528al\u4f20\u9001\u989c\u8272\u503c\uff0c(al)&#8712;{0,1,2,3,4,5,6,7}<\/p>\n<pre><code>assume cs:code<\/code><\/pre>\n<p>code segment<\/p>\n<pre><code>start:mov ax,cs\nmov ds,ax\nmov si,offset s;\u8bbe\u7f6eds:si\u6307\u5411\u6e90\u5730\u5740\nmov ax,0\nmov es,ax\nmov di,200h;\u8bbe\u7f6ees:di\u6307\u5411\u76ee\u6807\u5730\u5740\nmov cx,offset send-offset s;\u8bbe\u7f6ecx\u4e3a\u4f20\u8f93\u957f\u5ea6<\/code><\/pre>\n<p>cld;\u8bbe\u7f6e\u4f20\u8f93\u65b9\u5411\u4e3a\u6b63<\/p>\n<p>rep movsb<\/p>\n<p>;\u5728\u4e2d\u65ad\u5411\u91cf\u8868\u4e2d\u8bbe\u7f6e\u65b0\u7684int 7ch\u4e2d\u65ad\u4f8b\u7a0b\u7684\u5165\u53e3\u5730\u5740<\/p>\n<p>cli;\u8bbe\u7f6eIF\uff1d0\u5c4f\u853d\u4e2d\u65ad <\/p>\n<pre><code>mov word ptr es:[7ch*4],200h\nmov word ptr es:[7ch*4+2],0<\/code><\/pre>\n<p>sti;\u8bbe\u7f6eIF\uff1d1\u4e0d\u5c4f\u853d\u4e2d\u65ad<\/p>\n<p>;\u7ed3\u675f<\/p>\n<pre><code>mov ax,4c00h\nint 21h<\/code><\/pre>\n<p>;\u65b0\u7684int 7ch\u4e2d\u65ad\u4f8b\u7a0b<\/p>\n<pre><code>s:jmp short set<\/code><\/pre>\n<p>tabledw sub1-s+200h,sub2-s+200h,sub3-s+200h,sub4-s+200h<\/p>\n<pre><code>set:push bx\ncmp ah,3;\u5224\u65adah\u4e2d\u7684\u529f\u80fd\u53f7\u662f\u5426\u5927\u4e8e3\nja sret\nmov bl,ah\nmov bh,0\nadd bx,bx;\u8ba1\u7b97\u5bf9\u5e94\u5b50\u7a0b\u5e8f\u5728table\u8868\u4e2d\u7684\u504f\u79fb\ncall word ptr table[bx];\u8c03\u7528\u5bf9\u5e94\u7684\u529f\u80fd\u5b50\u7a0b\u5e8f\nsret:pop bx<\/code><\/pre>\n<p>iret<\/p>\n<p>;\u529f\u80fd\uff1a\u6e05\u5c4f<\/p>\n<pre><code>sub1:push bx\npush cx\npush es\nmov bx,0b800h\nmov es,bx\nmov bx,0\nmov cx,2000\nsubles:mov byte ptr es:[bx],' '\nadd bx,2\nloop subles\npop es\npop cx\npop bx<\/code><\/pre>\n<p>ret<\/p>\n<p>;\u8bbe\u7f6e\u524d\u666f\u8272\uff0cal\u4f20\u9001\u989c\u8272\u503c\uff0c(al)&#8712;{0,1,2,3,4,5,6,7}<\/p>\n<pre><code>sub2:push bx\npush cx\npush es\nmov bx,0b800h\nmov es,bx\nmov bx,1\nmov cx,2000\nsub2s:and byte ptr es:[bx],11111000b\nor es:[bx],al\nadd bx,2\nloop sub2s\npop es\npop cx\npop bx<\/code><\/pre>\n<p>ret<\/p>\n<p>;\u8bbe\u7f6e\u80cc\u666f\u8272\uff0cal\u4f20\u9001\u989c\u8272\u503c\uff0c(al)&#8712;{0,1,2,3,4,5,6,7}<\/p>\n<pre><code>sub3:push ax\npush bx\npush cx\npush es\nmov cl,4\nshl al,cl\nmov bx,0b800h\nmov es,bx\nmov bx,1\nmov cx,2000\nsub3s:and byte ptr es:[bx],10001111b\nor es:[bx],al\nadd bx,2\nloop sub3s\npop es\npop cx\npop bx\npop ax<\/code><\/pre>\n<p>ret<\/p>\n<p>;\u5411\u4e0a\u6eda\u52a8\u4e00\u884c<\/p>\n<pre><code>sub4:push cx\npush si\npush di\npush es\npush ds\nmov si,0b800h\nmov es,si\nmov ds,si\nmov si,160;ds:si\u6307\u5411\u7b2cN+1\u884c\nmov di,0;es:di\u6307\u5411\u7b2cN\u884c<\/code><\/pre>\n<p>cld<\/p>\n<pre><code>mov cx,24;\u5171\u590d\u523624\u884c\nsub4s:push cx\nmov cx,160<\/code><\/pre>\n<p>rep movsb;\u590d\u5236<\/p>\n<pre><code>pop cx\nloop sub4s\nmov cx,80\nsub4s1:mov byte ptr [160*24+si],' ';\u6700\u540e\u4e00\u884c\u6e05\u7a7a\nadd bx,2\nloop sub4s1\npop ds\npop es\npop di\npop si\npop cx<\/code><\/pre>\n<p>ret<\/p>\n<p>send:nop<\/p>\n<p>code ends<\/p>\n<p>end start<\/p>\n<p><strong>\u5b9e\u9a8c17  \u901a\u8fc7\u903b\u8f91\u6247\u533a\u53f7\u5bf9\u8f6f\u76d8\u8fdb\u884c\u8bfb\u5199<\/strong><\/p>\n<p>;\u529f\u80fd\uff1a\u5b89\u88c5\u65b0\u7684int 7ch\u4e2d\u65ad\u4f8b\u7a0b\uff0c\u5b9e\u73b0\u901a\u8fc7\u903b\u8f91\u6247\u533a\u53f7\u5bf9\u8f6f\u76d8\u8fdb\u884c\u8bfb\u5199<\/p>\n<p>;\u5165\u53e3\u53c2\u6570\uff1a<\/p>\n<p>;(dx)=\u8bfb\u5199\u6247\u533a\u7684\u903b\u8f91\u6247\u533a\u53f7<\/p>\n<p>;(ah)=0\u8868\u793a\u8bfb\u6247\u533a\uff0c(ah)=1\u8868\u793a\u5199\u6247\u533a<\/p>\n<p>;es:bx\u6307\u5411\u5b58\u50a8\u8bfb\u51fa\u6570\u636e\u6216\u5199\u5165\u6570\u636e\u7684\u5185\u5b58\u533a<\/p>\n<p>;\u8fd4\u56de\u53c2\u6570\uff1a<\/p>\n<pre><code>;(ah)=int 13h\u7684\u529f\u80fd\u53f7(2\u8868\u793a\u8bfb\u6247\u533a\uff0c3\u8868\u793a\u5199\u6247\u533a)<\/code><\/pre>\n<p>;(ch)=\u78c1\u9053\u53f7<\/p>\n<p>;(cl)=\u6247\u533a\u53f7<\/p>\n<p>;(dh)=\u78c1\u5934\u53f7(\u9762\u53f7)<\/p>\n<pre><code>assume cs:code<\/code><\/pre>\n<p>code segment<\/p>\n<pre><code>start:mov ax,cs\nmov ds,ax\nmov si,offset s;\u8bbe\u7f6eds:si\u6307\u5411\u6e90\u5730\u5740\nmov ax,0\nmov es,ax\nmov di,200h;\u8bbe\u7f6ees:di\u6307\u5411\u76ee\u6807\u5730\u5740\nmov cx,offset send-offset s;\u8bbe\u7f6ecx\u4e3a\u4f20\u8f93\u957f\u5ea6<\/code><\/pre>\n<p>cld;\u8bbe\u7f6e\u4f20\u8f93\u65b9\u5411\u4e3a\u6b63<\/p>\n<p>rep movsb<\/p>\n<p>;\u5728\u4e2d\u65ad\u5411\u91cf\u8868\u4e2d\u8bbe\u7f6e\u65b0\u7684int 7ch\u4e2d\u65ad\u4f8b\u7a0b\u7684\u5165\u53e3\u5730\u5740<\/p>\n<p>cli;\u8bbe\u7f6eIF\uff1d0\u5c4f\u853d\u4e2d\u65ad <\/p>\n<pre><code>mov word ptr es:[7ch*4],200h\nmov word ptr es:[7ch*4+2],0<\/code><\/pre>\n<p>sti;\u8bbe\u7f6eIF\uff1d1\u4e0d\u5c4f\u853d\u4e2d\u65ad<\/p>\n<p>;\u7ed3\u675f<\/p>\n<pre><code>mov ax,4c00h\nint 21h<\/code><\/pre>\n<p>;\u65b0\u7684int 7ch\u4e2d\u65ad\u4f8b\u7a0b<\/p>\n<pre><code>s:cmp ah,0\nje s1\ncmp ah,1\nje s2\nja sret;ah\u5927\u4e8e1\uff0c\u7ed3\u675f\ncmp dx,1443\nja sret;\u903b\u8f91\u6247\u533a\u53f7\u5927\u4e8e1443\uff0c\u7ed3\u675f<\/code><\/pre>\n<p> <\/p>\n<pre><code>s3:push bx\nmov ax,dx;\u903b\u8f91\u6247\u533a\u53f7\u8d4b\u503cax\nmov dx,0\nmov cx,1440\ndiv cx;\u5546\u5728ax\uff1b\u4f59\u5728dx\npush ax;ax=\u9762\u53f7=int(\u903b\u8f91\u6247\u533a\u53f7\/1440)\uff0c\u5165\u6808<\/code><\/pre>\n<p> <\/p>\n<pre><code>mov ax,dx\nmov cx,18\ndiv cx;\u5546\u5728ax\uff1b\u4f59\u5728dx\npush ax;ax=\u78c1\u9053\u53f7=int(rem(\u903b\u8f91\u6247\u533a\u53f7\/1440)\/18)\uff0c\u5165\u6808<\/code><\/pre>\n<p> <\/p>\n<pre><code>add dx,1;dx=\u6247\u533a\u53f7=rem(rem(\u903b\u8f91\u6247\u533a\u53f7\/1440)\/18)+1<\/code><\/pre>\n<p> <\/p>\n<pre><code>mov cl,dl;\u6247\u533a\u53f7\u8d4b\u503ccl\npop bx;\u78c1\u9053\u53f7\u51fa\u6808\nmov ch,bl\npop bx;\u9762\u53f7\u51fa\u6808\nmov dh,bl\npop bx;\u529f\u80fd\u53f7\u51fa\u6808\nmov ah,bl<\/code><\/pre>\n<p> <\/p>\n<pre><code>sret:pop bx<\/code><\/pre>\n<p>        iret <\/p>\n<pre><code>s1:mov ah,2;int 13h\u7684\u529f\u80fd\u53f7(ah=2\u8868\u793a\u8bfb\u6247\u533a)\npush ax;\u529f\u80fd\u53f7\uff0c\u5165\u6808\njmp s3\ns2:mov ah,3;int 13h\u7684\u529f\u80fd\u53f7(ah=3\u8868\u793a\u5199\u6247\u533a)\npush ax;\u529f\u80fd\u53f7\uff0c\u5165\u6808\njmp s3\nsend:nop \ncode ends <\/code><\/pre>\n<p>end start<\/p>\n<p> <\/p>\n<p><strong>\u8bfe\u7a0b\u8bbe\u8ba1 2<\/strong><strong><\/strong><\/p>\n<p>&#183;\u9605\u8bfb\u4e0b\u9762\u7684\u6750\u6599:  <\/p>\n<p>\u5f00\u673a\u540e,CPU\u81ea\u52a8\u8fdb\u5165\u5230FFFF:0\u5355\u5143\u5904\u6267\u884c,\u6b64\u5904\u6709\u4e00\u6761\u8df3\u8f6c\u6307\u4ee4\u3002CPU\u6267\u884c\u8be5\u6307\u4ee4\u540e,\u8f6c\u53bb\u6267\u884cBIOS\u4e2d\u7684\u786c\u4ef6\u7cfb\u7edf\u68c0\u6d4b\u548c\u521d\u59cb\u5316\u7a0b\u5e8f\u3002  <\/p>\n<p>\u521d\u59cb\u5316\u7a0b\u5e8f\u5c06\u5efa\u7acbBIOS\u6240\u652f\u6301\u7684\u4e2d\u65ad\u5411\u91cf,\u5373\u5c06BIOS\u63d0\u4f9b\u7684\u4e2d\u65ad\u4f8b\u7a0b\u7684\u5165\u53e3\u5730\u5740\u767b\u8bb0\u5728\u4e2d\u65ad\u5411\u91cf\u8868\u4e2d\u3002  <\/p>\n<p>\u786c\u4ef6\u7cfb\u7edf\u68c0\u6d4b\u548c\u521d\u59cb\u5316\u5b8c\u6210\u540e,\u8c03\u7528int 19h\u8fdb\u884c\u64cd\u4f5c\u7cfb\u7edf\u7684\u5f15\u5bfc\u3002  <\/p>\n<p>\u5982\u679c\u8bbe\u4e3a\u4ece\u8f6f\u76d8\u542f\u52a8\u64cd\u4f5c\u7cfb\u7edf,\u5219int 19h\u5c06\u4e3b\u8981\u5b8c\u6210\u4ee5\u4e0b\u5de5\u4f5c\u3002  <\/p>\n<p>(1)\u63a7\u52360\u53f7\u8f6f\u9a71,\u8bfb\u53d6\u8f6f\u76d80\u90530\u97621\u6247\u533a\u7684\u5185\u5bb9\u52300:7c00;  <\/p>\n<p>(2)\u5c06CS:IP\u6307\u54110:7c00\u3002  <\/p>\n<pre><code>\u8f6f\u76d8\u76840\u90530\u97621\u6247\u533a\u4e2d\u88c5\u6709\u64cd\u4f5c\u7cfb\u7edf\u5f15\u5bfc\u7a0b\u5e8f\u3002int 19h\u5c06\u5176\u88c5\u52300:7c00\u5904\u540e,\u8bbe\u7f6eCPU\u4ece0:7c00\u5f00\u59cb\u6267\u884c\u6b64\u5904\u7684\u5f15\u5bfc\u7a0b\u5e8f,\u64cd\u4f5c\u7cfb\u7edf\u88ab\u6fc0\u6d3b,\u63a7\u5236\u8ba1\u7b97\u673a\u3002  <\/code><\/pre>\n<p>\u5982\u679c\u57280\u53f7\u8f6f\u9a71\u4e2d\u6ca1\u6709\u8f6f\u76d8,\u6216\u53d1\u751f\u8f6f\u76d8I\/O\u9519\u8bef,\u5219int 19h\u5c06\u4e3b\u8981\u5b8c\u6210\u4ee5\u4e0b\u5de5\u4f5c\u3002  <\/p>\n<p>(1)\u8bfb\u53d6\u786c\u76d8C\u76840\u90530\u97621\u6247\u533a\u7684\u5185\u5bb9\u52300:7c00;  <\/p>\n<p>(2)\u5c06CS:IP\u6307\u54110:7c00\u3002  <\/p>\n<p>\u8fd9\u6b21\u8bfe\u7a0b\u8bbe\u8ba1\u7684\u4efb\u52a1\u662f\u7f16\u5199\u4e00\u4e2a\u53ef\u4ee5\u81ea\u884c\u542f\u52a8\u7684\u8ba1\u7b97\u673a,\u4e0d\u9700\u8981\u5728\u73b0\u6709\u64cd\u4f5c\u7cfb\u7edf\u73af\u5883\u4e2d\u8fd0\u884c\u7684\u7a0b\u5e8f\u3002  <\/p>\n<p>\u8be5\u7a0b\u5e8f\u7684\u529f\u80fd\u5982\u4e0b:  <\/p>\n<p>(1)\u5217\u51fa\u529f\u80fd\u9009\u9879,\u8ba9\u7528\u6237\u901a\u8fc7\u952e\u76d8\u8fdb\u884c\u9009\u62e9,\u754c\u9762\u5982\u4e0b  <\/p>\n<p>   1) reset pc          ;\u91cd\u65b0\u542f\u52a8\u8ba1\u7b97\u673a  <\/p>\n<p>   2) start system      ;\u5f15\u5bfc\u73b0\u6709\u7684\u64cd\u4f5c\u7cfb\u7edf  <\/p>\n<p>   3) clock             ;\u8fdb\u5165\u65f6\u949f\u7a0b\u5e8f  <\/p>\n<p>   4) set clock         ;\u8bbe\u7f6e\u65f6\u95f4  <\/p>\n<p>(2)\u7528\u6237\u8f93\u5165\"1\"\u540e\u91cd\u65b0\u542f\u52a8\u8ba1\u7b97\u673a(\u63d0\u793a:\u8003\u8651ffff:0\u5355\u5143)  <\/p>\n<p>(3)\u7528\u6237\u8f93\u5165\"2\"\u540e\u5f15\u5bfc\u73b0\u6709\u7684\u64cd\u4f5c\u7cfb\u7edf(\u63d0\u793a:\u8003\u8651\u786c\u76d8C\u76840\u90530\u97621\u6247\u533a)\u3002  <\/p>\n<p>(4)\u7528\u6237\u8f93\u5165\"3\"\u540e,\u6267\u884c\u52a8\u6001\u663e\u793a\u5f53\u524d\u65e5\u671f\u3001\u65f6\u95f4\u7684\u7a0b\u5e8f\u3002  <\/p>\n<p>\u663e\u793a\u683c\u5f0f\u5982\u4e0b:\u5e74\/\u6708\/\u65e5 \u65f6:\u5206:\u79d2  <\/p>\n<p>\u8fdb\u5165\u6b64\u9879\u529f\u80fd\u540e,\u4e00\u76f4\u52a8\u6001\u663e\u793a\u5f53\u524d\u7684\u65f6\u95f4,\u5728\u5c4f\u5e55\u4e0a\u5c06\u51fa\u73b0\u65f6\u95f4\u6309\u79d2\u53d8\u5316\u7684\u6548\u679c(\u63d0\u793a: \u5faa\u73af\u8bfb\u53d6CMOS)\u3002  <\/p>\n<p>\u5f53\u6309\u4e0bF1\u952e\u540e,\u6539\u53d8\u663e\u793a\u989c\u8272;\u6309\u4e0bEsc\u952e\u540e,\u8fd4\u56de\u5230\u4e3b\u9009\u5355(\u63d0\u793a:\u5229\u7528\u952e\u76d8\u4e2d\u65ad)\u3002  <\/p>\n<p>(5)\u7528\u6237\u8f93\u5165\"4\"\u540e\u53ef\u66f4\u6539\u5f53\u524d\u7684\u65e5\u671f\u3001\u65f6\u95f4,\u66f4\u6539\u540e\u8fd4\u56de\u5230\u4e3b\u9009\u5355(\u63d0\u793a:\u8f93\u5165\u5b57\u7b26\u4e32)\u3002<\/p>\n<p>&#183;\u53c2\u8003\u7a0b\u5e8f<\/p>\n<pre><code>assume cs:code<\/code><\/pre>\n<p>code segment<\/p>\n<p>;===============================================================<\/p>\n<p>;\u529f\u80fd\uff1a\u5c06\u4ee3\u7801\u5199\u51650\u97620\u90531\u6247\u533a<\/p>\n<p>;\u5165\u53e3\u53c2\u6570\uff1a<\/p>\n<pre><code>;(ah)=int 13h\u7684\u529f\u80fd\u53f7(2\u8868\u793a\u8bfb\u6247\u533a\uff0c3\u8868\u793a\u5199\u6247\u533a)<\/code><\/pre>\n<p>;(al)=\u5199\u5165\u7684\u6247\u533a\u6570<\/p>\n<p>;(ch)=\u78c1\u9053\u53f7<\/p>\n<p>;(cl)=\u6247\u533a\u53f7<\/p>\n<p>;(dh)=\u78c1\u5934\u53f7(\u9762\u53f7)<\/p>\n<p>;(dl)=\u9a71\u52a8\u5668\u53f7    \u8f6f\u533a\u4ece0\u5f00\u59cb\uff0c0\uff1a\u8f6f\u9a71A\uff0c1\uff1a\u8f6f\u9a71B<\/p>\n<p>;                        \u786c\u76d8\u4ece80h\u5f00\u59cb\uff0c80h\uff1a\u786c\u76d8C\uff0c81h\uff1a\u786c\u76d8D<\/p>\n<p>;es:bx\u6307\u5411\u5c06\u5199\u5165\u78c1\u76d8\u7684\u6570\u636e\u6216\u6307\u5411\u63a5\u6536\u4ece\u6247\u533a\u8bfb\u5165\u6570\u636e\u7684\u5185\u5b58\u533a<\/p>\n<p>;\u8fd4\u56de\u53c2\u6570\uff1a<\/p>\n<p>;\u64cd\u4f5c\u6210\u529f\uff1a(ah)=0\uff0c(al)=\u5199\u5165\u7684\u6247\u533a\u6570<\/p>\n<p>;\u64cd\u4f5c\u5931\u8d25\uff1a(ah)=\u51fa\u9519\u4ee3\u7801<\/p>\n<p>;===============================================================<\/p>\n<p>start:<\/p>\n<pre><code>mov ax,floppyend-floppy\nmov dx,0\nmov bx,512\ndiv bx;\u5546ax\u4e3a\u6240\u9700\u7684\u6247\u533a\u6570\ninc al;\u5199\u5165\u7684\u6247\u533a\u6570(\u4e3a\u4f59\u6570\u52a0\u6247\u533a)<\/code><\/pre>\n<p> <\/p>\n<pre><code>push cs\npop es\nmov bx,offset floppy;es:bx\u6307\u5411\u8981\u88ab\u5199\u5165\u7684\u5185\u5b58\u5355\u5143<\/code><\/pre>\n<p> <\/p>\n<pre><code>mov ch,0;\u78c1\u9053\u53f7\nmov cl,1;\u6247\u533a\u53f7\nmov dl,0;\u9a71\u52a8\u5668\u53f7\uff0c\u8f6f\u76d8A\nmov dh,0;\u78c1\u5934\u53f7(\u9762\u53f7)\nmov ah,3;int 13h\u7684\u529f\u80fd\u53f7(3\u8868\u793a\u5199\u6247\u533a)\nint 13h;\u5c06\u4ee3\u7801\u5199\u51650\u97620\u90531\u6247\u533a<\/code><\/pre>\n<p> <\/p>\n<pre><code>mov ax,4c00h\nint 21h<\/code><\/pre>\n<p> <\/p>\n<p>floppy:<\/p>\n<pre><code>jmp read<\/code><\/pre>\n<p>;===============================================================<\/p>\n<p>;\u76f4\u63a5\u5b9a\u5740\u8868<\/p>\n<p>;===============================================================<\/p>\n<p>tabledw function1-floppy,function2-floppy<\/p>\n<pre><code>dw function3-floppy,function4-floppy<\/code><\/pre>\n<p> <\/p>\n<p>menudb '***main Menu***',0<\/p>\n<pre><code>db '1) reset pc    ',0\ndb '2) start system',0\ndb '3) clock       ',0\ndb '4) set clock   ',0\ndb 'Please Choose: ',0<\/code><\/pre>\n<p> <\/p>\n<pre><code>timedb 'YY\/MM\/DD hh:mm:ss',0<\/code><\/pre>\n<p>cmosdb 9,8,7,4,2,0<\/p>\n<p>hintdb 'press F1 to change the color, press Esc to return',0<\/p>\n<p> <\/p>\n<pre><code>hint1db 'Please input: YY\/MM\/DD hh:mm:ss',0<\/code><\/pre>\n<p>chardb '  \/  \/     :  :  ',0<\/p>\n<p> <\/p>\n<p>;===============================================================<\/p>\n<p>;\u529f\u80fd\uff1a\u5c060\u97620\u90532\u6247\u533a\u7684\u5185\u5bb9\u5199\u51650:7e00h<\/p>\n<p>;\u5165\u53e3\u53c2\u6570\uff1a<\/p>\n<pre><code>;(ah)=int 13h\u7684\u529f\u80fd\u53f7(2\u8868\u793a\u8bfb\u6247\u533a)<\/code><\/pre>\n<p>;(al)=\u5199\u5165\u7684\u6247\u533a\u6570<\/p>\n<p>;(ch)=\u78c1\u9053\u53f7<\/p>\n<p>;(cl)=\u6247\u533a\u53f7<\/p>\n<p>;(dh)=\u78c1\u5934\u53f7(\u9762\u53f7)<\/p>\n<p>;(dl)=\u9a71\u52a8\u5668\u53f7    \u8f6f\u533a\u4ece0\u5f00\u59cb\uff0c0\uff1a\u8f6f\u9a71A\uff0c1\uff1a\u8f6f\u533aB<\/p>\n<p>;                        \u786c\u76d8\u4ece80h\u5f00\u59cb\uff0c80h\uff1a\u786c\u76d8C\uff0c81h\uff1a\u786c\u76d8D<\/p>\n<p>;es:bx\u6307\u5411\u5c06\u5199\u5165\u78c1\u76d8\u7684\u6570\u636e<\/p>\n<p>;\u8fd4\u56de\u53c2\u6570\uff1a<\/p>\n<p>;\u64cd\u4f5c\u6210\u529f\uff1a(ah)=0\uff0c(al)=\u5199\u5165\u7684\u6247\u533a\u6570<\/p>\n<p>;\u64cd\u4f5c\u5931\u8d25\uff1a(ah)=\u51fa\u9519\u4ee3\u7801<\/p>\n<p>;===============================================================<\/p>\n<p>read:<\/p>\n<pre><code>mov ax,floppyend-floppy\nmov dx,0\nmov bx,512\ndiv bx;\u5546ax\u4e3a\u6240\u9700\u7684\u6247\u533a\u6570\ninc al<\/code><\/pre>\n<p> <\/p>\n<pre><code>mov bx,0\nmov es,bx\nmov bx,7e00h;es:bx\u6307\u5411\u8981\u8bfb\u5165\u7684\u5185\u5b58\u5355\u5143<\/code><\/pre>\n<p> <\/p>\n<pre><code>mov ch,0;\u78c1\u9053\u53f7\nmov cl,2;\u6247\u533a\u53f7\nmov dl,0;\u9a71\u52a8\u5668\u53f7\nmov dh,0;\u78c1\u5934\u53f7(\u9762\u53f7)\nmov ah,2;int 13h\u7684\u529f\u80fd\u53f7(2\u8868\u793a\u8bfb\u6247\u533a)\nint 13h;\u8bfb\u53d60\u97620\u90532\u6247\u533a\u7684\u5185\u5bb9\u52300:7e00h\u5904<\/code><\/pre>\n<p>;(\u7b2c\u4e8c\u6247\u533a\u4ece512\/200h\u5f00\u59cb)<\/p>\n<p> <\/p>\n<pre><code>mov ax,7c0h\npush ax;push cs\nmov ax,showmenu-floppy\npush ax;push ip\nretf;jmp showmenu<\/code><\/pre>\n<p> <\/p>\n<p>;***************************************************************<\/p>\n<p>;\u663e\u793a\u4e3b\u83dc\u5355\uff0c\u8c03\u7528show_str\u3001clean\u5b50\u7a0b\u5e8f<\/p>\n<p>;***************************************************************<\/p>\n<p>showmenu:<\/p>\n<pre><code>call clean;\u6e05\u5c4f\npush cs\npop ds\nmov si,menu-floppy\nmov dh,8\nmov dl,30\nmov cx,6<\/code><\/pre>\n<p>showmenu0:<\/p>\n<pre><code>push cx\nmov cl,2\ncall show_str\nadd si,16\ninc dh\npop cx\nloop showmenu0<\/code><\/pre>\n<p> <\/p>\n<p>;===============================================================<\/p>\n<p>;\u63a5\u6536\u952e\u76d8\u8f93\u5165\uff0c\u8df3\u8f6c\u76f8\u5e94\u529f\u80fd\u7a0b\u5e8f\u6bb5<\/p>\n<p>;\u8c03\u7528BIOS\u7528\u6765\u63d0\u4f9b\u8bfb\u53d6\u952e\u76d8\u7f13\u51b2\u533a\u529f\u80fd\u7684\u4e2d\u65ad\u4f8b\u7a0bint 16h\uff0c<\/p>\n<p>;\u5c06\u8bfb\u53d6\u7684\u626b\u63cf\u7801\u9001\u5165ah\uff0cASCII\u7801\u9001\u5165al<\/p>\n<p>;===============================================================<\/p>\n<pre><code>go:mov ax,0\nint 16h\ncmp al,'1'\njb showmenu\ncmp al,'4'\nja showmenu<\/code><\/pre>\n<p> <\/p>\n<pre><code>sub al,31h\nmov bl,al\nmov bh,0\nadd bx,bx\nadd bx,3;\u8ba1\u7b97\u76f8\u5e94\u5b50\u7a0b\u5e8f\u5728table\u4e2d\u7684\u4f4d\u79fb\ncall word ptr cs:[bx]<\/code><\/pre>\n<p> <\/p>\n<pre><code>jmp showmenu<\/code><\/pre>\n<p> <\/p>\n<p>;***************************************************************<\/p>\n<p>;\u529f\u80fd1\uff1a\u91cd\u65b0\u542f\u52a8\u8ba1\u7b97\u673a<\/p>\n<p>;***************************************************************<\/p>\n<p>function1:<\/p>\n<pre><code>mov ax,0ffffh\npush ax\nmov ax,0\npush ax\nretf;jmp ffff:0<\/code><\/pre>\n<p> <\/p>\n<p>;***************************************************************<\/p>\n<p>;\u529f\u80fd3\uff1a\u8fdb\u5165\u65f6\u949f\u7a0b\u5e8f<\/p>\n<p>;***************************************************************<\/p>\n<p>function3:<\/p>\n<pre><code>push ax\npush bx\npush cx\npush dx\npush si\npush ds\npush es\ncall clean;\u6e05\u5c4f\nmov dh,0;\u884c\u53f7\nmov dl,0;\u5217\u53f7\nmov cl,2\nmov si,offset hint-floppy\ncall show_str;\u663e\u793a\u63d0\u793a\u4fe1\u606f<\/code><\/pre>\n<p>;===============================================================<\/p>\n<p>;\u540d\u79f0\uff1aclock<\/p>\n<p>;\u529f\u80fd\uff1a\u52a8\u6001\u663e\u793a\u5f53\u524d\u65e5\u671f\u3001\u65f6\u95f4<\/p>\n<p>;===============================================================<\/p>\n<pre><code>mov cx,2;\u663e\u793a\u989c\u8272\nclock:mov bx,offset cmos-floppy\nmov si,offset time-floppy\npush cx\nmov cx,6\nclock0:push cx\nmov al,[bx]<\/code><\/pre>\n<p>out 70h,al;\u5c06al\u9001\u5165\u5730\u5740\u7aef\u53e370h<\/p>\n<p>in al,71h;\u4ece\u6570\u636e\u7aef\u53e371h\u5904\u8bfb\u51fa\u5355\u5143\u5185\u5bb9<\/p>\n<pre><code>mov ah,al\nmov cl,4\nshr al,cl;\u53f3\u79fb4\u4f4d\nand ah,0fh;al\u5206\u6210\u4e24\u4e2a\u8868\u793aBCD\u7801\u503c\u7684\u6570\u636e\nadd ax,3030h;BCD\u7801+30h=10\u8fdb\u5236\u6570\u5bf9\u5e94\u7684ASCII\u7801\nmov [si],ax;ASCII\u7801\u5199\u5165time\u6bb5\ninc bx\nadd si,3\npop cx\nloop clock0<\/code><\/pre>\n<p>;---------------------------------------------------------------<\/p>\n<p>;\u6309\u4e0bF1\u952e\u540e\uff0c\u6539\u53d8\u663e\u793a\u989c\u8272<\/p>\n<p>;\u6309\u4e0bEsc\u952e\u540e\uff0c\u8fd4\u56de\u4e3b\u83dc\u5355\uff0c\u5176\u4ed6\u952e\u7167\u5e38\u5904\u7406<\/p>\n<p>;---------------------------------------------------------------<\/p>\n<pre><code>mov al,0<\/code><\/pre>\n<p>in al,60h<\/p>\n<pre><code>pop cx;\u663e\u793a\u989c\u8272\ncmp al,3bh;\u548cF1\u7684\u626b\u63cf\u78013bh\u6bd4\u8f83\nje colour\ncmp al,1;\u548cesc\u7684\u626b\u63cf\u780101h\u6bd4\u8f83\nje clockend\njmp show_clock\ncol_1:mov cx,1;cl&#8712;[1,7]\uff0c0\u4e3a\u9ed1\u8272\njmp show_clock\ncolour:cmp cx,7\nje col_1\ninc cx<\/code><\/pre>\n<p>show_clock:<\/p>\n<pre><code>mov dh,12;\u884c\u53f7\nmov dl,30;\u5217\u53f7\nmov si,offset time-floppy\ncall show_str\njmp clock;\u5faa\u73af\u663e\u793aCMOS<\/code><\/pre>\n<p>clockend:<\/p>\n<pre><code>pop es\npop ds\npop si\npop dx\npop cx\npop bx\npop ax<\/code><\/pre>\n<p>ret<\/p>\n<p> <\/p>\n<p>;***************************************************************<\/p>\n<p>;\u529f\u80fd4\uff1a\u8bbe\u7f6e\u65f6\u95f4<\/p>\n<p>;***************************************************************<\/p>\n<p>function4:<\/p>\n<pre><code>push ax\npush bx\npush cx\npush dx\npush si\ncall clean<\/code><\/pre>\n<p> <\/p>\n<pre><code>mov dh,8;\u884c\u53f7\nmov dl,30;\u5217\u53f7\nmov cl,2\nmov si,offset hint1-floppy\ncall show_str;\u663e\u793a\u63d0\u793a\u4fe1\u606f<\/code><\/pre>\n<p> <\/p>\n<pre><code>add dh,1;\u884c\u53f7\nadd dl,14;\u5217\u53f7\nmov si,offset char-floppy;ds:si\u6307\u5411\u5b57\u7b26\u6808\u7a7a\u95f4\ncall show_str;\u663e\u793a\u8f93\u5165\u683c\u5f0f\nmov di,0\ncall getstrs\ncall witein\ncall cleanchar\npop si\npop dx\npop cx\npop bx\npop ax<\/code><\/pre>\n<p>ret<\/p>\n<p> <\/p>\n<p>;===============================================================<\/p>\n<p>;\u6e05\u9664char\u5185\u8f93\u5165\u6570\u636e\uff0c\u8fd8\u539f\u73af\u5883<\/p>\n<p>;===============================================================<\/p>\n<p>cleanchar:<\/p>\n<pre><code>push cx<\/code><\/pre>\n<p>cleanchar1:<\/p>\n<pre><code>mov cx,di<\/code><\/pre>\n<p>jcxz cleanchar2<\/p>\n<pre><code>call charpop\njmp cleanchar1<\/code><\/pre>\n<p>cleanchar2:<\/p>\n<pre><code>pop cx<\/code><\/pre>\n<p>ret<\/p>\n<p> <\/p>\n<p>;===============================================================<\/p>\n<p>;ASCII=>BCD\uff0c\u5199\u5165CMOS<\/p>\n<p>;===============================================================<\/p>\n<p>witein:<\/p>\n<pre><code>push si\nmov cx,6\nmov bx,offset cmos-floppy\nwite:push cx\nmov al,[bx]<\/code><\/pre>\n<p>out 70h,al;\u5c06al\u9001\u5165\u5730\u5740\u7aef\u53e370h<\/p>\n<pre><code>mov ax,[si]\nsub ah,30h;10\u8fdb\u5236\u6570\u5bf9\u5e94\u7684ASCII\u7801-30h=BCD\u7801\nsub al,30h\nmov cl,4\nshl al,cl;\u5de6\u79fb4\u4f4d\nadd al,ah;al\u4e3a8\u4f4dBCD\u7801<\/code><\/pre>\n<p>out 71h,al;\u4ece\u6570\u636e\u7aef\u53e371h\u5904\u5199\u5165\u5355\u5143\u5185\u5bb9<\/p>\n<pre><code>add si,3\ninc bx\npop cx\nloop wite\npop si<\/code><\/pre>\n<p>ret<\/p>\n<p>;===============================================================<\/p>\n<p>;\u5b50\u7a0b\u5e8f\uff1a\u63a5\u6536\u6570\u5b57\u8f93\u5165<\/p>\n<p>;\u53c2\u6570\u8bf4\u660e\uff1adi=char\u6808\u9876(\u5b57\u7b26\u5730\u5740\u3001\u4e2a\u6570\u8bb0\u5f55\u5668)<\/p>\n<p>;===============================================================<\/p>\n<p>getstrs:<\/p>\n<pre><code>push ax\npush bx\ngetstr:mov ax,0\nint 16h\ncmp ah,0eh;\u9000\u683c\u952e\u7684\u626b\u63cf\u7801\nje backspace\ncmp ah,1ch;Enter\u952e\u7684\u626b\u63cf\u7801\nje enter1\ncmp al,'0'\njb getstr\ncmp al,'9'\nja getstr\ncmp di,16;\u9650\u5236\u8f93\u5165\u4e2a\u6570\nja enter1\ncall charpush;\u5b57\u7b26\u5165\u6808\ncall show_str;\u663e\u793a\u6808\u4e2d\u5b57\u7b26\njmp getstr<\/code><\/pre>\n<p>backspace:<\/p>\n<pre><code>call charpop;\u5b57\u7b26\u51fa\u6808\ncall show_str;\u663e\u793a\u6808\u4e2d\u5b57\u7b26\njmp getstr\nenter1:call show_str;\u663e\u793a\u6808\u4e2d\u5b57\u7b26\npop bx\npop ax<\/code><\/pre>\n<p>ret<\/p>\n<p><\/p>\n<p>;===============================================================<\/p>\n<p>;\u5b50\u7a0b\u5e8f\uff1a\u6570\u5b57\u7684\u5165\u6808\u3002<\/p>\n<p>;\u53c2\u6570\u8bf4\u660e\uff1ads:si\u6307\u5411char\u6808\u7a7a\u95f4\uff1b(al)=\u5165\u6808\u5b57\u7b26\uff1b<\/p>\n<p>;===============================================================<\/p>\n<p>charpush:<\/p>\n<pre><code>mov bx,di\nmov [si][bx],al\ninc di\ncmp di,2\nje adds\ncmp di,5\nje adds\ncmp di,8\nje adds\ncmp di,11\nje adds\ncmp di,14\nje adds<\/code><\/pre>\n<p>ret<\/p>\n<pre><code>adds:inc di<\/code><\/pre>\n<p>ret<\/p>\n<p> <\/p>\n<p>;===============================================================<\/p>\n<p>;\u5b50\u7a0b\u5e8f\uff1a\u6570\u5b57\u7684\u51fa\u6808\u3002<\/p>\n<p>;\u53c2\u6570\u8bf4\u660e\uff1ads:si\u6307\u5411char\u6808\u7a7a\u95f4\uff1b(al)=\u5165\u6808\u5b57\u7b26\uff1b<\/p>\n<p>;===============================================================<\/p>\n<pre><code>charpop:cmp di,0\nje sret;\u6808\u9876\u4e3a0(\u65e0\u5b57\u7b26)\uff0c\u7ed3\u675f\ncmp di,3\nje subs\ncmp di,6\nje subs\ncmp di,9\nje subs\ncmp di,12\nje subs\ncmp di,15\nje subs\ndec di\nmov bx,di\nmov al,' '\nmov [si][bx],al<\/code><\/pre>\n<p>ret<\/p>\n<pre><code>subs:sub di,2\nmov bx,di\nmov al,' '\nmov [si][bx],al<\/code><\/pre>\n<p>ret<\/p>\n<p>sret:ret<\/p>\n<p> <\/p>\n<p>;===============================================================<\/p>\n<p>;\u540d\u79f0\uff1ashow_str\u5b50\u7a0b\u5e8f<\/p>\n<p>;\u529f\u80fd\uff1a\u5728\u6307\u5b9a\u7684\u4f4d\u7f6e\uff0c\u7528\u6307\u5b9a\u7684\u989c\u8272\uff0c\u663e\u793a\u4e00\u4e2a\u75280\u7ed3\u675f\u7684\u5b57\u7b26\u4e32\u3002<\/p>\n<p>;\u53c2\u6570\uff1a(dh)=\u884c\u53f7(\u53d6\u503c\u8303\u56f40~24)\uff1b<\/p>\n<p>;      (dl)=\u5217\u53f7(\u53d6\u503c\u8303\u56f40~79)\uff1b<\/p>\n<p>;      (cl)=\u989c\u8272\uff1b<\/p>\n<p>;      ds:si\u6307\u5411\u5b57\u7b26\u4e32\u7684\u9996\u5730\u5740\u3002<\/p>\n<p>;\u8fd4\u56de\uff1a\u65e0\u3002<\/p>\n<p>;===============================================================<\/p>\n<p>show_str:<\/p>\n<pre><code>push ax\npush bx\npush cx\npush dx\npush si\npush es\nmov ax,0b800h\nmov es,ax\nmov ax,160\nmul dh\nmov bx,ax;bx=160*dh\nmov ax,2\nmul dl;ax=dl*2\nadd bx,ax;mov bx,(160*dh+dl*2)\u8bbe\u7f6ees:bx\u6307\u5411\u663e\u5b58\u9996\u5730\u5740\nmov al,cl;\u628a\u989c\u8272cl\u8d4b\u503cal\nmov cl,0\nshow0:mov ch,[si]<\/code><\/pre>\n<p>jcxz show1;(ds:si)=0\u65f6\uff0c\u8f6c\u5230show1\u6267\u884c<\/p>\n<pre><code>mov es:[bx],ch\nmov es:[bx].1,al\ninc si;ds:si\u6307\u5411\u4e0b\u4e00\u4e2a\u5b57\u7b26\u5730\u5740\nadd bx,2;es:bx\u6307\u5411\u4e0b\u4e00\u4e2a\u663e\u5b58\u5730\u5740\njmp show0\nshow1:pop es\npop si\npop dx\npop cx\npop bx\npop ax<\/code><\/pre>\n<p>ret<\/p>\n<p> <\/p>\n<p>;===============================================================<\/p>\n<p>;\u540d\u79f0\uff1aclean\u5b50\u7a0b\u5e8f<\/p>\n<p>;\u529f\u80fd\uff1a\u6e05\u5c4f<\/p>\n<p>;===============================================================<\/p>\n<pre><code>clean:push bx\npush cx\npush es\nmov bx,0b800h\nmov es,bx\nmov bx,0\nmov cx,2000\nclean0:mov byte ptr es:[bx],' '\nadd bx,2\nloop clean0\npop bx\npop cx\npop es<\/code><\/pre>\n<p>ret<\/p>\n<p> <\/p>\n<p>;***************************************************************<\/p>\n<p>;\u529f\u80fd2\uff1a\u5f15\u5bfc\u73b0\u6709\u7684\u64cd\u4f5c\u7cfb\u7edf<\/p>\n<p>;***************************************************************<\/p>\n<p>;===============================================================<\/p>\n<p>;\u529f\u80fd2\u5b9e\u73b0\u5f15\u5bfc\u73b0\u6709\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u4ee3\u7801\u9700\u8981\u5c06\u786c\u76d8\u76840\u97620\u90531\u6247\u533a\u8bfb\u51650:7c00\uff0c<\/p>\n<p>;\u4f1a\u8986\u76d6\u4ece\u8f6f\u76d8\u8bfb\u52300:7c00\u7684\u7b2c\u4e00\u4e2a\u6247\u533a\uff0c\u6240\u4ee5\u529f\u80fd2\u4ee3\u7801\u4e0d\u80fd\u5199\u5728\u7b2c\u4e00\u4e2a\u6247\u533a<\/p>\n<p>;===============================================================<\/p>\n<p>function2:<\/p>\n<pre><code>call clean\nmov ax,0\nmov es,ax\nmov bx,7c00h<\/code><\/pre>\n<p> <\/p>\n<pre><code>mov al,1;\u8bfb\u53d6\u7684\u6247\u533a\u6570\nmov ch,0;\u78c1\u9053\u53f7\nmov cl,1;\u6247\u533a\u53f7\nmov dl,80h;\u9a71\u52a8\u5668\u53f7\nmov dh,0;\u78c1\u5934\u53f7(\u9762\u53f7)\nmov ah,2;int 13h\u7684\u529f\u80fd\u53f7(2\u8868\u793a\u8bfb\u6247\u533a)\nint 13h;\u8bfb\u53d60\u97620\u90531\u6247\u533a\u7684\u5185\u5bb9\u52300:7c00h\u5904<\/code><\/pre>\n<p> <\/p>\n<pre><code>mov ax,0\npush ax;push cs\nmov ax,7c00h\npush ax;push ip\nretf;jmp 0:7c00h<\/code><\/pre>\n<p>floppyend:nop<\/p>\n<pre><code>code ends <\/code><\/pre>\n<p>end start<\/p>\n<p><strong>\u63d0\u7eb2\u6b63\u6587\u5230\u6b64\u7ed3\u675f<\/strong><strong><\/strong><\/p>\n<p><strong>\u63d0\u7eb2\u7248\u672c:2024-05-04\u7248<\/strong><strong><\/strong><\/p>\n<p> <\/p>\n<\/div><!--EndFragment-->\n    <\/div>\n<\/body>\n<\/html>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ee5\u4e0a\u4e3a16\u4f4d\u6c47\u7f16\uff0c\u6709\u4e9b\u53ef\u4ee5\u8fc1\u79fb\u523032\u4f4d\u548c64\u4f4d\uff0c\u540e\u9762\u4f1a\u66f4\u65b0\u66f4\u591a\u5e16\u5b50<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7b2c\u5341\u4e8c\u7ae0\u81f3\u7b2c\u5341\u4e03\u7ae0 &#8211; \u6c47\u7f16 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[18,9,8],"tags":[],"class_list":["post-508","post","type-post","status-publish","format-standard","hentry","category-assembly","category-9","category-8"],"_links":{"self":[{"href":"http:\/\/8.129.82.128\/index.php?rest_route=\/wp\/v2\/posts\/508","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/8.129.82.128\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/8.129.82.128\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/8.129.82.128\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/8.129.82.128\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=508"}],"version-history":[{"count":3,"href":"http:\/\/8.129.82.128\/index.php?rest_route=\/wp\/v2\/posts\/508\/revisions"}],"predecessor-version":[{"id":514,"href":"http:\/\/8.129.82.128\/index.php?rest_route=\/wp\/v2\/posts\/508\/revisions\/514"}],"wp:attachment":[{"href":"http:\/\/8.129.82.128\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=508"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/8.129.82.128\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=508"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/8.129.82.128\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=508"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}