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

Problem in C's programming concept for ucontroller

Sir,
I am frequent user of assembly language regarding MCS 51 family but now I want to shift on C programming I have understanding of C language. I am facing lot of difficulties in C for ucontroller programming.For assembly the instruction set is available is there any C's instruction set for controller to understand app notes of examples available in C. How can I use internal ram (bit addressable), rotate commands,interrupt vectors,serial interrupts, data pointer,bit checking.
How can I interpret these commands use in Keil examples? Is any help or guidance for me....?

LCD_DATA = (LCD_DATA&0x0F)|((value<<4)&0xF0);
SDA = (bit)((value&0x80) >> 7);
TMOD &= ~0xF0;
TMOD |= 0x20;

Parents
  • "I'd suggest reading the C51 compiler manual."

    More than that: it is essential that you read the compiler manual!!
    When it comes to programming the 8051 in 'C', you are going to have to use compiler-specific extensions to the standard language to access IDATA, BDATA, XDATA, SFRs, bits, interrupts, etc, etc...
    The only place you can learn about these is in the Manual
    You will also need to read the Manual to learn about things like the internal data representation, calling convention, the various memory models, command-line options, etc, etc

    You will also need a thorough understanding of the standard 'C' language - which is something that the manual will not give you!
    You have got a copy of K&R, haven't you?

    There's a bibliography on this site:
    http://www.keil.com/books/8051books.asp

Reply
  • "I'd suggest reading the C51 compiler manual."

    More than that: it is essential that you read the compiler manual!!
    When it comes to programming the 8051 in 'C', you are going to have to use compiler-specific extensions to the standard language to access IDATA, BDATA, XDATA, SFRs, bits, interrupts, etc, etc...
    The only place you can learn about these is in the Manual
    You will also need to read the Manual to learn about things like the internal data representation, calling convention, the various memory models, command-line options, etc, etc

    You will also need a thorough understanding of the standard 'C' language - which is something that the manual will not give you!
    You have got a copy of K&R, haven't you?

    There's a bibliography on this site:
    http://www.keil.com/books/8051books.asp

Children