Dear Sir, I am using C51 version 5.5,i am not able to read & write continous memory locations what i did using A51 code as below. mov a,#55h mov r0,#20h do: mov a,#55h mov @r0,a inc r0 mov a,r0 cjne a,#80h,do sjmp $ Help me on the above.
unsigned char data *dp; for (dp = 0x20; dp != 0x80; dp++) *dp = 0x55;
Just doing it in C is not the answer to his question. I have looked at the assembly code and see absolutotally no problem. One possiblity (I have been gulity myself): is the a "gramatical error" such as a missing '#' in your actual code that you subconsciously fixed when you copied the code to the forum. Erik
What's the value of P2 during this loop? Are you not writing at all, or just writing somewhere other than you expect, or scattering values all through memory?
What's the value of P2 during this loop? Why do you ask, it is MOV, not MOVX Erik
Good point. I was paying too much attention to the "@r0", and not enough to the actual instruction!