Question: Write a program to copy 10 bytes of data at ROM address 500H to RAM starting at location 40H. Start with creating a look-up table at a convenient location
ORG 500H TABLE: DB 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
ORG 40H START: MOV DPTR, #TABLE ;SOURCE POINTER MOV R1, #40H ;DESTINATION POINTER MOV R3, #10 ;COUNTER
BACK: MOVC A, @A+DPTR ;GET A BYTE FROM THE SOURCE MOV @R1, A INC R1 INC DPTR DJNZ R3, BACK ;Does this 10 times END
This is what I have but I have no idea if it is right or working correctly. Can anyone help me out?
Please note, that we actually try to help you to 'learn' what's wrong. Not by telling you exactly what's wrong in the code, then you only learn little or nothing give a man a log and he is warm for a day, set him on fire and he is warm fur the rest of his life.