Hello,everyone.
just like the title.
I write C code like this:
------------------------------------------------------------------------------------------
#include<pic16f887.h>
unsigned char a[4] = {0x12, 0x13, 0x14, 0x15};
int main() {
PORTA = a[2];
return 0;
}
-------------------------------------------------------------------------------------------
the generated asmbler file is:
-------------------------------------------------------------------------------------------
ID_a_0 idata
_a
db 0x12
db 0x13
db 0x14
db 0x15
STARTUP code 0x0000
nop
pagesel __sdcc_gsinit_startup
goto __sdcc_gsinit_startup
code_a code
_main
BANKSEL _a
MOVF (_a + 2),W
BANKSEL _PORTA
MOVWF _PORTA
; .line 1806; "a.c" return 0;
MOVLW 0x00
MOVWF STK00
MOVLW 0x00
RETURN
; exit point of _main
end
-------------------------------------------------------------------------------
in the manual of gputils for the directive IDATA have this "Data memory is
alllocated and the initialization data is placed in ROM,
The user must provide the code to load the data into memory"
so , just like the title can sdcc generate code which can load value from
ROM(placed for idata directive) to RAM in startup?
if have Where is the source code doing this LOAD?
if not ,How can i do this?
Another, in SDCC PIC14 the *pic16f887.lib* doing what?
and how it come from? how can i compile to get it by myself?
What does it contain?
Thanks, guys..
--
*live long and prosper..*
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user