Professional Documents
Culture Documents
Assignment 1 MP
Assignment 1 MP
Assignment No. 1
Section BEE 5C
Submit hardcopy of assignment by 1st October. Copied assignments will be marked as zero.
Lcd is connected with PORTD (data pins) and PortB (Control pins). A switch is connected to PC0
When switch is pressed, display your name on LCD and when switch is not pressed, display your roll
number.
Task 2:
Find the accurate delay generated by following code for following clock frequencies:
a) 1mhz
b) 8mhz
c) 16mhz
Delay:
Loop1:
Ldi r17,130
Loop2:
Ldi r18,10
Loop 3:
Nop
Nop
Dec r18
Brne loop3
Dec r17
Brne loop2
Dec r16
Brne loop1
Ret
Task 3:
Explain why initializing stack is necessary when you use call instruction
Task 4:
Write a assembly language code to display your roll number on seven segment. E.g if Roll number is 013,
display 0, give delay, display 1, give delay, display 3.
Task 5:
Show the value of status register after highlighted instructions of following code:
Ldi r16,0x25
Add r16,r17
Sub r18,r17
Ldi r19,0x78
Sub r19,r17