[A83] Re: Z88DK vs. SDCC


[Prev][Next][Index][Thread]

[A83] Re: Z88DK vs. SDCC




I assume that by GBDK you mean SDCC. I haven't tested the gameboy
functionality of SDCC. The reason it might not know what stdout is is
because it's not targeted to anything unless you do lcc -mz80/consolez80
(although i've not tried that, since I don't need a generic Z80 console
anyway). Notably it is true that it doesn't yet support argument lists for
printf, but if anyone is at all worried about program bloat, they wouldn't
use printf. Most of the formatting features of printf (the only real use of
printf) don't even work for the small menu font since it's variable width.
floats are supported in a limited fashion through long's, I think. I didn't
check because on the extremely rare occassions when you'd want to use
floats, it'd just add even more bloat to include your own floating point
library when there's one already on the calculator.

SDCC compiled an arithmetic decoder into Z80 perfectly, and at about 1/2 the
size and 3x the resultant speed of the same code compiled under Z88DK. Speed
is rather important for an arithmetic coder, where it is already rather slow
on a Z80. I didn't say it was perfect for all compilations, but the code it
produces is much better. It's still a work under progress. Z88DK even
explicitly says they have no plans for C source code optimization. All I'm
saying is that I think that people who program with Z88DK will be
disappointed by the relative size of their programs and the relative
slowness.

-----Original Message-----
From: assembly-83-bounce@lists.ticalc.org
[mailto:assembly-83-bounce@lists.ticalc.org]On Behalf Of Henk Poley
Sent: Wednesday, July 11, 2001 9:47 AM
To: assembly-83@lists.ticalc.org
Subject: [A83] Re: Z88DK vs. SDCC



No float support at the GBDK... Whereas the Z88DK has floats (library side,
not ROM floating point functions, but can be done)...

Or has it been 'fixed' in the mean time? Haven't noticed any change to the
GBDK site, but off coarse, could be some changes in CVS...

Oh, and try to compile this normal C code under the GBDK, yes it's a hello
world program...

/*      Hey, it's that infamous program again!
 *      Yup, Hello World strikes back in it's
 *      newest form!
 */

#include <stdio.h>

main()
{
	char buffer[80];
	fputs("Using fputs\n",stdout);
	putchar(':');
	printn(100,10,stdout);
        printf("Hello World %d\n",1);
	sprintf(buffer,"Testing sprintf %d",1);
	printf(buffer);
}

And you get a bunch of error mesages, it doesn't even know what stdout
is... (don't say that the way the z88dk handles this is perfect, no not
even nearly...)

Already found one bug (unless it's handled by the assembler), I don't think
the Z80 has an instruction like this:
	lda sp,-222(sp)

And yes I did compile via "lcc -mz80 ..."
(the same with "sdcc -mz80 ..."

	Henk Poley




References: