2,227 views
1 votes
1 votes
Consider the following program segment used to execute on a hypothetical processor. Consider all the registers are of 16 bit size

I1 MOV CX,0005 ; CX ← 0005

I2 MOV BX,OFF7H ; BX ← OFF7H

I3 MOV AX,OBCAH ; AX ← OBCAH

I4 OR BX,AX ; BX ← BX (OR) AX

I5 AND DX,AX ; DX ← DX (AND) AX

I6 LOOP I3 ; LOOP till CX = 0

Processor clock frequency is 1 MHz. In which data transfer operations takes 6 cycles, data manipulation operations takes 4 cycles and transfer of control operations takes 2 cycles to execute. How much time is required to execute the program on a above CPU?

1 Answer

0 votes
0 votes

92 is correct one as decrement and checking is performed simultaneously at the end.

In the iteration when the CX value is 1 which is its 5th iteration it decrements value of CX to 0 and loop is executed until CX value is 0, so it is matched and loop will not be executed.

Hence loop executed exactly 5 times.

Related questions

3 votes
3 votes
1 answer
2
admin asked Apr 1, 2020
1,589 views
Match list $I$ with List $II$ and select the correct answer using the codes given below the lists :$${\begin{array}{|c|c|c|}\hline&\textbf{List I} & & \textbf{List II}\\\...