Hi George, > i was not able to generate the hex code i compile the program using > the command sdcc -mpic14 -p16f84a -c example.c.but i have n't get the > hex code.
Does this really surprise you? The help text for the -c flag reads -c --compile-only Compile and assemble, but do not link ^!!!!!!!!!^ The .hex file is the result of linking your project's object files with the sdcc (and maybe other) libraries, so not linking will only produce 'example.o' but not 'example.hex'. > plz tell me how i can get the hex code The sample code I provided does intentionally not have a main() function, nor does the code make anything useful besides demonstrating IO port access. Thus to obtain a hex file you would need to add a main() function with useful functionality either in example.c or in another source.c, compile both with sdcc -mpic14 -p16f84a -c example.c sdcc -mpic14 -p16f84a -c source.c and then link them together (and with the libraries) using gplink example.o source.o libsdcc.lib pic16f84a.lib (alternatively, you should be able to use the slightly simpler sequence sdcc -mpic14 -p16f84a -c example.c sdcc -mpic14 -p16f84a source.c example.o BUT make sure to specify the source file containing main() in the last call and compile ALL other project source files with the -c option!) Good luck, Raphael ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user