From: SourceForge.net <no...@so...> - 2005-05-02 00:34:59
|
Bugs item #1193553, was opened at 2005-05-01 21:34 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1193553&group_id=599 Category: pic14 target Group: None Status: Open Resolution: None Priority: 5 Submitted By: Otavio Augusto Fuck Pereira (otaviofp) Assigned to: Nobody/Anonymous (nobody) Summary: Compilation failing Initial Comment: 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). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1193553&group_id=599 |