Micro Final Sample questions

What will be the content of R16 after the execution of the following instructions? LDI R16, 0x70 LDI R17, 0x40 ADD R16, R17
0x11
0xB1
0xB0
0xA0
The instruction LDS R16,0x300 means:
Load the number 300Hex to register R16
Load the memory location 0x300 with the content of register R16
Load the register R16 with the content of the memory location 0x300
Suppose that :  In the memory cell with address 0x300 is the number 0x05,  In the memory cell with address 0x301 is the number 0x06, After the execution of the following instructions, LDS R16, 0x300 LDS R17, 0x301 ADD R16, R17 STS 0x302, R16 the content of the memory cell with address 0x302 will be
0x601
0x60
0x0B
0xB0
Port B is programmed as input. Write a program to get data from Port B and send it to PORTC continuously
Again: IN R16, PINB OUT PORTC, R16 JMP Again
LDI R16, PORTB OUT PORTC, R16 JMP Again
Write a program that adds 0x12 to the content of location 0x500 and stores the result to location 0x501.
LDI R20, 0x12 LDS R21, 0x500 ADD R21, R20 STS 0x501, R21
LDS R20, 0x12 LDS R21, 0x500 ADD R21, R20 STS 0x501, R21
LDI R20, 0x12 LDI R21, 0x500 ADD R21, R20 STS 0x501, R21
LDI R20, 0x12 LDI R21, 0x500 ADD R21, R20 STS R21,0x500
Harvard architecture uses the same address and data busses to fetch both code and data
True
False
Assume that RAM location 0x400 has the value 0x33. Write a program to find the sum of location 0x400 of RAM and the constant 0x50. At the end of the program, R21 should contain the sum.
LDS R2, 0x400 LDI R21, 0x50 ADD R21,R2
LDS 0x400, R2 LDI 0x55, r21 ADD R21, R2
There are given two Unsigned Values, VAL_1 and VAL_2. Place the VAL_1 to R20, and VAL_2 to R21 Write a program to find the grater of the two values, and place it in R23
.EQU VAL_1 = .. .EQU VAL_2 = … LDI R20, VAL1 LDI R21, VAL_2 CP R20, R21 BRLO R21_High MOV R23, R20 RJMP NEXT R1_High: MOV R23, R21 NEXT: ------- ---------
.EQU VAL_1 = …. .EQU VAL_2 = …. LDI R20, VAL1 LDI R21, VAL_2 CP R20, R21 BRLO R21_High MOV R23, R20 R1_High: MOV R23, R21 NEXT: ------- ---------
Find the content of R20 after the execution of the following code: LDI R20, 0x00 LDI R21, 0x99 LDI R22, 0xFF OR R20, R21 EOR R20, R22
0x99
)0x66
0xFF
0xFF
What is the value of R20 after the execution of the following: LDI R20, 0x40 SEC ; carry flag C = 1 ROL R20 ; rotate left SWAP R20
0x18
0x81
0x88
Code a simple program to send 0x99 to Port B
LDI R16, 0xFF OUT DDRB, R16 LDI R16, 0x99 OUT PORTB, R16
LDI R16, 0x00 OUT DDRD, R16 LDI R16, 0x99 OUT PORTB, R16
Write a program to toggle PB7 continuously
SBI DDRB, 7 L1: SBI PORTB, 7 NOP CBI PORTB, 7 RJMP L1
) CBI DDRB, 7 L1: CBI PORTB, 7 NOP CBI PORTB, 7 RJMP L1
Write a program to monitor PB5 bit. When it is LOW, send 0x55 to Port D
LDI R16,0xFF OUT DDRD, R16 CBI DDRB, 5 Wait: SBIC PINB, 5 RJMP wait LDI R16, 0x55 OUT PORTD, R16
B LDI R16,0xFF OUT DDRD R16 CBI DDRB, 5 Wait: SBIC PORTB, 5 RJMP wait LDI R16, 0x55 OUT PORTD, R16
LDI R16,0xFF OUT DDRD, R16 CBI DDRB, 5 Wait: SBIC PORTB, 5 RJMP wait LDI R16, 0x55 OUT PORTD, R16
LDI R16,0xFF OUT DDRD, R16 CBI DDRB, 5 Wait: SBIS PINB, 5 RJMP wait LDI R16, 0x55 OUT PORTD, R16
Write a program to monitor PORTB continuously, for the value 0x63. It should stop monitoring only if PORTB = 0x63
LDI R20, 0x00 OUT DDRB, R20 LDI R21, 0x63 Again: IN R20, PINB CP R20, R21 BRNE Again
LDI R20, 0xFF OUT DDRB, R20 LDI R21, 0x63 Again: IN R20, PINB CP R20, R21 BRNE Again
LDI R20, 0x00 OUT DDRB, R20 LDS R21, 0x63 AGAIN: IN R20,PINB CP R20, R21 BRNE AGAIN
The following code reads from the flash memory: LDI R30,0x80 LDI R31,0x00 LPM R18,Z
Reads from the low byte of word 0x20
Reads from the low byte of Word 0x40
Reads from the low byte of word 0x80
{"name":"Micro Final Sample questions", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"What will be the content of R16 after the execution of the following instructions? LDI R16, 0x70 LDI R17, 0x40 ADD R16, R17, The instruction LDS R16,0x300 means:, Suppose that :  In the memory cell with address 0x300 is the number 0x05,  In the memory cell with address 0x301 is the number 0x06, After the execution of the following instructions, LDS R16, 0x300 LDS R17, 0x301 ADD R16, R17 STS 0x302, R16 the content of the memory cell with address 0x302 will be","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}
Make your own Survey
- it's free to start.