Hi
Can somebody please explain to me this program line by line I tried googling for the instruction didnt understand the program as a whole
MOVC A, @A+DPTR ; what is this instruction doing
MOV DPTR, #MYDATA what do we need to do this
MOV R2, #5 ; same question
Can somebody please explain to me this program line by line I tried googling for the instruction didnt understand the program as a whole
MOVC A, @A+DPTR ; what is this instruction doing
MOV DPTR, #MYDATA what do we need to do this
MOV R2, #5 ; same question
Code:
cseg at 0
jmp 100
cseg at 100
/* 5. Assuming that ROM space starting at 248H contains “Shiue”, write a program to
transfer the bytes into RAM locations starting at 37H using indexed address mode (6
points)*/
ORG 0 ; ROM location starts from 0000H
MOV DPTR, #MYDATA ; Copy the content in ROM to RAM
MOV R0, #37H ; R0 is a pointer starting from 37H
MOV R2, #5 ; “Shiue” has 5 characters
Back: CLR A ; A is reused, so it needs to be cleared
MOVC A, @A+DPTR ; DPTR is a pointer
MOV @R0, A
INC DPTR
INC R0
DJNZ R2, Back
Here: SJMP Here ; keep in the loop
ORG 248H
MYDATA: DB “Shiue” ; the data in the ROM starting 248H
END
main:
sjmp main
end