Microprocessors and Microcontrollers Lab DA2
Microprocessors and Microcontrollers Lab DA2
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
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
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