Beruflich Dokumente
Kultur Dokumente
: 2
School of Electronics Engineering
VIT, Vellore
Reg.No 17BEC0901
L23+L24,
Course Code ECE3003 Slot & Semester
FALL ~2019-20
Date of
Date of Exp. 1/08/2019 30/08/2019
Submission
Faculty A.Karthikeyan
Submission:
Mail Id :akece3003e1tt724@gmail.com ,
akece3003e2tt724@gmail.com
Mail Subject : REG.Number_L__+L__FALL_19_20
File Name and format : Reg.number.docx (doc) - only
Reg no: Fall 2019-20 ECE3003 - �C and its
applications
MAIL YOUR, DIGITAL ASSIGNMENT , LAB PROGRAMS TO THE ABOVE SAID MAIL ID
And also LOAD YOUR DOCUMENTS BEFORE THE DEAD LINE ON THE INTRANET
Question
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.
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.
Tools Required
Algorithm:
1. Transfer a string of data starting from address 200H to RAM locations starting at 40H
using instruction MOVC A,@A+DPTR.
2. Increment DPTR and R0.
3. Decrement R1 till it reaches 0. If R1!=0 we jump(branch instruction) to execute the
program again.
Program:
Memory Label Mnemonics Operands Addressing Machine Memory Type of Comments Flags
mode used cycle Byte Instruction getting
Address
Required Required affected by
the
Instruction.
- - END - 1 1 - End of -
.asm
source
file
Output :
R0=0x4E
R1=0x00
R2=0x00
R3=0x00
R4=0x00
R5=0x00
R6=0x00
R7=0x00
A=0x59
SP=0x07
DPTR=0x020E
Manual Calculation :
R0=40H+0EH=4EH
DPTR=200H+0EH=20EH
A=”Y”=59H
Inferences:
1. The code has been shifted to addresses starting from 40H from 200H.
Result: The 8051 ALP successfully transferred code starting from 200H to addresses
starting from 40H using keil software and the results are verified manually.
2. Aim: To 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.
Tools Required
Algorithm:
4. Transfer a string of data starting from address 200H to RAM locations starting at 40H
using instruction MOVC A,@A+DPTR.
5. Increment DPTR and R0.
6. Decrement R1 till it reaches 0. If R1!=0 we jump(branch instruction) to execute the
program again.
7. Copy the code from addresses starting from 40H to addresses starting from 60H
8. Increment R0 and R1
9. Decrement R3 till it reaches 0. If R3!=0 we jump(branch instruction) to execute the
program again.
Program:
Memory Label Mnemonics Operands Addressing Machine Memory Type of Comments Flags
mode used cycle Byte Instruction getting
Address
Required Required affected by
- - END - 1 1 - End of -
.asm
source
file
Output :
R0=0x4E
R1=0x6E
R2=0x00
R3=0x00
R4=0x00
R5=0x00
R6=0x00
R7=0x00
A=0x59
SP=0x07
DPTR=0x020E
Manual Calculation :
R0=40H+0EH=4EH
SENSE, VIT Page 11 of 13
Reg no: Fall 2019-20 ECE3003 - �C and its
applications
R1=60H+0EH=6EH
DPTR=200H+0EH=20EH
A=”Y”=59H
Inferences:
1. The code has been shifted to addresses starting from 40H from 200H.
2. The code has been copied from addresses starting from 40H to addresses starting from 60H.
Result: The 8051 ALP successfully transferred code starting from 200H to addresses
starting from 40H and then copied the code from addresses starting at 40H to addresses
starting from 60H using keil software and the results are verified manually.