2006-05-25 01:45 PM
2006-04-23 07:48 PM
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?2006-04-24 10:31 PM
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 ]2006-04-25 12:39 AM
Thank you very much Luca
But I defined it extern in other file and it works2006-05-25 01:45 PM
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