gnupic: sdcc and pic16f877.h


Previous by date: 12 Jul 2005 10:26:05 +0100 Re: [gnupic] picp 0.6.7 released, Jeff
Next by date: 12 Jul 2005 10:26:05 +0100 Re: [gnupic] learning assembler, Snail Instruments
Previous in thread:
Next in thread:

Subject: sdcc and pic16f877.h
From: Odd Skjaeveland ####@####.####
Date: 12 Jul 2005 10:26:05 +0100
Message-Id: <87acks9xzn.fsf@sivos.rl.no>

I am new to sdcc (and gputils) and try to learn how to use
sdcc/gputils for a pic16f877 project using a debian (unstable) 
system. I installed debian binaries and used the inc2h.pl script
to create the *.h files.

My first simple source file main.c :

#define __16F877

int
main(void)
{
  return(0);
}

Never mind the return from main in an embedded system, the code 
will just be used to illustrate what I need help to figure out.

I invoke the compiler (version 2.5.0 #1020) like this:

sdcc -I /usr/share/sdcc/include/pic -mpic14 -p16f877 main.c

sdcc compiles and assembles my main.c just fine. The following
compiles, but it does not assemble:

#define __16F877
#include <pic16f877.h>        /*  <---- new  */

int
main(void)
{
  return(0);
}

The assembler complains:

main.asm:128:Error [113] Symbol not previously defined (s0x7F)



The return statement is apparently supposed to store the return
value at location 0x7F, for which the compiler hands a
symbolic 's0x7F' to the assembler.

In the first case the assembler knows the definition of s0x7F,
(the compiler includes it in the .asm file) but this knowledge 
is lost somehow when I include the pic16f877.h file.

Removing #define __16F877 does not appear to have any effect 

I would appreciate if someone could point a sdcc/gputils beginner
in the right direction.

--
Odd Skjaeveland

Previous by date: 12 Jul 2005 10:26:05 +0100 Re: [gnupic] picp 0.6.7 released, Jeff
Next by date: 12 Jul 2005 10:26:05 +0100 Re: [gnupic] learning assembler, Snail Instruments
Previous in thread:
Next in thread:


Powered by ezmlm-browse 0.20.