简体   繁体   English

ADDNES和ADDSNE之间的区别

[英]Difference between ADDNES and ADDSNE

I am having trouble with understanding the difference between ADDNES and ADDSNE in ARM assembly. 我在理解ARM汇编中ADDNESADDSNE之间的区别时遇到了麻烦。 Please can someone help me, with some examples? 请有人帮我举一些例子吗?

They're different spellings for the same instruction. 它们是同一指令的不同拼写。 Clang, for example, can only handle the addnes format, but otool outputs addsne when disassembling it. 铛,例如,只能处理addnes格式,但otool输出addsne拆卸时。

Example: 例:

$ cat example.s
  addnes r0, r0, #1
$ clang -arch arm -c -o example.o example.s
$ otool -tV example.o 
example.o:
(__TEXT,__text) section
00000000    12900001    addsne  r0, r0, #1  @ 0x1

But if trying to use the addnse spelling in clang: 但是,如果尝试在clang中使用addnse拼写:

$ cat example.s
  addsne r0, r0, #1
$ clang -arch arm -c -o example.o example.s
example.s:1:bad instruction `addsne r0,r0,#1'
clang: error: assembler command failed with exit code 1 (use -v to see invocation)

it is one of those confusing things about arm assembly, all instructions have the condition field, some instructions have extra stuff like add and adds, where does the ne or eq or mi, etc go. 这是关于手臂组装的令人困惑的事情之一,所有指令都有条件字段,有些指令还有多余的东西,例如add和adds,ne或eq或mi等在哪里。 Before the s or after? 在s之前还是之后? add+ne+s addnes or add+s+ne. add + ne + s addnes或add + s + ne。 I would hope the tools take both, but it sounds from the accepted answer that it is worse than that, some take one some take the other. 我希望这些工具能够兼顾两者,但从公认的答案看来,这比这更糟,有人一拿再拿。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM