Can someone help me out with Z88dk?

Pagina 2/2
1 |

Van WORP3

Paladin (864)

afbeelding van WORP3

30-08-2022, 17:08

nuc1e0n wrote:

The z88dk project's wiki has a page that specifically talks about generic z80 code generation starting at address 0. Here's a link to it: https://github.com/z88dk/z88dk/wiki/NewLib--Platform--Embedded. z88dk contains two different compilers and two standard clibs. sccz80 is their original C compiler which can compile more obscure edge cases of the language. zsdcc is a version of sdcc modified to work with z88dk's libraries which can make slightly faster code and has options for using different registers but has fewer features. As for the clibs, the classic lib is the original one that covers many different z80 based platforms but involves more adhoc functions written in assembly. Newlib as the name suggests is newer and more of it is written in C itself with the aim to be more conformant to the C11 standard, but it only supports a few different platforms. One of which is for non system specific z80 output though. A lot of the improvements of newlib have also now been merged back into the classic clib.

I will take a look at that wiki page, thanks a lot fot that link and the additional information about the libraries :) It's quite a lot to get started with a new compiler and let it generate code for an undefined system. Probably if everything is running I will look back and think that was simple LOL!

Van WORP3

Paladin (864)

afbeelding van WORP3

16-10-2022, 17:10

In the meantime I've got the compiler working but still wondering about some code it's generating. Not that i'm not going to use this specific code/library but just out of curiosity, any of you an idea why the JP T0104H is inside this function? Why would you add a jump to the next ASM instruction Question ?

Default z80_outp( function inside the z80 library (generated by the z88dk):

T00FDh POP AF
T00FEh POP HL
T00FFh POP BC
T0100h PUSH AF
T0101h JP T0104H
T0104h OUT (C),L
T0106h RET

Pagina 2/2
1 |