help me to use syntax for storage class in SDCC MCU compiler.

2014-05-26
2014-06-06
  • Shrihari Shinde

    Shrihari Shinde - 2014-05-26

    Hi, to all
    I have written program in MCU 8051 IDE. my program requires array as data type, so i have defined required no of data types. Variables in program are so many that the cant fit into default storage class. So, to solve this issue i have used the syntax for indirect addressing of RAM and used syntax from SDCC compiler manual as __idata unsigned char test_idata but still it is not working so please help me any one having experience in this

    thank you in advance

     
  • Erik Petrich

    Erik Petrich - 2014-05-26

    The storage specifier needs to be before the variable name:
    char __idata test;

    Are you sure you need the array in data rather than idata? The code efficiency would be much better with the regular variables in data rather than idata and the array can be accessed equally well in either idata or data.

     
    Last edit: Erik Petrich 2014-05-26
    • Shrihari Shinde

      Shrihari Shinde - 2014-05-28

      hi, to all
      I want to program P89C51RD2BN microcontroller ic from philips company. so my question is that, can i program it in MCU 8051 IDE editor. I have seen while creating project that there is no such chip number is available in IC listing. So, can any one suggest me for another compiler or can i use the same one i.e. MCU 8051 IDE

      thanks in advance

       
  • Maarten Brock

    Maarten Brock - 2014-06-06

    Usually any 8051 derivative can be used with SDCC. You should start by looking if there is a header file for the device and if not, you should create one. This is not too hard with the datasheet at hand.

    Then you should check if pdata and xdata need special considerations. Sometimes there is internal xdata and P2 is not used for paging it. If there is another register for that you must add it as _XPAGE. If there is none, but there are 2 DPTR's you must copy and modify crtxinit.asm. If you need to enable xdata or disable a watchdog, implement an _sdcc_external_startup() function.

    Maarten

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks