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

Respuesta :

Answer:

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  

ACCESS MORE