Digital Assignment Microprocessor and Microcontroller EEE4001 Utkarsh Ghadge 15BEE0197

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

DIGITAL ASSIGNMENT

MICROPROCESSOR AND MICROCONTROLLER


EEE4001
UTKARSH GHADGE
15BEE0197
_________________________________________________________________________________________

Q1 Assume that the INT0 pin is connected to a switch that is normally high. Whenever it goes low, it
should turn on an LED. The LED is connected to P2.3 and is normally off. When it is turned on it should stay
on for a fraction of second. As long as the switch is pressed low, the LED should stay on. Write an 8051
assembly program with the above specifications.

ORG 0000H

LJMP MAIN ;bypass interrupt vector table

ORG 0003H

SETB P2.3

MOV R3,#255

BACK: DJNZ R3,BACK

CLR P2.3

RETI

;main program for initialization

ORG 30H

MAIN: MOV IE,#10000100B

HERE: SJMP HERE

END
2. Write an ARM assembly program to solve the following

ANS

area,comparison,code,read only

ldr, r0=OX

ldr, r1=OX

cmp r0,r1

sub (gt) r0,r0,r1

sub (Lt) r1,r1,r0

end

You might also like