KW: Is there a recommended set of command line options for Z88DK and the Next?
Moderator: Programming Moderators
- MrKWatkins
- Posts: 39
- Joined: Tue May 30, 2017 8:37 pm
- MrKWatkins
- Posts: 39
- Joined: Tue May 30, 2017 8:37 pm
Re: KW: Is there a recommended set of command line options for Z88DK and the Next?
...On that subject are there any other command line options other than -lm I need to use to get the floating point maths working for the Next? I'm trying to use the roundf function but I'm getting:
Code: Select all
Errors in source file D:\z88dk\lib\config\..\..\\libsrc\_DEVELOPMENT\target\zxn\zxn_crt.asm:
Error at file 'math/float/math48/c/sdcc_iy/cm48_sdcciy_round_fastcall.asm' line 15: symbol 'am48_round' not defined
-
- Posts: 459
- Joined: Mon May 29, 2017 7:00 pm
Re: KW: Is there a recommended set of command line options for Z88DK and the Next?
Just -lm is needed but not every function in the standard is implemented. Unfortunately round is one of them (floor, ceil and of course conversion to int/long is there). I probably ran out of gas at that point but if you need it I can maybe finish it off.MrKWatkins wrote: ↑Fri Oct 05, 2018 10:00 pm...On that subject are there any other command line options other than -lm I need to use to get the floating point maths working for the Next? I'm trying to use the roundf function but I'm getting:
Any ideas? Might be my code of course...Code: Select all
Errors in source file D:\z88dk\lib\config\..\..\\libsrc\_DEVELOPMENT\target\zxn\zxn_crt.asm: Error at file 'math/float/math48/c/sdcc_iy/cm48_sdcciy_round_fastcall.asm' line 15: symbol 'am48_round' not defined
The set of functions in the float library is here:
https://github.com/z88dk/z88dk/tree/mas ... math48/z80
Some of those files are empty and those are the ones not implemented. You can't see the file sizes in the web interface but it looks like it's all the ones with the comment "new math48 directory structure to act as template for other math libr…"
- MrKWatkins
- Posts: 39
- Joined: Tue May 30, 2017 8:37 pm
Re: KW: Is there a recommended set of command line options for Z88DK and the Next?
No it's not urgent, a cast to byte is good enough for now.Alcoholics Anonymous wrote: ↑Sat Oct 06, 2018 5:38 amI probably ran out of gas at that point but if you need it I can maybe finish it off.
Happy to look at implementing myself if you're accepting pull requests?
-
- Posts: 459
- Joined: Mon May 29, 2017 7:00 pm
Re: KW: Is there a recommended set of command line options for Z88DK and the Next?
Yes it's open and we always accept pull requests.MrKWatkins wrote: ↑Sat Oct 06, 2018 10:20 amHappy to look at implementing myself if you're accepting pull requests?
The floating point format described by the original programmer (and maybe you recognize the name Anders Hjelsberg

https://github.com/z88dk/z88dk/blob/mas ... AL.txt#L42
A 48-bit float is held in registers BCDEHL; this allows two floats to be held in registers at the same time one in the main set and the other in the EXX set.
The code has been changed by putting the primary accumulator in the EXX set (called AC' for accumulator in the exx set) and the secondary operand in the main set (called AC for accumulator in the main set). Some investigation of floor, ceil, trunc, and the dfix functions may help to understand what has to be done for round.
Who is online
Users browsing this forum: No registered users and 1 guest