Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Microprocessor Systems and Interfacing

Assignment No. 1

Section BEE 5C

Deadline: 4th October 2021

Submit hardcopy of assignment by 1st October. Copied assignments will be marked as zero.

Task 1 (Code and Proteus Simulation):


Write an assembly language code for given task:

Lcd is connected with PORTD (data pins) and PortB (Control pins). A switch is connected to PC0

Write a code to perform following:

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:

Ldi r16, 240

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

Ldi r17, 0x78

Add r16,r17

Ldi r18, 0x28

Sub r18,r17

Ldi r19,0x78

Sub r19,r17

You might also like