MOV RO

As a part of an "In application programming" I am using the following assembler code:

#pragma asm
MOV R0,#14 //OSC frec
MOV R1,#02H //PROGRAM DATA BYTE
#pragma endasm

I can't find the way of writing those two assembler lines in C, could anybody help me? Thanks, Juan

Parents
  • I don't know if you can define SFRs below 0x80, however you could:

    unsigned char data *ptr=0;

    ptr[0]=0xa5;
    ptr[1]=0x5a;
    etc

    but be warned that this is highly dodgy as the compiler may well be using those registers. You would need to look carefully at the generated code.

    You would be much better sticking with assembler for this IAP stuff.

    What derivative are you using?

Reply
  • I don't know if you can define SFRs below 0x80, however you could:

    unsigned char data *ptr=0;

    ptr[0]=0xa5;
    ptr[1]=0x5a;
    etc

    but be warned that this is highly dodgy as the compiler may well be using those registers. You would need to look carefully at the generated code.

    You would be much better sticking with assembler for this IAP stuff.

    What derivative are you using?

Children
More questions in this forum