From: Spyridon D. <sdi...@ya...> - 2005-05-05 14:27:24
|
Hello al, I am new at using the sdcc compiler and I am getting in a bit of a tangle using pointers. The following is a snipet of my little test program (using sdcc 2.4.8 and gpsim 0.21.4) to program a pic 16f628. //---------- main() //---------- { static const unsigned char StepArray[4] = {10,9,5,6}; setUp(); // set-up the machine while(1) { // go now into an endless loop Step(StepArray); } } static void Step(const char *control_vector) { while(*control_vector) { PORTA = *control_vector++; DelayMs(BaseDelay); } } While debugging with gpsim, it seems (my assembler is rather poor) that the body of the while loop in Step() is never entered and hence no output on the PORTA pins. The code compiles with no errors or warnings!! On an aside, when I compile the same code with the picclite compiler it executes as expected. Could someone help to clarify pointers with sdcc for mpic14? Thanks Spiros ___________________________________________________________ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com |