c4droid之前试过貌似不让汇编跳转,如:
#include <stdio.h>
#include <sys/time.h>
int main()
{
struct timeval beg,end;
gettimeofday(&beg,NULL);
asm(
"mov r1,#1\n"
"movs r2,#1\n"
"add r2,r2,#1\n"
"cmp r2,r1,lsl #31\n"
"bne -4"
);
gettimeofday(&end,NULL);
int s=end.tv_sec-beg.tv_sec;
int ss=end.tv_usec-beg.tv_usec;
printf("%ds:",s);
printf("%dμs ",ss);
}
bne部分直接跪了,变成了其他指令导致运行出错,但是修改了又能运行了