在我的一个家庭作业练习中,我被要求编写一个armv8程序来计算寄存器中的1位数。下面是我的实现:
.arch armv8-a // specifies the ARMv8 Architecture
.text
.align 2 // align to a multiple of 4 (1<<2)
.global start // arm64_emu.sh starts execution at start
.type start, %function
start:
movz x0, #8
movz x10, #0
movz x1, #0
loop:
rrx x0, x0 //rotate x0 and put the last bit into carry
bcs skip
add x10, x10, 1
skip:
cmp x1, #3
bne loop
svc 0 // dump registers
svc 999 // stop the emulation
.size start, .-start这个网站的一个很好的流程图很好地概述了我的程序:http://www.8085projects.info/Program21.html
但是,它给出了这个错误:
zl5022@enterprise:~$ arm64_emu.sh c.s
c.s: Assembler messages:
c.s:11: Error: unknown mnemonic `rrx' -- `rrx x0,x0'根据http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0204j/Cjacbgca.html的说法,rrx接受两个寄存器作为输入,那么我是不是遗漏了什么?
发布于 2020-11-12 06:44:27
ARMv8 rotate指令是ROR。
ROR Xd, Xm, #uimm
Rotate Right (immediate, 64-bit)https://stackoverflow.com/questions/48478159
复制相似问题