1
グローバル変数をロードし、それが-1に等しいかどうかをチェックしますが、私のコードで-1と等しいと認識されません。それはローカル変数との比較だけを渡します。アームアセンブリ内の符号付き整数の比較
//setting global variable
.data
.global top_m
top_m: .word -1
//loading global variable into x21
adrp x28, top_m
add x28, x28, :lo12:top_m
ldr x21, [x28]
//checking value of global variable, it does not branch to exit_stackEmpty
cmp x21, -1
b.eq exit_stackEmpty
//but if I compare with a local variable then it does branch
mov x23, -1
cmp x23, -1
b.eq exit_stackEmpty
EDIT:それはX21とX23
x21 0xffffffff 4294967295 //after loading -1 to x21
x23 0xffffffffffffffff -1 //after mov x23, -1
「.word」とはどのくらいの大きさですか。つまり、64ビット値を符号付きで読み込んでいますか? – Notlikethat