0% found this document useful (0 votes)
5 views

Microprocessors and Microcontrollers Lab DA2

The document contains assignments for a Microprocessors and Microcontrollers Lab, specifically focusing on programming in 8051 assembly language. It includes tasks such as toggling bits on ports, transferring data between input and output ports, and implementing digital circuits using the KEIL development tool. Each assignment provides code examples and instructions for assembly and simulation.

Uploaded by

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

Microprocessors and Microcontrollers Lab DA2

The document contains assignments for a Microprocessors and Microcontrollers Lab, specifically focusing on programming in 8051 assembly language. It includes tasks such as toggling bits on ports, transferring data between input and output ports, and implementing digital circuits using the KEIL development tool. Each assignment provides code examples and instructions for assembly and simulation.

Uploaded by

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

Microprocessors and Microcontrollers Lab

Assignment-1

23BKT0117

Rahul Pathak

Q1. Write and assemble a program to toggle all the bits of P0, P1, and P2 continuously by sending
55H and AAH to these ports. Put a time delay between the "on" and "off" states. Then using the
simulator, single-step through the program and examine the ports. Do not single-step through the
time delay call.

Code:

ORG 0000H

HERE:MOV P0,#55H

MOV P1,#55H

MOV P2,#55H

ACALL DELAY

MOV P0,#0AAH

MOV P1,#0AAH

MOV P2,#0H

ACALL DELAY

SJMP HERE

DELAY: MOV R1,#04H

BACK: MOV R2,#20H

AGAIN: DJNZ R2,AGAIN

DJNZ R1, BACK

RET

END
Output:

Q2. Write and assemble a program to get the Data from Port P1 and Send it to Port P2,Note:P1 as
input Port and P2 as Output Port.

Code:

ORG 000H

MOV A,#00H

MOV P1,A

START:

MOV A,P1

MOV P2,A

SJMP START

END
Output:

Q3. Write and assemble a program in 8051 to implement the given digital circuit using KEIL
development tool.

Code:

ORG 0000H

CLR ACC.0

CLR ACC.1

CLR ACC.2
CLR ACC.3

MOV C,ACC.0

ANL C.ACC.1

ORL C,ACC.2

CPL C

MOV ACC.7.C

MOV C,ACC.2

CPL C

ANL C,ACC.3

CPL C

ANL C.ACC.7

HALT: SJMP HALT

END

Output:
Q4. Write and assemble a program in 8051 to implement the given digital circuit using KEIL
development tool.

Code:

ORG 0000H

SETB ACC.0

SETB ACC.1

MOV C,ACC.1

CPL C

ANL C,ACC.0

MOV ACC.2,C

MOV C,ACC.0

ANL C,ACC.1

MOV ACC.3,C

H:SJMP H

END
Output:

23BKT0117

Rahul Pathak

You might also like