0% found this document useful (0 votes)
19 views2 pages

Programming in Assembly Language

This document describes an assembly language program that controls two LEDs connected to an MCU based on input from two switches. The program contains code segments that: 1) Clear LED1 if the first switch is pressed 2) Clear LED2 if the second switch is pressed 3) Continuously toggle both LEDs in a loop

Uploaded by

rgvrfb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views2 pages

Programming in Assembly Language

This document describes an assembly language program that controls two LEDs connected to an MCU based on input from two switches. The program contains code segments that: 1) Clear LED1 if the first switch is pressed 2) Clear LED2 if the second switch is pressed 3) Continuously toggle both LEDs in a loop

Uploaded by

rgvrfb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Programming in Assembly language

1. Two switch are connected to pins P3.2 & P3.3 , when switch is pressed ,
the corresponding LED goes low, Write a program to assembly

(a) One LED connected to port 1.4, if the first switch is pressed, LED1 will
glow.
(b) Another LED connected to port 1.5, if the second switch is pressed, LED
2will glow.

LED1 EQU 94H \\LED1


LED2 EQU 95H \\LED2
IE EQU 0A8H

ORG 0000H
LJMP HERE
ORG 0030H

ORG 0003H
CLR LED1
MOV R0, #09H
LOOP3: MOV R1, #0FFH
LOOP2: MOV R2, #0FFH
LOOP4: DJNZ R2, LOOP4
DJNZ R1, LOOP2
DJNZ R0, LOOP3
RETI

ORG 0013H
CLR LED2
MOV R0, #09H
LOOP13: MOV R1, #0FFH
LOOP12: MOV R2, #0FFH
LOOP14: DJNZ R2, LOOP14
DJNZ R1, LOOP12
DJNZ R0, LOOP13
RETI
ORG 0030H
HERE: MOV IE, #85H
L1: SETB LED1
SETB LED2
SJMP L1
END

You might also like