首页 > 解决方案 > 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'
.....................

看来代码完全错误...

标签: assemblyarmarm64

解决方案


推荐阅读