Skip to content

Commit

Permalink
Release v3.09-8 with Z280 MPU support for overlays etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
agn453 committed Jan 15, 2021
1 parent 7e0c30f commit 3b2ed49
Show file tree
Hide file tree
Showing 18 changed files with 929 additions and 84 deletions.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ emulation using RunZ80, SIMH or ZXCC.
Each release is a consolidated milestone with various updates and
patches applied.

The latest release is V3.09-7b (see Modification History below).
The latest release is V3.09-8 (see Modification History below).

I welcome bug reports/fixes and additional commentry and discussion.

Expand Down Expand Up @@ -926,6 +926,27 @@ been adjusted to be consistently in uppercase.

I've re-issued this as a revised v3.09-7b release too.


### Release v3.09-8 (support for Z280 MPU)

The compiler front-end source in cpm/C.C has been updated so that it
can be compiled to produce a Z280 MPU version. Co-existence with the Z80
version is now also possible due to the renaming of the various Z280 versions
start-up modules to C280CPM.OBJ, D280CPM.OBJ and R280CPM.OBJ.

The original source-code to the C280 front-end is lost (not included with the
UZI-280 distribution files) - so now Z280 users (like me) have the updated
version supporting overlays etc.

You'll find updated Z280 files in the *z280dist* folder. The
z280dist/C280-8.COM is the new front-end and can be copied to the system
drive as C280.COM. It tests for, and will only run on a Z280 MPU.
Be sure to copy the start-up object modules (?280CPM.OBJ files) and
the z280dist/LIB280*.LIB libraries to the system drive too.

This is also a new release milestone at v3.09-8.


--
Tony Nicholson
15-Jan-2021
94 changes: 94 additions & 0 deletions cpm/BUILD-C.LOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@

10E>;
10E>date
A:DATE COM (User 0)
Fri 15/01/2021 12:20:27
10E>;
10E>; Build Z80 version
10E>c -o -v c309-8.c
A:C COM (User 0)
Hi-Tech C Compiler (CP/M-80) V3.09-7
Copyright (C) 1984-87 HI-TECH SOFTWARE
Updated from https://github.com/agn453/HI-TECH-Z80-C
0:A:CPP -DCPM -DHI_TECH_C -Dz80 -I0:A: C309-8.C M:$CTMP1.$$$
0:A:P1 M:$CTMP1.$$$ M:$CTMP2.$$$ M:$CTMP3.$$$
0:A:CGEN M:$CTMP2.$$$ M:$CTMP1.$$$
0:A:OPTIM M:$CTMP1.$$$ M:$CTMP2.$$$
0:A:ZAS -J -N -OC309-8.OBJ M:$CTMP2.$$$
ERA M:$CTMP1.$$$
ERA M:$CTMP2.$$$
ERA M:$CTMP3.$$$
ERA M:$CTMP5.$$$
0:A:LINQ -Z -Ptext=0,data,bss -C100H -OC309-8.COM 0:A:CRTCPM.OBJ C309-8.OBJ 0:A:LIBC.LIB
ERA C309-8.OBJ
ERA M:$$EXEC.$$$

10E>;
10E>; Now build Z280 version
10E>;
10E>; First a Z280 version using the Z80 LIBC.C (runs on Z80)
10E>c309-8 -o -v -ec280z80.com -dZ280 c309-8.c
E:C309-8 COM
Hi-Tech C Compiler (CP/M-80) V3.09-8
Copyright (C) 1984-87 HI-TECH SOFTWARE
Updated from https://github.com/agn453/HI-TECH-Z80-C
0:A:CPP -DCPM -DHI_TECH_C -DZ80 -DZ280 -I0:A: C309-8.C M:$CTMP1.$$$
0:A:P1 M:$CTMP1.$$$ M:$CTMP2.$$$ M:$CTMP3.$$$
0:A:CGEN M:$CTMP2.$$$ M:$CTMP1.$$$
0:A:OPTIM M:$CTMP1.$$$ M:$CTMP2.$$$
0:A:ZAS -J -N -OC309-8.OBJ M:$CTMP2.$$$
ERA M:$CTMP1.$$$
ERA M:$CTMP2.$$$
ERA M:$CTMP3.$$$
ERA M:$CTMP5.$$$
0:A:LINQ -Z -Ptext=0,data,bss -C100H -OC280Z80.COM 0:A:CRTCPM.OBJ C309-8.OBJ 0:A:LIBC.LIB
ERA C309-8.OBJ
ERA M:$$EXEC.$$$

10E>;
10E>; and the Z280 optimized version from it (only runs on a Z280)
10E>c280z80 -of2 -v -ec280-8.com c309-8.c
E:C280Z80 COM
Hi-Tech C Compiler (CP/M-80) V3.09-8 [Z280 MPU version]
Copyright (C) 1984-87 HI-TECH SOFTWARE
Updated from https://github.com/agn453/HI-TECH-Z80-C
0:A:CPP -DCPM -DHI_TECH_C -DZ80 -DZ280 -I0:A: C309-8.C M:$CTMP1.$$$
0:A:P1 M:$CTMP1.$$$ M:$CTMP2.$$$ M:$CTMP3.$$$
0:A:CGEN M:$CTMP2.$$$ M:$CTMP1.$$$
0:A:OPTIM -F M:$CTMP1.$$$ M:$CTMP2.$$$
0:A:OPTIMH M:$CTMP2.$$$ M:$CTMP5.$$$
576 bytes optimized away
1452 bytes replaced
0:A:ZAS -N -OC309-8.OBJ M:$CTMP5.$$$
ERA M:$CTMP1.$$$
ERA M:$CTMP2.$$$
ERA M:$CTMP3.$$$
ERA M:$CTMP5.$$$
0:A:LINQ -Z -Ptext=0,data,bss -C100H -OC280-8.COM 0:A:C280CPM.OBJ C309-8.OBJ 0:A:LIB280C.LIB
ERA C309-8.OBJ
ERA M:$$EXEC.$$$

10E>;
10E>dir c*.com [fu
A:DIR COM (User 0)

Scanning Directory...

Sorting Directory...

Directory For Drive E: User 10

Name Bytes Recs Attributes Prot Update Create
------------ ------ ------ ------------ ------ -------------- --------------

C280-8 COM 24k 191 Dir RW None 15/01/21 12:30 15/01/21 12:30
C280Z80 COM 28k 203 Dir RW None 15/01/21 12:26 15/01/21 12:26
C309-8 COM 28k 201 Dir RW None 15/01/21 12:23 15/01/21 12:23

Total Bytes = 80k Total Records = 595 Files Found = 3
Total 1k Blocks = 76 Used/Max Dir Entries For Drive E: 1064/2048

10E>;
10E>; Done
10E>put console to console
A:PUT COM (User 0)
Expand Down
20 changes: 20 additions & 0 deletions cpm/BUILD-C.SUB
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
era build-c.log
put console output to file build-c.log [system]
;
date
;
; Build Z80 version
c -o -v c309-8.c
;
; Now build Z280 version
;
; First a Z280 version using the Z80 LIBC.C (runs on Z80)
c309-8 -o -v -ec280z80.com -dZ280 c309-8.c
;
; and the Z280 optimized version from it (only runs on a Z280)
c280z80 -of2 -v -ec280-8.com c309-8.c
;
dir c*.com [fu
;
; Done
put console to console
5 changes: 5 additions & 0 deletions cpm/BUILDCRT.SUB
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
;
; Build the start-up modules
;
c -c -o zcrtcpm.as zdrtcpm.as zrrtcpm.as
c280 -c -o zc280cpm.as zd280cpm.as zr280cpm.as
69 changes: 61 additions & 8 deletions cpm/C.C
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
| Revised to better support building self-relocating .COM files and |
| overlays by automating the building of the resident and overlay |
| portions (new -Y compiler flag). |
| |
| For new features, re-implement Z280 version (original sources lost) |
\*----------------------------------------------------------------------*/

#include <stdio.h>
Expand Down Expand Up @@ -71,6 +73,9 @@ static char
reloc, /* auto-relocate program at run time */
xref, /* generate cross reference listing */
nolocal, /* strip local symbols */
#ifdef Z280
z280optim, /* Z280 code optimization */
#endif
overlay=0; /* build with overlays */

static char
Expand All @@ -95,13 +100,24 @@ static char *paths[] =
"OPTIM",
"CPP",
"ZAS",
#ifdef Z280
"LIB280",
#else
"LIB",
#endif
"P1",
#ifdef Z280
"C280CPM.OBJ",
#else
"CRTCPM.OBJ",
#endif
"$EXEC",
"CREF",
"SYMTOAS",
"OPTIONS",
#ifdef Z280
"OPTIMH",
#endif
};

#define linker paths[0]
Expand All @@ -117,6 +133,9 @@ static char *paths[] =
#define cref paths[10]
#define symtoas paths[11]
#define options paths[12]
#ifdef Z280
#define optimh paths[13]
#endif

#define RELSTRT strtoff[plen]

Expand Down Expand Up @@ -146,15 +165,22 @@ static char *tempm[] =
#define l_dot_obj temps[4]
#define execmd temps[5]
#define crtmp temps[6]
#define tmpas temps[7]
#define tmpf5 temps[7]

#define osegs tempm[0]
#define nsegs tempm[1]
#define rsegs tempm[2]

static int cbase = 0x0100;

static char *cppdef[] = { "-DCPM", "-DHI_TECH_C", "-Dz80" };
static char *cppdef[] = {
"-DCPM",
"-DHI_TECH_C",
"-DZ80",
#ifdef Z280
"-DZ280",
#endif
};
static char *cpppath = "-I";

static char tmpbuf[128]; /* gen. purpose buffer */
Expand Down Expand Up @@ -200,8 +226,11 @@ int main(int argc, char **argv)
signal_t prev_sig;
prev_sig=signal(SIGINT,SIG_IGN);

fprintf(stderr, "Hi-Tech C Compiler (CP/M-80) V3.09-7\n");
fprintf(stderr, "Copyright (C) 1984-87 HI-TECH SOFTWARE\n");
fprintf(stderr, "Hi-Tech C Compiler (CP/M-80) V3.09-8");
#ifdef Z280
fprintf(stderr, " [Z280 MPU version]");
#endif
fprintf(stderr, "\nCopyright (C) 1984-87 HI-TECH SOFTWARE\n");
fprintf(stderr, "Updated from https://github.com/agn453/HI-TECH-Z80-C\n");
#if EDUC
fprintf(stderr, "Licensed for Educational purposes only\n");
Expand Down Expand Up @@ -265,7 +294,13 @@ int main(int argc, char **argv)
case 'O':
optimize = 1;
if(argv[0][2] == 'F' || argv[0][2] == 'f')
{
speed = 1;
#ifdef Z280
if (argv[0][3] == '2')
z280optim = 1;
#endif
}
break;

case 'I':
Expand Down Expand Up @@ -417,7 +452,7 @@ void doit()
rm(RM_FILE, tmpf1);
rm(RM_FILE, tmpf2);
rm(RM_FILE, tmpf3);
rm(RM_FILE, tmpas);
rm(RM_FILE, tmpf5);
if (!keep)
{
char * segopt = 0;
Expand Down Expand Up @@ -677,7 +712,7 @@ void assemble_sym(char *s)
{
cbase = sym2as(s);
vec[0] = s;
vec[1] = tmpas;
vec[1] = tmpf5;
vec[2] = 0;
doexec(symtoas, vec);
put_cmd(TRAP);
Expand All @@ -698,7 +733,7 @@ void assemble_sym(char *s)
*rindex(buf, '.') = 0;
strcat(buf, ".OBJ");
vec[i++] = buf;
vec[i++] = tmpas;
vec[i++] = tmpf5;
vec[i] = (char *)0;
doexec(assem, vec);
}
Expand Down Expand Up @@ -778,15 +813,33 @@ void compile(char *s)
if (speed)
vec[i++] = "-F";
vec[i++] = tmpf1;
#ifdef Z280
if (keepas && !z280optim)
#else
if (keepas)
#endif
vec[i++] = strcat(strcpy(tmpbuf, s), ".AS");
else
vec[i++] = tmpf2;
vec[i] = (char *)0;
doexec(optim, vec);
cp = tmpf2;
#ifdef Z280
if (z280optim)
{
i = 0;
vec[i++] = cp;
if (keepas)
vec[i++] = strcat(strcpy(tmpbuf, s), ".AS");
else
vec[i++] = tmpf5;
vec[i] = (char *)0;
doexec(optimh, vec);
cp = tmpf5;
}
#endif
if (keepas)
return;
cp = tmpf2;
}
i = 0;
if (nolocal)
Expand Down
Binary file renamed dist/C309-7.COM → dist/C309-8.COM
Binary file not shown.

0 comments on commit 3b2ed49

Please sign in to comment.