forked from MirrorRepos/RomWBW
Browse Source
- Attempting to sync ZXCC with latest source in repository by Tony Nicholson. Generally a failure, but it is closer.patch
150 changed files with 4289 additions and 3431 deletions
@ -1,13 +1,11 @@ |
|||||
@echo off |
@echo off |
||||
setlocal |
setlocal |
||||
|
|
||||
set PATH=%PATH%;..\..\..\Tools\zx;..\..\..\Tools\cpmtools; |
|
||||
|
set PATH=%PATH%;..\..\..\Tools\zxcc;..\..\..\Tools\cpmtools; |
||||
|
|
||||
set ZXBINDIR=../../../tools/cpm/bin/ |
|
||||
set ZXLIBDIR=../../../tools/cpm/lib/ |
|
||||
set ZXINCDIR=../../../tools/cpm/include/ |
|
||||
|
set CPMDIR80=%TOOLS%/cpm/ |
||||
|
|
||||
copy ..\z3base.lib . || exit /b |
copy ..\z3base.lib . || exit /b |
||||
zx ZMAC -zcpr33.z80 -/P || exit /b |
|
||||
|
zxcc ZMAC -zcpr33.z80 -/P || exit /b |
||||
del z3base.lib || exit /b |
del z3base.lib || exit /b |
||||
move zcpr33.rel .. || exit /b |
move zcpr33.rel .. || exit /b |
||||
@ -1,37 +0,0 @@ |
|||||
#
|
|
||||
# hacked up brute force makefile for linux and osx
|
|
||||
#
|
|
||||
UNAME := $(shell uname) |
|
||||
ifeq ($(UNAME), Linux) |
|
||||
SUFFIX=linux |
|
||||
endif |
|
||||
ifeq ($(UNAME), Darwin) |
|
||||
SUFFIX=darwin |
|
||||
endif |
|
||||
|
|
||||
DEST = ../../$(UNAME) |
|
||||
CFLAGS = -g # -DDEBUG |
|
||||
|
|
||||
OBJECTS = zx.o cpmdrv.o cpmglob.o cpmparse.o cpmredir.o \
|
|
||||
drdos.o util.o xlt.o zxbdos.o zxcbdos.o zxdbdos.o z80.o |
|
||||
UNUSED = dirent.o |
|
||||
|
|
||||
all: zx $(DEST) |
|
||||
cp -p bios.bin zx $(DEST) |
|
||||
|
|
||||
$(DEST): |
|
||||
mkdir -p $(DEST) |
|
||||
|
|
||||
clean: |
|
||||
-rm -f $(OBJECTS) config.h zx |
|
||||
|
|
||||
clobber: clean |
|
||||
-rm -f $(DEST)/zx $(DEST)/bios.bin zx |
|
||||
|
|
||||
$(OBJECTS): config.h |
|
||||
|
|
||||
zx: $(OBJECTS) |
|
||||
$(CC) -o zx $(OBJECTS) |
|
||||
|
|
||||
config.h: config.h.$(SUFFIX) |
|
||||
cp config.h.$(SUFFIX) config.h |
|
||||
@ -1,16 +0,0 @@ |
|||||
//#define HAVE_WINDOWS_H |
|
||||
#define HAVE_DIRENT_H |
|
||||
#define HAVE_UTIME_H |
|
||||
#define HAVE_FCNTL_H |
|
||||
#define HAVE_UNISTD_H |
|
||||
#define BINDIR80 getenv("ZXBINDIR") |
|
||||
#define LIBDIR80 getenv("ZXLIBDIR") |
|
||||
#define INCDIR80 getenv("ZXINCDIR") |
|
||||
#define DARWIN |
|
||||
#include <sys/param.h> |
|
||||
#include <sys/mount.h> |
|
||||
#define _S_IFDIR S_IFDIR |
|
||||
#define strcmpi(a,b) strcasecmp(a,b) |
|
||||
//#define WIN32 |
|
||||
//#define WINVER 0x0501 // target Windows XP |
|
||||
//#define _WIN32_WINNNT 0x0501 // target Windows XP |
|
||||
@ -1,17 +0,0 @@ |
|||||
//#define HAVE_WINDOWS_H |
|
||||
#define HAVE_DIRENT_H |
|
||||
#define HAVE_UTIME_H |
|
||||
#define HAVE_FCNTL_H |
|
||||
#define HAVE_SYS_VFS_H |
|
||||
#define HAVE_UNISTD_H |
|
||||
#define BINDIR80 getenv("ZXBINDIR") |
|
||||
#define LIBDIR80 getenv("ZXLIBDIR") |
|
||||
#define INCDIR80 getenv("ZXINCDIR") |
|
||||
#define LINUX |
|
||||
#include <sys/param.h> |
|
||||
#include <sys/mount.h> |
|
||||
#define _S_IFDIR S_IFDIR |
|
||||
#define strcmpi(a,b) strcasecmp(a,b) |
|
||||
//#define WIN32 |
|
||||
//#define WINVER 0x0501 // target Windows XP |
|
||||
//#define _WIN32_WINNNT 0x0501 // target Windows XP |
|
||||
@ -1,9 +0,0 @@ |
|||||
#define HAVE_WINDOWS_H |
|
||||
//#define HAVE_DIRENT_H |
|
||||
#define HAVE_FCNTL_H |
|
||||
#define BINDIR80 getenv("ZXBINDIR") |
|
||||
#define LIBDIR80 getenv("ZXLIBDIR") |
|
||||
#define INCDIR80 getenv("ZXINCDIR") |
|
||||
#define WIN32 |
|
||||
#define WINVER 0x0501 // target Windows XP |
|
||||
#define _WIN32_WINNNT 0x0501 // target Windows XP |
|
||||
@ -1,126 +0,0 @@ |
|||||
/*
|
|
||||
|
|
||||
CPMREDIR: CP/M filesystem redirector |
|
||||
Copyright (C) 1998, John Elliott <jce@seasip.demon.co.uk> |
|
||||
|
|
||||
This library is free software; you can redistribute it and/or |
|
||||
modify it under the terms of the GNU Library General Public |
|
||||
License as published by the Free Software Foundation; either |
|
||||
version 2 of the License, or (at your option) any later version. |
|
||||
|
|
||||
This library is distributed in the hope that it will be useful, |
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
||||
Library General Public License for more details. |
|
||||
|
|
||||
You should have received a copy of the GNU Library General Public |
|
||||
License along with this library; if not, write to the Free |
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
|
|
||||
This file parses filenames to FCBs. |
|
||||
*/ |
|
||||
|
|
||||
#include "cpmint.h" |
|
||||
|
|
||||
#define is_num(c) ((c >= '0') && (c <= '9')) |
|
||||
|
|
||||
static int parse_drive_user(char *txt, cpm_byte *fcb) |
|
||||
{ |
|
||||
char uid[4], drvid[4]; |
|
||||
int up, dp; |
|
||||
|
|
||||
for (up = dp = 0; *txt != ':'; ++txt) |
|
||||
{ |
|
||||
if (is_num (*txt)) uid [up++] = *txt; |
|
||||
if (isalpha(*txt)) drvid[dp++] = *txt; |
|
||||
if (!is_num(*txt) && !isalpha(*txt)) return -1; |
|
||||
} |
|
||||
uid[up] = 0; drvid[dp] = 0; |
|
||||
|
|
||||
if (dp > 1) return -1; /* Invalid driveletter */ |
|
||||
if (up > 2) return -1; /* Invalid uid */ |
|
||||
|
|
||||
fcb[0x0d] = atoi(uid) + 1; if (fcb[0x0d] > 16) return -1; |
|
||||
|
|
||||
if (islower(drvid[0])) drvid[0] = toupper(drvid[0]); |
|
||||
|
|
||||
if (drvid[0] < 'A' || drvid[0] > 'P') return -1; |
|
||||
|
|
||||
fcb[0] = drvid[0] - '@'; |
|
||||
return 0; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
cpm_word fcb_parse(char *txt, cpm_byte *fcb) |
|
||||
{ |
|
||||
int nl = 0, tl = 0, pl = 0, phase = 0; |
|
||||
char *ntxt, ch; |
|
||||
|
|
||||
memset(fcb, 0, 0x24); |
|
||||
|
|
||||
if (txt[1] == ':' || txt[2] == ':' || txt[3] == ':') |
|
||||
{ |
|
||||
if (parse_drive_user(txt, fcb)) return 0xFFFF; |
|
||||
/* Move past the colon */ |
|
||||
ntxt = strchr(txt, ':') + 1; |
|
||||
} |
|
||||
else ntxt = txt; |
|
||||
while (phase < 3) |
|
||||
{ |
|
||||
ch = *ntxt; |
|
||||
if (islower(ch)) ch = toupper(ch); |
|
||||
|
|
||||
switch(ch) |
|
||||
{ |
|
||||
case 0: |
|
||||
case '\r': /* EOL */ |
|
||||
phase = 4; |
|
||||
break; |
|
||||
|
|
||||
case '.': /* file.typ */ |
|
||||
if (!phase) ++phase; |
|
||||
else phase = 3; |
|
||||
break; |
|
||||
|
|
||||
case ';': /* Password */ |
|
||||
if (phase < 2) phase = 2; |
|
||||
else phase = 3; |
|
||||
break; |
|
||||
|
|
||||
case '[': case ']': case '=': case 9: case ' ': |
|
||||
case '>': case '<': case ':': case ',': case '/': |
|
||||
case '|': /* Terminator */ |
|
||||
phase = 3; |
|
||||
|
|
||||
default: |
|
||||
switch(phase) |
|
||||
{ |
|
||||
case 0: |
|
||||
if (nl >= 8) return 0xFFFF; |
|
||||
fcb[++nl] = ch; |
|
||||
break; |
|
||||
|
|
||||
case 1: |
|
||||
if (tl >= 3) return 0xFFFF; |
|
||||
fcb[tl + 9] = ch; |
|
||||
++tl; |
|
||||
break; |
|
||||
|
|
||||
case 2: |
|
||||
if (pl >= 8) return 0xFFFF; |
|
||||
fcb[pl + 0x10] = ch; |
|
||||
++pl; |
|
||||
break; |
|
||||
} |
|
||||
break; |
|
||||
} |
|
||||
} |
|
||||
if (!nl) return 0xFFFF; |
|
||||
|
|
||||
fcb[0x1A] = pl; |
|
||||
|
|
||||
if (phase == 4) return 0; |
|
||||
|
|
||||
return ntxt - txt; |
|
||||
} |
|
||||
@ -1,72 +0,0 @@ |
|||||
ZX Command |
|
||||
|
|
||||
An adaptation of zxcc-0.5.6 by Wayne Warthen |
|
||||
|
|
||||
This directory contains the source files used to build the "zx" tool. This tool |
|
||||
is essentially just John Elliott's zxcc package version zxcc-0.5.6 modified to |
|
||||
build for Windows and simplified down to just a single command (zx) |
|
||||
which is essentially just the zxcc command. |
|
||||
|
|
||||
Please see http://www.seasip.info/Unix/Zxcc/ for more information on zxcc. |
|
||||
|
|
||||
Note that this is a Win32 build. The code has not been updated to build as a 64-bit |
|
||||
binary. However, Win32 binaries run very nicely under 64 bit Windows. |
|
||||
|
|
||||
To build under Open Watcom or Microsoft Visual C++, use the following command: |
|
||||
|
|
||||
cl /Fe"zx.exe" zx.c cpmdrv.c cpmglob.c cpmparse.c cpmredir.c drdos.c util.c xlt.c zxbdos.c zxcbdos.c zxdbdos.c z80.c dirent.c |
|
||||
|
|
||||
To build a debug version, use the following command: |
|
||||
|
|
||||
cl /DDEBUG /Fe"zxdbg.exe" zx.c cpmdrv.c cpmglob.c cpmparse.c cpmredir.c drdos.c util.c xlt.c zxbdos.c zxcbdos.c zxdbdos.c z80.c dirent.c |
|
||||
|
|
||||
WARNING: There seems to be a rare scenario that breaks zx under the Open Watcom build. |
|
||||
CP/M allows a file to be accessed under multiple FCB's without an error. Open Watcom |
|
||||
will see this as an error. At present, the only tool I know of that does this is M80. |
|
||||
|
|
||||
December 5, 2014 |
|
||||
|
|
||||
After struggling to get the entire zxcc package to build nicely using autoconf, |
|
||||
I finally gave up and took a much more direct approach. I have extracted just |
|
||||
the source files needed and created a simple batch file to build the tool. I |
|
||||
realize this could be done much better, but I cheated in the interest of time. |
|
||||
|
|
||||
The one "real" change I made in the source code was that I modified the tool |
|
||||
to look for bios.bin in the same directory as the executable is in. This |
|
||||
just makes it much easier to set up (for me, anyway). |
|
||||
|
|
||||
The GPL status of everything remains in place and carries forward. |
|
||||
|
|
||||
Wayne Warthen |
|
||||
wwarthen@gmail.com |
|
||||
|
|
||||
March 15, 2017 |
|
||||
|
|
||||
- Updated to compile under Open Watcom. |
|
||||
- Implemented BDOS console status function. |
|
||||
- Set stdin and stdout to binary mode at startup. |
|
||||
|
|
||||
August 21, 2021 |
|
||||
|
|
||||
- Incorporated filename case insensitivity changes from Curt Mayer |
|
||||
- Incorporated fixes from Tony Nicholson at https://github.com/agn453/ZXCC |
|
||||
- Emulation of CP/M BDOS function 60 (call resident system extension) |
|
||||
should be disabled and return 0xFF in both the A and L registers. |
|
||||
- Change cpm_bdos_10() to return an unsigned result to avoid buffer |
|
||||
size being interpreted as negative. |
|
||||
- Fix the emulation of Z80 opcodes for IN (HL),(C) and |
|
||||
OUT (C),(HL) - opcodes 0xED,0x70 and 0xED,0x71 respectively. |
|
||||
This is noted in Fred Weigel's AM9511 arithmetic processing unit |
|
||||
emulation from https://github.com/ratboy666/am9511 in the howto.txt |
|
||||
description. NB: I have not included Fred's am9511 support at this |
|
||||
time into ZXCC. |
|
||||
- Fixed parse_to_fcb function in zx.c to handle parsing second automatic |
|
||||
FCB from command line |
|
||||
- I have not been able to reproduce the multiple FCBs referring to a |
|
||||
single file issue with Watcom documented above. Perhaps I fixed it |
|
||||
and don't remember or I found a bug-fixed version of M80. Not sure. |
|
||||
|
|
||||
Wayne Warthen |
|
||||
wwarthen@gmail.com |
|
||||
|
|
||||
--WBW 4:09 PM 8/21/2021 |
|
||||
@ -1,191 +0,0 @@ |
|||||
/*
|
|
||||
|
|
||||
CPMREDIR: CP/M filesystem redirector |
|
||||
Copyright (C) 1998, John Elliott <jce@seasip.demon.co.uk> |
|
||||
|
|
||||
This library is free software; you can redistribute it and/or |
|
||||
modify it under the terms of the GNU Library General Public |
|
||||
License as published by the Free Software Foundation; either |
|
||||
version 2 of the License, or (at your option) any later version. |
|
||||
|
|
||||
This library is distributed in the hope that it will be useful, |
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
||||
Library General Public License for more details. |
|
||||
|
|
||||
You should have received a copy of the GNU Library General Public |
|
||||
License along with this library; if not, write to the Free |
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
|
|
||||
This file holds functions dealing with name translation; also the |
|
||||
initialisation code. |
|
||||
*/ |
|
||||
|
|
||||
#include "cpmint.h" |
|
||||
|
|
||||
/* Detect DRDOS */ |
|
||||
|
|
||||
#ifdef __MSDOS__ |
|
||||
static void drdos_init(void) |
|
||||
{ |
|
||||
|
|
||||
/* The DJGPP DOS extender won't detect DRDOS using intdos(), so we have
|
|
||||
to use __dpmi_int() instead. */ |
|
||||
|
|
||||
#ifdef __GO32__ |
|
||||
__dpmi_regs ir; |
|
||||
|
|
||||
ir.x.ax = 0x4452; /* "DR" */ |
|
||||
|
|
||||
__dpmi_int(0x21, &ir); |
|
||||
if (ir.x.flags & 1) return; /* Not DRDOS */ |
|
||||
|
|
||||
redir_Msg("DRDOS detected.\r\n"); |
|
||||
|
|
||||
redir_drdos = 1; |
|
||||
|
|
||||
#else /* __GO32__ */ |
|
||||
|
|
||||
union REGS ir, or; |
|
||||
|
|
||||
ir.w.ax = 0x4452; /* "DR" */ |
|
||||
|
|
||||
intdos(&ir, &or); |
|
||||
if (or.w.cflag) return; /* Not DRDOS */ |
|
||||
|
|
||||
redir_Msg("DRDOS detected.\r\n"); |
|
||||
|
|
||||
redir_drdos = 1; |
|
||||
#endif /* __GO32__ */ |
|
||||
} |
|
||||
#endif /* __MSDOS__ */ |
|
||||
|
|
||||
|
|
||||
|
|
||||
int fcb_init(void) |
|
||||
{ |
|
||||
int n; |
|
||||
|
|
||||
/* A: to O: free */ |
|
||||
for (n = 0; n < 15; n++) redir_drive_prefix[n][0] = 0; |
|
||||
|
|
||||
strcpy(redir_drive_prefix[15], "./"); /* P: is current directory */ |
|
||||
|
|
||||
/* Log on to P:. It is the only drive at this point which we
|
|
||||
* know works. */ |
|
||||
redir_cpmdrive = 15; |
|
||||
#ifdef __MSDOS__ |
|
||||
drdos_init(); |
|
||||
#endif |
|
||||
|
|
||||
return 1; |
|
||||
} |
|
||||
|
|
||||
/* Deinitialise the library. */ |
|
||||
|
|
||||
void fcb_deinit(void) |
|
||||
{ |
|
||||
/* Nothing */ |
|
||||
} |
|
||||
|
|
||||
/* Translate a name from the host FS to a CP/M name. This will (if necessary)
|
|
||||
* create a mapping between a CP/M drive and a host directory path. |
|
||||
* |
|
||||
* CP/M drives A: to O: can be mapped in this way. P: is always the current |
|
||||
* drive. |
|
||||
* |
|
||||
*/ |
|
||||
|
|
||||
void xlt_name(char *localname, char *cpmname) |
|
||||
{ |
|
||||
char ibuf[CPM_MAXPATH + 1]; |
|
||||
char nbuf[CPM_MAXPATH + 1]; |
|
||||
char *pname; |
|
||||
int n; |
|
||||
|
|
||||
sprintf(ibuf, "%-.*s", CPM_MAXPATH, localname); |
|
||||
pname = strrchr(ibuf, '/'); |
|
||||
#ifdef __MSDOS__ |
|
||||
if (!pname) pname = strrchr(ibuf,'\\'); |
|
||||
if (!pname) pname = strrchr(ibuf,':'); |
|
||||
#endif |
|
||||
if (!pname) /* No path separators in the name. It is therefore a
|
|
||||
local filename, so map it to drive P: */ |
|
||||
{ |
|
||||
strcpy(cpmname, "p:"); |
|
||||
strcat(cpmname, ibuf); |
|
||||
return; |
|
||||
} |
|
||||
++pname; |
|
||||
strcpy(nbuf, pname); /* nbuf holds filename component */ |
|
||||
*pname = 0; /* ibuf holds path component */ |
|
||||
|
|
||||
/* See if the path is one of those already mapped to drives */ |
|
||||
|
|
||||
for (n = 0; n < 15; n++) |
|
||||
{ |
|
||||
if (redir_drive_prefix[n][0] && !strcmp(ibuf, redir_drive_prefix[n])) |
|
||||
{ |
|
||||
sprintf(cpmname,"%c:%s", n + 'a', nbuf); |
|
||||
return; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/* It is not, see if another drive can be allocated */ |
|
||||
|
|
||||
for (n = 0; n < 15; n++) if (!redir_drive_prefix[n][0]) |
|
||||
{ |
|
||||
strcpy(redir_drive_prefix[n], ibuf); |
|
||||
sprintf(cpmname,"%c:%s", n + 'a', nbuf); |
|
||||
return; |
|
||||
} |
|
||||
|
|
||||
/* No other drive can be allocated */ |
|
||||
|
|
||||
strcpy(cpmname,"p:"); |
|
||||
strcat(cpmname, nbuf); |
|
||||
} |
|
||||
|
|
||||
/* It is sometimes convenient to set some fixed mappings. This will create
|
|
||||
* a mapping for a given directory. |
|
||||
* Pass drive = -1 for "first available", or 0-15 for A: to P: |
|
||||
*/ |
|
||||
|
|
||||
int xlt_map(int drive, char *localdir) |
|
||||
{ |
|
||||
int n; |
|
||||
|
|
||||
if (drive == -1) |
|
||||
{ |
|
||||
for (n = 0; n < 15; n++) if (!redir_drive_prefix[n][0]) |
|
||||
{ |
|
||||
drive = n; |
|
||||
break; |
|
||||
} |
|
||||
if (drive == -1) return 0; /* No space for mappings */ |
|
||||
} |
|
||||
if (redir_drive_prefix[drive][0]) return 0; /* Drive taken */ |
|
||||
|
|
||||
sprintf(redir_drive_prefix[drive], "%-.*s", CPM_MAXPATH, localdir); |
|
||||
return 1; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
/* Unmap a drive
|
|
||||
*/ |
|
||||
|
|
||||
int xlt_umap(int drive) |
|
||||
{ |
|
||||
if (!redir_drive_prefix[drive][0]) return 0; /* Drive not taken */ |
|
||||
redir_drive_prefix[drive][0] = 0; |
|
||||
return 1; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
char *xlt_getcwd(int drive) |
|
||||
{ |
|
||||
if (drive < 0 || drive > 16) return ""; |
|
||||
|
|
||||
return redir_drive_prefix[drive]; |
|
||||
} |
|
||||
|
|
||||
@ -1,132 +0,0 @@ |
|||||
<html><head><title>zx CP/M Command Line Emulator</title></head><body> |
|
||||
|
|
||||
<h1>zx CP/M Command Line Emulator</h1> |
|
||||
|
|
||||
<p><em>zx</em> allows execution of CP/M 2.2 and 3.X application from a |
|
||||
Windows command line. It is compatible with Windows XP and greater (both |
|
||||
32 and 64 bit).</p> |
|
||||
|
|
||||
<p><em>zx</em> is basically a port of a subset of the zxcc program by John Elliott. |
|
||||
The GPLv2 licensing carries forward. Please refer to the |
|
||||
<a href="http://http://www.seasip.info/Unix/Zxcc/"> |
|
||||
zxcc web page</a> for more information.</p> |
|
||||
|
|
||||
<p>While the original zxcc package was generally intended to allow |
|
||||
execution of the Hi-Tech C CP/M compiler under Unix, <em>zx</em> is slightly |
|
||||
more general and intended to allow running most CP/M tools. Specific |
|
||||
changes were incorporated to improve interactice console operation of |
|
||||
CP/M applications. Additionally, Curt Mayer added case insensitivity |
|
||||
for filenames under Unix variants.</p> |
|
||||
|
|
||||
<h2>Setup</h2> |
|
||||
|
|
||||
<p>The <em>zx</em> application (zx.exe) may be copied to any directory for execution. |
|
||||
The bios.bin file must be copied to the same directory. For ease of use, |
|
||||
you will probably want the directory to part of your PATH environment |
|
||||
variable so that you can run the tool from any location.</p> |
|
||||
|
|
||||
<p>You will also need the CP/M applications that you want to run. |
|
||||
<em>zx</em> will load files fromthe current directory or one of the following |
|
||||
directories based on file type. Any of the following environment |
|
||||
variables may be defined to determine where <em>zx</em> searches for the |
|
||||
respective file types:</p> |
|
||||
|
|
||||
<ul> |
|
||||
<li><strong>ZXBINDIR</strong> may contain a single path which will |
|
||||
be searched for executable files (usually *.com)</li> |
|
||||
<li><strong>ZXLIBDIR</strong> may contain a single path which will |
|
||||
be search for library files (usually *.lib)</li> |
|
||||
<li><strong>ZXINCDIR</strong> may contain a single path which will |
|
||||
be searched for include files (usually *.inc)</li> |
|
||||
</ul> |
|
||||
|
|
||||
<h2>Usage</h2> |
|
||||
|
|
||||
<p>In general CP/M applications are executed by prefixing the CP/M command |
|
||||
line with "zx". So for example, you could assemble a test.asm using |
|
||||
rmac with a command line like:</p> |
|
||||
|
|
||||
<blockquote><tt>zx rmac hello</tt></blockquote> |
|
||||
|
|
||||
<p>In this case, rmac.com would need to be in the directory specified by |
|
||||
environment variable ZXBINDIR or in the current directory. Also, |
|
||||
hello.asm would need to be in the current directory.</p> |
|
||||
|
|
||||
<h3>Filenames</h3> |
|
||||
|
|
||||
<p>Where you would normally enter a CP/M filename you instead enter |
|
||||
a Windows filename. Note that you will need to use a forward slash |
|
||||
instead of the traditional backslash as a directory separator. The |
|
||||
filename itself (as opposed to any directories in |
|
||||
its path) must obey CP/M 8.3 naming conventions.</p> |
|
||||
|
|
||||
<p>Where the documentation requires a CP/M drive letter/user number |
|
||||
you should enter a path complete with trailing slash, for example:</p> |
|
||||
<blockquote><tt>-I/usr/src/linux-80/include/</tt></blockquote> |
|
||||
|
|
||||
<h2>Technical</h2> |
|
||||
|
|
||||
<p><em>zx</em> emulates a subset of CP/M 3; hopefully enough to run the |
|
||||
most CP/M tools. It can be used as a limited general-purpose CP/M 3 |
|
||||
emulator provided the emulated program only uses a common subset of |
|
||||
system calls.</p> |
|
||||
|
|
||||
<p>Syntax for <em>zx</em> is:</p> |
|
||||
|
|
||||
<blockquote> |
|
||||
<tt>zx <i>comfile.com</i> arg1 arg2 ...</tt> |
|
||||
</blockquote> |
|
||||
|
|
||||
<p>The comfile is the program to run; <em>zx</em> searches the current |
|
||||
directory and <strong>ZXBINDIR</strong> for it.</p> |
|
||||
|
|
||||
<p>The arguments are parsed in this way:</p> |
|
||||
|
|
||||
<ul> |
|
||||
<li>Any argument starting with a - sign is passed to the CP/M program as-is, |
|
||||
minus the leading - sign. |
|
||||
<li>Any argument starting with a + sign is parsed as a filename (see below) |
|
||||
and then concatenated to the previous argument. |
|
||||
<li>Any argument starting "+-" is concatenated without being parsed. |
|
||||
<li>All other arguments are parsed as filenames. The path is |
|
||||
converted to a CP/M driveletter. |
|
||||
</ul> |
|
||||
|
|
||||
<p>For example: |
|
||||
<blockquote> |
|
||||
<tt>zx foo.com --Q -A /src/main --I +/src/sub +-, +/foo/bar</tt> |
|
||||
</blockquote> |
|
||||
|
|
||||
<p>would pass these arguments to foo.com:</p> |
|
||||
|
|
||||
<blockquote> |
|
||||
<tt>-Q A d:main -Id:sub,e:bar</tt> |
|
||||
</blockquote> |
|
||||
|
|
||||
<p>The other programs are merely wrappers that convert their command lines |
|
||||
into the form required by <em>zx</em>.</p> |
|
||||
|
|
||||
<h2>Errors</h2> |
|
||||
|
|
||||
<p>Any errors raised by the <em>zx</em> runtime system will be prefixed |
|
||||
with <tt>zx:</tt>. Some errors you may encounter are:</p> |
|
||||
|
|
||||
<dl> |
|
||||
<dt>Unsupported BDOS call</dt> |
|
||||
<dd>Part of CP/M 3 that the program uses has not been emulated. Add the |
|
||||
required functionality to zxbdos.c and recompile.</dd> |
|
||||
<dt>Z80 encountered invalid trap</dt> |
|
||||
<dd>The CP/M program being run attempted to call the <em>zx</em> runtime |
|
||||
system with an unknown call number.</dd> |
|
||||
</dl> |
|
||||
|
|
||||
<h2>Acknowledgements</h2> |
|
||||
|
|
||||
<ul> |
|
||||
<li>zxcc was written by John Elliott</li> |
|
||||
<li>Hi-Tech C was written by Hi-Tech Software.</li> |
|
||||
<li>The Z80 emulation engine was written by Ian Collier.</li> |
|
||||
<li>Thanks to Jacob Nevins, Andy Parkins and others for bug fix suggestions.</li> |
|
||||
</ul> |
|
||||
</body> |
|
||||
</html> |
|
||||
@ -0,0 +1,21 @@ |
|||||
|
@echo off |
||||
|
setlocal |
||||
|
|
||||
|
:: |
||||
|
:: Edit WATCOM variable below as needed for your environment |
||||
|
:: |
||||
|
set WATCOM=..\..\Tools\WATCOM2 |
||||
|
|
||||
|
set PATH=%WATCOM%\BINNT;%WATCOM%\BINW;%PATH% |
||||
|
set EDPATH=%WATCOM%\EDDAT |
||||
|
set INCLUDE=%WATCOM%\H;%WATCOM%\H\NT |
||||
|
|
||||
|
copy config.h.windows config.h |
||||
|
|
||||
|
cl /Fe"zxcc.exe" zxcc.c cpmdrv.c cpmglob.c cpmparse.c cpmredir.c drdos.c util.c track.c xlt.c zxbdos.c zxcbdos.c zxdbdos.c z80.c |
||||
|
if errorlevel 1 exit /b 255 |
||||
|
|
||||
|
cl /Fe"zxccdbg.exe" /DDEBUG zxcc.c cpmdrv.c cpmglob.c cpmparse.c cpmredir.c drdos.c util.c track.c xlt.c zxbdos.c zxcbdos.c zxdbdos.c z80.c |
||||
|
if errorlevel 1 exit /b 255 |
||||
|
|
||||
|
copy cpm\bios.bin . |
||||
@ -0,0 +1,25 @@ |
|||||
|
@echo off |
||||
|
setlocal |
||||
|
|
||||
|
:: |
||||
|
:: Visual Studio x86 Native Tools Command Prompt is assumed |
||||
|
:: |
||||
|
|
||||
|
:: Below configures VS2012 to target Windows XP and beyond |
||||
|
:: Not sure if it will work in later versions of VS, but seems |
||||
|
:: to do no harm. |
||||
|
set INCLUDE=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Include;%INCLUDE% |
||||
|
set PATH=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Bin;%PATH% |
||||
|
set LIB=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Lib;%LIB% |
||||
|
set CL=/D_USING_V110_SDK71_;%CL% |
||||
|
set LINK=/SUBSYSTEM:CONSOLE,5.01 %LINK% |
||||
|
|
||||
|
copy config.h.windows config.h |
||||
|
|
||||
|
cl zxcc.c cpmdrv.c cpmglob.c cpmparse.c cpmredir.c drdos.c util.c xlt.c zxbdos.c zxcbdos.c zxdbdos.c z80.c dirent.c track.c |
||||
|
if errorlevel 1 exit /b 255 |
||||
|
|
||||
|
cl /DDEBUG /Fe"zxccdbg.exe" zxcc.c cpmdrv.c cpmglob.c cpmparse.c cpmredir.c drdos.c util.c xlt.c zxbdos.c zxcbdos.c zxdbdos.c z80.c dirent.c track.c |
||||
|
if errorlevel 1 exit /b 255 |
||||
|
|
||||
|
copy cpm\bios.bin . |
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue