[問題] mac assembly orz...
__asm__ __volatile__("sync\n"
"0: ldrex %0,0,%2\n\t" /* load w/ reservation */
"cmpw %0,%4\n\t" /* compare against comparand */
"bne- 1f\n\t" /* exit if not same */
"strex. %3,0,%2\n\t" /* store new_value */
"bne- 0b\n" /* retry if reservation lost */
"1: sync" /* the exit */
: "=&r"(result), "=m"(* (int32_t*) ptr)
: "r"(ptr), "r"(value), "r"(comparand), "m"(* (int32_t*) ptr)
: "cr0");
有沒有高手可以幫我把它翻成C語言
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.134.29.68
→
11/27 18:03, , 1F
11/27 18:03, 1F
→
11/27 18:15, , 2F
11/27 18:15, 2F
推
11/27 22:47, , 3F
11/27 22:47, 3F
推
11/28 00:52, , 4F
11/28 00:52, 4F
推
11/28 02:01, , 5F
11/28 02:01, 5F
→
11/28 02:01, , 6F
11/28 02:01, 6F
→
11/28 11:14, , 7F
11/28 11:14, 7F
推
11/28 12:40, , 8F
11/28 12:40, 8F
推
11/29 14:21, , 9F
11/29 14:21, 9F
ASM 近期熱門文章
PTT數位生活區 即時熱門文章