assembly - arm aarch64 程序集:如何通过 gcc 编译
问题描述
例如,汇编代码来自:https ://blog.csdn.net/novawl/article/details/5606777
但无法在 OrangePI(allwinner H5 core, aarch64) 上编译它,我的用法:
as convert.s -o convert.o
或者gcc -o convert.o convert.s
输出是:
convert.s: Assembler messages:
convert.s:28: Error: junk at end of line, first unrecognized character is `@'
convert.s:28: Error: junk at end of line, first unrecognized character is `,'
convert.s:30: Error: unknown mnemonic `stmdb' -- `stmdb sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,lr}'
convert.s:32: Error: operand 1 should be an integer register -- `mov r5,#0@r5=row counter'
convert.s:34: Error: operand 1 should be an integer register -- `ldr r6,[r1],#0x04@load 2-pixel i.e. 4-bytes'
convert.s:35: Error: operand 1 should be an integer register -- `ldr r9,[r1],#0x04@load 2-pixel i.e. 4-bytes'
convert.s:37: Error: operand 1 should be an integer register -- `mov r7,r6,lsr#8'
convert.s:38: Error: operand 1 should be an integer or stack pointer register -- `and r10,r9,#0xFF00FF00'
convert.s:39: Error: operand 1 should be an integer or stack pointer register -- `and r7,r7,#0x00FF00FF'
convert.s:41: Error: operand 1 should be a SIMD vector register -- `orr r7,r10,r7@r7=vvuu'
convert.s:42: Error: operand 1 should be an integer register -- `mov r8,r7,lsr#16@r8=vv'
convert.s:44: Error: operand 1 should be an integer or stack pointer register -- `and r6,r6,#0x00FF00FF'
convert.s:45: Error: operand 1 should be an integer or stack pointer register -- `and r9,r9,#0x00FF00FF'
convert.s:46: Error: operand 1 should be an integer register -- `mov r10,r6,lsr#16@the second byte for y'
convert.s:47: Error: operand 1 should be an integer register -- `mov r11,r9,lsr#16@the four byte for y'
convert.s:49: Error: operand 1 should be an integer or stack pointer register -- `and r6,r6,#0x000000FF@the first byte for y'
convert.s:50: Error: operand 1 should be an integer or stack pointer register -- `and r9,r9,#0xFF@the third byte for y'
.....................
看来代码完全错误...
解决方案
推荐阅读
- css - 如何反转 Bootstrap 4 进度条的动画?
- python - 数据帧中的间隔从第一行开始[python 3.6.0]
- javascript - 输入隐藏的天才聊天消息
- reactjs - 如何使用 jest 与 react 和 typescript 对 amcharts 进行单元测试?
- nginx - nginx 通过保留 headers 和 args 重写规则
- java - 通过 JAVA 自动生成 OPC UA 对象的实例(为 OPC UA 服务器的地址空间生成 XML)
- azure - Azure 上带有 webapi 的 Office-js 插件。获取错误
- jenkins - 如何使用bitbucket repo上的Json文件在Jenkinsfile.groovy中传递环境变量?
- javascript - 如何将 Typescript 与 Redux reducer 一起使用
- flutter - Flutter SqlBrite 未重建 streambuilder 列表