Question: A student was asked to write a Pep/9 assembly code implementation of the following pseudocode. counter 0 Input (N) Do { if N is even

A student was asked to write a Pep/9 assembly code implementation of the following pseudocode. counter 0 Input (N) Do { if N is even NaN/2 else N=N*3+1 Counter = Counter+1 } until N = 1 Output (Counter) Identify the logical errors in the following submission Deci N,d Ldwx 0,i counter Ldwa N, d Anda 2,i Breq Even Adda N, d Adda N, s Adda 1,i Br Next Asra Addx 1,i Cpwa 1,i Brne Loop Stwx -2, s Deco -2, s Loop: Even: Next: N: block 2 end
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
