We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
if my ASM code is previously coded to run for 256Byte internal RAM of MCU (use MOV instruction) and i now need to change to external 2Kbyte RAM (use MOVX), then should i change R7 to R7:R6 because R7 is not big enought to address BUFFER? or can anyone suggest what should i change the following code? unsigned char Test(unsigned char BUFFER) { #pragma asm MOV A, R7 MOV R1, A RET #pragma endasm return 1; }
Sorry, let me make it clear! 2Kbyte should be expanded internal RAM of MCU. The datasheet of MCU states that MOVX should be used to access data. So, how to deal with R7 in this case?
Your example moves the BUFFER parameter (a byte in R7) to R1, which has no practical effect that we can see. That said, it will work on any 8051 regardless of its external or expanded internal RAM. So no changes are required.