Engineering Questions with Answers - Multiple Choice Questions
Home » MCQs » Computer Science » MCQs on Jump, Loop and Call Instructions
MCQs on Jump, Loop and Call Instructions
Which of the following is correct about BRNE instruction in avr microcontrollers?
a) it is used to compare two registers
b) it is used to compare two values
c) it is used to check the zero flag
d) it is used to jump to the given mentioned label when the zero flag accounts to 0
View Answer
Answer: d
Explanation: BRNE label instruction is used to jump to that particular address denoted by label if condition (Z=0) is true or satisfied. If the condition is not satisfied then it will execute the next immediate instruction.
How many times is this loop going to get executed?
LDI R20, 10 now: LDI R21, 70 DEC R21 BRNE now OUT PORTB, R20
a) 10
b) 70
c) 700
d) none of the mentioned
View Answer
Answer: b
Explanation: As the R21 register is loaded with 70, so to make it zero it needs to be decremented 70 times then only the OUT instruction will be executed so this loop repeats 70 times.
Which of the below mentioned are not the conditional jumps?
a) BRLO
b) BRMI
c) BRVC
d) None of the mentioned
View Answer
Answer: d
Explanation: BRLO is used to branch if C=1, BRMI is used when N=1 and BRVC are used when V=0, so all are the conditional jumps.
What is the relation between the target and the relative address?
a) target address= PC address + relative address
b) target address= relation address*2
c) relative address= PC address + target address
d) none of the mentioned
View Answer
Answer: a
Explanation: Target address can be calculated by calculating the sum of the address of the program counter and the relative address.
In the JMP instruction, how many bits are there for determining the target address?
a) 16
b) 32
c) 22
d) 10
View Answer
Answer: c
Explanation: In the JMP instruction of 4 bytes space, 22 bits are there for determining the target address and the other 10 are for the op code verification.
Which of the following statements are correct?
a) relative address of RJMP instruction varies from 000-fffH
b) target address of JMP instruction varies from 000000-3fffffH
c) IJMP instruction jumps to that address that points to by the Z register
d) all of the mentioned
View Answer
Answer: d
Explanation: The relative address of the RJMP instruction varies from 000-fffH. The target address of the JMP instruction varies from 000000-3fffffH. IJMP instruction is used to jump at that particular address pointed to by the Z register. So all are the correct statements.
Which of the following is used to represent the last RAM address?
a) MEM
b) LASTRAM
c) RAMEND
d) None of the mentioned
View Answer
Answer: c
Explanation: RAMEND is a micro used to represent the last RAM address. In AVR, Stack Pointer is initialized on top of the stack i.e. last address of RAM.
Which of the following statements are correct about the RCALL instruction?
a) it is a 2 byte instruction
b) it is a 4 byte instruction
c) it is a 16 byte instruction
d) none of the mentioned
View Answer
Answer: a
Explanation: RCALL instruction is used to go to the target address in the memory from -2048 to 2047.
On power on SP points to the address?
a) ffffH
b) fffH
c) 00h
d) all of the mentioned
View Answer
Answer: c
Explanation: On power on SP register points to the 00H address.
Which of the following statements is true?
a) CALL instruction is used to transfer control anywhere in the 4M memory space
b) PUSH instruction is used to take out the value from the stack into some register
c) POP instruction is used to jump to any location
d) RCALL is a 4 byte instruction
View Answer
Answer: a
Explanation: CALL instruction is used to transfer control anywhere in the 4M memory space available in the AVR.