1. Write a program to transfer 09 bytes of data from external RAM
address location 9000H to internal RAM address
location 50H.
MOV DPTR, #9000H
MOV R0, #50H
MOV R2, #09H
MOVX A, @DPTR
MOV @R0, A
INC DPTR
INC R0
DJNZ R2, L1
HERE: S J M P HERE
2. Write a program to add list of 10 no.s stored from the internal RAM
address location 60H. Store the result in the memory location 80H.
MOV R0, #60H
MOV R1, #80H
MOV R2, #0AH MOVX A, #00H MOV R3,#00H
L2: ADD A, @R0 JNC L1
INC R3
L1: INC R0
DJNZ R2, L2
MOV @R1, A
INC R1
MOV A, @R3
MOV @R1, A
HERE: S J MP HERE
3. Write a program to exchange 10 bytes from 50H to 60H.
MOV R0, #50H
MOV R1, #60H
MOV R2, #0AH
L1: MOV A, @R0
XCH A, @R0
MOV @R0, A
INC R0
INC R1
DJNZ R2, L1
HERE: SJMP HERE
4. Write a program to move 10 bytes of data from internal ROM
0500H to Internal RAM 50H.
MOV DPTR, #0500H
MOV R0, # 50H
MOV R2, #0AH
L1: MOVX A, @DPTR
MOV @R0, A
INC DPTR
INC R0
DJNZ R2, L1
HERE: SJMP HERE
5.
6.
7. Develop an Assembly Language Program to find whether a given
byte is available in the given sequence or not. If it is available,
write FF in R3, otherwise write 00 in R3.
MOV R0, #20H
MOV R3, #00H
MOV R1, #05H
BAC K MOV A, @R0
CJNE A, #45H, AHEAD
MOV R3, #0FFH
INC R0
DJNZ R1, BACK
AHEAD
HERE S J MP HERE
8. Develop an assembly language program to
find average of two eight bit numbers
MOV F0 (B), #02H
MOV A,R0
ADD A,R1
DIV AB MOV
R2, A SJMP
HERE
HERE:
9. Develop an assembly language program to count the number of 1s and 0s in
given byte of data.
MOV A, #25H
MOV R0, #80H
MOV R1, #00H
MOV R2, #00H
MOV R3, #08H
CLR C
UP: RRC A
JNC DOWN
INC R1
SJMP NEXT
DOWN: INC R2
NEXT: DJNZ R3, UP
MOV A, R1
MOV @R0, A
INC R0
MOV A, R2
MOV @R0, A
HERE: SJMP HERE
10. Develop a program by using 8051 instructions to multiply two 8-
bit numbers present at memory locations 9000H and 9001H and
store the result at the memory locations 9050H and 9051H.
MOV DPTR, #9000
MOVX A, @DPTR
MOV 0F0, A
MOV DPTR, #9001
MOVX A, @DPTR
MUL AB
MOV DPTR, #9050
MOVX @DPTR, A INC
DPTR
MOV A, 0F0H MOVX
@DPTR, A
SJMP HERE
HERE:
11. Develop a program by using 8051 instructions to divide an 8- bit
number present at memory location 8000H with number present at
address 8001H and store the quotient at the memory location 8020
and remainder at memory address 8021H.
MOV
MOVX
MOV
INC
MOVX
MOV
MOV
DIV
MOV
MOVX
INC
MOV
MOVX
SJMP
DPTR, #8000H
A, @DPTR
R0, A
DPTR
A, @DPTR 0F0,
A
A, R0 AB
DPTR, #8020H
@DPTR, A DPTR
A, 0F0H
@DPTR, A HERE
HERE:
12. Develop an assembly language program to find Odd & Even numbers
from the given series of numbers.
MOV R0, #80H
MOV R1, #00H
MOV R2, #00H
MOV R3, #10H
MOV A, @R0
CLR C
RRC A
JNC DOWN
INC R1
SJMP NEXT
INC R2
INC R0
DJNZ R3, UP
MOV A, R1
MOV @R0, A
INC R0
MOV A, R2
MOV @R0, A
SJMP HERE
UP:
DOWN:
NEXT:
HERE:
13. Develop an assembly language program to find Positive & Negative numbers from the
given series of numbers.
MOV R0, #90H
MOV R1, #00H
MOV R2, #00H
MOV R3, #10H
MOV A, @R0
CLR C
RLC A
JNC DOWN
INC R1
SJMP NEXT
INC R2
INC R0
DJNZ R3, UP
MOV A, R1
MOV @R0, A
INC R0
MOV A, R2
MOV @R0, A
UP:
DOWN:
NEXT:
HERE: SJMP HERE