Skip to main content
Visitor II
May 25, 2006
Question

COSMIC

  • May 25, 2006
  • 4 replies
  • 1111 views
Posted on May 25, 2006 at 22:45

COSMIC

    This topic has been closed for replies.

    4 replies

    irmakci2Author
    Visitor II
    April 24, 2006
    Posted on April 24, 2006 at 04:48

    I want to use global bit and I read the document which was in tutorial.We had had to declare .bit section in link file.But how to prepare to link file

    example my link file is

    +seg .text -b 0xfa00 -n .text # program start address

    +seg .const -a .text # constants follow code

    +seg .bsct -b 0x80 -m 0x80 # data start address

    +seg .ubsct -n iram # uninitialized zero page

    #

    # define the .share segment when using compact or memory models only

    #

    +seg .share -a iram -n share -is # shared segment

    Where and how should I allocate .bit section and which address if it is possible???Can you help me?And Is ıt required identifier such as extern like global variables?

    Visitor II
    April 25, 2006
    Posted on April 25, 2006 at 07:31

    example of C file:

    _Bool mybit; // general bit variable, requires the .bit segment to be declared in the linker file

    _Bool PA0@PADR:0; // absolute bit variable, does not require the .bit segment

    ....

    mybit=0;

    my_global_var=0;

    while(1)

    {

    PA0=0;

    PA0=1; // Generate a waveform

    if (my_global_var==1)

    printf(''Interrupt happened!\n'');

    }

    and the associated linker file

    +seg .text -b 0xf000 -n .text # program start address

    +seg .const -a .text # constants follow code

    +seg .bsct -b 0x80 -m 0x80 # data start address

    +seg .ubsct -n iram # uninitialized zero page

    #

    # define the .share segment when using compact or memory models only

    #

    +seg .share -a iram -is -n .share # shared segment

    +seg .bit -a .share # bit segment after the share segment (still in page zero)

    +seg .eeprom -b 0xc00 -m256 # eeprom segment

    .....

    the bit segment must be in page 0.

    Regards,

    Luca (Cosmic)

    [ This message was edited by: _luca on 25-04-2006 11:03 ]

    irmakci2Author
    Visitor II
    April 25, 2006
    Posted on April 25, 2006 at 09:39

    Thank you very much Luca

    But I defined it extern in other file and it works

    Visitor II
    May 25, 2006
    Posted on May 25, 2006 at 22:45

    I use stvd3 and cosmic,but i do nothing with *.lkf file,I just click

    ''project''--''setting''--''linker''--''input''--''Zero Page'' then ''add Section'' then write ''.bit''; all is ok.

    it is so easy.

    maybe it will be helpful for you.

    I am a chinese,sorry for my poor english level

    msn:majingang@msn.com