Question
Download Solution PDFWhat is the functionality of the program given below?
MOV A, #0
MOV R2, #10
AGAIN: ADD A, #03
DJNZ R2, AGAIN
MOV R5, A
Answer (Detailed Solution Below)
Detailed Solution
Download Solution PDFIt clears the accumulator and then adds the value 3 to the accumulator 10 times.
Explanation:
- The instruction MOV A, #0 clears the accumulator A by moving the value 0 into it.
- The instruction MOV R2, #10 moves the value 10 into register R2.
- The program enters a loop labeled "AGAIN."
- Within the loop, the instruction ADD A, #03 adds the value 3 to the accumulator A.
- The instruction DJNZ R2, AGAIN decrements the value of register R2 by 1 and jumps back to the label "AGAIN" if the result is not zero. This loop is executed 10 times since the initial value of R2 is 10.
- After the loop completes, the instruction MOV R5, A moves the value in the accumulator A to register R5.
- Therefore, the correct answer is:
- It clears the accumulator and then adds the value 3 to the accumulator 10 times.
Last updated on Jun 16, 2025
-> BSPHCL JE EE admit card 2025 has been released. Candidates can download admit card through application number and password.
-> The BSPHCL JE EE 2025 Exam will be conducted on June 20, 22, 24 to 30.
-> BSPHCL JE EE Notification has been released for 40 vacancies. However, the vacancies are increased to 113.
-> The selection process includes a CBT and document verification
Candidates who want a successful selection must refer to the BSPHCL JE EE Previous Year Papers to increase their chances of selection.