#48 code char at 0xfff0 compiledate[] = __DATE__;

closed
None
5
2006-09-30
2003-12-13
No

It would be nice if SDCC supported initialized
variables
in code space together with "at".

You'd need this if you want a font bitmap at a
certain
address, or have a bootloader which looks for some
'magic bytes', or just like to have a compile date/
time
at a fixed address.

Frieder

Discussion

  • Maarten Brock

    Maarten Brock - 2004-01-15

    Logged In: YES
    user_id=888171

    The strange thing is, that if you use this construct and leave
    out the initialiser, SDCC generates an error. So you must
    supply something that gets thrown away immediately.

    Also, the following generates incorrect code:
    code char * code at 0x0FF0 crc_start = 0;
    It forgets the at 0x0FF0 part and generates initialised code. I
    guess this is actually a bug.

    Greets,
    Maarten

     
  • Nobody/Anonymous

    Logged In: NO

    I need this functionnality too to insert an unsigned long in
    code space at a specific address ...
    like :
    code at 0xF7FC unsigned long CHKCOD = 0xFFFF0000 ;

    This "variable" is well reserve at the good adress but not
    initialized (like like the sdcc documentation)

    Do you know when it'll be implemented ???
    Vinzzz

     
  • Jesus Calvino-Fraga

    Logged In: YES
    user_id=603650

    You can easily do this using inline assembly:

    extern code unsigned char * Date_Built;

    void main(void)
    {
    int i;
    for(i=0; i<100; i++);
    }

    void dummy_function(void) _naked
    {
    _asm
    .area myseg (abs)
    .org 0xff00
    _Date_Built:
    .asciz __DATE__
    _endasm;
    }

     
  • Maarten Brock

    Maarten Brock - 2006-09-30
    • assigned_to: nobody --> maartenbrock
    • status: open --> closed
     
  • Maarten Brock

    Maarten Brock - 2006-09-30

    Logged In: YES
    user_id=888171

    Implemented for mcs51, ds390 and hc08 in SDCC 2.6.1 #4391.

     

Log in to post a comment.