Question: a = 0; i = 0; While (i < 10) do a = a + i; I = i + 1 endwhile Assembly - language

a = 0;

i = 0;

While (i < 10) do

a = a + i;

I = i + 1

endwhile

Assembly - language instructions:

Move eax,0 ; transfer the value 0 into the

; variable a

Move ebx,0 ; transfer the value 0 into the

; variable i

cmp ebx,10 ; compare the value of i with 10

Jl loop ; if i is less than 10 jump to the

; label loop.

Loop;

Add eax, ebx; add i to a.result is stored in a.

Add ebx, 1 ; add 1 to i.result is stored in i

Write in pseudocode, and a flowchart.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!