![]() ![]() You can also supply defaults such as code origin, data origin, bss origin, heap size, and so on that make sense for the target. You also get to supply one or more crts that would allow you to insert startup code for different compile scenarios (compile for rom, compile for ram, etc). The advantage of doing this is you can cherry pick what goes into the rc2014 library as well as add rc2014-specific functionality. The new C library also allows you to define a new target and you could define one for the rc2014. And of course you don't have to use what you don't want to. Although people here are advocating not using the C library, with z88dk I'd the encourage the opposite :) If you want to investigate the quality of the implementation you can have a look at the source, here for the new C library which is what I think you'd need to use for the rc2014: (you'll have to navigate around the dead directories that cvs retains in the online code base) It is true that using printf/scanf comes at a cost since it has to implement complex behaviours defined by the standard which may not be required but the new C library's implementation does allow the user to individually exclude specific % converters in order to at least help reduce code footprint. Z88dk's C library is different from other compilers in that it is written in assembly language, so it is more compact and faster than other z80 C compilers'. In order to generate ROMable code, you should really be using the new C library but your makefile is using the classic C library which will (currently) mix ram vars with rom code. Anything else uses the classic C library. "-clib=new", "-clib=sdcc_ix" and "-clib=sdcc_iy" all use the new C library. The choice of C library is made on the compile line. Although it's not finished (it's missing disk io and non-blocking io), it is in an advanced state. The stdio model is object oriented and allows device drivers to be written using code inheritance from the library. It is 100% machine code, is written to be compatible with any C compiler, and can generate ROMable code with separation of ROM and RAM data. The new C library is a rewrite from scratch with the intention of meeting a subset of C11 compliance. Both of these issues are being addressed now. It's also not compatible with sdcc at this time. However, at this time it cannot be used to generate ROMable code as it mixes variables with code in the output binary. It is mostly written in machine code and has a small stdio implementation. The level of library support varies by target with the best supported having sprite libraries, sound, graphics, etc supplementing the standard c library. It has many crts available for it that allows compiling for a lot of target machines out of the box. ![]() The classic C library is the C library that has always shipped with z88dk. To use sdcc, "-clib=sdcc_ix" or "-clib=sdcc_iy" would appear in the compile line. You can choose which C compiler you use by selecting the appropriate switch on the command line. sdcc is an optimizing compiler and z88dk's patch improves on sdcc's output by supplying some bugfixes not yet incorporated into sdcc itself and by supplying a very large set of peephole rules to further improve output. The other C compiler is a patch of sdcc, another open source compiler that attempts to implement subsets of C89, C99 and C11. It is a little short of C89 compliance with a few notable non-compliances being multi-dimensional arrays and function pointer prototyping. For example, floating point is supported, ANSI C declarations are supported, 8/16/32-bit integers are supported and so on. One C compiler is sccz80 which is derived from small C but z88dk's version has seen continuous development over the past 30 years so it's had most of the limitations of small C removed. You should be made aware that there are two c libraries and two c compilers in z88dk currently. We had someone asking about an rc2014 at z88dk and since I'd never heard of one before, a google search led me here :) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |