Sei sulla pagina 1di 10

Reg.

No 15BEC0760

Student Name Aditya G Kulkarni

L43+L44,
Course Code ECE3003 Slot & Semester
WINTER ~2019-20

Course Name Microcontroller and its applications

Program Title To transfer a string of Data

Faculty Dr. A Karthikeyan


1)Write a program to transfer a string of data from code space
starting at address 200H to RAM locations starting at 40H. The data is as
shown below:
0200H:DB "VIT UNIVERSITY"
Using the simulator, single-step through the program and examine the data
transfer and registers.

AIM:

To write 8051 ALP to perform transfer a string of data from code


space starting at address 200H to RAM locations starting at 40H using keil
software and verify the result manually.

ALGORITHM:

➢ Start the program.


➢ Move the value 200H to DPTR
➢ Move the value of 14H to R1 register
➢ Move the value of 40H to R0 register
➢ Increment DPTR and R0
➢ ORG value is 200H
➢ Put VIT UNIVERSITY in DB
➢ Stop the program
PROGRAM:
Flags
Label Mnemonic Operands Addressin Mac Mem Type of Comments getting
s g mode hine ory Instruction affected
cycle byte by the
requi requi instructi
red red on
ORG 0000H Assembly
directive
MOV DPTR, immediate 1 3 Data Load 200H
#200H transfer into DPTR
MOV R1, #0EH Immediate 1 2 Data Load 0E
transfer into R0
MOV R0, #40H Immediate 1 2 Data Load 40
transfer into R1
LOOP: CLR A 1 1 Logical Clear
Accumulator

MOVC A, Indexed 2 1 Data Transfer


@A+DPTR transfer address of
A and value
of DPTR to
the A
register
MOV @R0, A Register 1 1 Data Value of A
indirect transfer transfer to
addressing address of
mode R0
INC DPTR 1 1 Arithmetic Increment
DPTR
INC R0 1 1 Arithmetic Increment
R0
DJNZ R1, LOOP 2 2 Branch Decrement
R1 when
found non
zero
HERE: SJMP HERE Stay in this 2 2 Branch Short jump
loop
ORG 0200H Give the
string using
DB in
address of
200H
DB “VIT String to
UNIVERSI input
TY”
END End of the
program

OUTPUT:
VIT UNIVERSITY
INFERENCE:

➢ Load the memory location value to be store in data pointer


➢ Clear the accumulator and transfer address of A and value of
DPTR to the A register.

RESULT:

The 8051 ALP to perform transfer a string of data from code space starting
at address 200H to RAM locations starting at 40H using keil software and the
results are verified manually.
2)Add the following subroutine to the program 1, single-step through the subroutine
and examine the RAM locations. After data has been transferred from ROM space into
RAM, the subroutine should copy the data from RAM locations starting at 40H to RAM
locations starting at 60H.

AIM:

To write 8051 ALP to perform transfer a string of data from code space
starting at address 200H to RAM locations starting at 40H to RAM locations
starting at 60H using keil software and verify the result manually.

ALGORITHM:

▪ Start the program.


▪ Move the value 200H to DPTR
▪ Move the value of 14H to R1 register
▪ Move the value of 40H to R0 register
▪ Clear the accumulator
▪ Increment DPTR and R0
▪ Decrement jump on non-zero to R1
▪ Move the value 14H to R3 register
▪ Move the value 40H to R0 register
▪ Move the value 60H to R1 register
▪ ORG value is 200H
▪ Put VIT UNIVERSITY in DB
▪ Stop the program
PROGRAM:
Flags
Label Mnemoni Operands Addressin Mac Mem Type of Comments getting
cs g mode hine ory Instruction affected
cycle byte by the
requi requi instructi
red red on
ORG 0000H Assembly
directive
MOV DPTR, immediate 2 3 Data Load 200H
#200H transfer into DPTR
MOV R1, #0EH Immediate 1 2 Data Load 0EH
transfer into R1
MOV R0, #40H Immediate 1 2 Data Load 40H
transfer into R0
LOOP: CLR A 1 1 Logical Clear
Accumulator

MOVC A, Indexed 2 1 Data Transfer


@A+DPTR transfer address of
A and value
of DPTR to
the A
register
MOV @R0, A Register 1 1 Data Value of A
indirect transfer transfer to
addressing address of
mode R0
INC R0 1 1 Arithmetic Increment
R0
INC DPTR 1 1 Arithmetic Increment
DPTR
DJNZ R1, LOOP 2 2 Branch Decrement
R1 when
found non
zero
MOV R0, #40H Immediate 1 2 Data Load 40H
transfer into R0
MOV R1, #60H Immediate 1 2 Data Load 60H
transfer into R1
MOV R3, #OEH immediate 1 2 Data Load 0EH
transfer Into R3
LOOP2: CLR A 1 1 Logical Clear
accumulator
MOV A, @R0 Register 1 1 Data The address
indirect transfer of R0
addressing transfer to A
mode
MOV @R1, A Register 1 1 Data The address
indirect transfer of A
addressing transfer to
mode R1
INC R0 1 1 Arithmetic Increment
R0
INC R1 1 1 Arithmetic Increment
R1
DJNZ R3,LOOP2 2 2 Branch Decrement
R3 when
found non
zero
HERE: SJMP HERE Stay in this 2 2 Branch Short jump
loop
ORG 0200H Give the
string using
DB in
address of
200H
DB “VIT String to
UNIVERSI input
TY”
END End of the
program

OUTPUT:
VIT UNIVERSITY
INFERENCE:
➢ Load the memory location value to be store in data pointer
➢ Clear the accumulator and transfer address of A and value of
DPTR to the A register.
RESULT:
The 8051 ALP to perform transfer a string of data from code space starting
at address 200H to RAM locations starting at 40H to RAM locations starting at
60H using keil software and the results are verified manually.

Potrebbero piacerti anche