假设我在高级语言中有一个while循环,看起来像:
当i>=0并且x<5,
x86中的汇编代码会是什么样子?我试过对while语句的条件部分使用cmp,但我不确定AND将如何实现。
感谢
;; assuming eax contains i, ecx contains x
myloop:
test eax, eax
jl exitloop ; i < 0
cmp ecx, 5
jge exitloop ; x >= 5
;; loop content goes here
jmp myloop
exitloop:
;; life continues after the loop