sscanf, fscanf etc on clib=8080 missing
sscanf, fscanf etc on clib=8080 missing
I am on a project to convert my inettools-z80 repo to run on 8080 cpu.
I am hitting a small bug. Seems to be the same one every time.
Here is the zcc version
zcc - Frontend for the z88dk Cross-C Compiler - v19234-6605bce02-20220124
This should be very recent.
$ grep error log
libhost.c::Hosts_Init::3::3:70: error: undefined symbol: fscanf
telnet_client.c::main::3::10:152: error: undefined symbol: sscanf
telnet_client.c::main::2::23:243: error: undefined symbol: _InStat
telnet_client.c::main::3::24:245: error: undefined symbol: _InChar
libhost.c::Hosts_Init::3::3:70: error: undefined symbol: fscanf
ping.c::main::3::5:121: error: undefined symbol: sscanf
libhost.c::Hosts_Init::3::3:70: error: undefined symbol: fscanf
libhost.c::Hosts_Init::3::3:70: error: undefined symbol: fscanf
htget.c::main::2::19:247: error: undefined symbol: sscanf
libhost.c::Hosts_Init::3::3:70: error: undefined symbol: fscanf
htlist.c::main::3::27:292: error: undefined symbol: sscanf
libhost.c::Hosts_Init::3::3:70: error: undefined symbol: fscanf
libhost.c::Hosts_Init::3::3:70: error: undefined symbol: fscanf
libhost.c::Hosts_Init::3::3:70: error: undefined symbol: fscanf
mac.c::main::1::3:28: error: undefined symbol: scanf
Typical:
$ make
zcc +cpm -create-app -clib=8080 -s -m -pragma-include:zpragma.inc -DAMALLOC2 -oifconfig -Wunused addrprint.o w5500.o dhcp.o spi.o socket.o ethernet.o dns.o libhost.o libinet.o
libhost.c::Hosts_Init::3::3:70: error: undefined symbol: fscanf
^---- fscanf
make: *** [Makefile:47: ifconfig] Error 1
I create a very short test program
#include <stdio.h>
main()
{
FILE *in;
int i,j;
fscanf(in, "%d %d",&i,&j);
}
$ zcc +cpm test.c
$ zcc +cpm -clib=8080 test.c
C:/cygwin64/home/lbmgm/projects/z88dk/lib/../lib/crt/classic/crt_runtime_selecti
on.asm:96: error: undefined symbol: __scanf_handle_d
^---- __scanf_handle_d
test.c::main::0::1:3: error: undefined symbol: fscanf
^---- fscanf
I am hitting a small bug. Seems to be the same one every time.
Here is the zcc version
zcc - Frontend for the z88dk Cross-C Compiler - v19234-6605bce02-20220124
This should be very recent.
$ grep error log
libhost.c::Hosts_Init::3::3:70: error: undefined symbol: fscanf
telnet_client.c::main::3::10:152: error: undefined symbol: sscanf
telnet_client.c::main::2::23:243: error: undefined symbol: _InStat
telnet_client.c::main::3::24:245: error: undefined symbol: _InChar
libhost.c::Hosts_Init::3::3:70: error: undefined symbol: fscanf
ping.c::main::3::5:121: error: undefined symbol: sscanf
libhost.c::Hosts_Init::3::3:70: error: undefined symbol: fscanf
libhost.c::Hosts_Init::3::3:70: error: undefined symbol: fscanf
htget.c::main::2::19:247: error: undefined symbol: sscanf
libhost.c::Hosts_Init::3::3:70: error: undefined symbol: fscanf
htlist.c::main::3::27:292: error: undefined symbol: sscanf
libhost.c::Hosts_Init::3::3:70: error: undefined symbol: fscanf
libhost.c::Hosts_Init::3::3:70: error: undefined symbol: fscanf
libhost.c::Hosts_Init::3::3:70: error: undefined symbol: fscanf
mac.c::main::1::3:28: error: undefined symbol: scanf
Typical:
$ make
zcc +cpm -create-app -clib=8080 -s -m -pragma-include:zpragma.inc -DAMALLOC2 -oifconfig -Wunused addrprint.o w5500.o dhcp.o spi.o socket.o ethernet.o dns.o libhost.o libinet.o
libhost.c::Hosts_Init::3::3:70: error: undefined symbol: fscanf
^---- fscanf
make: *** [Makefile:47: ifconfig] Error 1
I create a very short test program
#include <stdio.h>
main()
{
FILE *in;
int i,j;
fscanf(in, "%d %d",&i,&j);
}
$ zcc +cpm test.c
$ zcc +cpm -clib=8080 test.c
C:/cygwin64/home/lbmgm/projects/z88dk/lib/../lib/crt/classic/crt_runtime_selecti
on.asm:96: error: undefined symbol: __scanf_handle_d
^---- __scanf_handle_d
test.c::main::0::1:3: error: undefined symbol: fscanf
^---- fscanf
Re: sscanf, fscanf etc on clib=8080 missing
That one is documented here: https://github.com/z88dk/z88dk/wiki/Classic-8080#stdioh
I’ll need to look at the code to see how long it’ll take to port over to 8080.
I’ll need to look at the code to see how long it’ll take to port over to 8080.
Re: sscanf, fscanf etc on clib=8080 missing
Actually what formatters do you need? I should have a C version somewhere that won't be a feature rich, but should be a quick drop in.
Re: sscanf, fscanf etc on clib=8080 missing
The ones listed above, sscanf, fscanf and scanf.
If you have that in C, I'd be happy with that.
If you have that in C, I'd be happy with that.
Re: sscanf, fscanf etc on clib=8080 missing
I had a look at updating the regular version - shouldn’t take too long so I’ll aim for that rather than a different version.
Hopefully should be done in the next few days.
Hopefully should be done in the next few days.
Re: sscanf, fscanf etc on clib=8080 missing
..or hours. The next nightly should have a version of the scanf family available for 808x.
Re: sscanf, fscanf etc on clib=8080 missing
wow, thanks for the fast turn around.
Re: sscanf, fscanf etc on clib=8080 missing
Getting there:
__scanf_handle_c.asm:18: error: undefined symbol: __scanf_get_width
This seems to be the last one.
__scanf_handle_c.asm:18: error: undefined symbol: __scanf_get_width
This seems to be the last one.
Re: sscanf, fscanf etc on clib=8080 missing
in ~/stdio/__scanf_8080.asm
at line 110 is ___scanf_get_width:
But there is no PUBLIC for it.
Attempting a rebuild with the PUBLIC added. My success rate
has been zero in the past, but worth a try.
at line 110 is ___scanf_get_width:
But there is no PUBLIC for it.
Attempting a rebuild with the PUBLIC added. My success rate
has been zero in the past, but worth a try.
Re: sscanf, fscanf etc on clib=8080 missing
Well, that was as expected. I can't build it.
make cpm8080_clib.lib
--- Building CP/M Library (8080)---
TARGET=cpm TYPE=8080 DEVICE=nodevice z88dk-z80asm -d -Ic:\cygwin64\home\lbmgm\projects\z88dk\lib\config/../ -m8080 -DSTANDARDESCAPECHARS -x/home/lbmgm/projects/z88dk/libsrc//cpm8080_clib @/home/lbmgm/projects/z88dk/libsrc//../libsrc//target/cpm/cpm_8080.lst
error: file open: /home/lbmgm/projects/z88dk/libsrc//../libsrc//target/cpm/cpm_8080.lst
make: [Makefile:713: cpm8080_clib.lib] Error 1 (ignored)
I did find that there is an extra _ on the lable ___scanf_get_width it shoud be __scanf_get_width
make cpm8080_clib.lib
--- Building CP/M Library (8080)---
TARGET=cpm TYPE=8080 DEVICE=nodevice z88dk-z80asm -d -Ic:\cygwin64\home\lbmgm\projects\z88dk\lib\config/../ -m8080 -DSTANDARDESCAPECHARS -x/home/lbmgm/projects/z88dk/libsrc//cpm8080_clib @/home/lbmgm/projects/z88dk/libsrc//../libsrc//target/cpm/cpm_8080.lst
error: file open: /home/lbmgm/projects/z88dk/libsrc//../libsrc//target/cpm/cpm_8080.lst
make: [Makefile:713: cpm8080_clib.lib] Error 1 (ignored)
I did find that there is an extra _ on the lable ___scanf_get_width it shoud be __scanf_get_width
Re: sscanf, fscanf etc on clib=8080 missing
Oh I’m sorry. Because there’s a test I assumed all formatters were tested. Turns out only %d is covered.
I shall sort that this evening. Apologies.
I shall sort that this evening. Apologies.
Re: sscanf, fscanf etc on clib=8080 missing
No problem. Thanks for taking care of this.
Re: sscanf, fscanf etc on clib=8080 missing
Thanks for the understanding, there's now quite few tests: https://github.com/z88dk/z88dk/blob/mas ... io/scanf.c and z80 and 8080 versions both produce the same results.
The only thing missing is the the %f handler which I'll leave for a rainy day.
The only thing missing is the the %f handler which I'll leave for a rainy day.
Re: sscanf, fscanf etc on clib=8080 missing
o.k. I don't need floating point output for basic ethernet anyway. Maybe next week when I start working on the 9511 coprocessor. wink!
Re: sscanf, fscanf etc on clib=8080 missing
Don't write it, use @feilipu's code with the --am9511 option!
In all seriousness if you do need it, let me know and I'll fix it up.
Re: sscanf, fscanf etc on clib=8080 missing
I am getting a clean build now.
Not really planning to do a 9511 on my 8080 (maybe next year) but Will be working on it for z80 S100 platform. I
don't think this will require any additional code work.....
Not really planning to do a 9511 on my 8080 (maybe next year) but Will be working on it for z80 S100 platform. I
don't think this will require any additional code work.....