![](/img/trans.png)
[英]Intel x86 (IA32) assembly decoder stub for custom encoder not working as expected
[英]cmp not working - Intel x86 (IA32) Assembly
我試圖在匯編中編寫一個簡單的代碼,使用cmp比較兩個值時遇到麻煩。 如果我的值不在65到90之間,我想跳到某個點。
cmp $65, (%ebx)
jl looping
cmp $90, (%ebx)
jg check_minusculas
運行gdb我有%ebx值是0x80490f9並使用:
x /1db 0x80490f9
我得到的(%ebx)是77。但是,當顯然77 <90時,程序將跳轉到check_minusculas。
我在這里想念什么?
謝謝!
您的問題是您忘記了使用大小說明符,並且在顯然要使用字節的情況下默認使用了很長的時間。 解決方案:使用cmpb
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.