{"id":41991,"date":"2025-06-06T03:03:06","date_gmt":"2025-06-05T19:03:06","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/41991.html"},"modified":"2025-06-06T03:03:06","modified_gmt":"2025-06-05T19:03:06","slug":"arm%e6%9e%b6%e6%9e%84","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/41991.html","title":{"rendered":"ARM\u67b6\u6784"},"content":{"rendered":"<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"%E5%93%88%E4%BD%9B%E7%BB%93%E6%9E%84-toc\" style=\"margin-left:0px\">\u54c8\u4f5b\u7ed3\u6784<\/p>\n<p id=\"arm%E6%8C%87%E4%BB%A4%E6%A0%BC%E5%BC%8F-toc\" style=\"margin-left:40px\">arm\u6307\u4ee4\u683c\u5f0f<\/p>\n<p id=\"%C2%A0%E6%9C%89%E7%AC%A6%E5%8F%B7%E6%95%B0%E7%9A%84%E6%BA%A2%E5%87%BA%EF%BC%888bit)%E2%80%8B%E7%BC%96%E8%BE%91-toc\" style=\"margin-left:80px\">\u00a0\u6709\u7b26\u53f7\u6570\u7684\u6ea2\u51fa&#xff08;8bit)\u200b<\/p>\n<p id=\"%E6%97%A0%E7%AC%A6%E5%8F%B7%E6%95%B0%E7%9A%84%E8%BF%9B%E4%BD%8D%2F%E5%80%9F%E4%BD%8D-toc\" style=\"margin-left:80px\">\u65e0\u7b26\u53f7\u6570\u7684\u8fdb\u4f4d\/\u501f\u4f4d<\/p>\n<p id=\"CPSR%EF%BC%88%E5%BD%93%E5%89%8D%E7%A8%8B%E5%BA%8F%E7%8A%B6%E6%80%81%E5%AF%84%E5%AD%98%E5%99%A8%EF%BC%89-toc\" style=\"margin-left:40px\">CPSR&#xff08;\u5f53\u524d\u7a0b\u5e8f\u72b6\u6001\u5bc4\u5b58\u5668&#xff09;<\/p>\n<p id=\"arm%E6%A8%A1%E5%BC%8F-toc\" style=\"margin-left:40px\">ARM\u6a21\u5f0f<\/p>\n<p id=\"arm%E5%BC%82%E5%B8%B8%E7%B1%BB%E5%9E%8B-toc\" style=\"margin-left:40px\">arm\u5f02\u5e38\u7c7b\u578b<\/p>\n<p id=\"%C2%A0ARMv7%E6%9E%B6%E6%9E%84%E5%BC%82%E5%B8%B8%E5%90%91%E9%87%8F%E8%A1%A8-toc\" style=\"margin-left:80px\">\u00a0ARMv7\u67b6\u6784\u5f02\u5e38\u5411\u91cf\u8868<\/p>\n<p id=\"%C2%A0arm%E5%BC%82%E5%B8%B8%E7%9A%84%E5%A4%84%E7%90%86%E6%B5%81%E7%A8%8B-toc\" style=\"margin-left:80px\">\u00a0arm\u5f02\u5e38\u7684\u5904\u7406\u6d41\u7a0b<\/p>\n<p id=\"arm%E5%AF%84%E5%AD%98%E5%99%A8-toc\" style=\"margin-left:40px\">arm\u5bc4\u5b58\u5668<\/p>\n<p id=\"%E5%A0%86%E6%A0%88%E6%8C%87%E9%92%88%E5%AF%84%E5%AD%98%E5%99%A8-toc\" style=\"margin-left:40px\">\u5806\u6808\u6307\u9488\u5bc4\u5b58\u5668<\/p>\n<p id=\"arm%E6%A8%A1%E5%BC%8F%E5%88%87%E6%8D%A2%E6%B5%81%E7%A8%8B-toc\" style=\"margin-left:40px\">arm\u6a21\u5f0f\u5207\u6362\u6d41\u7a0b<\/p>\n<p id=\"LDR%E6%8C%87%E4%BB%A4%E3%80%81STR%E6%8C%87%E4%BB%A4-toc\" style=\"margin-left:40px\">LDR\u6307\u4ee4\u3001STR\u6307\u4ee4<\/p>\n<p id=\"%E6%8C%87%E4%BB%A4%E6%B5%81%E6%B0%B4%E7%BA%BF%EF%BC%88%E4%B8%89%E7%BA%A7%E6%B5%81%E6%B0%B4%E7%BA%BF%2B%E5%86%AF%E8%AF%BA%E4%BE%9D%E6%9B%BC%E4%BD%93%E7%B3%BB%EF%BC%89-toc\" style=\"margin-left:40px\">\u6307\u4ee4\u6d41\u6c34\u7ebf&#xff08;\u4e09\u7ea7\u6d41\u6c34\u7ebf&#043;\u51af\u8bfa\u4f9d\u66fc\u4f53\u7cfb&#xff09;<\/p>\n<p id=\"%E4%B8%89%E7%BA%A7%E6%B5%81%E6%B0%B4%E7%BA%BF-toc\" style=\"margin-left:80px\">\u4e09\u7ea7\u6d41\u6c34\u7ebf<\/p>\n<p id=\"%E5%B8%A6%E6%9C%89%E8%AE%BF%E9%97%AE%E5%AD%98%E5%82%A8%E5%99%A8%E6%8C%87%E4%BB%A4%E6%B5%81%E6%B0%B4%E7%BA%BF%EF%BC%88LDR%2FSTR)-toc\" style=\"margin-left:80px\">\u5e26\u6709\u8bbf\u95ee\u5b58\u50a8\u5668\u6307\u4ee4\u6d41\u6c34\u7ebf&#xff08;LDR\/STR)<\/p>\n<p id=\"%E5%88%86%E6%94%AF%E6%B5%81%E6%B0%B4%E7%BA%BF-toc\" style=\"margin-left:80px\">\u5206\u652f\u6d41\u6c34\u7ebf<\/p>\n<p id=\"B%2FBL-toc\" style=\"margin-left:80px\">B\/BL<\/p>\n<p id=\"arm%E7%AB%8B%E5%8D%B3%E6%95%B0%E7%BC%96%E7%A0%81%E8%A7%84%E5%88%99-toc\" style=\"margin-left:40px\">arm\u7acb\u5373\u6570\u7f16\u7801\u89c4\u5219<\/p>\n<p id=\"arm%E6%9D%A1%E4%BB%B6%E7%A0%81%E8%A1%A8-toc\" style=\"margin-left:40px\">arm\u6761\u4ef6\u7801\u8868<\/p>\n<p id=\"arm%E7%A7%BB%E4%BD%8D%E6%93%8D%E4%BD%9C-toc\" style=\"margin-left:40px\">arm\u79fb\u4f4d\u64cd\u4f5c<\/p>\n<p id=\"%E9%80%BB%E8%BE%91%E7%A7%BB%E4%BD%8Dvs%E7%AE%97%E6%9C%AF%E7%A7%BB%E4%BD%8D-toc\" style=\"margin-left:80px\">\u903b\u8f91\u79fb\u4f4dvs\u7b97\u672f\u79fb\u4f4d<\/p>\n<p id=\"%E9%80%BB%E8%BE%91%E7%A7%BB%E4%BD%8D%E7%9A%84%E6%9C%AC%E8%B4%A8----%E6%97%A0%E8%AE%BA%E5%B7%A6%E7%A7%BB%E8%BF%98%E6%98%AF%E5%8F%B3%E7%A7%BB%EF%BC%8C%E7%A9%BA%E5%87%BA%E7%9A%84%E4%BD%8D%E5%9D%87%E8%A1%A5%E9%9B%B6%EF%BC%8C%E4%B8%8D%E4%BF%9D%E7%95%99%E7%AC%A6%E5%8F%B7%E4%BF%A1%E6%81%AF-toc\" style=\"margin-left:120px\">\u903b\u8f91\u79fb\u4f4d\u7684\u672c\u8d28&#8212;-\u65e0\u8bba\u5de6\u79fb\u8fd8\u662f\u53f3\u79fb&#xff0c;\u7a7a\u51fa\u7684\u4f4d\u5747\u8865\u96f6&#xff0c;\u4e0d\u4fdd\u7559\u7b26\u53f7\u4fe1\u606f<\/p>\n<p id=\"LDM%2FSTM%E6%8C%87%E4%BB%A4-toc\" style=\"margin-left:40px\">LDM\/STM\u6307\u4ee4<\/p>\n<p id=\"%C2%A0LDM%E6%8C%87%E4%BB%A4%EF%BC%9A-toc\" style=\"margin-left:80px\">\u00a0LDM\u6307\u4ee4&#xff1a;<\/p>\n<p id=\"%E8%BD%AF%E4%B8%AD%E6%96%AD%E6%8C%87%E4%BB%A4-toc\" style=\"margin-left:80px\">\u8f6f\u4e2d\u65ad\u6307\u4ee4<\/p>\n<p id=\"%E8%BD%AF%E4%B8%AD%E6%96%AD%E7%9A%84%E6%9C%AC%E8%B4%A8-toc\" style=\"margin-left:80px\">\u8f6f\u4e2d\u65ad\u7684\u672c\u8d28<\/p>\n<p id=\"%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%20arm%20Linux%E7%B3%BB%E7%BB%9F%E8%B0%83%E7%94%A8%E5%AE%9E%E7%8E%B0-toc\" style=\"margin-left:40px\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 arm Linux\u7cfb\u7edf\u8c03\u7528\u5b9e\u73b0<\/p>\n<p id=\"%C2%A0STM%E6%8C%87%E4%BB%A4-toc\" style=\"margin-left:80px\">\u00a0STM\u6307\u4ee4<\/p>\n<p id=\"arm%E5%AF%BB%E5%9D%80%E6%96%B9%E5%BC%8F-toc\" style=\"margin-left:40px\">arm\u5bfb\u5740\u65b9\u5f0f<\/p>\n<p id=\"%E5%A4%9A%E5%AF%84%E5%AD%98%E5%99%A8%E5%AF%BB%E5%9D%80-toc\" style=\"margin-left:80px\">\u591a\u5bc4\u5b58\u5668\u5bfb\u5740<\/p>\n<p id=\"%E5%A0%86%E6%A0%88%E5%AF%BB%E5%9D%80-toc\" style=\"margin-left:40px\">\u5806\u6808\u5bfb\u5740<\/p>\n<p id=\"%C2%A0%E6%A0%87%E7%AD%BElabel-toc\" style=\"margin-left:40px\">\u00a0\u6807\u7b7elabel<\/p>\n<p id=\"%E5%85%A8%E5%B1%80%E6%A0%87%E7%AD%BE-toc\" style=\"margin-left:80px\">\u5168\u5c40\u6807\u7b7e<\/p>\n<p id=\"%C2%A0%E5%AE%9A%E4%B9%89%E5%85%A8%E5%B1%80%E5%87%BD%E6%95%B0-toc\" style=\"margin-left:120px\">\u00a0\u5b9a\u4e49\u5168\u5c40\u51fd\u6570<\/p>\n<p id=\"%C2%A0%E5%AE%9A%E4%B9%89%E5%85%A8%E5%B1%80%E5%8F%98%E9%87%8F-toc\" style=\"margin-left:120px\">\u00a0\u5b9a\u4e49\u5168\u5c40\u53d8\u91cf<\/p>\n<p id=\"%C2%A0%E4%BD%BF%E7%94%A8%E5%9C%BA%E6%99%AF-toc\" style=\"margin-left:120px\">\u00a0\u4f7f\u7528\u573a\u666f<\/p>\n<p id=\"%E5%B1%80%E9%83%A8%E6%A0%87%E7%AD%BE-toc\" style=\"margin-left:80px\">\u5c40\u90e8\u6807\u7b7e<\/p>\n<p id=\"%E5%BC%95%E7%94%A8%E6%96%B9%E5%BC%8F-toc\" style=\"margin-left:120px\">\u5f15\u7528\u65b9\u5f0f<\/p>\n<p id=\"%E5%BC%95%E7%94%A8%E8%A7%84%E5%88%99-toc\" style=\"margin-left:120px\">\u5f15\u7528\u89c4\u5219<\/p>\n<p id=\"%E4%BD%BF%E7%94%A8%E5%9C%BA%E6%99%AF-toc\" style=\"margin-left:120px\">\u4f7f\u7528\u573a\u666f<\/p>\n<p id=\"%E5%BC%B1%E6%A0%87%E7%AD%BE-toc\" style=\"margin-left:80px\">\u5f31\u6807\u7b7e<\/p>\n<p id=\"%C2%A0%E5%BC%B1%E6%A0%87%E7%AD%BE%E7%9A%84%E8%A6%86%E7%9B%96%E5%8E%9F%E5%88%99-toc\" style=\"margin-left:120px\">\u00a0\u5f31\u6807\u7b7e\u7684\u8986\u76d6\u539f\u5219<\/p>\n<p id=\"%E4%BD%BF%E7%94%A8%E5%9C%BA%E6%99%AF-toc\" style=\"margin-left:120px\">\u4f7f\u7528\u573a\u666f<\/p>\n<p id=\"%E9%9D%99%E6%80%81%E6%A0%87%E7%AD%BE-toc\" style=\"margin-left:80px\">\u9759\u6001\u6807\u7b7e<\/p>\n<p id=\"%E9%9D%99%E6%80%81%E6%A0%87%E7%AD%BE%E7%9A%84%E5%AE%9A%E4%B9%89-toc\" style=\"margin-left:120px\">\u9759\u6001\u6807\u7b7e\u7684\u5b9a\u4e49<\/p>\n<p id=\"%C2%A0%E4%BD%BF%E7%94%A8%E5%9C%BA%E6%99%AF-toc\" style=\"margin-left:120px\">\u00a0\u4f7f\u7528\u573a\u666f<\/p>\n<p id=\"%E4%BC%AA%E6%8C%87%E4%BB%A4-toc\" style=\"margin-left:40px\">\u4f2a\u6307\u4ee4<\/p>\n<p id=\"NOP%E4%BC%AA%E6%8C%87%E4%BB%A4-toc\" style=\"margin-left:80px\">NOP\u4f2a\u6307\u4ee4<\/p>\n<p id=\"ADR%E4%BC%AA%E6%8C%87%E4%BB%A4-toc\" style=\"margin-left:80px\">ADR\u4f2a\u6307\u4ee4<\/p>\n<p id=\"ADRL%E4%BC%AA%E6%8C%87%E4%BB%A4-toc\" style=\"margin-left:80px\">ADRL\u4f2a\u6307\u4ee4<\/p>\n<p id=\"LDR%E4%BC%AA%E6%8C%87%E4%BB%A4-toc\" style=\"margin-left:80px\">LDR\u4f2a\u6307\u4ee4<\/p>\n<p id=\"LDR%E4%BC%AA%E6%8C%87%E4%BB%A4%E7%9A%84%E4%B8%A4%E7%A7%8D%E5%BD%A2%E5%BC%8F-toc\" style=\"margin-left:120px\">LDR\u4f2a\u6307\u4ee4\u7684\u4e24\u79cd\u5f62\u5f0f<\/p>\n<p id=\"arm%E4%BC%AA%E6%93%8D%E4%BD%9C-toc\" style=\"margin-left:40px\">arm\u4f2a\u64cd\u4f5c<\/p>\n<p id=\"arm%E5%BC%82%E5%B8%B8%E7%9A%84%E5%A4%84%E7%90%86%E6%B5%81%E7%A8%8B-toc\" style=\"margin-left:40px\">\u6c47\u7f16\u8c03\u7528c\u7a0b\u5e8f<\/p>\n<p id=\"%C2%A0c%E8%B0%83%E7%94%A8%E6%B1%87%E7%BC%96%E7%A8%8B%E5%BA%8F-toc\" style=\"margin-left:80px\">\u00a0c\u8c03\u7528\u6c47\u7f16\u7a0b\u5e8f<\/p>\n<p id=\"%E5%86%85%E8%81%94%E6%B1%87%E7%BC%96-toc\" style=\"margin-left:80px\">\u5185\u8054\u6c47\u7f16<\/p>\n<p id=\"%E9%A5%B1%E5%92%8C%E7%AE%97%E6%9C%AF%E8%BF%90%E7%AE%97%EF%BC%9A-toc\" style=\"margin-left:120px\">\u9971\u548c\u7b97\u672f\u8fd0\u7b97&#xff1a;<\/p>\n<p id=\"%E5%8D%8F%E5%A4%84%E7%90%86%E5%99%A8-toc\" style=\"margin-left:120px\">\u534f\u5904\u7406\u5668<\/p>\n<p id=\"%E5%86%85%E8%81%94%E6%B1%87%E7%BC%96%E7%9A%84%E5%9F%BA%E6%9C%AC%E8%AF%AD%E6%B3%95-toc\" style=\"margin-left:120px\">\u5185\u8054\u6c47\u7f16\u7684\u57fa\u672c\u8bed\u6cd5<\/p>\n<hr id=\"hr-toc\" \/>\n<p>\u00a0 <\/p>\n<h2 id=\"%E5%93%88%E4%BD%9B%E7%BB%93%E6%9E%84\">\u54c8\u4f5b\u7ed3\u6784<\/h2>\n<\/p>\n<p>\u6838\u5fc3\u7279\u5f81\u662f\u5c06\u6307\u4ee4\u5b58\u50a8\u548c\u6570\u636e\u5b58\u50a8\u5b8c\u5168\u5206\u79bb&#xff0c;\u5404\u81ea\u4f7f\u7528\u72ec\u7acb\u7684\u5b58\u50a8\u5668\u548c\u603b\u7ebf<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"292\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250605190301-6841e9e56bb1c.png\" width=\"976\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"620\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250605190301-6841e9e58dcab.png\" width=\"1229\" \/><\/p>\n<h3 id=\"arm%E6%8C%87%E4%BB%A4%E6%A0%BC%E5%BC%8F\">arm\u6307\u4ee4\u683c\u5f0f<\/h3>\n<p>arm\u6307\u4ee4\u96c6\u91c7\u7528\u56fa\u5b9a\u957f\u5ea632\u4f4d\u7684\u6307\u4ee4\u683c\u5f0f<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"501\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250605190301-6841e9e5ce2a0.png\" width=\"947\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"371\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250605190301-6841e9e5f1f7b.png\" width=\"807\" \/><\/p>\n<h4 id=\"%C2%A0%E6%9C%89%E7%AC%A6%E5%8F%B7%E6%95%B0%E7%9A%84%E6%BA%A2%E5%87%BA%EF%BC%888bit)%E2%80%8B%E7%BC%96%E8%BE%91\">\u00a0\u6709\u7b26\u53f7\u6570\u7684\u6ea2\u51fa&#xff08;8bit)<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"268\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250605190302-6841e9e6225ec.png\" width=\"1051\" \/><\/h4>\n<h4 id=\"%E2%80%8B%E7%BC%96%E8%BE%91\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"262\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250605190302-6841e9e64c148.png\" width=\"1017\" \/><\/h4>\n<h4 id=\"%E6%97%A0%E7%AC%A6%E5%8F%B7%E6%95%B0%E7%9A%84%E8%BF%9B%E4%BD%8D%2F%E5%80%9F%E4%BD%8D\">\u65e0\u7b26\u53f7\u6570\u7684\u8fdb\u4f4d\/\u501f\u4f4d<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"501\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250605190302-6841e9e66f8dc.png\" width=\"1037\" \/><\/p>\n<h3 id=\"CPSR%EF%BC%88%E5%BD%93%E5%89%8D%E7%A8%8B%E5%BA%8F%E7%8A%B6%E6%80%81%E5%AF%84%E5%AD%98%E5%99%A8%EF%BC%89\">CPSR&#xff08;\u5f53\u524d\u7a0b\u5e8f\u72b6\u6001\u5bc4\u5b58\u5668&#xff09;<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"476\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250605190302-6841e9e6c0fc1.png\" width=\"991\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"424\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250605190302-6841e9e6e83d2.png\" width=\"1036\" \/><\/p>\n<h3 id=\"arm%E6%A8%A1%E5%BC%8F\">ARM\u6a21\u5f0f<\/h3>\n<ul>\n<li>\n<p><span style=\"color:#511b78\">\u7528\u6237\u6a21\u5f0f<\/span>&#xff0c;\u7528\u6237\u7a0b\u5e8f\u7684\u5de5\u4f5c\u6a21\u5f0f&#xff0c;\u7528\u6237\u6a21\u5f0f\u6ca1\u6709\u6743\u9650\u53bb\u64cd\u4f5c\u5176\u5b83\u786c\u4ef6\u8d44\u6e90&#xff0c;\u53ea\u80fd\u6267\u884c\u5904\u7406\u81ea\u5df1\u7684 \u6570\u636e&#xff1b;<\/p>\n<\/li>\n<li>\n<p><span style=\"color:#be191c\">\u7cfb\u7edf\u6a21\u5f0f<\/span>&#xff0c;\u9996\u5148\u7528\u6237\u6a21\u5f0f\u4e0e\u7cfb\u7edf\u6a21\u5f0f\u5171\u7528\u540c\u4e00\u5957\u5bc4\u5b58\u5668&#xff0c;\u7cfb\u7edf\u6a21\u5f0f\u4e3a\u7279\u6743\u6a21\u5f0f&#xff0c;\u7cfb\u7edf\u6a21\u5f0f\u53ef\u4ee5\u76f4\u63a5\u8bbf\u95ee\u786c\u4ef6\u8d44\u6e90<\/p>\n<\/li>\n<li>\n<p><span style=\"color:#ad720d\">svc\u6a21\u5f0f<\/span>&#xff0c;\u4e3b\u8981\u7528\u4e8e\u5b8c\u6210\u7cfb\u7edf\u521d\u59cb\u5316\u7684\u5de5\u4f5c&#xff0c;cpu\u4e0a\u7535\u4e4b\u540e\u9ed8\u8ba4\u7684\u5de5\u4f5c\u6a21\u5f0f&#xff0c;\u5f53\u8c03\u7528swi\/svc&#xff0c;cpu\u5904\u4e8esvc\u6a21\u5f0f&#xff1b;<\/p>\n<\/li>\n<li>\n<p><span style=\"color:#1c7331\">\u4e2d\u6b62\u6a21\u5f0f<\/span>&#xff0c;\u5f53\u7528\u6237\u8bbf\u95ee\u975e\u6cd5\u5185\u5b58\u5730\u5740\u6216\u8005\u8bbf\u95ee\u67d0\u4e00\u5757\u4e0d\u5177\u6709\u8bfb\u5199\u6743\u9650\u7684\u5185\u5b58\u5730\u5740\u65f6\u5904\u4e8e\u6b64\u5de5\u4f5c\u6a21\u5f0f&#xff1b;<\/p>\n<\/li>\n<li>\n<p><span style=\"color:#1c7892\">Fiq\u6a21\u5f0f <\/span>&#xff08;\u5feb\u901f\u4e2d\u65ad\u6a21\u5f0f&#xff09;&#xff0c;\u7528\u6765\u5904 \u7406\u5bf9\u65f6\u95f4\u8981\u6c42\u6bd4\u8f83\u7d27\u6025\u7684\u4e2d\u65ad\u8bf7\u6c42&#xff0c;\u4e3b\u8981\u7528\u4e8e\u9ad8\u901f\u6570\u636e\u4f20\u8f93\u53ca\u901a\u9053\u5904\u7406\u4e2d&#xff1b;<\/p>\n<\/li>\n<li>\n<p><span style=\"color:#1a439c\">IRQ\u6a21\u5f0f<\/span>&#xff08;\u666e\u901a\u4e2d\u65ad\u6a21\u5f0f&#xff09;&#xff0c;\u7528\u4e8e\u5904\u7406\u4e00\u822c\u7684\u4e2d\u65ad\u8bf7\u6c42&#xff0c;\u901a\u5e38\u5728\u786c\u4ef6\u4ea7\u751f\u4e2d\u65ad\u4fe1\u53f7\u4e4b\u540e\u81ea\u52a8\u8fdb\u5165IRQ\u6a21\u5f0f&#xff1b;<\/p>\n<\/li>\n<\/ul>\n<h3 id=\"arm%E5%BC%82%E5%B8%B8%E7%B1%BB%E5%9E%8B\">arm\u5f02\u5e38\u7c7b\u578b<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"467\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250605190303-6841e9e72751c.png\" width=\"961\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"226\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250605190303-6841e9e748615.png\" width=\"727\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"273\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250605190303-6841e9e7550d7.png\" width=\"805\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"253\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250605190303-6841e9e76b95d.png\" width=\"821\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"244\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250605190303-6841e9e781365.png\" width=\"798\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"268\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250605190303-6841e9e796b2d.png\" width=\"834\" \/><\/p>\n<h4 id=\"%C2%A0ARMv7%E6%9E%B6%E6%9E%84%E5%BC%82%E5%B8%B8%E5%90%91%E9%87%8F%E8%A1%A8\">\u00a0ARMv7\u67b6\u6784\u5f02\u5e38\u5411\u91cf\u8868<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"481\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250605190303-6841e9e7ad66a.png\" width=\"1032\" \/><\/p>\n<h4 id=\"%C2%A0arm%E5%BC%82%E5%B8%B8%E7%9A%84%E5%A4%84%E7%90%86%E6%B5%81%E7%A8%8B\">\u00a0arm\u5f02\u5e38\u7684\u5904\u7406\u6d41\u7a0b<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"739\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250605190303-6841e9e7e22a4.png\" width=\"1489\" \/><\/p>\n<h3 id=\"arm%E5%AF%84%E5%AD%98%E5%99%A8\">arm\u5bc4\u5b58\u5668<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"677\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250605190304-6841e9e83ddb6.png\" width=\"1061\" \/><\/p>\n<p>arm\u5904\u7406\u5668\u5728\u4efb\u4f55\u5de5\u4f5c\u6a21\u5f0f\u4e0b\u5171\u7528\u4e00\u4e2aPC\u5bc4\u5b58\u5668&#xff08;\u7a0b\u5e8f\u8ba1\u6570\u5bc4\u5b58\u5668&#xff09;\u4e0eCPSR\u5bc4\u5b58\u5668&#xff08;\u5f53\u524d\u7a0b\u5e8f\u72b6\u6001\u5bc4\u5b58\u5668&#xff09;\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"125\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250605190304-6841e9e899a1f.png\" width=\"646\" \/><\/p>\n<h3 id=\"%E5%A0%86%E6%A0%88%E6%8C%87%E9%92%88%E5%AF%84%E5%AD%98%E5%99%A8\">\u5806\u6808\u6307\u9488\u5bc4\u5b58\u5668<\/h3>\n<p>\u00a0\u6808\u6309\u7167\u6808\u7684\u751f\u957f\u65b9\u5411&#xff08;\u9012\u589e\u3001\u9012\u51cf&#xff09;\u4e0e\u6570\u636e\u7684\u5b58\u50a8\u65b9\u5f0f&#xff08;\u6ee1\u6808\u3001\u7a7a\u6808&#xff09;\u5206\u4e3a\u56db\u79cd\u7c7b\u578b<\/p>\n<p>1. \u6ee1\u9012\u589e\u6808 2. \u6ee1\u9012\u51cf\u6808 3. \u7a7a\u9012\u589e\u6808 4. \u7a7a\u9012\u51cf\u6808<\/p>\n<p>\u6808\u9876\u6307\u9488&#xff08;sp): \u59cb\u7ec8\u6307\u5411\u5f53\u524d\u6808\u7684\u6808\u9876&#xff0c;\u5373\u6700\u540e\u4e00\u4e2a\u5165\u6808\u5143\u7d20\u7684\u5730\u5740&#xff08;\u6ee1\u6808&#xff09;\u6216\u8005 \u4e0b\u4e00\u4e2a\u53ef\u7528\u7a7a\u95f4\u7684\u5730\u5740&#xff08;\u7a7a\u6808&#xff09;<\/p>\n<p>\u9012\u589e\u6808&#xff1a;\u6808\u9876\u5411\u9ad8\u5730\u5740\u65b9\u5411\u589e\u957f<\/p>\n<p>\u9012\u51cf\u6808&#xff1a;\u6808\u9876\u5411\u4f4e\u5730\u5740\u65b9\u5411\u589e\u957f<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"588\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250605190304-6841e9e8a486c.png\" width=\"1183\" \/><\/p>\n<p><span style=\"color:#fe2c24\">push\u64cd\u4f5c\u65f6\u5904\u7406\u5668\u5148\u51cf\u5c0fSP\u503c&#xff0c;\u7136\u540e\u5c06\u6307\u5b9a\u5bc4\u5b58\u5668\u5b58\u50a8\u5230SP\u5bc4\u5b58\u5668\u6307\u5411\u7684\u5b58\u50a8\u5668\u5730\u5740<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"615\" src=\"2025-06-0600r2mzqnwvm.png\" width=\"1203\" \/><span style=\"color:#fe2c24\">\u00a0POP\u64cd\u4f5c\u65f6\u5904\u7406\u5668\u5148\u5c06SP\u6307\u5411\u7684\u5b58\u50a8\u5668\u5730\u5740\u5b58\u50a8\u5230\u6307\u5b9a\u5bc4\u5b58\u5668\u4e2d&#xff0c;\u7136\u540e\u5c06SP\u5bc4\u5b58\u5668\u503c\u589e\u52a0\u3002<\/span><\/p>\n<h3 id=\"arm%E6%A8%A1%E5%BC%8F%E5%88%87%E6%8D%A2%E6%B5%81%E7%A8%8B\">arm\u6a21\u5f0f\u5207\u6362\u6d41\u7a0b<\/h3>\n<p><span style=\"color:#b95514\">\u5728ARM\u4e2d&#xff0c;\u5f53\u53d1\u751f\u5f02\u5e38\u65f6&#xff0c;\u5904\u7406\u5668\u4f1a\u81ea\u52a8\u5207\u6362\u5230\u5bf9\u5e94\u7684\u5f02\u5e38\u6a21\u5f0f&#xff0c;\u6bcf\u79cd\u5f02\u5e38\u6a21\u5f0f\u90fd\u6709\u81ea\u5df1\u72ec\u7acb\u7684\u7269\u7406\u5bc4\u5b58\u5668&#xff0c;R13(SP&#xff1a;\u5806\u6808\u5bc4\u5b58\u5668)\u3001R14(LR:\u94fe\u63a5\u5bc4\u5b58\u5668&#xff09;SPSR&#xff08;\u5907\u4efd\u7a0b\u5e8f\u72b6\u6001\u5bc4\u5b58\u5668&#xff09;\u3002<\/span><\/p>\n<p>\u5f53\u4ece\u7528\u6237\u6a21\u5f0f\u8fdb\u5165IRQ\u6a21\u5f0f\u65f6&#xff0c;\u4fdd\u5b58\u9700\u8981\u4fdd\u62a4\u7684\u5bc4\u5b58\u5668\u5230IRQ\u6a21\u5f0f\u7684\u5806\u6808&#xff0c;\u6b65\u9aa4\u5982\u4e0b&#xff1a;<\/p>\n<li>\u7528\u6237\u7a0b\u5e8f\u5728\u7528\u6237\u6a21\u5f0f\u4e0b\u8fd0\u884c&#xff0c;\u4f7f\u7528SP_usr&#xff1b;<\/li>\n<li>\u53d1\u751f\u4e2d\u65ad&#xff0c;\u5904\u7406\u5668\u81ea\u52a8\u5207\u6362\u5230IRQ\u6a21\u5f0f&#xff0c;\u6b64\u65f6SP\u81ea\u52a8\u53d8\u4e3aSP_irq\u3002<\/li>\n<li>\n<p><span style=\"color:#0d0016\">\u4fdd\u5b58\u8fd4\u56de\u5730\u5740\u5230LR_irq&#xff08;LR_irq &#061; \u5f53\u524dPC &#043; 4&#xff09;\u3002<\/span><\/p>\n<\/li>\n<li>\n<p><span style=\"color:#0d0016\">\u4fdd\u5b58\u5f53\u524dCPSR\u5230SPSR_irq\u3002<\/span><\/p>\n<\/li>\n<li>\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u5f00\u59cb\u6267\u884c&#xff0c;\u4f7f\u7528SP_irq\u6307\u5411\u7684\u5806\u6808\u4fdd\u5b58\u5bc4\u5b58\u5668&#xff08;\u5982R0-R12, LR_irq&#xff09;<\/li>\n<li>\u5904\u7406\u5b8c\u4e2d\u65ad\u540e&#xff0c;\u4eceSP_irq\u7684\u5806\u6808\u4e2d\u6062\u590d\u5bc4\u5b58\u5668\u3002<\/li>\n<li>\u8fd4\u56de\u5230\u7528\u6237\u6a21\u5f0f&#xff0c;\u7ee7\u7eed\u4f7f\u7528SP_usr\u3002<\/li>\n<p>IRQ_Handler:<br \/>\n    ; 1. \u4fdd\u5b58\u7528\u6237\u6a21\u5f0f\u7684\u5bc4\u5b58\u5668&#xff08;R0-R12, LR_irq\u4fdd\u5b58\u7684\u662f\u8fd4\u56de\u5730\u5740&#xff09;<br \/>\n    STMFD SP!, {R0-R12, LR}   ; \u4f7f\u7528SP_irq\u538b\u6808&#xff08;SP_irq -&#061; 56\u5b57\u8282&#xff09;<\/p>\n<p>    ; 2. \u5904\u7406\u4e2d\u65ad&#xff08;\u5982\u8bfb\u53d6\u5b9a\u65f6\u5668\u72b6\u6001&#xff09;<br \/>\n    BL Handle_Timer_Interrupt<\/p>\n<p>    ; 3. \u6062\u590d\u5bc4\u5b58\u5668\u5e76\u8fd4\u56de\u7528\u6237\u6a21\u5f0f<br \/>\n    LDMFD SP!, {R0-R12, LR}   ; \u4eceSP_irq\u5f39\u6808&#xff08;SP_irq &#043;&#061; 56\u5b57\u8282&#xff09;<br \/>\n    SUBS PC, LR, #4           ; \u8fd4\u56de\u5230\u7528\u6237\u6a21\u5f0f\u7684\u4e0b\u4e00\u6761\u6307\u4ee4&#xff08;\u6062\u590dCPSR&#xff09; <\/p>\n<p>\u00a0<\/p>\n<h3 id=\"LDR%E6%8C%87%E4%BB%A4%E3%80%81STR%E6%8C%87%E4%BB%A4\">LDR\u6307\u4ee4\u3001STR\u6307\u4ee4<\/h3>\n<p>LDR\u6307\u4ee4&#xff08;Load Register&#xff09;\u662f\u7528\u4e8e\u4ece\u5185\u5b58\u4e2d\u52a0\u8f7d\u6570\u636e\u5230\u5bc4\u5b58\u5668\u7684\u6838\u5fc3\u6307\u4ee4<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"509\" src=\"2025-06-06aqr0c03m5qq.png\" width=\"1015\" \/><\/p>\n<p>\u00a0STR\u6307\u4ee4&#xff08;Store Register&#xff09;\u7528\u4e8e\u5c06\u5bc4\u5b58\u5668\u4e2d\u7684\u503c\u5b58\u50a8\u5230\u5185\u5b58\u4e2d<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"545\" src=\"2025-06-06hcscs3prja5.png\" width=\"1046\" \/><\/p>\n<h3 id=\"%E6%8C%87%E4%BB%A4%E6%B5%81%E6%B0%B4%E7%BA%BF%EF%BC%88%E4%B8%89%E7%BA%A7%E6%B5%81%E6%B0%B4%E7%BA%BF%2B%E5%86%AF%E8%AF%BA%E4%BE%9D%E6%9B%BC%E4%BD%93%E7%B3%BB%EF%BC%89\">\u6307\u4ee4\u6d41\u6c34\u7ebf&#xff08;\u4e09\u7ea7\u6d41\u6c34\u7ebf&#043;\u51af\u8bfa\u4f9d\u66fc\u4f53\u7cfb&#xff09;<\/h3>\n<p><span style=\"color:#956fe7\">\u51af\u8bfa\u4f9d\u66fc\u4f53\u7cfb&#xff1a;\u6570\u636e\u603b\u7ebf\u53ea\u6709\u4e00\u6839&#xff0c;\u53d6\u6307\u4ee4\u4e0e\u53d6\u6570\u636e\u91c7\u7528\u540c\u4e00\u6839\u6570\u636e\u7ebf<\/span><\/p>\n<h4 id=\"%E4%B8%89%E7%BA%A7%E6%B5%81%E6%B0%B4%E7%BA%BF\">\u4e09\u7ea7\u6d41\u6c34\u7ebf<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"454\" src=\"2025-06-064kyu1zykud0.png\" width=\"958\" \/><\/p>\n<h4 id=\"%E5%B8%A6%E6%9C%89%E8%AE%BF%E9%97%AE%E5%AD%98%E5%82%A8%E5%99%A8%E6%8C%87%E4%BB%A4%E6%B5%81%E6%B0%B4%E7%BA%BF%EF%BC%88LDR%2FSTR)\">\u5e26\u6709\u8bbf\u95ee\u5b58\u50a8\u5668\u6307\u4ee4\u6d41\u6c34\u7ebf&#xff08;LDR\/STR)<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"437\" src=\"2025-06-06uefufor2asz.png\" width=\"975\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"386\" src=\"2025-06-06ffjzpzzimdj.png\" width=\"855\" \/><\/p>\n<p>LDR\u6307\u4ee4<\/p>\n<p>\u00a0 \u00a0 \u00a0 step1&#xff1a;\u8bbf\u95ee\u5185\u5b58\u2014\u2014\u53d6\u6570\u636e\u2014\u2014\u6570\u636e\u603b\u7ebf\u88ab\u5360\u7528\u2014\u2014AND\u6307\u4ee4\u88ab\u5ef6\u65f6(stall)<\/p>\n<p>\u00a0 \u00a0 \u00a0 step2&#xff1a;\u6570\u636e\u5199\u56de\u5bc4\u5b58\u5668\u2014\u2014\u5199\u6570\u636e\u2014\u2014\u6570\u636e\u603b\u7ebf\u88ab\u5360\u7528\u2014\u2014\u5176\u4ed6\u6307\u4ee4\u88ab\u5ef6\u65f6<\/p>\n<h4 id=\"%E5%88%86%E6%94%AF%E6%B5%81%E6%B0%B4%E7%BA%BF\">\u5206\u652f\u6d41\u6c34\u7ebf<\/h4>\n<p>BL&#xff08;Branch with Link&#xff09;\u6307\u4ee4\u6838\u5fc3\u529f\u80fd\u662f<span style=\"color:#b95514\">\u8df3\u8f6c\u5230\u76ee\u6807\u5730\u5740\u6267\u884c\u5b50\u7a0b\u5e8f<\/span>&#xff0c;\u540c\u65f6<span style=\"color:#1a439c\">\u5c06\u8fd4\u56de\u5730\u5740<\/span>&#xff08;<span style=\"color:#fe2c24\">\u4e0b\u4e00\u6761\u6307\u4ee4\u5730\u5740<\/span>&#xff09;<span style=\"color:#1a439c\">\u4fdd\u5b58\u5230\u94fe\u63a5\u5bc4\u5b58\u5668LR<\/span>;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"276\" src=\"2025-06-06lcp3xurazfu.png\" width=\"989\" \/><\/p>\n<p>B&#xff08;Branch&#xff09;\u6307\u4ee4\u7684\u6838\u5fc3\u529f\u80fd\u662f\u6539\u53d8\u7a0b\u5e8f\u6267\u884c\u6d41\u7a0b&#xff0c;\u5e38\u7528\u4e8e\u5faa\u73af\u63a7\u5236&#xff08;for\/while)\u3001\u6761\u4ef6\u5206\u652f(if-else) \u548c\u4ee3\u7801\u5757\u8df3\u8f6c<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"264\" src=\"2025-06-06tzgwi3lqqqx.png\" width=\"945\" \/><\/p>\n<h4 id=\"B%2FBL\">B\/BL<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"241\" src=\"2025-06-061byvo4dhgkf.png\" width=\"726\" \/><\/p>\n<p>BL &lt;label&gt; #label\u4e2d\u5b58\u50a8\u7684\u662f\u76ee\u6807\u5730\u5740<\/p>\n<p><span style=\"color:#fe2c24\">\u8df3\u8f6c\u5730\u5740\u8ba1\u7b97\u6d41\u7a0b&#xff1a;<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"380\" src=\"2025-06-06vq0xjdzbdai.png\" width=\"852\" \/><\/p>\n<p>\u00a0eg:<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"489\" src=\"2025-06-06qra4vapknns.png\" width=\"827\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"616\" src=\"2025-06-061xkrmqr5ymi.png\" width=\"881\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"290\" src=\"2025-06-06qmnvpkuwknm.png\" width=\"957\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"512\" src=\"2025-06-06ynxeofs1uj3.png\" width=\"1108\" \/><\/p>\n<h3 id=\"arm%E7%AB%8B%E5%8D%B3%E6%95%B0%E7%BC%96%E7%A0%81%E8%A7%84%E5%88%99\">arm\u7acb\u5373\u6570\u7f16\u7801\u89c4\u5219<\/h3>\n<p>ARM\u7acb\u5373\u6570\u91c7\u7528 &#034;<span style=\"color:#fe2c24\">8 \u4f4d\u6570\u503c<\/span> &#043;<span style=\"color:#fe2c24\"> 4 \u4f4d\u5faa\u73af\u53f3\u79fb<\/span>&#xff08;Rotate Right)&#034;\u7684\u7ec4\u5408\u7f16\u7801&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"265\" src=\"2025-06-061u1cf3mlhq4.png\" width=\"900\" \/><\/p>\n<h3 id=\"arm%E6%9D%A1%E4%BB%B6%E7%A0%81%E8%A1%A8\">arm\u6761\u4ef6\u7801\u8868<\/h3>\n<p>\u5047\u8bbe\u6709\u7b26\u53f7\u6570A\u548cB&#xff0c;\u6bd4\u8f83A \u2265 B\u7b49\u4ef7\u4e8e\u5224\u65adA &#8211; B \u2265 0<\/p>\n<p>\u8bbeS &#061; A &#8211; B&#xff0c;\u5219<\/p>\n<ul>\n<li>\u82e5S \u2265 0&#xff0c;\u5219S\u7684\u7b26\u53f7\u4f4d\u4e3a 0&#xff08;N&#061;0&#xff09;\u3002<\/li>\n<li>\u82e5\u8ba1\u7b97\u8fc7\u7a0b\u672a\u6ea2\u51fa&#xff08;V&#061;0&#xff09;&#xff0c;\u5219N&#061;0\u76f4\u63a5\u8868\u793aS \u2265 0\u3002<\/li>\n<li>\u82e5\u8ba1\u7b97\u8fc7\u7a0b\u6ea2\u51fa&#xff08;V&#061;1&#xff09;&#xff0c;\u5219N&#061;1\u624d\u8868\u793aS \u2265 0&#xff08;\u6ea2\u51fa\u5bfc\u81f4\u7b26\u53f7\u4f4d\u53cd\u8f6c&#xff09;\u3002<\/li>\n<\/ul>\n<p>A \u2265 B\u7684\u5145\u8981\u6761\u4ef6\u662f&#xff1a;N \u4e0e V \u72b6\u6001\u4e00\u81f4&#xff08;N\u22bbV&#061;0&#xff09;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"432\" src=\"2025-06-06e2tn34ume4j.png\" width=\"726\" \/><\/p>\n<h3 id=\"arm%E7%A7%BB%E4%BD%8D%E6%93%8D%E4%BD%9C\">arm\u79fb\u4f4d\u64cd\u4f5c<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"288\" src=\"2025-06-06je0stiwdvxq.png\" width=\"827\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"630\" src=\"2025-06-06xr0sg5ou3b2.png\" width=\"936\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"601\" src=\"2025-06-06lnocvycm3ct.png\" width=\"917\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"617\" src=\"2025-06-061rousx41n0a.png\" width=\"953\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"600\" src=\"2025-06-06fo2pfqqlvva.png\" width=\"943\" \/><\/p>\n<h4 id=\"%E9%80%BB%E8%BE%91%E7%A7%BB%E4%BD%8Dvs%E7%AE%97%E6%9C%AF%E7%A7%BB%E4%BD%8D\">\u903b\u8f91\u79fb\u4f4dvs\u7b97\u672f\u79fb\u4f4d<\/h4>\n<h5 id=\"%E9%80%BB%E8%BE%91%E7%A7%BB%E4%BD%8D%E7%9A%84%E6%9C%AC%E8%B4%A8----%E6%97%A0%E8%AE%BA%E5%B7%A6%E7%A7%BB%E8%BF%98%E6%98%AF%E5%8F%B3%E7%A7%BB%EF%BC%8C%E7%A9%BA%E5%87%BA%E7%9A%84%E4%BD%8D%E5%9D%87%E8%A1%A5%E9%9B%B6%EF%BC%8C%E4%B8%8D%E4%BF%9D%E7%95%99%E7%AC%A6%E5%8F%B7%E4%BF%A1%E6%81%AF\"><span style=\"color:#be191c\">\u903b\u8f91\u79fb\u4f4d\u7684\u672c\u8d28&#8212;-\u65e0\u8bba\u5de6\u79fb\u8fd8\u662f\u53f3\u79fb&#xff0c;\u7a7a\u51fa\u7684\u4f4d\u5747\u8865\u96f6&#xff0c;\u4e0d\u4fdd\u7559\u7b26\u53f7\u4fe1\u606f<\/span><\/h5>\n<p><span style=\"color:#be191c\">\u7b97\u672f\u79fb\u4f4d\u7684\u672c\u8d28&#8212;-\u53f3\u79fb\u65f6\u4fdd\u7559\u7b26\u53f7\u4f4d&#xff08;\u9ad8\u4f4d\u586b\u5145\u539f\u7b26\u53f7\u4f4d&#xff09;&#xff0c;\u5de6\u79fb\u4e0e\u903b\u8f91\u5de6\u79fb\u4e00\u81f4<\/span><\/p>\n<h3 id=\"LDM%2FSTM%E6%8C%87%E4%BB%A4\">LDM\/STM\u6307\u4ee4<\/h3>\n<h4 id=\"%C2%A0LDM%E6%8C%87%E4%BB%A4%EF%BC%9A\">\u00a0LDM\u6307\u4ee4&#xff1a;<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"461\" src=\"2025-06-0654mgdx10usi.png\" width=\"970\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"631\" src=\"2025-06-065pjbjs3qxx3.png\" width=\"915\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"491\" src=\"2025-06-06vqboeu3e1td.png\" width=\"1003\" \/><\/p>\n<h4 id=\"%E8%BD%AF%E4%B8%AD%E6%96%AD%E6%8C%87%E4%BB%A4\">\u8f6f\u4e2d\u65ad\u6307\u4ee4<\/h4>\n<h4 id=\"%E8%BD%AF%E4%B8%AD%E6%96%AD%E7%9A%84%E6%9C%AC%E8%B4%A8\">\u8f6f\u4e2d\u65ad\u7684\u672c\u8d28<\/h4>\n<ul>\n<li>\n<p>\u4e3b\u52a8\u89e6\u53d1&#xff1a;\u4e0e\u786c\u4ef6\u4e2d\u65ad&#xff08;\u7531\u5916\u90e8\u8bbe\u5907\u89e6\u53d1&#xff0c;\u5982\u952e\u76d8\u3001\u65f6\u949f&#xff09;\u4e0d\u540c&#xff0c;\u8f6f\u4e2d\u65ad\u662f\u7a0b\u5e8f\u901a\u8fc7\u663e\u5f0f\u6267\u884c\u6307\u4ee4\u4e3b\u52a8\u53d1\u8d77\u7684\u3002<\/p>\n<\/li>\n<li>\n<p>\u7279\u6743\u7ea7\u5207\u6362&#xff1a;\u5728\u4fdd\u62a4\u6a21\u5f0f\u4e0b&#xff0c;\u8f6f\u4e2d\u65ad\u901a\u5e38\u7528\u4e8e\u4ece<span style=\"color:#be191c\">\u7528\u6237\u6001<\/span>&#xff08;\u4f4e\u7279\u6743\u7ea7&#xff09;\u5207\u6362\u5230<span style=\"color:#be191c\">\u5185\u6838\u6001<\/span>&#xff08;\u9ad8\u7279\u6743\u7ea7&#xff09;&#xff0c;\u4ee5\u4fbf\u6267\u884c\u53d7\u4fdd\u62a4\u7684\u64cd\u4f5c&#xff08;\u5982\u8bbf\u95ee\u786c\u4ef6\u3001\u7ba1\u7406\u5185\u5b58&#xff09;\u3002<\/p>\n<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"446\" src=\"2025-06-06glj3unfhaaa.png\" width=\"1124\" \/><\/p>\n<h3 id=\"%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%20arm%20Linux%E7%B3%BB%E7%BB%9F%E8%B0%83%E7%94%A8%E5%AE%9E%E7%8E%B0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 arm Linux\u7cfb\u7edf\u8c03\u7528\u5b9e\u73b0<\/h3>\n<p><span style=\"color:#fe2c24\">\u7cfb\u7edf\u8c03\u7528\u53f7<\/span>\u662f<span style=\"color:#fe2c24\">\u64cd\u4f5c\u7cfb\u7edf\u5185\u6838<\/span>\u4e3a\u6bcf\u4e2a\u7cfb\u7edf\u8c03\u7528\u5206\u914d\u7684<span style=\"color:#fe2c24\">\u552f\u4e00\u7f16\u53f7&#xff01;<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"540\" src=\"2025-06-06k55402al3h0.png\" width=\"1021\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"366\" src=\"2025-06-06g0hv1m1zdml.png\" width=\"937\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"352\" src=\"2025-06-06fldjknpsaqf.png\" width=\"961\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"349\" src=\"2025-06-06y0as4rti2yu.png\" width=\"990\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"560\" src=\"2025-06-06acy0ktcqeag.png\" width=\"982\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"444\" src=\"2025-06-06pcnj3iymaqh.png\" width=\"1049\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"336\" src=\"2025-06-06yyy3zrtrqiw.png\" width=\"932\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"277\" src=\"2025-06-06r0sd13wdv5v.png\" width=\"895\" \/><\/p>\n<h4 id=\"%C2%A0STM%E6%8C%87%E4%BB%A4\">\u00a0STM\u6307\u4ee4<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"398\" src=\"2025-06-062lqvojsme55.png\" width=\"902\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"486\" src=\"2025-06-06a4c5pmcbx2d.png\" width=\"880\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"524\" src=\"2025-06-062js40u3xb2n.png\" width=\"977\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"412\" src=\"2025-06-060udie3c0haf.png\" width=\"893\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"403\" src=\"2025-06-06mfsl3tjgtm1.png\" width=\"929\" \/><\/p>\n<h3 id=\"arm%E5%AF%BB%E5%9D%80%E6%96%B9%E5%BC%8F\">arm\u5bfb\u5740\u65b9\u5f0f<\/h3>\n<p>\u6307\u4ee4\u5982\u4f55\u8868\u8fbe \u201c<span style=\"color:#be191c\">\u53bb\u54ea\u91cc\u627e\u6570\u636e<\/span>\u201d \u6216 \u201c<span style=\"color:#1c7892\">\u628a\u7ed3\u679c\u5b58\u5230\u54ea\u91cc\u201d<\/span>&#xff1f;\u8fd9\u9700\u8981\u4e00\u5957\u89c4\u5219 \u2014\u2014 \u5373\u5bfb\u5740\u6a21\u5f0f<\/p>\n<p><span style=\"color:#0d0016\">\u5bfb\u5740\u662f<\/span><span style=\"color:#1c7331\">\u786e\u5b9a\u6307\u4ee4\u4e2d\u64cd\u4f5c\u6570\u4f4d\u7f6e<\/span><span style=\"color:#0d0016\">\u7684\u8fc7\u7a0b\u3002\u64cd\u4f5c\u6570\u53ef\u4ee5\u5b58\u50a8\u5728&#xff1a;<\/span><\/p>\n<p><span style=\"color:#0d0016\">1. \u5bc4\u5b58\u5668&#xff08;\u5982 R0~R15&#xff09;<\/span><\/p>\n<p><span style=\"color:#0d0016\">2. \u5185\u5b58&#xff08;\u5982\u53d8\u91cf\u3001\u6570\u7ec4&#xff09;<\/span><\/p>\n<p><span style=\"color:#0d0016\">3. \u7acb\u5373\u6570&#xff08;\u6307\u4ee4\u4e2d\u76f4\u63a5\u7ed9\u51fa\u7684\u5e38\u6570&#xff09;<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"271\" src=\"2025-06-06mv0hkv42rko.png\" width=\"828\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"295\" src=\"2025-06-06a1omzomyfkr.png\" width=\"866\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"502\" src=\"2025-06-06m25rxbsch5r.png\" width=\"1069\" \/> <img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"180\" src=\"2025-06-06w4hlmqc4mbg.png\" width=\"975\" \/><\/p>\n<h4 id=\"%E5%A4%9A%E5%AF%84%E5%AD%98%E5%99%A8%E5%AF%BB%E5%9D%80\">\u591a\u5bc4\u5b58\u5668\u5bfb\u5740<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"495\" src=\"2025-06-06nepw5alhwou.png\" width=\"801\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"350\" src=\"2025-06-06kdbwtsicp0m.png\" width=\"984\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"312\" src=\"2025-06-06gv3y0ixy54p.png\" width=\"837\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"291\" src=\"2025-06-06fyqxibxxqbs.png\" width=\"901\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"598\" src=\"2025-06-06o0rg3uqf55l.png\" width=\"760\" \/>\u00a0<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"508\" src=\"2025-06-06x2qkgvrvomn.png\" width=\"737\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"246\" src=\"2025-06-06g5m5powe0na.png\" width=\"702\" \/><\/p>\n<h3 id=\"%E5%A0%86%E6%A0%88%E5%AF%BB%E5%9D%80\">\u5806\u6808\u5bfb\u5740<\/h3>\n<p><span style=\"color:#fe2c24\">push\/pop<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"335\" src=\"2025-06-065pxmhdxei23.png\" width=\"881\" \/><\/p>\n<h3 id=\"%C2%A0%E6%A0%87%E7%AD%BElabel\">\u00a0\u6807\u7b7elabel<\/h3>\n<p>\u6807\u7b7e\u662f\u4e00\u4e2a\u7b26\u53f7\u5316\u7684\u5730\u5740\u6807\u8bb0&#xff0c;\u6307\u5411\u4ee3\u7801\u6216\u6570\u636e\u5728\u5185\u5b58\u4e2d\u7684\u4f4d\u7f6e&#xff1b;<\/p>\n<p>\u5728 ARM Linux \u6c47\u7f16\u5f00\u53d1\u4e2d&#xff0c;\u6807\u7b7e&#xff08;Label&#xff09;\u7684\u5206\u7c7b\u4e3b\u8981\u57fa\u4e8e\u5176 <span style=\"color:#fe2c24\">\u4f5c\u7528\u57df<\/span>&#xff08;\u53ef\u89c1\u6027\u8303\u56f4&#xff09;\u3001<span style=\"color:#fe2c24\">\u94fe\u63a5\u5c5e\u6027<\/span>&#xff08;\u7b26\u53f7\u5728\u94fe\u63a5\u9636\u6bb5\u7684\u884c\u4e3a&#xff09;\u4ee5\u53ca <span style=\"color:#fe2c24\">\u7b26\u53f7\u5f3a\u5f31\u6027<\/span>&#xff08;\u662f\u5426\u5141\u8bb8\u88ab\u8986\u76d6&#xff09;\u53ef\u4ee5\u5206\u4e3a <span style=\"color:#b95514\">\u5168\u5c40\u6807\u7b7e<\/span>\u3001<span style=\"color:#b95514\">\u5c40\u90e8\u6807\u7b7e<\/span>\u3001<span style=\"color:#b95514\">\u9759\u6001\u6807\u7b7e<\/span>\u3001<span style=\"color:#b95514\">\u5f31\u6807\u7b7e<\/span>\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"293\" src=\"2025-06-06ijiz4s2bmqe.png\" width=\"878\" \/><\/p>\n<h4 id=\"%E5%85%A8%E5%B1%80%E6%A0%87%E7%AD%BE\">\u5168\u5c40\u6807\u7b7e<\/h4>\n<p>\u4f7f\u7528 .global \u4f2a\u6307\u4ee4\u58f0\u660e\u6807\u7b7e\u4e3a\u5168\u5c40&#xff0c;\u5141\u8bb8\u5176\u4ed6\u6587\u4ef6\u5f15\u7528<\/p>\n<p>.global \u6807\u7b7e\u540d       &#064; \u58f0\u660e\u4e3a\u5168\u5c40\u6807\u7b7e<br \/>\n\u6807\u7b7e\u540d:              &#064; \u6807\u7b7e\u5b9a\u4e49<br \/>\n      \u6c47\u7f16\u6307\u4ee4 <\/p>\n<h5 id=\"%C2%A0%E5%AE%9A%E4%B9%89%E5%85%A8%E5%B1%80%E5%87%BD%E6%95%B0\">\u00a0\u5b9a\u4e49\u5168\u5c40\u51fd\u6570<\/h5>\n<p>&#064;\u5b9a\u4e49\u4e00\u4e2a\u5168\u5c40\u51fd\u6570 add_two<br \/>\n.global add_two     &#064; \u58f0\u660e\u4e3a\u5168\u5c40<br \/>\nadd_two:<br \/>\n    ADD R0, R0, R1  &#064; R0 &#061; R0 &#043; R1<br \/>\n    BX  LR          &#064; \u8fd4\u56de <\/p>\n<h5 id=\"%C2%A0%E5%AE%9A%E4%B9%89%E5%85%A8%E5%B1%80%E5%8F%98%E9%87%8F\">\u00a0\u5b9a\u4e49\u5168\u5c40\u53d8\u91cf<\/h5>\n<p>.data<br \/>\n.global g_counter   &#064; \u58f0\u660e\u5168\u5c40\u53d8\u91cf<br \/>\ng_counter:<br \/>\n    .word 0x0       &#064; \u521d\u59cb\u503c\u4e3a0 <\/p>\n<h5 id=\"%C2%A0%E4%BD%BF%E7%94%A8%E5%9C%BA%E6%99%AF\">\u00a0\u4f7f\u7528\u573a\u666f<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"389\" src=\"2025-06-06ekjfxcxv1dc.png\" width=\"932\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"536\" src=\"2025-06-064wzkrdmkqtt.png\" width=\"971\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"353\" src=\"2025-06-06ocfsy35jnow.png\" width=\"992\" \/><\/p>\n<h4 id=\"%E5%B1%80%E9%83%A8%E6%A0%87%E7%AD%BE\">\u5c40\u90e8\u6807\u7b7e<\/h4>\n<p>\u5728 ARM \u6c47\u7f16\u4e2d<span style=\"color:#fe2c24\">&#xff0c;\u5c40\u90e8\u6807\u7b7e<\/span>\u662f\u4ec5\u5728 <span style=\"color:#fe2c24\">\u5f53\u524d\u4ee3\u7801\u5757\u6216\u4f5c\u7528\u57df\u5185\u6709\u6548<\/span> \u7684\u4e34\u65f6\u7b26\u53f7&#xff0c;\u7528\u4e8e\u7b80\u5316\u5faa\u73af\u3001\u6761\u4ef6\u5206\u652f\u7b49\u63a7\u5236\u903b\u8f91&#xff0c;\u907f\u514d\u547d\u540d\u51b2\u7a81\u3002\u5c40\u90e8\u6807\u7b7e\u901a\u8fc7<span style=\"color:#fe2c24\"> \u6570\u5b57 &#043; \u5192\u53f7 <\/span>\u5b9a\u4e49&#xff0c;\u5e76\u901a\u8fc7 b&#xff08;backward&#xff09;\u548c f&#xff08;forward&#xff09; \u5f15\u7528&#xff1b;<\/p>\n<ul>\n<li>\n<p>\u5b9a\u4e49\u683c\u5f0f&#xff1a;\u4ee5\u6570\u5b57\u5f00\u5934&#xff0c;\u540e\u8ddf\u5192\u53f7&#xff08;\u5982 1:\u30012:&#xff09;&#xff1b;<\/p>\n<\/li>\n<li>\n<p>\u4f5c\u7528\u57df&#xff1a;\u4ec5\u5728\u5f53\u524d\u4ee3\u7801\u5757&#xff08;\u5982\u51fd\u6570\u6216\u5faa\u73af\u4f53&#xff09;\u5185\u6709\u6548&#xff1b;<\/p>\n<\/li>\n<\/ul>\n<h5 id=\"%E5%BC%95%E7%94%A8%E6%96%B9%E5%BC%8F\">\u5f15\u7528\u65b9\u5f0f<\/h5>\n<ul>\n<li>\n<p>1b&#xff1a;\u5411\u540e\u8df3\u8f6c&#xff08;Backward&#xff09;&#xff0c;\u6307\u5411 \u6700\u8fd1\u7684\u524d\u4e00\u4e2a 1: \u6807\u7b7e\u3002<\/p>\n<\/li>\n<li>\n<p>1f&#xff1a;\u5411\u524d\u8df3\u8f6c&#xff08;Forward&#xff09;&#xff0c;\u6307\u5411 \u6700\u8fd1\u7684\u540e\u4e00\u4e2a 1: \u6807\u7b7e<\/p>\n<\/li>\n<\/ul>\n<h5 id=\"%E5%BC%95%E7%94%A8%E8%A7%84%E5%88%99\">\u5f15\u7528\u89c4\u5219<\/h5>\n<ul>\n<li>\n<p>\u5c31\u8fd1\u539f\u5219&#xff1a;\u6839\u636e b\/f \u65b9\u5411&#xff0c;\u5bfb\u627e\u6700\u8fd1\u7684\u540c\u540d\u6807\u7b7e\u3002<\/p>\n<\/li>\n<li>\n<p>\u53ef\u91cd\u590d\u4f7f\u7528&#xff1a;\u540c\u4e00\u4ee3\u7801\u5757\u5185\u53ef\u591a\u6b21\u5b9a\u4e49\u540c\u540d\u5c40\u90e8\u6807\u7b7e&#xff08;\u5982 1:&#xff09;\u3002<\/p>\n<\/li>\n<\/ul>\n<h5 id=\"%E4%BD%BF%E7%94%A8%E5%9C%BA%E6%99%AF\">\u4f7f\u7528\u573a\u666f<\/h5>\n<p>.text<br \/>\n.global _start<\/p>\n<p>_start:<br \/>\n    MOV R0, #5        &#064; \u521d\u59cb\u5316 R0 &#061; 5<\/p>\n<p>loop_start:           &#064; \u5168\u5c40\u6807\u7b7e&#xff08;\u53ef\u9009&#xff09;<br \/>\n1:                    &#064; \u5c40\u90e8\u6807\u7b7e1&#xff08;\u5faa\u73af\u5165\u53e3&#xff09;<br \/>\n    SUBS R0, R0, #1   &#064; R0 &#061; R0 &#8211; 1&#xff0c;\u66f4\u65b0\u6807\u5fd7\u4f4d<br \/>\n    BEQ 1f            &#064; \u82e5 R0 &#061;&#061; 0&#xff0c;\u5411\u524d\u8df3\u8f6c\u5230\u5c40\u90e8\u6807\u7b7e1&#xff08;\u5faa\u73af\u51fa\u53e3&#xff09;<br \/>\n    B   1b            &#064; \u5426\u5219&#xff0c;\u5411\u540e\u8df3\u8f6c\u5230\u5c40\u90e8\u6807\u7b7e1&#xff08;\u7ee7\u7eed\u5faa\u73af&#xff09;<\/p>\n<p>1:                    &#064; \u5c40\u90e8\u6807\u7b7e1&#xff08;\u5faa\u73af\u51fa\u53e3&#xff09;<br \/>\n    MOV R7, #1        &#064; \u9000\u51fa\u7cfb\u7edf\u8c03\u7528\u53f7<br \/>\n    SVC #0            &#064; \u89e6\u53d1\u7cfb\u7edf\u8c03\u7528 <\/p>\n<h4 id=\"%E5%BC%B1%E6%A0%87%E7%AD%BE\">\u5f31\u6807\u7b7e<\/h4>\n<p>\u5728 ARM \u6c47\u7f16\u4e2d&#xff0c;<span style=\"color:#fe2c24\">\u5f31\u6807\u7b7e&#xff08;Weak Label&#xff09;<\/span> \u662f\u4e00\u79cd\u5141\u8bb8 <span style=\"color:#fe2c24\">\u540c\u540d\u7b26\u53f7\u8986\u76d6<\/span> \u7684\u6807\u7b7e\u7c7b\u578b\u3002\u5b83\u5e38\u7528\u4e8e\u5b9a\u4e49 \u9ed8\u8ba4\u5b9e\u73b0 \u6216 \u53ef\u9009\u529f\u80fd&#xff0c;\u5f53\u94fe\u63a5\u5668\u53d1\u73b0\u540c\u540d\u7684 \u5f3a\u6807\u7b7e&#xff08;Strong Label&#xff09; \u65f6&#xff0c;\u4f1a\u4f18\u5148\u4f7f\u7528\u5f3a\u6807\u7b7e\u7684\u5b9a\u4e49&#xff0c;\u5f31\u6807\u7b7e\u7684\u5b9a\u4e49\u5219\u88ab\u5ffd\u7565\u3002<\/p>\n<p>.weak \u6807\u7b7e\u540d       &#064; \u58f0\u660e\u4e3a\u5f31\u6807\u7b7e<br \/>\n\u6807\u7b7e\u540d:            &#064; \u6807\u7b7e\u5b9a\u4e49<br \/>\n      \u6c47\u7f16\u6307\u4ee4 <\/p>\n<h5 id=\"%C2%A0%E5%BC%B1%E6%A0%87%E7%AD%BE%E7%9A%84%E8%A6%86%E7%9B%96%E5%8E%9F%E5%88%99\">\u00a0\u5f31\u6807\u7b7e\u7684\u8986\u76d6\u539f\u5219<\/h5>\n<ul>\n<li>\n<p><span style=\"color:#fe2c24\">\u5f3a\u6807\u7b7e\u4f18\u5148<\/span>&#xff1a;\u82e5\u5b58\u5728\u540c\u540d\u7684\u5f3a\u6807\u7b7e&#xff08;\u901a\u8fc7 .global \u58f0\u660e&#xff09;&#xff0c;\u94fe\u63a5\u65f6\u4f7f\u7528\u5f3a\u6807\u7b7e\u7684\u5b9a\u4e49\u3002<\/p>\n<\/li>\n<li>\n<p><span style=\"color:#fe2c24\">\u65e0\u5f3a\u6807\u7b7e\u65f6\u751f\u6548<\/span>&#xff1a;\u82e5\u672a\u5b9a\u4e49\u5f3a\u6807\u7b7e&#xff0c;\u94fe\u63a5\u5668\u4f7f\u7528\u5f31\u6807\u7b7e\u7684\u5b9e\u73b0\u3002<\/p>\n<\/li>\n<li>\n<p><span style=\"color:#fe2c24\">\u5141\u8bb8\u591a\u4e2a\u5f31\u6807\u7b7e&#xff1a;<\/span>\u82e5\u591a\u4e2a\u5f31\u6807\u7b7e\u540c\u540d&#xff0c;\u94fe\u63a5\u5668\u968f\u673a\u9009\u62e9\u5176\u4e00&#xff08;\u901a\u5e38\u62a5\u8b66\u544a&#xff09;\u3002<\/p>\n<\/li>\n<\/ul>\n<h5 id=\"%E4%BD%BF%E7%94%A8%E5%9C%BA%E6%99%AF\">\u4f7f\u7528\u573a\u666f<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"478\" src=\"2025-06-06iiemabd3flr.png\" width=\"896\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"568\" src=\"2025-06-06o12iofq3zfm.png\" width=\"958\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"447\" src=\"2025-06-06pkszezorols.png\" width=\"864\" \/><\/p>\n<h4 id=\"%E9%9D%99%E6%80%81%E6%A0%87%E7%AD%BE\">\u9759\u6001\u6807\u7b7e<\/h4>\n<p>\u9759\u6001\u6807\u7b7e\u662f\u4ec5\u5728 \u5f53\u524d\u6c47\u7f16\u6587\u4ef6\u5185\u6709\u6548 \u7684\u7b26\u53f7&#xff0c;\u4e0d\u53ef\u88ab\u5176\u4ed6\u6587\u4ef6\u5f15\u7528\u3002\u5b83\u7684\u6838\u5fc3\u4f5c\u7528\u662f \u5c01\u88c5\u5185\u90e8\u5b9e\u73b0&#xff0c;\u907f\u514d\u547d\u540d\u51b2\u7a81&#xff0c;\u63d0\u5347\u4ee3\u7801\u6a21\u5757\u5316&#xff1b;<\/p>\n<h5 id=\"%E9%9D%99%E6%80%81%E6%A0%87%E7%AD%BE%E7%9A%84%E5%AE%9A%E4%B9%89\">\u9759\u6001\u6807\u7b7e\u7684\u5b9a\u4e49<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"519\" src=\"2025-06-06vym5qqt2cq2.png\" width=\"948\" \/><\/p>\n<h5 id=\"%C2%A0%E4%BD%BF%E7%94%A8%E5%9C%BA%E6%99%AF\">\u00a0\u4f7f\u7528\u573a\u666f<\/h5>\n<p>\u5728\u6587\u4ef6 utils.s \u4e2d\u5b9a\u4e49\u9759\u6001\u51fd\u6570 internal_add&#xff0c;\u4ec5\u5728\u6587\u4ef6\u5185\u90e8\u8c03\u7528&#xff1b;\u5728 main.s \u4e2d\u5c1d\u8bd5\u8c03\u7528\u8be5\u51fd\u6570\u5c06\u5931\u8d25\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"342\" src=\"2025-06-06co1lp5cvxh2.png\" width=\"920\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"363\" src=\"2025-06-06u0eilj1acce.png\" width=\"902\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"310\" src=\"2025-06-06w1ib1slmdw1.png\" width=\"945\" \/><\/p>\n<h3 id=\"%E4%BC%AA%E6%8C%87%E4%BB%A4\">\u4f2a\u6307\u4ee4<\/h3>\n<h4 id=\"NOP%E4%BC%AA%E6%8C%87%E4%BB%A4\">NOP\u4f2a\u6307\u4ee4<\/h4>\n<p>NOP(No Operation)\u4f2a\u6307\u4ee4 \u6838\u5fc3\u529f\u80fd 1. \u5b9e\u73b0\u5ef6\u65f6 2.\u00a0\u5bf9\u9f50\u6307\u4ee4\u5730\u5740<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"288\" src=\"2025-06-06ksgyhik2t3k.png\" width=\"579\" \/><\/p>\n<h4 id=\"ADR%E4%BC%AA%E6%8C%87%E4%BB%A4\">ADR\u4f2a\u6307\u4ee4<\/h4>\n<p><span style=\"color:#1c7892\">ADR\u4f2a\u6307\u4ee4 \u53ef\u4ee5\u83b7\u53d6\u7a0b\u5e8f\u7684\u8fd0\u884c\u5730\u5740&#xff0c;\u800c\u4e0d\u662f\u94fe\u63a5\u5730\u5740<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"288\" src=\"2025-06-06gksv04rvtp1.png\" width=\"961\" \/><\/p>\n<h4 id=\"%E2%80%8B%E7%BC%96%E8%BE%91\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"611\" src=\"2025-06-06sprl2bdku5d.png\" width=\"886\" \/><\/h4>\n<h4 id=\"ADRL%E4%BC%AA%E6%8C%87%E4%BB%A4\">ADRL\u4f2a\u6307\u4ee4<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"609\" src=\"2025-06-06rlpony50vet.png\" width=\"1025\" \/><\/p>\n<p><span style=\"color:#fe2c24\">\u6ce8\u610f&#xff1a; \u6807\u7b7e\u5730\u5740\u5fc5\u987b\u4e0eADRL\u6307\u4ee4\u4f4d\u4e8e\u540c\u4e00\u4ee3\u7801\u6bb5\u5185<\/span><\/p>\n<h4 id=\"LDR%E4%BC%AA%E6%8C%87%E4%BB%A4\">LDR\u4f2a\u6307\u4ee4<\/h4>\n<p><span style=\"color:#fe2c24\">LDR\u4f2a\u6307\u4ee4&#xff08;Pseudo-Instruction&#xff09;\u4e3b\u8981\u529f\u80fd\u5982\u4e0b&#xff1a;<\/span><\/p>\n<ul>\n<li>\u52a0\u8f7d32\u4f4d\u7acb\u5373\u6570\u5230\u5bc4\u5b58\u5668&#xff1b;<\/li>\n<li>\u52a0\u8f7d\u6807\u7b7e\u5730\u5740\u5230\u5bc4\u5b58\u5668&#xff1b;<\/li>\n<\/ul>\n<h5 id=\"LDR%E4%BC%AA%E6%8C%87%E4%BB%A4%E7%9A%84%E4%B8%A4%E7%A7%8D%E5%BD%A2%E5%BC%8F\">LDR\u4f2a\u6307\u4ee4\u7684\u4e24\u79cd\u5f62\u5f0f<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"327\" src=\"2025-06-06rgvhejund2v.png\" width=\"916\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"402\" src=\"2025-06-06h0hzyfmhugo.png\" width=\"937\" \/><\/p>\n<p>\u00a0\u6ce8\u610f&#xff1a;#offset\u662f<span style=\"color:#fe2c24\">\u5f53\u524d\u6307\u4ee4\u5730\u5740<\/span>&#xff08;PC&#xff09;\u5230 <span style=\"color:#fe2c24\">\u6587\u5b57\u6c60\u4e2d\u76ee\u6807\u6570\u636e\u5730\u5740 <\/span>\u7684\u504f\u79fb\u91cf<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"647\" src=\"2025-06-06ekcxei51lp0.png\" width=\"857\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"476\" src=\"2025-06-06mpdjrscamzu.png\" width=\"950\" \/><\/p>\n<h3 id=\"arm%E4%BC%AA%E6%93%8D%E4%BD%9C\">arm\u4f2a\u64cd\u4f5c<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"542\" src=\"2025-06-06s4kr0jqto23.png\" width=\"971\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"483\" src=\"2025-06-06u1nro0xulcs.png\" width=\"977\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"251\" src=\"2025-06-06s4oxtkpcasl.png\" width=\"898\" \/><\/p>\n<h3 id=\"arm%E5%BC%82%E5%B8%B8%E7%9A%84%E5%A4%84%E7%90%86%E6%B5%81%E7%A8%8B\">\u6c47\u7f16\u8c03\u7528c\u7a0b\u5e8f<\/h3>\n<p>\u6c47\u7f16\u8c03\u7528c\u7a0b\u5e8f\u6d41\u7a0b<br \/>\n&#064;1 c\u6587\u4ef6\u4e2d\u5b9e\u73b0c\u8bed\u8a00\u51fd\u6570<br \/>\n&#064;2 .extern\u4f2a\u64cd\u4f5c\u58f0\u660ec\u51fd\u6570 .extern my_add<br \/>\n&#064;3.1 \u6839\u636eATPCS\u6807\u51c6,R0,R1,R2,R3\u7528\u4e8e\u4f20\u9012\u53c2\u6570&#xff0c;\u7531\u4e8ec\u8bed\u8a00\u51fd\u6570\u7684\u53c2\u6570\u53ef\u80fd\u8d85\u8fc74\u4e2a<br \/>\n&#064;3.2  \u91c7\u7528\u4f2a\u6307\u4ee4ldr\u521d\u59cb\u5316\u6808\u7a7a\u95f4<br \/>\n&#064;4    \u4f20\u9012\u53c2\u6570 mov r0,#0x01<br \/>\n&#064;5    \u8c03\u7528\u51fd\u6570 BL\/B my_add<\/p>\n<p> &#064;start.s\u6587\u4ef6<br \/>\n .text<br \/>\n .global _start &#064;\u5c06_start\u58f0\u660e\u4e3a\u5168\u5c40\u7684<br \/>\n .extern my_add<br \/>\n _start:<br \/>\n &#064;\u5148\u521d\u59cb\u5316\u8981\u4f7f\u7528\u7684\u6808\u7a7a\u95f4<br \/>\n     ldr sp, &#061;0x400<br \/>\n     mov r0, #10<br \/>\n     mov r1, #20<br \/>\n     mov r2, #30<br \/>\n     mov r3, #40<br \/>\n     mov r5, #50<br \/>\n     push {r5}<br \/>\n bl my_add<br \/>\n loop:<br \/>\n     b loop<br \/>\n .data<br \/>\n .align 4 &#064;\u63092^4\u5b57\u8282\u5bf9\u9f50<br \/>\n.space 4096<br \/>\n .end<br \/>\n \/\/add.c\u6587\u4ef6<br \/>\n int my_add(int x, int y, int z, int m, int n)<br \/>\n {<br \/>\n     return x &#043; y &#043; z &#043; m &#043; n;<br \/>\n } <\/p>\n<h4 id=\"%C2%A0c%E8%B0%83%E7%94%A8%E6%B1%87%E7%BC%96%E7%A8%8B%E5%BA%8F\">\u00a0c\u8c03\u7528\u6c47\u7f16\u7a0b\u5e8f<\/h4>\n<p>1. \u5b9a\u4e49\u6c47\u7f16\u51fd\u6570my_add, \u6ce8\u610f\u4f20\u9012\u7684\u53c2\u6570\u3001\u8fd4\u56de\u503c\u6ee1\u8db3ATCPS\u89c4\u5219<br \/>\n2. \u6c47\u7f16\u6587\u4ef6\u4e2d\u901a\u8fc7.global \u628amy_add\u58f0\u660e\u4e3a\u5168\u5c40\u51fd\u6570<br \/>\n3. C\u8bed\u8a00\u4e2d\u901a\u8fc7extern\u58f0\u660e\u5916\u90e8\u51fd\u6570my_add<br \/>\n&#064;start.s\u6587\u4ef6<br \/>\n.text<br \/>\n.global _start<br \/>\n.extern main<br \/>\n_start:<br \/>\nldr sp,&#061;0x400<br \/>\nbl main<br \/>\n.data<br \/>\n.align 4<br \/>\n.space 4096<br \/>\nloop:<br \/>\nb loop<br \/>\n.end<br \/>\n\/\/main.c\u6587\u4ef6<br \/>\nextern int my_add(int x,int y,int z);<br \/>\nint main()<br \/>\n{<br \/>\nint ret&#061;my_add(10,20,30);<br \/>\nreturn ret;<br \/>\n}<br \/>\n&#064; add.s\u6587\u4ef6<br \/>\n.arm<br \/>\n.text<br \/>\n.global my_add<br \/>\nmy_add:<br \/>\nadd r5,r0,r1<br \/>\nadd r5,r5,r2<br \/>\nmov r0,r5 &#064;\u51fd\u6570\u7684\u8fd4\u56de\u503c\u901a\u8fc7R0\u4f20\u9012<br \/>\n.end <\/p>\n<h4 id=\"%E5%86%85%E8%81%94%E6%B1%87%E7%BC%96\">\u5185\u8054\u6c47\u7f16<\/h4>\n<p>\u5185\u8054\u6c47\u7f16\u5141\u8bb8\u5728\u9ad8\u7ea7\u8bed\u8a00&#xff08;\u5982C\/C&#043;&#043;&#xff09;\u4e2d\u76f4\u63a5\u5d4c\u5165\u6c47\u7f16\u4ee3\u7801&#xff0c;\u5185\u8054\u6c47\u7f16\u7684\u5e94\u7528\u573a\u666f&#xff1a;<\/p>\n<ul>\n<li>\u7a0b\u5e8f\u4e2d\u4f7f\u7528\u9971\u548c\u7b97\u672f\u8fd0\u7b97(Saturating Arithmetic)<\/li>\n<li>\u7a0b\u5e8f\u9700\u8981\u64cd\u4f5c\u534f\u5904\u7406\u5668&#xff1b;<\/li>\n<li>C\u7a0b\u5e8f\u4e2d\u9700\u8981\u64cd\u4f5c\u7a0b\u5e8f\u72b6\u6001\u5bc4\u5b58\u5668&#xff1b;<\/li>\n<\/ul>\n<h5 id=\"%E9%A5%B1%E5%92%8C%E7%AE%97%E6%9C%AF%E8%BF%90%E7%AE%97%EF%BC%9A\">\u9971\u548c\u7b97\u672f\u8fd0\u7b97&#xff1a;<\/h5>\n<p>\u9971\u548c\u7b97\u672f\u8fd0\u7b97\u662f\u4e00\u79cd\u5728\u6570\u503c\u8fd0\u7b97\u4e2d\u9632\u6b62\u6ea2\u51fa\u7684\u5904\u7406\u65b9\u5f0f\u3002\u5f53\u8fd0\u7b97\u7ed3\u679c\u8d85\u51fa\u6570\u636e\u7c7b\u578b\u7684\u8868\u793a\u8303\u56f4\u65f6&#xff0c;\u7ed3\u679c\u4f1a\u88ab\u201c\u9971\u548c\u201d\u5230\u8be5\u6570\u636e\u7c7b\u578b\u80fd\u8868\u793a\u7684\u6700\u5927\u503c\u6216\u6700\u5c0f\u503c&#xff1b;<\/p>\n<h5 id=\"%E5%8D%8F%E5%A4%84%E7%90%86%E5%99%A8\">\u534f\u5904\u7406\u5668<\/h5>\n<p>ARM\u67b6\u6784\u901a\u8fc7\u652f\u6301\u534f\u5904\u7406\u5668\u6765\u6269\u5c55\u5904\u7406\u5668\u7684\u529f\u80fd\u3002ARM\u67b6\u6784\u7684\u5904\u7406\u5668\u652f\u6301\u6700\u591a16\u4e2a\u534f\u5904\u7406\u5668&#xff0c;\u901a\u5e38\u79f0\u4e3aCP0~CP15&#xff1b;<\/p>\n<p>CP15,\u63d0\u4f9b\u7cfb\u7edf\u63a7\u5236\u529f\u80fd&#xff0c;\u4e3b\u8981\u7528\u4e8e\u914d\u7f6eMMU\u3001TLB\u548cCache\u3001\u5f02\u5e38\u5411\u91cf\u8868\u7684\u5730\u5740\u8bbe\u7f6e&#xff1b;<\/p>\n<h5 id=\"%E5%86%85%E8%81%94%E6%B1%87%E7%BC%96%E7%9A%84%E5%9F%BA%E6%9C%AC%E8%AF%AD%E6%B3%95\">\u5185\u8054\u6c47\u7f16\u7684\u57fa\u672c\u8bed\u6cd5<\/h5>\n<p>\/\/__asm__\u544a\u77e5\u7f16\u8bd1\u5668\u4e0d\u7528\u68c0\u67e5\u540e\u9762\u7684\u5185\u5bb9&#xff0c;\u53ea\u9700\u8981\u4ea4\u7ed9\u6c47\u7f16\u5668\u8fdb\u884c\u5904\u7406<br \/>\n__asm__ volatile (<br \/>\n    &#034;asm code&#034;<br \/>\n    : \u8f93\u51fa\u64cd\u4f5c\u6570\u5217\u8868<br \/>\n    : \u8f93\u5165\u64cd\u4f5c\u6570\u5217\u8868<br \/>\n    : \u7834\u574f\u5217\u8868(Clobber List)<br \/>\n); <\/p>\n<p>1. volatile \u5173\u952e\u5b57\u7981\u6b62\u7f16\u8bd1\u5668\u4f18\u5316\u5185\u8054\u6c47\u7f16\u4ee3\u7801&#xff1b;<\/p>\n<p>2. &#034;asm code&#034;\u4e3b\u8981\u7528\u4e8e\u586b\u5199\u6c47\u7f16\u4ee3\u7801&#xff0c;\u7528\\\\n\\\\t\u5206\u9694\u591a\u884c\u6c47\u7f16\u6307\u4ee4&#xff1b;<\/p>\n<p>__asm__ volatile (<br \/>\n    &#034;add r0, r1, r2\\\\n\\\\t&#034;<br \/>\n    &#034;add r0, r0, r3\\\\n\\\\t&#034;<br \/>\n    &#034;mov r0, r0&#034;<br \/>\n    : \/* \u8f93\u51fa\u64cd\u4f5c\u6570\u5217\u8868 *\/<br \/>\n    : \/* \u8f93\u5165\u64cd\u4f5c\u6570\u5217\u8868 *\/<br \/>\n    : \/* \u7834\u574f\u5217\u8868 *\/<br \/>\n); <\/p>\n<p>3. \u8f93\u51fa\u64cd\u4f5c\u6570\u5217\u8868(asm-&gt;c\/c&#043;&#043;)\u7528\u4e8e\u6307\u5b9a\u6c47\u7f16\u4ee3\u7801\u6267\u884c\u540e\u9700\u8981\u4f20\u9012\u56de C\/C&#043;&#043; \u53d8\u91cf\u7684\u7ed3\u679c&#xff0c;\u901a\u5e38\u53ea\u80fd\u4e3a\u53d8\u91cf&#xff1b;<\/p>\n<p>__asm__ volatile (<br \/>\n    &#034;mov r0, #0xFF&#034;<br \/>\n    :&#061;r(value)       \/\/ \u5c06r0\u7684\u503c\u5199\u5165value<br \/>\n    :                \/\/ \u8f93\u5165\u64cd\u4f5c\u6570\u5217\u8868<br \/>\n    :                \/\/ \u7834\u574f\u5217\u8868<br \/>\n); <\/p>\n<p>\u6bcf\u4e2a\u8f93\u51fa\u64cd\u4f5c\u6570\u7684\u683c\u5f0f\u4e3a <span style=\"color:#1a439c\">&#034;\u7ea6\u675f&#034;(\u53d8\u91cf)<\/span>&#xff0c;\u591a\u4e2a\u64cd\u4f5c\u6570\u7528\u9017\u53f7\u5206\u9694&#xff0c;\u5176\u4e2d\u7ea6\u675f\u7531\u4e24\u90e8\u5206\u6784\u6210&#xff0c;\u4e00\u90e8\u5206<span style=\"color:null\">\u4e3a<\/span><span style=\"color:#1c7892\">\u65b9\u5411\u4fee\u9970\u7b26<\/span>&#xff08;&#043;&#xff0c;&#061;&#xff0c;&amp;&#xff09;&#xff0c;\u65b9\u5411\u4fee\u9970\u7b26\u7528\u4e8e\u6307\u5b9a\u8be5\u64cd\u4f5c\u6570\u662f\u8f93\u5165\u8fd8\u662f\u8f93\u51fa&#xff0c;\u8f93\u51fa\u64cd\u4f5c\u6570\u5fc5\u987b\u5305\u542b<span style=\"color:#fe2c24\"> &#061;&#xff08;\u8868\u793a\u64cd\u4f5c\u6570\u4ec5\u7528\u4e8e\u8f93\u51fa\u7b49\u4ef7\u4e8e\u53ea\u5199<\/span>&#xff09;\u6216\u00a0 <span style=\"color:#fe2c24\">&#043;&#xff08;\u8868\u793a\u64cd\u4f5c\u6570\u65e2\u662f\u8f93\u5165\u53c8\u662f\u8f93\u51fa\u7b49\u4ef7\u4e8e\u53ef\u8bfb\u53ef\u5199&#xff09;<\/span>&#xff0c;<span style=\"color:#b95514\">&amp; \u5fc5\u987b\u901a\u8fc7 &#043;&amp; \u6216\u8005 &#061;&amp; \u8fdb\u884c\u4f7f\u7528<\/span>&#xff0c;\u53e6\u4e00\u90e8\u5206\u4e3a<span style=\"color:#1c7892\">\u7ea6\u675f\u7b26&#xff08;r&#xff0c;m&#xff09;<\/span>&#xff0c;\u7ea6\u675f\u7b26\u7528\u4e8e\u6307\u5b9a\u64cd\u4f5c\u6570\u7684\u5b58\u653e\u4f4d\u7f6e&#xff0c;\u5176\u4e2d <span style=\"color:#1c7331\">r<\/span><span style=\"color:#1c7331\"> \u7ea6\u675f&#xff08;\u5bc4\u5b58\u5668\u7ea6\u675f&#xff09;<\/span>\u8981\u6c42\u64cd\u4f5c\u6570\u5b58\u50a8\u5728\u901a\u7528\u5bc4\u5b58\u5668\u4e2d&#xff0c;<span style=\"color:#511b78\">m \u7ea6\u675f&#xff08;\u5185\u5b58\u7ea6\u675f&#xff09;<\/span>\u8981\u6c42\u64cd\u4f5c\u6570\u76f4\u63a5\u5b58\u50a8\u5728\u5185\u5b58\u5730\u5740\u4e2d&#xff0c;\u907f\u514d\u901a\u8fc7\u5bc4\u5b58\u5668\u4e2d\u8f6c&#xff1b;<\/p>\n<p>&#061;r :\u00a0<span style=\"color:#be191c\">\u8f93\u51fa\u5230\u901a\u7528\u5bc4\u5b58\u5668<\/span>&#xff0c;\u64cd\u4f5c\u6570\u4ec5\u7528\u4e8e\u5199\u5165<\/p>\n<p>__asm__ volatile (<br \/>\n        &#034;mov r0, #42&#034;<br \/>\n        : &#034;&#061;r&#034; (result)<br \/>\n); <\/p>\n<p>\u7ed3\u679c\u5199\u5165\u5bc4\u5b58\u5668 r0&#xff0c;\u518d\u4f20\u9012\u7ed9 result&#xff1b;<\/p>\n<p>4. \u8f93\u5165\u64cd\u4f5c\u6570\u5217\u8868(c\/c&#043;&#043; -&gt; asm)\u7528\u4e8ec\/c&#043;&#043;\u7a0b\u5e8f\u5411\u6c47\u7f16\u4ee3\u7801\u4f20\u9012\u6570\u636e&#xff0c;\u8f93\u5165\u64cd\u4f5c\u6570\u7684\u503c\u5728\u6c47\u7f16\u4ee3\u7801\u4e2d\u4e0d\u5e94\u88ab\u4fee\u6539&#xff0c;\u53ea\u80fd\u8bfb\u53d6&#xff0c;\u56e0\u6b64<span style=\"color:#fe2c24\">\u8f93\u5165\u64cd\u4f5c\u6570\u65e0\u9700\u65b9\u5411\u4fee\u9970\u7b26&#xff0c;\u5e38\u7528\u7ea6\u675f\u7b26 r&#xff08;<\/span>\u53d8\u91cf\u503c\u5b58\u5165\u901a\u7528\u5bc4\u5b58\u5668<span style=\"color:#fe2c24\">&#xff09;m&#xff08;<\/span>\u53d8\u91cf\u76f4\u63a5\u901a\u8fc7\u5185\u5b58\u5730\u5740\u8bbf\u95ee<span style=\"color:#fe2c24\">&#xff09;i&#xff08;<\/span>\u7acb\u5373\u6570&#xff08;\u6574\u6570\u5e38\u91cf&#xff09;<span style=\"color:#fe2c24\">&#xff09;&#xff0c;<\/span><span style=\"color:null\">\u6b64\u5916<\/span>\u7528\u4e8e\u5b9a\u4e49\u8f93\u5165\u7684\u53c2\u6570&#xff0c;\u53ef\u4ee5\u662f\u53d8\u91cf\u4e5f\u53ef\u4ee5\u662f\u7acb\u5373\u6570&#xff1b;<\/p>\n<p>int a &#061; 10, b &#061; 20;<br \/>\n__asm__ volatile (<br \/>\n    &#034;add r0, %1, %2\\\\n\\\\t&#034;   \/\/ %0, %1, &#8230;, %n\u8868\u793a\u5360\u4f4d\u7b26,\u5148\u6309\u7167\u8f93\u51fa\u64cd\u4f5c\u6570\u7684\u987a\u5e8f\u8fdb\u884c\u5f15\u7528<br \/>\n                           \/\/\u518d\u6309\u7167\u8f93\u5165\u64cd\u4f5c\u6570\u7684\u987a\u5e8f\u8fdb\u884c\u5f15\u7528<br \/>\n    &#034;mov %0, r0&#034;           \/\/ result &#061; r0<br \/>\n    : &#034;&#061;r&#034; (result)        \/\/ \u8f93\u51fa\u64cd\u4f5c\u6570: result -&gt; %0<br \/>\n    : &#034;r&#034; (a), &#034;r&#034; (b)     \/\/ \u8f93\u5165\u64cd\u4f5c\u6570&#xff1a;a -&gt; %1, b-&gt; %2<br \/>\n    : &#034;r0&#034;                 \/\/ \u7834\u73af\u5217\u8868\u7528\u4e8e\u544a\u77e5\u7f16\u8bd1\u5668\u54ea\u4e9b\u5bc4\u5b58\u5668\u6216\u8d44\u6e90\u88ab\u9690\u5f0f\u4fee\u6539<br \/>\n); <\/p>\n<p>5. \u7834\u574f\u5217\u8868\u544a\u77e5\u7f16\u8bd1\u5668\u54ea\u4e9b\u5bc4\u5b58\u5668\u6216\u8d44\u6e90\u88ab\u9690\u5f0f\u4fee\u6539&#xff0c;\u5e38\u89c1\u503c\u5982\u4e0b&#xff1a;<\/p>\n<ul>\n<li>\n<p>&#034;cc&#034;&#xff1a;\u6761\u4ef6\u7801\u5bc4\u5b58\u5668&#xff08;CPSR&#xff09;&#xff1b;<\/p>\n<\/li>\n<li>\n<p>&#034;memory&#034;&#xff1a;\u8868\u793a\u5185\u5b58\u88ab\u4fee\u6539&#xff08;\u5f3a\u5236\u5237\u65b0\u5185\u5b58\u7f13\u5b58&#xff09;&#xff1b;<\/p>\n<\/li>\n<li>\n<p>&#034;r0&#034;, &#034;r1&#034;&#xff1a;\u6307\u5b9a\u88ab\u7834\u574f\u7684\u5bc4\u5b58\u5668&#xff1b;<\/p>\n<\/li>\n<\/ul>\n<p>__asm__ volatile (<br \/>\n    &#034;mov r0, %1\\\\n\\\\t&#034;<br \/>\n    &#034;str r0, [%0]&#034;<br \/>\n    :<br \/>\n    : &#034;r&#034; (addr), &#034;r&#034; (value)<br \/>\n    : &#034;r0&#034;, &#034;memory&#034;  \/\/ \u58f0\u660e\u7834\u574f r0 \u548c memory<br \/>\n); <\/p>\n<\/p>\n<\/p>\n<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2.8k\u6b21\uff0c\u70b9\u8d5e18\u6b21\uff0c\u6536\u85cf47\u6b21\u3002ARM\u67b6\u6784<\/p>\n","protected":false},"author":2,"featured_media":41971,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[751,58,3870,188],"topic":[],"class_list":["post-41991","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-arm","tag-linux","tag-3870","tag-188"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>ARM\u67b6\u6784 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/41991.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ARM\u67b6\u6784 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2.8k\u6b21\uff0c\u70b9\u8d5e18\u6b21\uff0c\u6536\u85cf47\u6b21\u3002ARM\u67b6\u6784\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/41991.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-06-05T19:03:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250605190301-6841e9e56bb1c.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/41991.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/41991.html\",\"name\":\"ARM\u67b6\u6784 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-06-05T19:03:06+00:00\",\"dateModified\":\"2025-06-05T19:03:06+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/41991.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/41991.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/41991.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ARM\u67b6\u6784\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ARM\u67b6\u6784 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/41991.html","og_locale":"zh_CN","og_type":"article","og_title":"ARM\u67b6\u6784 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2.8k\u6b21\uff0c\u70b9\u8d5e18\u6b21\uff0c\u6536\u85cf47\u6b21\u3002ARM\u67b6\u6784","og_url":"https:\/\/www.wsisp.com\/helps\/41991.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-06-05T19:03:06+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250605190301-6841e9e56bb1c.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/41991.html","url":"https:\/\/www.wsisp.com\/helps\/41991.html","name":"ARM\u67b6\u6784 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-06-05T19:03:06+00:00","dateModified":"2025-06-05T19:03:06+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/41991.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/41991.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/41991.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"ARM\u67b6\u6784"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/41991","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=41991"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/41991\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/41971"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=41991"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=41991"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=41991"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=41991"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}