{"id":2900,"date":"2019-11-22T07:47:13","date_gmt":"2019-11-22T07:47:13","guid":{"rendered":""},"modified":"2019-11-22T15:47:48","modified_gmt":"2019-11-22T07:47:48","slug":"keil+c51%e5%8d%95%e7%89%87%e6%9c%ba%e4%b8%ad%e5%8f%98%e9%87%8f%e7%9a%84%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95%e8%a7%a3%e6%9e%90","status":"publish","type":"post","link":"http:\/\/www.szryc.com\/?p=2900","title":{"rendered":"Keil C51\u5355\u7247\u673a\u4e2d\u53d8\u91cf\u7684\u4f7f\u7528\u65b9\u6cd5\u89e3\u6790"},"content":{"rendered":"

\n\t8051\u5185\u6838\u5355\u7247\u673a<\/u>\u662f\u4e00\u79cd\u901a\u7528\u5355\u7247\u673a\uff0c\u5728\u56fd\u5185\u5360\u6709\u8f83\u5927\u7684\u5e02\u573a\u4efd\u989d\u3002\u5728\u5c06C\u8bed\u8a00\u7528\u4e8e51\u5185\u6838\u5355\u7247\u673a\u7684\u7814\u7a76\u65b9\u9762\uff0cKeil<\/u>\u516c\u53f8\u505a\u5f97\u6700\u4e3a\u6210\u529f\u3002\u7531\u4e8e51\u5185\u6838\u5355\u7247\u673a\u7684\u5b58\u50a8<\/u>\u7ed3\u6784\u7684\u7279\u6b8a\u6027\uff0cKeil C51\u4e2d\u53d8\u91cf\u7684\u4f7f\u7528\u4e0e\u6807\u51c6C\u6709\u6240\u4e0d\u540c\u3002\u6b63\u786e\u5730\u4f7f\u7528\u53d8\u91cf\uff0c\u6709\u5229\u4e8e\u83b7\u5f97\u9ad8\u6548\u7684\u76ee\u6807\u4ee3\u7801\u3002\u4e0b\u9762\u8be6\u7ec6\u4ecb\u7ecdKeil C51\u4e2d\u53d8\u91cf\u7684\u4f7f\u7528\u65b9\u6cd5\u3002<\/p>\n

\n\t\u4e00\u3001CPU<\/u>\u5b58\u50a8\u7ed3\u6784\u4e0e\u53d8\u91cf\u7684\u5173\u7cfb<\/p>\n

\n\t <\/div>\n

\n\t\u53d8\u91cf\u90fd\u9700\u8981\u6709\u5b58\u50a8\u7a7a\u95f4\uff0c\u5b58\u50a8\u7a7a\u95f4\u7684\u4e0d\u540c\u4f7f\u5f97\u53d8\u91cf\u4f7f\u7528\u65f6\u7684\u5de5\u4f5c\u6548\u7387\u4e5f\u4e0d\u540c\u3002<\/p>\n

\n\t\u6807\u51c6C\u7684\u5178\u578b\u8fd0\u884c\u73af\u5883\u662f8086\uff08\u542bIA-32\u7cfb\u5217\uff09\u5185\u6838\uff0c\u5176\u5b58\u50a8\u7ed3\u6784\u662fCPU\u5185\u90e8\u6709\u5bc4\u5b58\u5668<\/u>\uff0c\u5916\u90e8\u6709\u5b58\u50a8\u5668<\/u>\uff0c\u5bc4\u5b58\u5668\u7684\u8bbf\u95ee\u901f\u5ea6\u5927\u5927\u9ad8\u4e8e\u5b58\u50a8\u5668\u7684\u8bbf\u95ee\u901f\u5ea6\u3002\u5728\u6807\u51c6C\u4e2d\uff0c\u4e0d\u52a0\u7279\u522b\u5b9a\u4e49\u7684\u53d8\u91cf\u662f\u653e\u5728\u5b58\u50a8\u5668\u4e2d\u7684\uff0c\u4f7f\u7528registe<\/u>r\u53ef\u4ee5\u5f3a\u5236\u53d8\u91cf\u5b58\u50a8\u5728\u5bc4\u5b58\u5668\u4e2d\uff0c\u5bf9\u4e8e\u4f7f\u7528\u7279\u522b\u9891\u7e41\u4e14\u6570\u91cf\u4e0d\u591a\u7684\u53d8\u91cf\u53ef\u4ee5\u9009\u7528\u8fd9\u79cd\u5b58\u50a8\u6a21\u5f0f\uff0c\u4ee5\u83b7\u5f97\u66f4\u9ad8\u7684\u5de5\u4f5c\u6548\u7387\u3002<\/p>\n

\n\t\u76f8\u6bd4\u4e4b\u4e0b\uff0c51\u5185\u6838\u5355\u7247\u673a\u7684\u5b58\u50a8\u7ed3\u6784\u5219\u663e\u5f97\u6709\u4e9b\u602a\u5f02\uff0c\u5b83\u7684\u5b58\u50a8\u7a7a\u95f4\u67093\u4e2a\uff1a\u7a0b\u5e8f\u5b58\u50a8\u5668\u7a7a\u95f4\uff0864 KB\u542b\u7247\u5185\u3001\u7247\u5916\uff09\u3001\u7247\u5916\u6570\u636e\u5b58\u50a8\u5668\u7a7a\u95f4\uff0864KB\uff09\u3001\u7247\u5185\u6570\u636e\u5b58\u50a8\u5668\u53ca\u7279\u6b8a\u529f\u80fd\u5bc4\u5b58\u5668\u7a7a\u95f4\u3002\u5b83\u6ca1\u6709\u771f\u6b63\u610f\u4e49\u4e0a\u7684\u5bc4\u5b58\u5668\uff0c\u5b83\u7684\u5bc4\u5b58\u5668\u5176\u5b9e\u662f\u7247\u5185\u6570\u636e\u5b58\u50a8\u5668\uff08\u5982R0\uff5eR7\uff09\u548c\u7279\u6b8a\u529f\u80fd\u5bc4\u5b58\u5668\uff08\u5982A\u3001B\u7b49\uff09\u4e2d\u7684\u4e00\u90e8\u5206\u3002\u56e0\u6b64\uff0c\u5728Keil C51\u4e2d\u4f7f\u7528\u53d8\u91cf\u5c31\u548c\u6807\u51c6C\u6709\u5f88\u5927\u4e0d\u540c\u3002<\/p>\n

\n\t\u4e8c\u3001Keil C51\u53d8\u91cf\u5206\u6790<\/p>\n

\n\tKeil C51\u652f\u6301\u6807\u51c6C\u539f\u6709\u7684\u5927\u591a\u6570\u53d8\u91cf\u7c7b\u578b\uff0c\u4f46\u4e3a\u8fd9\u4e9b\u53d8\u91cf\u65b0\u589e\u4e86\u591a\u79cd\u5b58\u50a8\u7c7b\u578b\uff0c\u4e5f\u65b0\u589e\u4e86\u4e00\u4e9b\u6807\u51c6C\u6ca1\u6709\u7684\u53d8\u91cf\u3002<\/p>\n

\n\t2.1 Keil C51\u65b0\u589e\u7684\u53d8\u91cf\u5b58\u50a8\u7c7b\u578b<\/p>\n

\n\tKeil C51\u4e2d\u5b9a\u4e49\u53d8\u91cf\u7684\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n

\n\t\uff3b\u5b58\u50a8\u79cd\u7c7b\uff3d\u6570\u636e\u7c7b\u578b\uff3b\u5b58\u50a8\u7c7b\u578b\uff3d\u53d8\u91cf\u540d\u8868;<\/p>\n

\n\t\u5176\u4e2d\uff0c\uff3b\u5b58\u50a8\u7c7b\u578b\uff3d\u662f\u6807\u51c6C\u4e2d\u6ca1\u6709\u7684\uff0c\uff3b\u5b58\u50a8\u7c7b\u578b\uff3d\u5171\u67096\u79cd\uff0c\u5206\u522b\u4ecb\u7ecd\u5982\u4e0b\uff1a<\/p>\n

\n\t\u2460data\u3002\u5c06\u53d8\u91cf\u5b58\u50a8\u5728\u7247\u5185\u53ef\u76f4\u63a5\u5bfb\u5740\u7684\u6570\u636e\u5b58\u50a8\u5668\u4e2d\u3002\u4f7f\u7528\u8fd9\u79cd\u5b58\u50a8\u6a21\u5f0f\uff0c\u76ee\u6807\u4ee3\u7801\u4e2d\u5bf9\u53d8\u91cf\u7684\u8bbf\u95ee\u901f\u5ea6\u6700\u5feb\u3002<\/p>\n

\n\t\u2461bdata\u3002\u5c06\u53d8\u91cf\u5b58\u50a8\u5728\u7247\u5185\u53ef\u4f4d\u5bfb\u5740\u7684\u6570\u636e\u5b58\u50a8\u5668\u4e2d\u3002\u5728\u76ee\u6807\u4ee3\u7801\u4e2d\u53d8\u91cf\u53ef\u4ee5\u65b9\u4fbf\u5730\u8fdb\u884c\u4f4d\u5904\u7406\uff0c\u5728\u4e0d\u8fdb\u884c\u4f4d\u5904\u7406\u65f6\u4e0edata\u76f8\u540c\u3002<\/p>\n

\n\t\u2462idata\u3002\u5c06\u53d8\u91cf\u5b58\u50a8\u5728\u7247\u5185\u95f4\u63a5\u5bfb\u5740\u7684\u6570\u636e\u5b58\u50a8\u5668\u4e2d\u3002\u572852\u5185\u6838\u4e2d\uff0c\u5f53\u7247\u5185\u76f4\u63a5\u5bfb\u5740\u6570\u636e\u5b58\u50a8\u5668\u4e0d\u591f\u7528\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528128\u5b57\u8282\u95f4\u63a5\u5bfb\u5740\u6570\u636e\u5b58\u50a8\u5668\uff0c\u8bbf\u95ee\u901f\u5ea6\u4e00\u822c\u8f83data\u8981\u6162\u4e00\u4e9b\uff0c\u4f46\u5177\u6709\u6700\u5927\u7684\u7247\u5185\u6570\u636e\u5b58\u50a8\u5668\u7a7a\u95f4;\u572851\u5185\u6838\u4e2d\u56e0\u65e0\u5355\u72ec\u7684\u95f4\u63a5\u5bfb\u5740\u6570\u636e\u5b58\u50a8\u5668\u533a\uff0cidata\u4e0edata\u65e0\u533a\u522b\u3002<\/p>\n

\n\t\u2463xdata\u3002\u5c06\u53d8\u91cf\u5b58\u50a8\u5728\u7247\u5916\u6570\u636e\u5b58\u50a8\u5668\u4e2d\u3002\u76ee\u6807\u4ee3\u7801\u4e2d\u53ea\u80fd\u4f7f\u7528“MOVX A\uff0c@DPTR”\u548c“MOVX@DPTR\uff0cA”\u6307\u4ee4\u8bbf\u95ee\u53d8\u91cf\uff0c\u8bbf\u95ee\u901f\u5ea6\u6700\u6162\uff0c\u4f46\u5b58\u50a8\u7a7a\u95f4\u6700\u5927\uff0864KB\uff09\u3002<\/p>\n

\n\t\u2464pdata\u3002\u5c06\u53d8\u91cf\u5b58\u50a8\u5728\u7247\u5916\u6570\u636e\u5b58\u50a8\u5668\u4e2d\u7684\u7b2c\u4e00\u9875\uff0800H\uff5eFFH\uff09\u4e2d\u3002\u76ee\u6807\u4ee3\u7801\u4e2d\u53ef\u4ee5\u4f7f\u7528“MOVX A\uff0c@Ri”\u548c“MOVX@Ri\uff0cA”\u6307\u4ee4\u8bbf\u95ee\u53d8\u91cf\uff0c\u8bbf\u95ee\u901f\u5ea6\u4e0exdata\u76f8\u540c\uff0c\u5b58\u50a8\u7a7a\u95f4\u4e3a256\u5b57\u8282\u3002<\/p>\n

\n\t\u2465code\u3002\u5c06\u53d8\u91cf\u5b58\u50a8\u5728\u7a0b\u5e8f\u5b58\u50a8\u5668\u4e2d\u3002\u76ee\u6807\u4ee3\u7801\u4e2d\u53ea\u80fd\u4f7f\u7528MOVC\u6307\u4ee4\u8bbf\u95ee\u53d8\u91cf\uff0c\u56e0\u53d8\u91cf\u5b58\u50a8\u5728\u7a0b\u5e8f\u5b58\u50a8\u5668\u4e2d\uff0c\u5177\u6709\u975e\u6613\u5931\u6027\u4e14\u4e3a\u53ea\u8bfb\u3002<\/p>\n

\n\t2.2 Keil C51\u65b0\u589e\u7684\u6307\u9488\u53d8\u91cf\u5b58\u50a8\u7c7b\u578b<\/p>\n

\n\tKeil C51\u4e2d\u7684\u6307\u9488\u53d8\u91cf\u5f62\u5f0f\u5982\u4e0b\uff1a<\/p>\n

\n\t\u6570\u636e\u7c7b\u578b\uff3b\u6570\u636e\u5b58\u50a8\u7c7b\u578b\uff3d*\uff3b\u6307\u9488\u5b58\u50a8\u7c7b\u578b\uff3d\u6807\u8bc6\u7b26;<\/p>\n

\n\t\u5176\u4e2d\uff0c\uff3b\u6570\u636e\u5b58\u50a8\u7c7b\u578b\uff3d\u548c\uff3b\u6307\u9488\u5b58\u50a8\u7c7b\u578b\uff3d\u90fd\u662f\u6807\u51c6C\u4e2d\u6ca1\u6709\u7684\u3002\uff3b\u6570\u636e\u5b58\u50a8\u7c7b\u578b\uff3d\u5b9a\u4e49\u6570\u636e\uff08\u5373\u5bfb\u5740\u5bf9\u8c61\uff09\u5b58\u50a8\u7684\u7a7a\u95f4\uff0c\uff3b\u6307\u9488\u5b58\u50a8\u7c7b\u578b\uff3d\u5b9a\u4e49\u6307\u9488\u81ea\u8eab\u5b58\u50a8\u7684\u7a7a\u95f4\u3002\u82e5\u4e0d\u4f7f\u7528\uff3b\u6570\u636e\u5b58\u50a8\u7c7b\u578b\uff3d\uff0c\u5219\u6307\u9488\u4e3a\u4e00\u822c\u6307\u9488\uff0c\u5360\u75283\u4e2a\u5b57\u8282;\u82e5\u4f7f\u7528\uff3b\u6570\u636e\u5b58\u50a8\u7c7b\u578b\uff3d\u5219\u6307\u9488\u4e3a\u57fa\u4e8e\u5b58\u50a8\u5668\u7684\u6307\u9488\uff0c\u5360\u75281\uff5e2\u4e2a\u5b57\u8282\u3002<\/p>\n

\n\t2.3 Keil C51\u65b0\u589e\u7684\u53d8\u91cf\u7c7b\u578b<\/p>\n

\n\tbit\uff1a\u4f4d\u53d8\u91cf\u3002\u5b58\u50a8\u5728\u7247\u5185\u6570\u636e\u5b58\u50a8\u5668\u7684\u53ef\u4f4d\u5bfb\u5740\u5b57\u8282\uff0820H\uff5e2FH\uff09\u7684\u67d0\u4e2a\u4f4d\u4e0a\uff0c\u8fd9\u4e2a\u53d8\u91cf\u5728\u5b9e\u65f6\u63a7\u5236\u4e2d\u5177\u6709\u5f88\u9ad8\u7684\u5b9e\u7528\u4ef7\u503c\u3002<\/p>\n

\n\tsfr\uff1a\u7279\u6b8a\u529f\u80fd\u5bc4\u5b58\u5668\u53d8\u91cf\u3002\u5b58\u50a8\u5728\u7247\u5185\u7279\u6b8a\u529f\u80fd\u5bc4\u5b58\u5668\u4e2d\uff0c\u7528\u6765\u5bf9\u7279\u6b8a\u529f\u80fd\u5bc4\u5b58\u5668\u8fdb\u884c\u8bfb\u5199\u64cd\u4f5c\u3002<\/p>\n

\n\tsbit\uff1a\u7279\u6b8a\u529f\u80fd\u5bc4\u5b58\u5668\u4f4d\u53d8\u91cf\u3002\u5b58\u50a8\u5728\u7247\u5185\u7279\u6b8a\u529f\u80fd\u5bc4\u5b58\u5668\u7684\u53ef\u4f4d\u5bfb\u5740\u5b57\u8282\uff08\u5730\u5740\u53ef\u4ee5\u88ab8\u6574\u9664\u8005\uff09\u7684\u67d0\u4e2a\u4f4d\u4e0a\uff0c\u7528\u6765\u5bf9\u7279\u6b8a\u529f\u80fd\u5bc4\u5b58\u5668\u7684\u53ef\u4f4d\u5bfb\u5740\u4f4d\u8fdb\u884c\u8bfb\u5199\u64cd\u4f5c\u3002<\/p>\n

\n\tsbitl6\uff1a16\u4f4d\u7279\u6b8a\u529f\u80fd\u5bc4\u5b58\u5668\u53d8\u91cf\u3002\u5b58\u50a8\u5728\u7247\u5185\u7279\u6b8a\u529f\u80fd\u5bc4\u5b58\u5668\u7684\u8fde\u7eed2\u4e2a\u5b57\u8282\u7684\u4f4e\u5730\u5740\u4e0a\uff0c\u8fd9\u4e2a\u53d8\u91cf\u7c7b\u578b\u5f88\u5c11\u4f7f\u7528\u3002<\/p>\n

\n\t\u4ee5\u4e0a\u8fd9\u4e9bKeil C51\u4e2d\u65b0\u589e\u7684\u53d8\u91cf\u7c7b\u578b\uff0c\u4e0d\u652f\u6301\u6570\u7ec4\u548c\u6307\u9488\u64cd\u4f5c\u3002<\/p>\n

\n\t\u4e09\u3001Keil C51\u4e2d\u4f7f\u7528\u53d8\u91cf\u5b58\u50a8\u6a21\u5f0f\u7684\u5fc5\u8981\u6027<\/p>\n

\n\t\u5728Keil C51\u4e2d\uff0c\u53d8\u91cf\u7684\u5b58\u50a8\u6a21\u5f0f\u662f\u4e00\u4e2a\u53ef\u9009\u9879\uff0c\u5982\u679c\u4e0d\u4f7f\u7528\u8fd9\u4e2a\u9009\u9879\uff0c\u5219Keil C51\u5728\u7f16\u8bd1\u65f6\u81ea\u52a8\u8fdb\u884c\u4f18\u9009\u5206\u914d\u3002\u4f46\u8fd9\u79cd\u5904\u7406\u65b9\u6cd5\u6709\u4ee5\u4e0b\u7f3a\u70b9\uff1a<\/p>\n

\n\t\u2460\u7cfb\u7edf\u4e0d\u77e5\u9053\u5404\u79cd\u53d8\u91cf\u7684\u4f7f\u7528\u9891\u5ea6\uff0c\u6709\u53ef\u80fd\u5bf9\u4f7f\u7528\u9891\u5ea6\u9ad8\u7684\u53d8\u91cf\u4f7f\u7528\u4e86\u8bbf\u95ee\u901f\u5ea6\u6162\u7684\u7247\u5916\u5b58\u50a8\u65b9\u5f0f\uff0c\u800c\u5bf9\u4f7f\u7528\u9891\u9ad8\u7684\u53d8\u91cf\u4f7f\u7528\u4e86\u7247\u5185\u5b58\u50a8\u65b9\u5f0f\uff0c\u4f7f\u5f97\u7a0b\u5e8f\u7684\u8fd0\u884c\u6548\u7387\u964d\u4f4e;<\/p>\n

\n\t\u2461\u5728\u4f7f\u7528\u6307\u9488\u5bfb\u5740\u65f6\uff0c\u7531\u4e8e\u4e0d\u77e5\u9053\u5bfb\u5740\u5bf9\u8c61\u7684\u5b58\u50a8\u65b9\u5f0f\uff0c\u53ea\u597d\u4f7f\u7528\u4e00\u822c\u6307\u9488\uff0c\u5728Keil C51\u4e2d\u4e00\u822c\u6307\u9488\u8981\u591a\u5360\u75281\uff5e2\u4e2a\u5b57\u8282\uff0c\u5e76\u4e14\u4f7f\u7528\u65f6\u8fd8\u8981\u5bf9\u5b58\u50a8\u65b9\u5f0f\u8fdb\u884c\u5224\u65ad\uff0c\u589e\u52a0\u4e86\u5bfb\u5740\u64cd\u4f5c\u65f6\u95f4\u3002<\/p>\n

\n\t\u5982\u679c\u80fd\u591f\u5728\u5b9a\u4e49\u53d8\u91cf\u7684\u540c\u65f6\u5b9a\u4e49\u5176\u5b58\u50a8\u7c7b\u578b\uff0c\u53ef\u4ee5\u9ad8\u6548\u5730\u4f7f\u752851\u5185\u6838\u5355\u7247\u673a\u7684\u5b58\u50a8\u7a7a\u95f4\uff0c\u83b7\u5f97\u9ad8\u8d28\u91cf\u7684\u76ee\u6807\u4ee3\u7801\u3002<\/p>\n

\n\t\u56db\u3001Keil C51\u53d8\u91cf\u7684\u4f7f\u7528\u65b9\u6cd5<\/p>\n

\n\t4.1 \u5168\u5c40\u53d8\u91cf\u548c\u9759\u6001\u5c40\u90e8\u53d8\u91cf<\/p>\n

\n\t\u5168\u5c40\u53d8\u91cf\u4e00\u822c\u4f1a\u5728\u591a\u4e2a\u51fd\u6570\u4e2d\u88ab\u4f7f\u7528\uff0c\u5e76\u5728\u6574\u4e2a\u7a0b\u5e8f\u8fd0\u884c\u671f\u95f4\u5185\u6709\u6548\uff0c\u9759\u6001\u5c40\u90e8\u53d8\u91cf\u867d\u7136\u53ea\u5728\u4e00\u4e2a\u51fd\u6570\u4e2d\u4f7f\u7528\uff0c\u4f46\u4e5f\u662f\u5728\u6574\u4e2a\u7a0b\u5e8f\u8fd0\u884c\u671f\u95f4\u6709\u6548\u3002\u5bf9\u4e8e\u8fd9\u4e9b\u53d8\u91cf\uff0c\u5e94\u5c3d\u91cf\u9009\u62e9data\u578b\uff0c\u8fd9\u6837\u5728\u76ee\u6807\u4ee3\u7801\u4e2d\u5c31\u53ef\u4ee5\u7528\u76f4\u63a5\u5bfb\u5740\u6307\u4ee4\u8bbf\u95ee\uff0c\u83b7\u5f97\u6700\u9ad8\u7684\u8bbf\u95ee\u901f\u5ea6\uff0c\u63d0\u9ad8\u7a0b\u5e8f\u7684\u5de5\u4f5c\u6548\u7387\u3002\u4f8b\u5982\u4e00\u4e2a\u4fdd\u5b58\u4eba\u6570\u7684\u5168\u5c40\u53d8\u91cfn_g\uff0c\u5728\u591a\u4e2a\u51fd\u6570\u4e2d\u90fd\u88ab\u7ecf\u5e38\u7528\u5230\uff0c\u53ef\u4ee5\u8fd9\u6837\u5b9a\u4e49\uff1a<\/p>\n

\n\tunsigned int data n_g;\/\/\u5bf9n_g\u8d4b\u503c\u65f6\u4f7f\u7528“MOV XXH\uff0c……”\u6307\u4ee4<\/p>\n

\n\t4.2 \u6570\u7ec4\uff08\u5305\u62ec\u5168\u5c40\u548c\u5c40\u90e8\uff09<\/p>\n

\n\t\u5b9a\u4e49\u6570\u7ec4\u4e00\u822c\u7528idata\u5b58\u50a8\u7c7b\u578b\uff0c\u5728\u76ee\u6807\u4ee3\u7801\u4e2d\u4f7f\u7528“MOV@Ri”\u6307\u4ee4\u8fdb\u884c\u95f4\u63a5\u5bfb\u5740\u3002\u5982\u679c\u56e0\u6570\u7ec4\u5143\u7d20\u8fc7\u591a\u800c\u5728\u7f16\u8bd1\u65f6\u62a5\u9519\uff0c\u53ef\u4ee5\u6539\u7528pdata\u548cxdata\u5b58\u50a8\u7c7b\u578b\u3002<\/p>\n

\n\t\u6570\u7ec4\u5b9a\u4e49\u4e3adata\u5b58\u50a8\u7c7b\u578b\u610f\u4e49\u4e0d\u5927\uff0c\u56e0\u4e3a\u65e2\u7136\u4f7f\u7528\u6570\u7ec4\uff0c\u5c31\u662f\u5e0c\u671b\u80fd\u591f\u6839\u636e\u67d0\u4e00\u81ea\u53d8\u91cf\u8bbf\u95ee\u6570\u7ec4\u5143\u7d20\u3002\u5982\u5b9a\u4e49X\uff3b100\uff3d\uff0c\u4e00\u822c\u90fd\u662f\u4e3a\u4e86\u80fd\u591f\u4f7f\u7528X\uff08i\u662f\u4e00\u4e2a\u53d8\u91cf\uff09\u6765\u8bbf\u95ee\uff0c\u8fd9\u6837\u5728\u76ee\u6807\u4ee3\u7801\u4e2d\u5c31\u5fc5\u987b\u4f7f\u7528\u95ee\u63a5\u5bfb\u5740\uff0c\u6240\u4ee5\u6570\u7ec4\u6ca1\u6709\u5fc5\u8981\u4f7f\u7528data\u5b58\u50a8\u7c7b\u578b\uff0c\u5373\u4fbf\u4f7f\u7528\u4e86data\u5b58\u50a8\u7c7b\u578b\uff0c\u5728\u76ee\u6807\u4ee3\u7801\u4e2d\u4e5f\u4ecd\u7136\u8981\u7528\u95f4\u63a5\u5bfb\u5740\u6307\u4ee4\u3002\u6570\u7ec4\u5b9a\u4e49\u6210idata\u5b58\u50a8\u7c7b\u578b\uff0c\u5728\u4f7f\u752852\u5185\u6838\u4e14\u7247\u5185\u6570\u636e\u5b58\u50a8\u5668\u4e0d\u591f\u65f6\uff0c\u4f1a\u4f7f\u7528\u53ea\u80fd\u95f4\u63a5\u5bfb\u5740\u7684\u7247\u5185\u6570\u636e\u5b58\u50a8\u7a7a\u95f4\u3002\u8fd9\u6837\uff0c\u65e2\u4e0d\u80fd\u964d\u4f4e\u5904\u7406\u901f\u5ea6\uff0c\u53c8\u6269\u5927\u4e86\u53ef\u4f7f\u7528\u7684\u5b58\u50a8\u7a7a\u95f4\u3002<\/p>\n

\n\t4.3 \u4f9b\u67e5\u8868\u7528\u7684\u6570\u636e<\/p>\n

\n\t\u8fd9\u7c7b\u6570\u636e\u7684\u7279\u70b9\u662f\u9700\u8981\u59cb\u7ec8\u4fdd\u6301\u4e0d\u53d8\uff0c\u4e14\u4f7f\u7528\u65f6\u53ea\u8bfb\uff0c\u56e0\u6b64\u5e94\u5b9a\u4e49\u4e3acode\u578b\u3002\u4f8b\u5982\u4e00\u4e2a\u5b57\u5f62\u8868\uff1a<\/p>\n

\n\t\"Keil<\/p>\n

\n\t\u5168\u5c40\u6216\u5c40\u90e8code\u578b\u53d8\u91cf\u5728\u5b58\u50a8\u65f6\u65e0\u533a\u522b\u3002<\/p>\n

\n\t4.4 \u975e\u9759\u6001\u5c40\u90e8\u53d8\u91cf<\/p>\n

\n\t\u975e\u9759\u6001\u5c40\u90e8\u53d8\u91cf\u4ec5\u5728\u67d0\u4e00\u51fd\u6570\u5185\u4f7f\u7528\uff0c\u9000\u51fa\u8be5\u51fd\u6570\u65f6\u53d8\u91cf\u4e5f\u88ab\u91ca\u653e\u3002<\/p>\n

\n\t\u82e5\u7cfb\u7edf\u4f7f\u7528small\u5b58\u50a8\u6a21\u5f0f\uff0c\u5bf9\u4e8e\u8fd9\u4e9b\u53d8\u91cf\u53ef\u4ee5\u4e0d\u52a0\u5b58\u50a8\u8bf4\u660e\uff0c\u7531\u7f16\u8bd1\u8f6f\u4ef6\u81ea\u884c\u6309\u6700\u4f18\u539f\u5219\u51b3\u5b9a\uff0c\u56e0\u4e3a\u4ec5\u5728\u51fd\u6570\u5185\u4f7f\u7528\u7684\u975e\u9759\u6001\u5c40\u90e8\u53d8\u91cf\uff0c\u6709\u53ef\u80fd\u4f7f\u7528\u5de5\u4f5c\u5bc4\u5b58\u5668R0\uff5eR7\uff0c\u8fd9\u6837\u4f1a\u66f4\u5feb\u901f\u548c\u66f4\u8282\u7701\u5b58\u50a8\u7a7a\u95f4\u3002\u4f8b\u5982\uff1a<\/p>\n

\n\tunsigned char i\uff0cj; \/\/\u7cfb\u7edf\u5c3d\u53ef\u80fd\u4f1a\u7528R0\uff5eR7\u5b58\u50a8i\u548cj<\/p>\n

\n\t\u82e5\u7cfb\u7edf\u4f7f\u7528\u4e86compact\u6216large\u5b58\u50a8\u6a21\u5f0f\uff0c\u5219\u5e94\u5c06\u8fd9\u4e9b\u53d8\u91cf\u5b9a\u4e49\u4e3adata\u5b58\u50a8\u6a21\u5f0f\uff0c\u4ee5\u9632\u7cfb\u7edf\u81ea\u884c\u51b3\u5b9a\u65f6\u88ab\u5b9a\u4e49\u4e3apdagta\u6216xdata\u6a21\u5f0f\u800c\u964d\u4f4e\u5de5\u4f5c\u6548\u7387\u3002<\/p>\n

\n\t4.5 \u6307\u9488<\/p>\n

\n\t\u5982\u524d\u6240\u8ff0\uff0c\u5b9a\u4e49\u6307\u9488\u53d8\u91cf\u65f6\u67092\u4e2a\u5b58\u50a8\u7c7b\u578b\uff1a\u6570\u636e\u5b58\u50a8\u7c7b\u578b\uff0c\u8bf4\u660e\u88ab\u5bfb\u5740\u5bf9\u8c61\u7684\u5b58\u50a8\u7c7b\u578b;\u6307\u9488\u5b58\u50a8\u7c7b\u578b\uff0c\u8bf4\u660e\u6307\u9488\u81ea\u8eab\u7684\u5b58\u50a8\u7c7b\u578b\u3002\u5f53\u6570\u636e\u5b58\u50a8\u7c7b\u578b\u4e3axdata\u65f6\uff0c\u6307\u9488\u81ea\u8eab\u5360\u75282\u4e2a\u5b57\u8282;\u5f53\u6570\u636e\u5b58\u50a8\u7c7b\u578b\u4e3apdata\u4ee5\u53caidata\u7b49\u7247\u5185\u5b58\u50a8\u7c7b\u578b\u65f6\uff0c\u6307\u9488\u81ea\u8eab\u5360\u75281\u4e2a\u5b57\u8282;\u82e5\u4e0d\u8bf4\u660e\u6570\u636e\u5b58\u50a8\u7c7b\u578b\uff0c\u6307\u9488\u81ea\u8eab\u5c31\u8981\u5360\u75283\u4e2a\u5b57\u8282\u3002\u56e0\u6b64\uff0c\u5728KeilC51\u4e2d\u4f7f\u7528\u6307\u9488\u65f6\uff0c\u5e94\u5c3d\u91cf\u5b9a\u4e49\u6570\u636e\u5b58\u50a8\u7c7b\u578b\uff0c\u4f46\u8981\u7279\u522b\u6ce8\u610f\u6307\u9488\u4e2d\u7684\u6570\u636e\u5b58\u50a8\u7c7b\u578b\u4e0e\u88ab\u5bfb\u5740\u5bf9\u8c61\u7684\u5b58\u50a8\u7c7b\u578b\u5fc5\u987b\u4e00\u81f4\u3002\u6307\u9488\u90fd\u662f\u9891\u7e41\u4f7f\u7528\u7684\uff0c\u5b83\u8981\u4e0d\u65ad\u88ab\u8bbe\u7f6e\u3001\u4fee\u6539\u548c\u4f7f\u7528\uff0c\u56e0\u6b64\u5b83\u81ea\u8eab\u7684\u5b58\u50a8\u7c7b\u578b\u5e94\u9009\u62e9data\u578b\u3002\u4f8b\u5982\u5b9a\u4e49\u4e00\u4e2a\u6570\u7ec4\u65f6\u5c31\u540c\u65f6\u5b9a\u4e49\u5176\u5b58\u50a8\u7c7b\u578b\uff0c\u4ee5\u540e\u7528\u6307\u9488\u5bf9\u5176\u5bfb\u5740\u65f6\u5c31\u5c06\u6570\u7ec4\u7684\u5b58\u50a8\u7c7b\u578b\u6dfb\u52a0\u5230\u6307\u9488\u7684\u6570\u636e\u7c7b\u578b\u4e2d\u3002\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n

\n\t\"Keil<\/p>\n

\n\t4.6 \u4e8c\u4e49\u6027\u53d8\u91cf<\/p>\n

\n\t\u5728\u6807\u51c6C\u4e2d\u5982\u679c\u8981\u4f7f\u7528\u4e00\u4e2a\u4e8c\u4e49\u6027\u53d8\u91cf\uff0c\u53ea\u80fd\u7528\u679a\u4e3e\u7c7b\u578b\u3002\u5982\uff1a<\/p>\n

\n\t\"Keil<\/p>\n

\n\t\u4ee5\u4e0a\u7a0b\u5e8f\u5728Keil C51\u4e2d\u4f7f\u7528\u65f6\uff0c\u53d8\u91cft\u867d\u7136\u4ec5\u67090\u548c1\u4e24\u79cd\u72b6\u6001\uff0c\u4f46\u5728\u76ee\u6807\u4ee3\u7801\u4e2d\u4ecd\u5360\u7528\u4e00\u4e2a\u5b57\u8282\u3002\u6b64\u5904\u7406\u65b9\u6cd5\u65e2\u6d6a\u8d39\u5b58\u50a8\u8d44\u6e90\uff0c\u53c8\u5ef6\u957f\u4e86\u5904\u7406\u65f6\u95f4\uff0c\u8fd9\u5bf9\u4e8e8086\u5185\u6838\u7b97\u4e0d\u4e0a\u591a\u5927\u95ee\u9898\uff0c\u4f46\u5728\u8d44\u6e90\u6709\u9650\u3001\u8fd0\u884c\u901f\u5ea6\u4e0d\u9ad8\u768451\u5185\u6838\u4e2d\u5c31\u4e0d\u80fd\u4e0d\u8003\u8651\u4e86\u3002\u5728Keil C51\u4e2d\u53ef\u4f7f\u7528\u4ee5\u4e0b\u65b9\u6cd5\uff1a<\/p>\n

\n\t\"Keil<\/p>\n

\n\t\u8fd9\u4e24\u79cd\u65b9\u5f0f\u6548\u679c\u662f\u5b8c\u5168\u76f8\u540c\u7684\uff0c\u4f46\u5728\u76ee\u6807\u4ee3\u7801\u4e2d\u53d8\u91cft\u4ec5\u5360\u75281\u4f4d\uff08\u53731\/8\u5b57\u8282\uff09\uff0c\u800c\u4e14\u56e0\u4e3a51\u5185\u6838\u5355\u7247\u673a\u6307\u4ee4\u7cfb\u7edf\u4e2d\u6709\u4f4d\u5904\u7406\u6307\u4ee4\uff0c\u751f\u6210\u7684\u76ee\u6807\u4ee3\u7801\u5360\u7528\u5185\u5b58\u5c11\u3001\u8fd0\u884c\u901f\u5ea6\u5feb\u3002<\/p>\n

\n\t4.7 \u7279\u6b8a\u529f\u80fd\u5bc4\u5b58\u5668\u53d8\u91cf\uff08\u5305\u62ec\u4f4d\u53d8\u91cf\uff09<\/p>\n

\n\t\u7279\u6b8a\u529f\u80fd\u5bc4\u5b58\u5668\u4e2d\uff0c\u7d2f\u52a0\u5668A\u3001\u5bc4\u5b58\u5668B\u3001\u5806\u6808\u6307\u9488SP\u548c\u6570\u636e\u6307\u9488DPTR\u662f\u5f52\u7cfb\u7edf\u4f7f\u7528\u7684\uff0c\u5728C51\u4e2d\u4e0d\u63d0\u4f9b\u7ed9\u7528\u6237\u3002\u5176\u4ed6\u7684\u7279\u6b8a\u529f\u80fd\u5bc4\u5b58\u5668\u90fd\u53ef\u4ee5\u7528sfr\u5b9a\u4e49\u6210\u53d8\u91cf\uff0c\u5176\u4e2d\u5730\u5740\u53ef\u4ee5\u88ab8\u6574\u9664\u8005\u7684\u5404\u4f4d\uff0c\u8fd8\u53ef\u4ee5\u7528bsfr\u5b9a\u4e49\u6210\u4f4d\u53d8\u91cf\u3002\u8bbf\u95ee\u8fd9\u4e9b\u53d8\u91cf\uff0c\u5c31\u53ef\u4ee5\u5bf9\u7279\u6b8a\u529f\u80fd\u5bc4\u5b58\u5668\u53ca\u5176\u53ef\u4ee5\u4f4d\u5bfb\u5740\u7684\u5404\u4f4d\u8fdb\u884c\u8bfb\u5199\uff0c\u8fbe\u5230\u64cd\u4f5c\u5355\u7247\u673a\u5185\u90e8\u5404\u786c\u4ef6\u7684\u76ee\u7684\u3002\u5bf9\u4e8e\u6807\u51c6\u768451\u5185\u6838\u5355\u7247\u673a\uff0c\u5934\u6587\u4ef6reg51.h\u3001reg52.h\u6216\u5176\u4ed6\u5934\u6587\u4ef6\u4e2d\u5df2\u5bf9\u8fd9\u4e9b\u7279\u6b8a\u529f\u80fd\u5bc4\u5b58\u5668\u53d8\u91cf\u4f5c\u4e86\u5b9a\u4e49\uff0c\u7528\u6237\u53ef\u4ee5\u7528#include\u5c06\u6b64\u5934\u6587\u4ef6\u5305\u542b\u8fdb\u6765\uff0c\u7136\u540e\u5c31\u53ef\u4ee5\u4f7f\u7528\u4e86\u3002\u73b0\u5728\u5f88\u591a51\u5185\u6838\u517c\u5bb9\u578b\u5355\u7247\u673a\u6269\u5c55\u4e86\u66f4\u591a\u7684\u7279\u6b8a\u529f\u80fd\u5bc4\u5b58\u5668\uff0c\u8fd9\u4e9b\u5c31\u9700\u8981\u7528\u6237\u81ea\u884c\u5b9a\u4e49\uff0c\u5177\u4f53\u65b9\u6cd5\u53ef\u53c2\u8003\u5668\u4ef6\u7684\u4f7f\u7528\u8bf4\u660e\u3002<\/p>\n

\n\t4.8 \u5916\u90e8\u6570\u636e\u5b58\u50a8\u5668\u53d8\u91cf<\/p>\n

\n\t\u82e5\u8bbe\u7f6e\u6210pdata\u548cxdata\u5b58\u50a8\u7c7b\u578b\uff0c\u5c06\u628a\u53d8\u91cf\u5b58\u50a8\u5728\u7247\u5916\u6570\u636e\u5b58\u50a8\u5668\u4e2d\u3002\u8fd9\u4e24\u79cd\u5b58\u50a8\u7c7b\u578b\u7684\u8bbf\u95ee\u901f\u5ea6\u6700\u6162\uff0c\u975e\u8feb\u4e0d\u5f97\u5df2\u4e0d\u8981\u4f7f\u7528\u3002\u5728\u4f7f\u7528\u8fd9\u4e24\u79cd\u5b58\u50a8\u7c7b\u578b\u65f6\uff0c\u6ce8\u610f\u5c3d\u91cf\u53ea\u7528\u5b83\u4fdd\u5b58\u539f\u59cb\u6570\u636e\u6216\u6700\u7ec8\u7ed3\u679c\uff0c\u5c3d\u91cf\u51cf\u5c11\u5bf9\u5176\u8bbf\u95ee\u7684\u6b21\u6570\uff0c\u9700\u8981\u9891\u7e41\u8bbf\u95ee\u7684\u4e2d\u95f4\u7ed3\u679c\u4e0d\u8981\u7528\u5b83\u3002<\/p>\n

\n\t4.9 \u7528\u5916\u90e8\u6570\u636e\u5b58\u50a8\u5668\u5730\u5740\u6269\u5c55\u7684\u5176\u4ed6\u786c\u4ef6<\/p>\n

\n\t\u5728\u5355\u7247\u673a\u5916\u90e8\u6269\u5c55\u7684\u5176\u4ed6\u786c\u4ef6\uff0c\u4e00\u822c\u90fd\u501f\u7528\u5916\u90e8\u6570\u636e\u5b58\u50a8\u5668\u5730\u5740\uff0c\u8868\u73b0\u4e3a\u5916\u90e8\u6570\u636e\u5b58\u50a8\u5668\u5355\u5143\u5f62\u5f0f\u3002\u5bf9\u4e8e\u8fd9\u4e9b\u786c\u4ef6\uff0c\u53ef\u4ee5\u7528\u6307\u9488\u8fdb\u884c\u8bfb\u5199\u64cd\u4f5c\u3002\u4f8b\u5982\uff1a<\/p>\n

\n\t\"Keil<\/p>\n

\n\t\u4e94\u3001\u7ed3\u8bed<\/p>\n

\n\tKeil C51\u4e2d\u7684\u53d8\u91cf\u589e\u52a0\u4e86\u5b58\u50a8\u7c7b\u578b\uff0c\u5728\u4f7f\u7528\u65f6\u800c\u663e\u5f97\u6bd4\u6807\u51c6C\u7a0d\u5fae\u590d\u6742\u3002\u5728Keil C51\u4e2d\uff0c\u53d8\u91cf\u7684\u5b58\u50a8\u7c7b\u578b\u4e0d\u540c\uff0c\u8bbf\u95ee\u53d8\u91cf\u6240\u9700\u8981\u7684\u65f6\u95f4\u4e5f\u4e0d\u540c\uff0c\u7531\u4e8eC51\u5185\u6838\u5355\u7247\u673a\u8d44\u6e90\u5c11\u3001\u901f\u5ea6\u6162\uff0c\u53d8\u91cf\u5b58\u50a8\u7c7b\u578b\u5bf9\u7cfb\u7edf\u5de5\u4f5c\u901f\u5ea6\u7684\u5f71\u54cd\u4e0d\u53ef\u5ffd\u89c6\u3002\u5728\u4e86\u89e3\u53d8\u91cf\u4e0e\u5355\u7247\u673a\u5b58\u50a8\u7ed3\u6784\u5173\u7cfb\u7684\u57fa\u7840\u4e0a\uff0c\u6839\u636e\u7a0b\u5e8f\u5bf9\u53d8\u91cf\u7684\u4f7f\u7528\u8981\u6c42\uff0c\u5408\u7406\u5730\u9009\u62e9\u53d8\u91cf\u7684\u5b58\u50a8\u7c7b\u578b\uff0c\u53ef\u4ee5\u5728\u76f8\u540c\u7684\u786c\u4ef6\u4e0a\u83b7\u5f97\u66f4\u9ad8\u7684\u5de5\u4f5c\u6548\u7387\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

8051\u5185\u6838 \u5355\u7247\u673a \u662f\u4e00\u79cd\u901a\u7528\u5355\u7247\u673a\uff0c\u5728\u56fd\u5185\u5360\u6709\u8f83\u5927\u7684\u5e02\u573a\u4efd\u989d\u3002\u5728\u5c06C\u8bed\u8a00\u7528\u4e8e51\u5185\u6838\u5355\u7247\u673a\u7684\u7814\u7a76\u65b9\u9762\uff0c Keil \u516c\u53f8\u505a\u5f97\u6700\u4e3a\u6210\u529f\u3002\u7531\u4e8e51\u5185\u6838\u5355\u7247\u673a\u7684 \u5b58\u50a8 \u7ed3\u6784\u7684\u7279\u6b8a\u6027\uff0cKeil C51\u4e2d\u53d8<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"_links":{"self":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/2900"}],"collection":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2900"}],"version-history":[{"count":0,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/2900\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2900"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2900"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2900"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}