Alternative Code Template Statement Follows Execute E C G Evaluate E Jumpif 0 H Execute C Q37135976

An alternative code template for the while statement asfollows:

execute [while E do C]=

g: evaluate E

JUMPIF (0) H

Execute C

JUMP g

h:

Apply this code template to determine the object code forexecute [While n<=45 do n:=n+2]


Solution


Following is the handwritten solution to the above problem:

Accoroina ho aiven A evalua te m add m,2

Thanks

Accoroina ho aiven A evalua te m add m,2

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.