Ask Question

What will be the final value of EAX in this example? mov eax, 0 mov ecx, 10; outer loop counter L1: mov eax, 3 mov ecx, 5; inner loop counter L2: add eax, 5 loop L2; repeat inner loop loop L1; repeat outer loop

+5
Answers (1)
  1. 21 November, 21:07
    0
    eax = 28.

    Explanation:

    The given code in question will not end. The following code is correct version. eax will be 28 in both scenarios.

    mov eax, 0; Unnecessary as next instruction changes this

    L1: push ecx; This and the pop below solves the problem

    mov eax, 3

    mov ecx, 5

    L2: add eax, 5

    loop L2

    pop ecx

    loop L1; ECX is decremented first
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “What will be the final value of EAX in this example? mov eax, 0 mov ecx, 10; outer loop counter L1: mov eax, 3 mov ecx, 5; inner loop ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers