像网站上这种详细的编码
Google 上也没有找到这么详细的
这个工具可以帮你转换汇编代码,正反都可以。不过这个工具似乎把 Source Reg 和 Destination Reg 搞反了。例如 mov %rax,%rdi 的机器码是 48 89 c7,而在这个工具里,输入 mov %rax,%rdi 得到的结果是 48 89 f8,输入 mov %rdi,%rax 得到的结果才是 48 89 c7。
另外寄存器以 r 开头的是 x86-64(或 x64)架构,而不是 x86 架构,详情见下图
不存在反不反的问题,单纯 AT&T 和微软的规范不一样
Thanks for the clarification. This page might be helpful for your reference:
https://staffwww.fullcoll.edu/aclifton/courses/cs241/syntax.html
ps: there is one thing I want to correct, it’s not that AT&T vs Microsoft, it’s that AT&T vs Intel
使用 gcc -c example.s
,lab3 的附录 B 里有讲