z88dk v1.99A Release Candidate

Noticias relacionadas con el mundo del Spectrum en general y este foro en particular. Presentación de nuevos usuarios.

Moderador: Sir Cilve Sinclair

z88dk v1.99A Release Candidate

Notapor Alcoholics Anonymous el Jue Dic 17, 2015 12:06 am

Download from:
http://nightly.z88dk.org/Releases/

The release candidate will be available for testing until December 23 when it will be replaced by an official release of v1.99A.

The download options are a binary win32 build, a binary mac osx build and a generic source tree for other platforms. Installation hints can be found here: http://www.z88dk.org/wiki/doku.php?id=t ... stallation . Instructions for installing the MacOSX binary are missing so if a MacOSX user is able to submit those, it would be appreciated

z88dk has undergone some significant development in the past two years. The version number reflects this (v1.99) and anticipates a v2.0 when the development roadmap is completed.

WHAT'S NEW

Quite a lot and we don't have a complete list of changes yet.

In broad terms:

* [z80asm] Sections introduced for creating memory maps and compiling for bankswitched memory
* [z80asm] Modern operator syntax introduced
* [z80asm] PUBLIC, EXTERN, GLOBAL scoping keywords introduced to replace XDEF, XREF, XLIB, LIB, etc

* [sccz80] Numerous bugfixes

* [classic c library] New targets and new libraries which will be enumerated at official release

* [new c library] A new c library has been written from scratch in assembly language and currently contains more than 700 functions
* [new c library] Compatible with sdcc
* [new c library] Many unique libraries including zx7 (compression), adt (C++ STL containers), fzx (proportional fonts), BIFROST/NIRVANA/SP1 (zx), tritone music and bitfx sound effects for 1-bit audio devices.
* [new c library] Object oriented stdio allowing writing of sophisticated drivers using code inheritance from the library. Currently base classes implement serial character devices and terminal (console) devices.
* [new c library] Targets supported initially include cp/m, embedded (generic z80) and zx (zx spectrum). The built-in crts allow creation of terminal windows with assignable input source using fixed width or proportional fonts, output as ROM or RAM-resident programs.
* [new c library] The library and crts are highly configurable. Library build time options allow selection between fast and small library code and the crts can be configured at compile time by embedded pragmas in the C source code.

* [sdcc] sdcc is fully supported as alternate C compiler using the new C library.
* [sdcc] sdcc's output is improved by an additional 400 peephole rules supplied by z88dk
* [sdcc] sdcc's calls to its primitives are modified to use smaller and faster callee linkage

The combination sdcc+z88dk supplies a C compiler that behaves similarly to 32-bit C compilers. sdcc implements a large subset of C90/C95/C11 standards and the z88dk library completes the compliance. The only missing element is the disk i/o which is currently under development.

sccz80 will often create smaller code than sdcc particularly when longs and floats are in use.

Some benchmarks including Dhrystone 2.1 and Whetstone 1.2 comparing with some other commercial compilers:
http://www.z88dk.org/wiki/doku.php?id=t ... benchmarks

New documentation under construction:
http://www.z88dk.org/wiki/doku.php?id=temp:front

Collection of links describing how to compile with sdcc:
http://www.z88dk.org/wiki/doku.php?id=t ... _with_sdcc

Example programs using the classic library:
z88dk/examples

Example programs using the new c library and sdcc:
z88dk/libsrc/_DEVELOPMENT/EXAMPLES

PURPOSE OF A RELEASE CANDIDATE

We are hoping to identify problems with installation and use before an official release. Particularly we are looking for problems with using the new elements in the release.

1. Try making the new c library.

cd z88dk/libsrc/_DEVELOPMENT
windows: "Winmake all" (10-15 mins to complete)
other: "make"

2. Try compiling your own programs and some of the examples.

Thanks to anyone who can find the time at this time of year to do a little testing.
Alcoholics Anonymous
rst 0
 
Mensajes: 21
Registrado: Lun Feb 04, 2008 7:16 am

Re: z88dk v1.99A Release Candidate

Notapor radastan el Jue Dic 17, 2015 1:46 pm

I just maked minor changes to my "library" and all works:

"djnz, label" to "djnz label"

and

".label" to "label:"

Only receive a lot of "Looking for label XXXXX" compiling, but works fine. ¿Why?

Example:

Código: Seleccionar todo
extern unsigned char sprite_tile0 [];

#asm
   _sprite_tile0:
   DEFB   51, 51, 51, 51
   DEFB   51, 51, 51, 51
   DEFB   51, 51, 51, 51
   DEFB   51, 51, 51, 51
   DEFB   51, 51, 51, 51
   DEFB   51, 51, 51, 51
   DEFB   51, 51, 51, 51
   DEFB   51, 51, 51, 51

#endasm
_________________________________________
Hay otras páginas.... pero no son Bytemaniacos
http://www.bytemaniacos.com
Orgullo de 8 bits
_________________________________________
Avatar de Usuario
radastan
Phantomas
 
Mensajes: 2120
Registrado: Lun May 07, 2007 5:34 pm

Re: z88dk v1.99A Release Candidate

Notapor Alcoholics Anonymous el Jue Dic 17, 2015 10:36 pm

radastan escribió:I just maked minor changes to my "library" and all works:


Ok good thanks for checking :)

If you have time, check if you can compile using the new c library and optionally sdcc. The examples directory ( http://z88dk.cvs.sourceforge.net/viewvc/z88dk/z88dk/libsrc/_DEVELOPMENT/EXAMPLES/ ) has sample compile lines stored at the top of c files.

Only receive a lot of "Looking for label XXXXX" compiling, but works fine. ¿Why?


It will be okay. The message can be generated if the declarations are a little bit unusual.

Código: Seleccionar todo
extern unsigned char sprite_tile0 [];

#asm
   _sprite_tile0:
   DEFB   51, 51, 51, 51
   DEFB   51, 51, 51, 51
   DEFB   51, 51, 51, 51
   DEFB   51, 51, 51, 51
   DEFB   51, 51, 51, 51
   DEFB   51, 51, 51, 51
   DEFB   51, 51, 51, 51
   DEFB   51, 51, 51, 51

#endasm


sdcc cannot intermingle C and assembly language so this is deprecated in favour of completely separating C and asm into their own files. There is an sp1 demo here: http://z88dk.cvs.sourceforge.net/viewvc/z88dk/z88dk/libsrc/_DEVELOPMENT/EXAMPLES/zx/demo_sp1/ where you can see how this is done.

You'll also note that assembly code and data are placed into sections. This allows z88dk to generate a memory map, create code for ROMs and compile for bankswitched memory. The sections "code_user, bss_user, data_user, rodata_user, smc_user" are all automatically provided to allow user code to be placed within the default memory maps created by z88dk.

code_user = read only executable code
bss_user = initially zero data
data_user = initially non-zero data
rodata_user = initially non-zero read only data
smc_user = self modifying code
Alcoholics Anonymous
rst 0
 
Mensajes: 21
Registrado: Lun Feb 04, 2008 7:16 am

Re: z88dk v1.99A Release Candidate

Notapor radastan el Vie Dic 18, 2015 12:11 pm

I try to compile startrek example without success. A lot of things to fix.
Example: double_t needs to change to double, functions with a space in middle of name declaration... :cry:
_________________________________________
Hay otras páginas.... pero no son Bytemaniacos
http://www.bytemaniacos.com
Orgullo de 8 bits
_________________________________________
Avatar de Usuario
radastan
Phantomas
 
Mensajes: 2120
Registrado: Lun May 07, 2007 5:34 pm

Re: z88dk v1.99A Release Candidate

Notapor Alcoholics Anonymous el Vie Dic 18, 2015 2:53 pm

radastan escribió:I try to compile startrek example without success. A lot of things to fix.
Example: double_t needs to change to double, functions with a space in middle of name declaration... :cry:


double_t and float_t are defined in math.h. These were introduced in C95 I think and within z88dk they get rid of all the warnings generated by sdcc since sdcc has a float type and not a double type (in sdcc float_t=float and double_t=float and in sccz80 float_t=double and double_t=double).

The whitespace is ok.

startrek.c happens to be the most difficult one to compile and requires you to know a little more about what's going on so I'm happy to give some instructions here :)

Near the top of the file:

// The libraries must be rebuilt with %sdf enabled for printf
// zcc +zx -vn -SO3 -startup=4 -clib=sdcc_ix --reserve-regs-iy --max-allocs-per-node200000 startrek.c -o startrek -lm
// appmake +zx -b startrek_CODE.bin -o startrek.tap --org 30000 --blockname strek

1. The default library compiles without %aefg enabled in printf. This keeps float math out of typical compiles but startrek.c prints floats (and in fact uses %sdf as noted in the comments). So you have to enable %sdf and rebuild the library.


* open the file z88dk/libsrc/_DEVELOPMENT/target/zx/clib_cfg.asm (on web: http://z88dk.cvs.sourceforge.net/viewvc ... iew=markup )

This file contains the zx library's configuration. Scroll down to "defc __CLIB_OPT_PRINTF = $3fffff" (line 249 on web). Each bit corresponds to a particular printf converter which can be individually enabled or disabled in order to reduce program size. startrek.c needs %sdf which corresponds to $4000201. I left that in the file commented out (line 248 on web). Uncomment that and comment out the current value:

defc __CLIB_OPT_PRINTF = $4000201
;; defc __CLIB_OPT_PRINTF = $3fffff

Save this configuration.

2. Rebuild the zx library.

cd z88dk/libsrc/_DEVELOPMENT
Winmake zx

If you're not on windows, that should be "make zx"

Now printf will only understand %sdf

3. Compile startrek.c

cd EXAMPLES
zcc +zx -vn -SO3 -startup=4 -clib=sdcc_ix --reserve-regs-iy --max-allocs-per-node200000 startrek.c -o startrek -lm
appmake +zx -b startrek_CODE.bin -o startrek.tap --org 30000 --blockname strek

With --max-allocs-per-node very high at 200000, sdcc can be very slow compiling large programs and in this case it takes about 8 minutes on my machine. Be prepared to wait a little bit!

This program must be compiled with sdcc rather than sccz80 because it uses multi-dimensional arrays so it cannot be compiled with sccz80 without modifications.

In order to compile with sdcc you must first install sdcc. There are some brief instructions here: http://www.z88dk.org/wiki/doku.php?id=temp:front#sdcc1

a. go to the sdcc nightly build page. My machine is win64 so I would download the latest under heading "Supported Windows - x86_64 Binaries". I prefer the zip file and not the exe setup.
b. unzip wherever you like.
c. add sdcc/bin to your path
d. for windows, copy "zsdcc.exe" from http://z88dk.cvs.sourceforge.net/viewvc ... _patch.zip to sdcc/bin

If you're not running windows it's a little more complicated and you'll have to compile sdcc yourself.

4. LOAD "" tap file.

Let me know if this doesn't work for you. I just went through the steps and had no problems.

5. Restore the libarary configuration

* Set "defc __CLIB_OPT_PRINTF = $3fffff" in z88dk/libsrc/_DEVELOPMENT/target/zx/clib_cfg.asm
* Rebuild zx library: cd z88dk/libsrc/_DEVELOPMENT ; Winmake zx

A few of the examples do have to be patched, see:
http://www.z88dk.org/forum/viewtopic.php?id=9172
Alcoholics Anonymous
rst 0
 
Mensajes: 21
Registrado: Lun Feb 04, 2008 7:16 am

Re: z88dk v1.99A Release Candidate

Notapor Alcoholics Anonymous el Vie Dic 18, 2015 8:40 pm

I think I know what the confusion is.

Your are compiling with sccz80 and the classic C library if you use a 'normal' compile line like this:
zcc +zx -vn -O3 test.c -o test -lndos

You are compiling with sccz80 and the new C library if you use a compile line like this:
zcc +zx -vn -O3 -clib=new test.c -o test

You are compiling with sdcc and the new C library if you use a compile line like this:
zcc +zx -vn -SO3 -clib=sdcc_ix --reserve-regs-iy --max-allocs-per-node200000 test.c -o test
zcc +zx -vn -SO3 -clib=sdcc_iy --max-allocs-per-node200000 test.c -o test

The new C library and the classic C library are completely separate and use separate crts. The new C library tries to implement a healthy subset of C11 and is highly configurable.

startrek.c cannot be compiled with the classic C library as-is.
Alcoholics Anonymous
rst 0
 
Mensajes: 21
Registrado: Lun Feb 04, 2008 7:16 am

Re: z88dk v1.99A Release Candidate

Notapor Alcoholics Anonymous el Jue Dic 24, 2015 7:26 am

z88dk 1.99A has been released and is available at sourceforge for download.

Thanks to anyone who had a chance to do some testing. A few minor issues were found and corrected in the release.


CHANGES (brief)


z88dk 1.99A 23.Dec.2015
Major changes incorporated into z88dk. This is a transition release in anticipation of v2.0.

Two C compilers are supported (sccz80 - z88dk's native C compiler - and sdcc).
Two different C libraries are present (classic - the same library as pre 1.99A - and new).

Accordingly, there are now three different compile modes:

1. Compile with sccz80 and the classic C library. This is equivalent to pre-1.99A.
2. Compile with sccz80 and the new C library. Compile lines include "-clib=new".
3. Compile with sdcc and the new C library. Compile lines include "-clib=sdcc_ix" or "-clib=sdcc_iy".

[z80asm] Sections have been introduced for generating memory maps and compiling to bankswitched memory.
[z80asm] Modern logical operators have been adopted.
[z80asm] New scoping keywords PUBLIC, EXTERN and GLOBAL introduced.
[z80asm] Relocate files are generated for output binaries for patching assembled code to a new address at load time.
[sccz80] Numerous bugfixes.
[sdcc] SDCC is now fully supported as alternate C compiler for the new C library.
[sdcc] SDCC's generated code is improved by a large set of aggressive peephole rules (use -SO3 to enable).
[sdcc] SDCC's calls to its primitive functions are modified to use callee linkage.
[new c lib] New C library written in assembly language from scratch aiming for a subset of C11 compliance. Contains more than 700 functions currently.
[new c lib] Stdio made object-oriented so that drivers can inherit library code to implement features with a minimal amount of additional code.
[new c lib] Stdio base classes currently include serial character i/o and terminal i/o implementing windows and proportional fonts. Disk i/o is missing in this release.
[new c lib] Unique stdio implementation allows removal of high level buffers without affecting performance.
[new c lib] Many functions from GNU and POSIX are present beyond the C11 standard.
[new c lib] Many unique libraries including some C++ STL containers, data compression, obstacks, game libraries, sound, fzx proportional fonts, etc. The new C lib contains libraries not present in the classic C lib and vice versa. Over time the two libraries will homogenize.
[new c lib] CRTs are supplied for three initial targets: embedded (generic z80), cpm, zx (zx spectrum). Specialized crts allow immediate compilation without customization by the user.
[new c lib] The library and crts are highly configurable at library build time and at compile time. Options allow easy generation of binaries for ROM or RAM targets.
[tools] New tool ticks is a command line z80 emulator able to exactly measure execution time of a code block.
[tools] New tool dzx7 is a decompressor counterpart to zx7.
[tools] New tool zx7 is an optimal lz77/lzss data compressor with companion decompression subroutines in the z80 library.
[appmake] +rom added to manipulate raw binaries; options include code injection, extraction and conversion to intel hex format.

The new C library completes C standards compliance for sdcc and leads to much smaller and faster output binaries. sdcc's longlong type is not supported in this release.

Documentation is a work in progress.

Installation:
http://www.z88dk.org/wiki/doku.php?id=t ... stallation

Overview, Classic C Library Information:
http://www.z88dk.org/wiki/doku.php

Overview, New C Library Description, SDCC compilation described:
http://www.z88dk.org/wiki/doku.php?id=temp:front

Some benchmarks:
http://www.z88dk.org/wiki/doku.php?id=t ... benchmarks
Alcoholics Anonymous
rst 0
 
Mensajes: 21
Registrado: Lun Feb 04, 2008 7:16 am

Re: z88dk v1.99A Release Candidate

Notapor radastan el Jue Dic 24, 2015 2:31 pm

A great Christmast present! Thanks!
_________________________________________
Hay otras páginas.... pero no son Bytemaniacos
http://www.bytemaniacos.com
Orgullo de 8 bits
_________________________________________
Avatar de Usuario
radastan
Phantomas
 
Mensajes: 2120
Registrado: Lun May 07, 2007 5:34 pm

Re: z88dk v1.99A Release Candidate

Notapor Alcoholics Anonymous el Vie Ene 22, 2016 8:10 am

z88dk's version of sdcc (zsdcc) has been patched to make the peepholer more accurate. This will improve code quality by some amount. You can update zsdcc in the usual way by following instructions here: http://www.z88dk.org/wiki/doku.php?id=temp:front#sdcc1

More details can be found in this thread: http://www.z88dk.org/forum/viewtopic.php?id=9221 . But not too many more :P
Alcoholics Anonymous
rst 0
 
Mensajes: 21
Registrado: Lun Feb 04, 2008 7:16 am


Volver a Noticias, eventos y presentaciones

¿Quién está conectado?

Usuarios navegando este Foro: No hay usuarios registrados visitando el Foro y 0 invitados