arm aarch64汇编:如何通过gcc编译

时间:2018-08-19 09:37:02

标签: assembly arm arm64

例如,来自https://blog.csdn.net/novawl/article/details/5606777

的汇编代码

但是不能在OrangePI(allwinner H5核心,aarch64)上编译它,我的用法是

as convert.s -o convert.ogcc -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'
.....................

似乎代码完全错误...

0 个答案:

没有答案