Programming in Assembly Language
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.
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