0

次のような高水準言語の while ループがあるとします。

i >= 0 かつ x < 5 の間、

x86 のアセンブリ コードはどのようになりますか? while 文の条件部分に cmp を使おうと考えてみたのですが、AND がどのように実装されるのかわかりません。

ありがとう

4

1 に答える 1

1
    ;; 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
于 2013-07-25T21:31:35.317 に答える