agn453 / HI-TECH-Z80-C

HI-TECH Z80 CP/M C compiler v3.09 and updates
Other
128 stars 19 forks source link

DOS message too long? #14

Closed tsupplis closed 3 years ago

tsupplis commented 3 years ago

I get a very weird problem with the new message, in one of my test scenarios, the c front end generates garbled content. if I reduce by one character (removing the dot at the end) everything goes fine....

I suppose it is a question of address access but where and how? no clues.

the issue appears when I try to compile:

c -v -r testbios.c

I get this weird trace

zxcc c --v --r testbios.c
HI-TECH C COMPILER (CP/M-80) V3.09-P009.1-dev
Copyright (C) 1984-2021 HI-TECH SOFTWARE
0:CPP -DCPM -DHI_TECH_C -D_HTC_C -Dz80 -D_HTC_REDIR -I P:TESTBIOS.C $CTMP1.$$$
1:P:K: Not found - change disks, hit a key

rather than the expected:

zxcc c --v --r testbios.c
HI-TECH C COMPILER (CP/M-80) V3.09-P009.1-dev
Copyright (C) 1984-2021 HI-TECH SOFTWARE
0:CPP -DCPM -DHI_TECH_C -D_HTC_C -Dz80 -D_HTC_REDIR -I P:TESTBIOS.C $CTMP1.$$$
0:P1 $CTMP1.$$$ $CTMP2.$$$ $CTMP3.$$$
0:CGEN $CTMP2.$$$ $CTMP1.$$$
0:ZAS -N -oTESTBIOS.OBJ $CTMP1.$$$

No idea whatsoever ....

agn453 commented 3 years ago

I changed it from

This program requires a Z80 processor.

to

This CP/M program requires a Z80 CPU.

which is one less character.

Maybe the issue I'm seeing is also related to some weird memory side-effect too.

tsupplis commented 3 years ago

'This CP/M program requires a Z80 CPU.' causes the problem vs the version I had which was 3 character less 'This CP/M program requires a Z80 CPU' without the dot worked. For the time being I just reduced it to 'CP/M program for Z80 CPU.' 😀

Stopping for this morning ... It was a fun night but I am getting flaky 😉 I will spend next week end trying to transform my tests into regressions. I think we need that.

agn453 commented 3 years ago

I've just modified the x86 test code for detecting execution under MS-DOS. The ZAS optimisation was changing a JP to a JR instruction. Let me know if this fixes your issue running under zxcc in your branch.

Tony

tsupplis commented 3 years ago
[thierry@local]zxcc testver.com
CP/M BDOS Version (3.1)
Machine (MCS80/Z80)
BDOS Address (0xFE00)
BIOS Address (0xFF00)
TPA Size (63.2K)
[thierry@local]emu2 testver.com
This CP/M program requires a Z80 CPU.

works perfectly. all tests compiled properly and passed too.