This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to use movc in keil?

Hi,
Using at89c51 i want some data to copy from program memory to external Data memory..
without using memcopy()...
any idea ?

Parents
  • For a single byte:

    code unsigned char code_var _at_ 0x1234;
    xdata unsigned char xdata_var _at_ 0x4321;
    
    xdata_var = code_var;
    I'm sure you can take it from there...

    Hint: If you make the two variables structs, you can simply do the assignment, and the compiler will implement the copy in an effiecient manner!

    But, again, what's wrong with memcpy?!

Reply
  • For a single byte:

    code unsigned char code_var _at_ 0x1234;
    xdata unsigned char xdata_var _at_ 0x4321;
    
    xdata_var = code_var;
    I'm sure you can take it from there...

    Hint: If you make the two variables structs, you can simply do the assignment, and the compiler will implement the copy in an effiecient manner!

    But, again, what's wrong with memcpy?!

Children