#5 Retrograde step

closed
nobody
None
5
2001-09-18
2001-09-16
No

I just downloaded sdcc afresh from the CVS archive and
compiled the following program which has worked in the
past:

#include <8051.h>

void putchar (char c) {
while (TI != 1)
;
TI = 0 ;
SBUF = c ;
}

char getchar () {
char c ;
while (RI != 1)
;
RI = 0 ;
return c = SBUF ;
}

void initializeSerialLine() {
SCON = 0x50 ;
TMOD &= 0xCF ;
TMOD |= 0x20 ;
TH1 = 0xfd ;
TR1 = 1 ;
}

unsigned char * message = "Hello World!\n" ;

int main() {
unsigned char * p = message ;
initializeSerialLine() ;
while (*p != 0) {
putchar(*p++) ;
}
putchar('\n') ;
return 0 ;
}

with the outcome:

711 elon:8051 |> make helloWorldBroken.ihx
sdcc helloWorldBroken.c

library file
/home/share/tools/sdcc/share/sdcc/lib/small/libsdcc.lib
library file
/home/share/tools/sdcc/share/sdcc/lib/small/libint.lib
library file
/home/share/tools/sdcc/share/sdcc/lib/small/liblong.lib
library file
/home/share/tools/sdcc/share/sdcc/lib/small/libfloat.lib

?ASlink-Warning-Undefined Global '__str_0' referenced
by module 'helloWorldBroken'
make: *** [helloWorldBroken.ihx] Error 1
712 elon:8051 |>

From the lst file, the __str_0 is associated with the
string constant.

Discussion

  • Johan Knol

    Johan Knol - 2001-09-18
    • status: open --> closed
     
  • Johan Knol

    Johan Knol - 2001-09-18

    Logged In: YES
    user_id=63512

    fixed in SDCCglue.c:1.69

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks