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
편집 : 그것은 X21 및 X23
x21 0xffffffff 4294967295 //after loading -1 to x21
x23 0xffffffffffffffff -1 //after mov x23, -1
'.word'의 크기가 얼마나 큽니까, 즉 서명 된 64 비트 값을로드하는 것입니까? – Notlikethat