Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#913 Compilation failing

closed-works-for-me
nobody
5
2013-05-25
2005-05-02
No

After compiling a C code, I get an error message from
the assembler claiming that a register "s0xF7" is not
defined, plus some claims that the PSAVE, SSAVE and
WSAVE registers change on 2nd pass. Follows the command
issued to start the compilation and the source code.

$ sdcc -mpic14 -p16f84 -Iinclude -o obj/control.o -c
src/control.c
Processor: 16f84
obj/control.asm:49:Error [116] Value of symbol "PSAVE"
differs on second pass
pass 1=14, pass 2=61
obj/control.asm:50:Error [116] Value of symbol "SSAVE"
differs on second pass
pass 1=13, pass 2=62
obj/control.asm:51:Error [116] Value of symbol "WSAVE"
differs on second pass
pass 1=12, pass 2=63
obj/control.asm:107:Error [113] Symbol not previously
defined (s0x7F).
obj/control.asm:210:Error [113] Symbol not previously
defined (s0x7F).
otavio@otavio:~/pic$ sdcc -v
SDCC : pic16/pic14 2.5.0-pre1 #1018 (May 1 2005) (UNIX)

include <p16f84.h>

typedef enum { LEFT_MOTOR = 0, RIGHT_MOTOR = 2 } t_motor;
typedef enum { FORWARD = 0x01, BACKWARD = 0x02 }
t_direction;

static unsigned char porta_motor_mask(t_motor motor);

void turn_motor_on(t_motor motor, t_direction direction) {
PORTA = (PORTA & porta_motor_mask(motor)) |
(direction << motor);
}

void turn_motor_off(t_motor motor) {
PORTA &= porta_motor_mask(motor);
}

unsigned char porta_motor_mask(t_motor motor) {
switch (motor) {
case LEFT_MOTOR:
return 0xFC;
break;
case RIGHT_MOTOR:
return 0xF3;
break;
};
return 0xFF;
}

int
main(void) {
while (1) {
if (PORTA & 0x10) {
turn_motor_on(LEFT_MOTOR,FORWARD);
} else {
turn_motor_off(LEFT_MOTOR);
}
}
}

I first ran into this issue with:
$ sdcc -v
SDCC : pic16/pic14 2.4.0 (Apr 29 2005) (UNIX)
$ sdcc -mpic14 -p16f84 -o test -Iinclude/ src/control.c
Processor: 16f84
test.asm:105:Error [113] Symbol not previously defined
(s0x7F).
test.asm:206:Error [113] Symbol not previously defined
(s0x7F).

Discussion

  • Source file that won't compile

     
    Attachments
  • Raphael Neider
    Raphael Neider
    2005-07-01

    • milestone: --> fixed
    • status: open --> closed-works-for-me
     
  • Raphael Neider
    Raphael Neider
    2005-07-01

    Logged In: YES
    user_id=1115835

    Seems to have been fixed (possibly by Slade Rich, June 2nd)
    some time ago..., works with SDCC 2.5.1 #1053.