Use of SDCC libs?

Post Reply
AxelStone
New member
Posts: 7
Joined: Thu Oct 24, 2019 7:38 pm

Use of SDCC libs?

Post by AxelStone »

Hello all, another question, this time related to usage of SDCC libs. Let's supose I want to use a lib compiled in SDCC (asm.lib, no sources available) with my code in Z88DK. Can I link any library compiled in SDCC with the Z88DK compiler or should I compile / link everything using SDCC compiler?

On the other hand, I see that z88dk package includes asmlib documentation and header file, but not library itself. It should be nice to add it ;)

Thanks!!
User avatar
dom
Well known member
Posts: 1195
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

z88dk uses its own assembler and linker to produce libraries - as far as I know there's no way to use sdcc libraries directly.

asmlib is present in libsrc/target/msx/asmlib and the cross platform code in libsrc/arch/z80 - is there something missing?
AxelStone
New member
Posts: 7
Joined: Thu Oct 24, 2019 7:38 pm

Post by AxelStone »

Ok I got a bit confused. I've checked the folders you say and I can see the header files like asm.h but here goes my question: is there any way to know which lib contains every function? I explain.

I've opened msx_clib.lib with hex editor and I've seen that it includes all described functions of asmlib. So I need to include asm.h in my source code and compile using -lmsx_clib, just checked and works. But how can I know all functions contained in msx_clib.lib? asm.h only contains the related to asmlib, but for sure msx_clib.lib contains a lot more functions described in several .h files.

On the other hand I can see in libsrc/target/msx/asmlib sources for .C files, but not the asmlib.asm source itself, maybe?

Thanks for your help.
User avatar
dom
Well known member
Posts: 1195
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

Try the z80nm tool - it will print out details of every object file contained in the library detailing the symbols of what it exports and what it imports.

The library will contain objects generated from the files defined in libsrc/msx.lst, this in turn includes other .lst files. In total, it looks like msx_clib.lib has over 1700 object files within it
Post Reply