Bela Torok <bela.torok@...> responded to my email:
> > Obviously there is an error since putchar has not been defined but the
> > i8051 compilation is totally comprehensible, the z80 compilation,
> > however, is the bizarre bit.
> Putchar is intentionally not part of the library.
> The reason is very simple; there is no "stdout" and "stdin" for the 8051.
> Depednig of your hardware, you have to define the putchar() and getchar()
> e.g., #define putcar(c) ser_putch(c) // see ser_ir.c file
> After defining these, you can use printf without modification to output
> characters to SIO1, SIO2, to a LCD-display, etc.
but has misunderstood what I was saying. I clearly phrased things wrongly,
apologies. I was trying to say that I know that the program cannot compile
using SDCC for exactly the reason given above (though it can with the Keil
suite since that provides a default putchar and getchar connected to serial
line 1 which all 8051s have but then the above suggestion is entirely
equivalent). My issue with the Hello World program was that it compiled in
an exactly expected way for the 8051 but failed incorrectly for the z80
target. The issue is a problem with the compiler using the -mz80 option.
Dr Russel Winder Chief Technology Officer
OneEighty Software Ltd Tel: +44 20 8263 2329
The Lansdowne Building Fax: +44 20 8263 6314
2 Lansdowne Road R.Winder@...
Croydon, Surrey CR9 2ER, UK http://www.180sw.com
Under the Regulation of Investigatory Powers (RIP) Act 2000 together
with any and all Regulations in force pursuant to the Act One Eighty
Software Ltd reserves the right to monitor any or all incoming or
outgoing communications as provided for under the Act