[A83] Re: Z88DK vs. SDCC
[Prev][Next][Index][Thread]
[A83] Re: Z88DK vs. SDCC
> Van: Kirk Meyer <kirk.meyer@colorado.edu>
>
> I'm not exactly clear on why SDCC would need to be ported. All that has
to
> be done to SDCC is add some Z80 libraries (in ASM, they already exist in
C
> obviously), fix a few compiler bugs, and write up some peephole
> optimizations. This seems easier than taking the parts of SDCC that are
good
> and putting it into Z88DK, unless by a fluke we can just replace one
source
> file with another and they happen to use all the same conventions...
The *only* things that need to be changed in SDCC:
1) Make back-end generate Z80ASM compatible code
Easy, I think. You only need to output things as:
ld a,(ix+12)
instead of
ld a,12(ix)
and some of the things with library usage/defines, that is handled with
XREF/XDEF/LIB/XLIB in Z80ASM, but differently with the asxxxx assemblers
2) add #pragma stuff currently used by Z88DK
3) Enable floating point stuff in the compiler
That would be that more difficult part, since that hasn't been implemented
in Z80 yet, the compiler though has already support for it (in the
intermediate language).
Can't think of anything more...
On the side of the Z88DK me might need to change some include-files
(z88dk/include/*.h), some of them have special labels attached so the
(current) compiler knows some optimizations that can be done in calling
this routine. (Things like not needing to push the variable to the stack
but hand it in HL)
It could be that some of these changes need to be reflected into the
library... (but not much, most of the library routines are written in asm,
or in handoptimized C [so also asm])
Porting GCC seems to me waaaay to difficult, and needless.
Henk Poley