in The AVR, Looping Action With The "BRNE Target" Instruction Is Limited
in The AVR, Looping Action With The "BRNE Target" Instruction Is Limited
in The AVR, Looping Action With The "BRNE Target" Instruction Is Limited
PROBLEMS
SECTION 3.1: BRANCH INSTRUCTIONS AND LOOPING
1. In the AVR, looping action with the "BRNE target" instruction is limited
to iterations.
2. If a conditional branch is not taken, what is the next instruction to be
executed?
3. In calculating the target address for a branch, a displacement is added to the
contents of register __ _
4. The mnemonic RJMP stands for_ __ and it is a(n) _-byte instruction.
5. The JMP instruction is a(n) _-byte instruction.
6. What is the advantage of using RJMP over JMP?
7. True or false. The target of a BRNE can be anywhere in the 4M word address
space.
8. True or false. All AVR branch instructions can branch to anywhere in the 4M
word address space.
9. Which of the following instructions is (are) 2-byte instructions.
(a) BREQ (b) BRSH (c) JMP (d) RJMP
10. Dissect the RJMP instruction, indicating how many bits are used for the
operand and the opcode, and indicate how far it can branch.
11. True or false. All conditional branches are 2-byte instructions.
12. Show code for a nested loop to perform an action 1,000 times.
13. Show code for a nested loop to perform an action 100,000 times.
14. Find the number of times the following loop is performed:
LDI R20, 200
BACK: LOI
HERE: DEC
BRNE
DEC
R21, 100
R21
HERE
R20
BRNE BACK
15. The target address ofa BRNE is backward if the relative address of the opcode
1s ___ (negative, positive).
16. The target address of a BRNE is forward if the relative address of the opcode
1s ____ (negative, positive).