⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 opinion_04.html

📁 关于ARM汇编的非常好的教程
💻 HTML
字号:
<!doctype html public "-//W3C//DTD HTML 3.2//EN"><html><head><title>Opinion - Don't be over zealous</title><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><meta http-equiv="content-language" content="en" /><meta name="resource-type" content="document"><meta name="copyright" content="This document copyright 2001 by Richard Murray. Use for non-profit and education purposes explicitly granted."><meta name="author" content="Richard Murray"><meta name="rating" content="general"></head><!--  /assembler/opinion_04.html         --><!--                                     --><!--  (C) Copyright 2000 Richard Murray  --><!--  Designed by Richard Murray         --><!--  rmurray@heyrick.co.uk              --><!--                                     --><body bgcolor="#f0f0f0" text="#000000" link="#0022dd" vlink="#002288"><table border = "0" width="100%">  <tr>    <td align=center width=100>      <img src="arm3.gif" width=79 height=78 align = middle>    </td>    <td>      <h1 align="center"><font color="#800080">Opinion<br>Don't be over zealous</font></h1>    </td>    <td align=center width=100>      <img src="arm3.gif" width=79 height=78 align = middle>    </td></table><p>&nbsp;<p><font size = "1"><i>The views expressed in this article are purely the opinions of theauthor, Richard Murray, and should not be taken as truth, fact, or resembling anythingwhatsoever. So there.</i></font><p>&nbsp;<p>&nbsp;<p><div align="right">16th November 2000</div><p>&nbsp;<p>Nick Roberts (author of <a href="http://www.argonet.co.uk/users/tigger/programs/misc.html">ASM</a> <font color = "red" size = "-1">[EXTERNAL LINK]</font>) contacted me to tell me that &quot;<i>your entire argument is fatally flawed as far as timingis concerned, as your are not comparing the same thing in C and assembler.</i>&quot;.<p>That is more or less correct. As far as I was concerned, it was pretty much the same thing. Aroutine to convert strings to lowercase. One implemented using C's standard string handlingfacilities, the other knocked out in assembler.<p>Nick says &quot;<i>The assembler version scores primarily because the characters are convertedafter using 2 SWIs to set up conversion tables;</i>&quot; (though, note, it needs to set up thesesame tables each time, it could be further optimised).<br>He continues to say &quot;<i>in your C example, each character invokes the penalty of anAPCS-compliant procedure call, with all that implies as far as stack management isconcerned.</i>&quot;.<p>Nick informs me that the C compiler has a brain (my words, not his) and if I wrote lowercase()in the same method in C, the timing difference would go away. I've not tried this, but I suspectany differences would be minimal.<p>Which teaches us one important thing. Don't be over zealous. Provided you are not writing devicedrivers, FP code, intensive stuff that doesn't optimise well, or in an interpreted language; youwon't have an awful lot of need to code stuff in assembler. If something is being really slow,than maybe it is your implementation at fault?<br>The moral... Don't write everything in assembler because you can. By now you should know thatassembler is harder to maintain (that comment will probably get me some flames, but you gottaadmit that a sequence of opcodes is harder to follow than a line of code to generate apercentage, say), has a steeper learning curve, and while it offers a lot there is even more tolearn. I'm doing exactly that right now!<p>&nbsp;<p>Many thanks to Nick for writing to me.<p>&nbsp;<p><hr size = "3"><a href="index.html#16">Return to assembler index</a><hr size = "3"><address>Copyright &copy; 2000 Richard Murray</address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -