mirror of https://github.com/wwarthen/RomWBW.git
committed by
GitHub
2266 changed files with 279933 additions and 170805 deletions
@ -0,0 +1,11 @@ |
|||
<!-- |
|||
BEFORE YOU CREATE A PULL REQUEST: |
|||
|
|||
- Please base all pull requests against the master branch |
|||
- Include a clear description of your change |
|||
- Reference related Issue(s) (e.g., "Resolves Issue #123") |
|||
|
|||
Thank you for contributing to RomWBW! I will review your pull request as soon as possible. |
|||
|
|||
DELETE EVERYTHING IN THIS COMMENT BLOCK AND REPLACE WITH YOUR COMMENTS |
|||
--> |
|||
@ -1,10 +1,11 @@ |
|||
TOOLS = ../../Tools |
|||
MOREDIFF := $(shell $(TOOLS)/unix/casefn.sh *.com Tunes/*) |
|||
MOREDIFF := $(shell $(TOOLS)/unix/casefn.sh *.com) |
|||
SUBDIRS = Test |
|||
|
|||
include $(TOOLS)/Makefile.inc |
|||
|
|||
all:: |
|||
mkdir -p Tunes |
|||
|
|||
clobber:: |
|||
rm -f *.bin *.com *.img *.rom *.pdf *.log *.eeprom *.COM *.BIN Tunes/*.mym Tunes/*.pt? |
|||
clean:: |
|||
@rm -f *.bin *.com *.img *.rom *.pdf *.log *.eeprom *.ovr *.hlp *.doc *.COM *.BIN Tunes/*.mym Tunes/*.pt? Tunes/*.vgm |
|||
|
|||
@ -0,0 +1,4 @@ |
|||
@echo off |
|||
setlocal |
|||
|
|||
if exist *.com del *.com |
|||
@ -0,0 +1,7 @@ |
|||
TOOLS = ../../../Tools |
|||
MOREDIFF := $(shell $(TOOLS)/unix/casefn.sh *.com) |
|||
|
|||
include $(TOOLS)/Makefile.inc |
|||
|
|||
clean:: |
|||
@rm -f *.com |
|||
@ -0,0 +1,16 @@ |
|||
*********************************************************************** |
|||
*** *** |
|||
*** R o m W B W *** |
|||
*** *** |
|||
*** Z80/Z180 System Software *** |
|||
*** *** |
|||
*********************************************************************** |
|||
|
|||
This directory contains various hardware test application files that |
|||
are specific to RomWBW. The source for these applications is found |
|||
in the Source\Apps\Test directory of the distribution. |
|||
|
|||
These files are included on the pre-built disk images in user area 2. |
|||
|
|||
N.B., these files may be specific to certain hardware. They should |
|||
be used as directred by the instructions for your specific hardware. |
|||
@ -0,0 +1,11 @@ |
|||
@echo off |
|||
setlocal |
|||
|
|||
if exist *.spr del *.spr |
|||
if exist *.com del *.com |
|||
if exist *.sys del *.sys |
|||
if exist *.pat del *.pat |
|||
if exist *.dat del *.dat |
|||
if exist *.1st del *.1st |
|||
if exist *.spr del *.spr |
|||
if exist *.pat del *.pat |
|||
@ -0,0 +1,7 @@ |
|||
TOOLS = ../../Tools |
|||
MOREDIFF := $(shell $(TOOLS)/unix/casefn.sh *.spr) |
|||
|
|||
include $(TOOLS)/Makefile.inc |
|||
|
|||
clean:: |
|||
@rm -f *.spr *.com *.sys *.dat cpm3fix.pat readme.1st |
|||
@ -0,0 +1,17 @@ |
|||
*********************************************************************** |
|||
*** *** |
|||
*** R o m W B W *** |
|||
*** *** |
|||
*** Z80/Z180 System Software *** |
|||
*** *** |
|||
*********************************************************************** |
|||
|
|||
This directory contains the CP/M 3 system files for the RomWBW CP/M 3 |
|||
adaptation. All of these files are already included on the CP/M 3 |
|||
boot disk images. However if you are creating a CP/M 3 boot disk |
|||
manually, you should copy all of these files to the boot disk. |
|||
|
|||
These files should also be copied to any CP/M 3 boot disks on your |
|||
system when you upgrade your ROM firmware. Some of these files |
|||
*must* match the version of the RomWBW firmware you are using for |
|||
proper operation of your system. |
|||
@ -0,0 +1,4 @@ |
|||
@echo off |
|||
setlocal |
|||
|
|||
if exist *.lbr del *.lbr |
|||
@ -0,0 +1,7 @@ |
|||
TOOLS = ../../Tools |
|||
MOREDIFF := $(shell $(TOOLS)/unix/casefn.sh *.lbr) |
|||
|
|||
include $(TOOLS)/Makefile.inc |
|||
|
|||
clean:: |
|||
@rm -f *.lbr |
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,38 @@ |
|||
*********************************************************************** |
|||
*** *** |
|||
*** R o m W B W *** |
|||
*** *** |
|||
*** Z80/Z180 System Software *** |
|||
*** *** |
|||
*********************************************************************** |
|||
|
|||
This directory contains the CP/NET client packages. Please refer to |
|||
the RomWBW User Guide for instructions on installing these packages. |
|||
Either the MT011 RCBus module or the Duodyne Disk I/O board is required. |
|||
|
|||
All of these files come from Douglas Miller. Please refer to |
|||
https://github.com/durgadas311/cpnet-z80 for more information, complete |
|||
documentation and the latest source code. Refer to the RomWBW |
|||
User Guide for basic installation and usage instructions under RomWBW. |
|||
|
|||
| File | CP/NET Version | OS | Hardware | |
|||
+--------------+----------------+----------+-----------------------+ |
|||
| CPN12MT.LBR | CP/NET 1.2 | CP/M 2.2 | RCBus w/ MT011 | |
|||
| CPN3MT.LBR | CP/NET 3 | CP/M 3 | RCBus w/ MT011 | |
|||
| CPN12DUO.LBR | CP/NET 1.2 | CP/M 2.2 | Duodyne w/ Disk I/O | |
|||
| CPN3DUO.LBR | CP/NET 3 | CP/M 3 | Duodyne w/ Disk I/O | |
|||
|
|||
In general, to use CP/NET on RomWBW, it is intended that you will |
|||
extract the appropriate set of files into your default directory in |
|||
user area 0. Refer to the RomWBW User Guide for more information. |
|||
|
|||
The libraries include enhanced help files appropriate for the version |
|||
of CP/NET. Rename the desired topic collection to HELP.HLP on the |
|||
target system. |
|||
|
|||
CPM2NET.HLP CP/M 2.2 basic system with CP/NET 1.2 |
|||
CPNET12.HLP CP/NET 1.2 help only |
|||
CPM3NET.HLP CP/M 3 basic system with CP/NET 3 |
|||
CPNET3.HLP CP/NET 3 help only |
|||
|
|||
-- WBW 7:14 AM 2/11/2024 |
|||
@ -1,167 +0,0 @@ |
|||
*********************************************************************** |
|||
*** *** |
|||
*** R o m W B W *** |
|||
*** *** |
|||
*** Z80/Z180 System Software *** |
|||
*** *** |
|||
*********************************************************************** |
|||
|
|||
This directory ("Binary") is part of the RomWBW System Software |
|||
distribution archive. Refer to the ReadMe.txt file in this |
|||
directory for more information on the overall contents of the |
|||
directory. |
|||
|
|||
RomWBW includes a set of disk images that are ready to copy onto |
|||
a floppy or hard/CF/SD disk. You can use your modern computer |
|||
(Windows/Linux/Mac) to copy the disk image file onto your disk |
|||
media. The disk media will then be ready to use in your RomWBW |
|||
System. |
|||
|
|||
A description of the disk images is provided later in this file. |
|||
For more information on the creatioin of these images including |
|||
instructions for customizing them or creating your own, refer to |
|||
the ReadMe.txt file in the Source\Images directory. |
|||
|
|||
Installing Images |
|||
----------------- |
|||
|
|||
The following instructions apply to Windows computers. Alternatively, |
|||
you can use the "dd" command on Linux or Mac. |
|||
|
|||
First of all, a MAJOR WARNING!!!! The tools described below are |
|||
quite capable of obliterating your running Windows system drive. Use |
|||
with extreme caution and make sure you have backups. |
|||
|
|||
To install a floppy image on floppy media, you can use the tool |
|||
called RaWriteWin. This tool is included in the Tools directory of |
|||
the distribution. This tool will write your floppy image (fd_xxx.img) |
|||
to a floppy disk using a raw block transfer. The tool is GUI based |
|||
and it's operation is self explanatory. |
|||
|
|||
To install a hard disk image on a CF card or SD card, you must have |
|||
the appropriate media card slot on your computer. If you do, you can |
|||
use the tool called Win32DiskImager. This tool is also included in |
|||
the Tools directory of the distribution. It will write your |
|||
hard disk image (hd_xxx.img) to the designated media card. This tool |
|||
is also GUI based and self explanatory. |
|||
|
|||
The use of the SIMH emulator is outside of the scope of this document. |
|||
However, if you use SIMH, you will find that you can attach the hard |
|||
disk images to the emulator with lines such as the following in your |
|||
SIMH configuration file: |
|||
|
|||
| attach hdsk0 hd_cpm22.img |
|||
| set hdsk0 format=HDSK |
|||
| set hdsk0 geom=T:2048/N:256/S:512 |
|||
| set hdsk0 wrtenb |
|||
|
|||
Making Disk Images Bootable |
|||
--------------------------- |
|||
|
|||
The Operating System disk images below are ready to boot by the |
|||
RomWBW Boot Loader. However, if you update your RomWBW ROM, then |
|||
you should also update the system tracks of your bootable disk |
|||
images. You would use SYSCOPY to do this. SYSCOPY can also be |
|||
used to make a disk bootable if it is not already bootable. |
|||
|
|||
You would use a command like the following to make drive C bootable: |
|||
|
|||
| B>SYSCOPY C:=CPM.SYS |
|||
|
|||
The system file to use depends on the operating system you are trying |
|||
to boot from the slice you are initializing with SYSCOPY: |
|||
|
|||
CP/M 2.2 - cpm.sys |
|||
ZSDOS 1.1 - zsys.sys |
|||
CP/M 3 - cpmldr.sys |
|||
ZPM3 - cpmldr.sys |
|||
|
|||
Slices |
|||
------ |
|||
|
|||
A RomWBW CP/M filesystem is fixed at 8MB. This is because it is the |
|||
largest size filesystem supported by all common CP/M variants. Since |
|||
all modern hard disks (including SD Cards and CF Cards) are much |
|||
larger than 8MB, RomWBW supports the concept of "slices". This |
|||
simply means that you can concatenate multiple CP/M filesystems (up |
|||
to 256 of them) on a single physical hard disk and RomWBW will allow |
|||
you to assign drive letters to them and treat them as multiple |
|||
independent CP/M drives. |
|||
|
|||
With the exception of the hd_combo image, each of the disk images |
|||
includes a single CP/M file system (i.e., a single slice). However, |
|||
you can easily create a multi-slice disk image by merely concatenating |
|||
multiple images together. For example, if you wanted to create a 2 |
|||
slice disk image that has ZSDOS in the first slice and Wordstar in |
|||
the second slice, you could use the following command from a Windows |
|||
command prompt: |
|||
|
|||
| C:\RomWBW\Binary>copy /b hd_zsdos.img + hd_ws.img hd_multi.img |
|||
|
|||
You can now write hd_multi.img onto your SD or CF Card and you will |
|||
have ZSDOS in the first slice and Wordstar in the second slice. |
|||
|
|||
The hd_combo disk image is an example of this. It contains several |
|||
slices in one image file. The contents of this special disk image |
|||
are described below. |
|||
|
|||
The concept of slices applies ONLY to hard disks. Floppy disks are |
|||
not large enough to support multiple slices. |
|||
|
|||
Disk Image Contents |
|||
------------------- |
|||
|
|||
What follows is a brief description of the contents of the |
|||
disk images automatically provided in the RomWBW distribution. |
|||
Note that all of the OS images include the RomWBW custom |
|||
support apps. |
|||
|
|||
cpm22 - DRI CP/M 2.2 (Bootable Floppy and Hard Disk) |
|||
|
|||
Standard DRI CP/M 2.2 distribution files along with a few commonly |
|||
used utilities. |
|||
|
|||
zsdos - ZCPR1 + ZSDOS 1.1 (Bootable Floppy and Hard Disk) |
|||
|
|||
Contains ZCPR1 and ZSDOS 1.1. This is roughly equivalent to the |
|||
ROM boot contents, but provides a full set of the applications |
|||
and related files that would not all fit on the ROM drive. |
|||
|
|||
nzcom - NZCOM (Bootable Floppy and Hard Disk) |
|||
|
|||
Standard NZCOM distribution. Note that you will need to run the |
|||
NZCOM setup before this will run properly. You will need |
|||
to refer to the NZCOM documentation. |
|||
|
|||
cpm3 - DRI CP/M3 (Bootable Floppy and Hard Disk) |
|||
|
|||
Standard DRI CP/M 3 adaptation for RomWBW that is ready to run. |
|||
It can be started by running CPMLDR. |
|||
|
|||
zpm3 - ZPM3 (Bootable Floppy and Hard Disk) |
|||
|
|||
Simeon Cran's ZCPR 3 compatible OS for CP/M 3 adapted for RomWBW and |
|||
ready to run. It can be started by running CPMLDR (which seems |
|||
wrong, but ZPMLDR is somewhat broken). |
|||
|
|||
ws4 - WordStar 4 (Floppy and Hard Disk) |
|||
|
|||
Micropro Wordstar 4 full distribution. This image is not bootable |
|||
and is intended to be added as an additional slice to an OS image. |
|||
|
|||
bp - BPBIOS (Hard Disk only) |
|||
|
|||
Adaptation of BPBIOS for RomWBW. This is NOT complete and NOT |
|||
useable in it's current state. |
|||
|
|||
combo - Multi-Boot Combination (Bootable Hard Disk) |
|||
|
|||
A pre-created combo image that contains the following slices. The |
|||
slices are identical to the individual images listed above. |
|||
|
|||
Slice 0: cpm22 (bootable) |
|||
Slice 1: zsdos (bootable) |
|||
Slice 2: nzcom (bootable) |
|||
Slice 3: cpm3 (bootable) |
|||
Slice 4: zpm3 (bootable) |
|||
Slice 5: ws4 (not bootable) |
|||
@ -1,8 +1,8 @@ |
|||
TOOLS = ../Tools |
|||
MOREDIFF := $(shell $(TOOLS)/unix/casefn.sh *.img *.rom *.com *.eeprom) |
|||
SUBDIRS = Apps |
|||
SUBDIRS = Apps CPM3 ZPM3 CPNET |
|||
|
|||
include $(TOOLS)/Makefile.inc |
|||
|
|||
clobber:: |
|||
rm -f *.bin *.com *.img *.rom *.pdf *.log *.eeprom |
|||
clean:: |
|||
@rm -f *.bin *.com *.img *.rom *.upd *.hex *.pdf *.log *.eeprom *.dat |
|||
|
|||
@ -1,218 +0,0 @@ |
|||
*********************************************************************** |
|||
*** *** |
|||
*** R o m W B W *** |
|||
*** *** |
|||
*** Z80/Z180 System Software *** |
|||
*** *** |
|||
*********************************************************************** |
|||
|
|||
This directory ("Binary") is part of the RomWBW System Software |
|||
distribution archive. Refer to the ReadMe.txt file in this |
|||
directory for more information on the overall contents of the |
|||
directory. |
|||
|
|||
When distributed, RomWBW contains a set of pre-built ROM images that |
|||
are ready to program onto the EEPROM of any of the Z80/Z180 based |
|||
RetroBrew Computers CPU boards. Additionally, any custom built ROM |
|||
images will be placed in this directory. |
|||
|
|||
All of the pre-built ROM images are 512KB. This size is compatible |
|||
with all of the Z80/Z180 systems. Some systems can accept different |
|||
size ROM images. Creating alternative sizes requires a custom ROM |
|||
build (see ReadMe.txt in the Source directory). |
|||
|
|||
It is critical that the right ROM Imgae be selected for the target |
|||
platform being used. The table below indicates the correct ROM |
|||
image to use for each platform: |
|||
|
|||
SBC V1/V2 SBC_std.rom |
|||
SBC SimH SBC_simh.rom |
|||
Zeta V1 ZETA_std.rom |
|||
Zeta V2 ZETA2_std.rom |
|||
N8 N8_std.rom |
|||
Mark IV MK4_std.rom |
|||
RC2014 w/ Z80 RCZ80_std.rom |
|||
RC2014 w/ Z180 RCZ180_nat.rom (native Z180 memory addressing) |
|||
RC2014 w/ Z180 RCZ180_ext.rom (external 512K RAM/ROM module) |
|||
SC-series SC126, SC130 |
|||
Easy Z80 EZZ180_std.rom |
|||
Dyno DYNO_std.rom |
|||
|
|||
You will find there is one additional ROM image called |
|||
"UNA_std.rom". This ROM image is an UNA-based RomWBW ROM image. As |
|||
such, this ROM image can be used on any Z80/Z180 platform supported |
|||
by John Coffman's UNA BIOS. Refer to RetroBrew Computers Wiki for |
|||
more information on UNA hardware support. |
|||
|
|||
For each of the ROM Images (".rom"), there are corresponding files |
|||
with the extensions of ".com" and ".img". The .com variant can be |
|||
copied to a functional RomWBW-based system and executed like a |
|||
normal application under CP/M or Z-System. This will load the new |
|||
ROM on-the-fly. It is an excellent way to test a ROM Image before |
|||
actually burning it. Similarly, the .img files can be loaded using |
|||
the UNA FAT loader for testing. |
|||
|
|||
WARNING: In a few cases the .com file is too big to load. If you get |
|||
a message like "Full" or "BAD LOAD" when trying to load one of the |
|||
.com files, it is too big. In these cases, you will not be able to |
|||
test the ROM prior to programming it. |
|||
|
|||
All of the standard ROM Images are configured for: |
|||
- 512KB ROM Disk |
|||
- 512KB RAM Disk |
|||
- 38.4Kbps baud serial console (*) |
|||
- Auto-discovery of all serial ports |
|||
|
|||
* RC2014 and Stephen Cousins' kits run at 115,200Kbps baud |
|||
|
|||
All hard disk type devices (IDE, PPIDE, CF Card, SD Card) will be |
|||
automatically assigned two drive letters per device. The drive |
|||
letters will refer to the first 2 slices of the device. The ASSIGN |
|||
command can be used to display and reassign drives to disk devices |
|||
and slices as desired. |
|||
|
|||
Standard ROM Image Notes |
|||
------------------------ |
|||
|
|||
The standard ROM images will detect and install support for certain |
|||
devices and peripherals that are on-board or frequently used with |
|||
each platform as documented below. If the device or peripheral is |
|||
not detected at boot, the ROM will simply bypass support |
|||
appropriately. |
|||
|
|||
SBC (SBC_std.rom): |
|||
- CPU speed is detected at startup |
|||
- Console on onboard UART serial port at 38400 baud |
|||
- Includes support for PPIDE/CF Card(s) connected to on-board |
|||
parallel port. |
|||
- Includes support for CVDU and VGA3 boards. If detected at |
|||
startup, support for video and keyboard is installed |
|||
including VT-100/ANSI terminal emulation. |
|||
- Auto-detects PropIO or PropIO V2 and installs associated |
|||
video, keyboard and SD Card support if present. |
|||
- If PropIO, PropIO V2, CVDU, or VGA hardware is detected, |
|||
initial console output is determined by JP2. If JP2 is |
|||
shorted, console will go to on-board serial port, if JP2 |
|||
is open, console will go to the detected video and keyboard |
|||
ports. |
|||
- SBC V1 has a known race condition in the bank switching |
|||
circuit which is likely to cause system instability. SBC |
|||
V2 does not have this issue. |
|||
|
|||
SBC (SBC_simh.rom): |
|||
- SBC variant customized to run under SimH |
|||
- Implments two emulated SimH hard disk images |
|||
- Uses SimH RTC |
|||
|
|||
ZETA (ZETA_std.rom): |
|||
- CPU speed is detected at startup |
|||
- Console on onboard UART serial port at 38400 baud |
|||
- Includes support for on-board floppy disk controller and |
|||
two attached floppy disks. |
|||
- Auto-detects ParPortProp and includes support for it if it |
|||
is attached. |
|||
- If ParPortProp is installed, initial console output is |
|||
determined by JP1. If JP1 is shorted, console will go to |
|||
on-board serial port, if JP1 is open, console will go to |
|||
ParPortProp video and keyboard ports. |
|||
|
|||
ZETA2 (ZETA2_std.rom): |
|||
- CPU speed is detected at startup |
|||
- Console on onboard UART serial port at 38400 baud |
|||
- Includes support for on-board floppy disk controller and |
|||
two attached floppy disks. |
|||
- Auto-detects ParPortProp and includes support for it if it |
|||
is attached. |
|||
- Uses CTC to generate periodic timer interrupts. |
|||
- If ParPortProp is installed, initial console output is |
|||
determined by JP1. If JP1 is shorted, console will go to |
|||
on-board serial port, if JP1 is open, console will go to |
|||
ParPortProp video and keyboard ports. |
|||
|
|||
N8 (N8_std.rom): |
|||
- CPU speed is detected at startup |
|||
- Console on Z180 onboard primary ASCI serial port at 38400 baud |
|||
- Includes support for on-board floppy disk controller and |
|||
two attached floppy disks. |
|||
- Includes support for on-board TMS9918 video and keyboard |
|||
including VT-100/ANSI terminal emulation. |
|||
- Includes support for on-board SD Card as hard disk and |
|||
assumes a production level N8 board (date code >= 2312). |
|||
|
|||
MK4 (MK4_std.rom): |
|||
- CPU speed is detected at startup |
|||
- Console on Z180 onboard primary ASCI serial port at 38400 baud |
|||
- Includes support for on-board IDE port (CF Card via adapter). |
|||
- Includes support for on-board SD Card port. |
|||
- Auto-detects PropIO or PropIO V2 and installs associated |
|||
video, keyboard and SD Card support if present. |
|||
- Includes support for CVDU and VGA3 boards. If detected at |
|||
startup, support for video and keyboard is installed |
|||
including VT-100/ANSI terminal emulation. |
|||
|
|||
RCZ80 (RCZ80_std.rom): |
|||
- Assumes CPU oscillator of 7.3728 MHz |
|||
- Requires 512K RAM/ROM module |
|||
- Auto detects Serial I/O Module (ACIA) and Dual Serial |
|||
Module (SIO/2). Either one may be used. |
|||
- Console on whichever serial module is installed, |
|||
but will use the SIO/2 if both are installed. Baud |
|||
rate is determined by hardware, but normally 115200. |
|||
- Includes support for RC2014 Compact Flash Module |
|||
- Support for RC2014 PPIDE Module may be enabled in config |
|||
- Support for Scott Baker SIO board may be enabled in config |
|||
- Support for Scott Baker floppy controllers (SMC & WDC) may |
|||
be enabled in config |
|||
|
|||
RCZ80 w/ KIO (RCZ80_kio.rom): |
|||
- Assumes CPU oscillator of 7.3728 MHz |
|||
- Requires 512K RAM/ROM module |
|||
- Requires KIO module |
|||
- Console on KIO primary serial port at 115200 baud |
|||
- Includes support for RC2014 Compact Flash Module |
|||
- Includes support for RC2014 PPIDE Module |
|||
- Support for Scott Baker SIO board may be enabled in config |
|||
- Support for Scott Baker floppy controllers (SMC & WDC) may |
|||
be enabled in config |
|||
|
|||
RCZ180 (RCZ180_nat.rom & RCZ180_ext.rom): |
|||
- Assumes CPU oscillator of 18.432 MHz |
|||
- Console on Z180 onboard primary ASCI serial port at 115200 baud |
|||
- Includes support for RC2014 Compact Flash Module |
|||
- Includes support for RC2014 PPIDE Module |
|||
- Support for alternative serial modules may be enabled in config |
|||
- Support for Scott Baker floppy controllers (SMC & WDC) may |
|||
be enabled in config |
|||
- You must pick the _nat or _ext variant depending on which |
|||
memory module you are using: |
|||
- RCZ180_nat.rom uses the built-in Z180 memory manager |
|||
for use with memory modules allow direct physical |
|||
addressing of memory, such as the SC119 |
|||
- RCZ180_ext.rom uses external bank management to access |
|||
memory, such as the 512K RAM/ROM module. |
|||
|
|||
SCZ180 (SCZ180_126.rom, SCZ180_130.rom, SCZ180_131.rom): |
|||
- Assumes CPU oscillator of 18.432 MHz |
|||
- Console on Z180 onboard primary ASCI serial port at 115200 baud |
|||
- Includes support for RC2014 Compact Flash Module |
|||
- Includes support for RC2014 PPIDE Module |
|||
- Support for alternative serial modules may be enabled in config |
|||
- Support for Scott Baker floppy controllers (SMC & WDC) may |
|||
be enabled in config |
|||
- The 3 different variants of SCZ180 are provided to match the |
|||
3 corresponding systems (SC126, SC130, and SC131) designed by |
|||
Stephen Cousins. |
|||
|
|||
EZZ80 (EZZ80_std.rom): |
|||
- Assumes CPU oscillator of 10.000 MHz |
|||
- Console on primary SIO serial port at 115200 baud |
|||
- Includes support for on-board SIO |
|||
- Includes support for RC2014 Compact Flash Module |
|||
- Includes support for RC2014 PPIDE Module |
|||
|
|||
DYNO (DYNO_std.rom): |
|||
- Assumes CPU oscillator of 18.432 MHz |
|||
- Console on Z180 onboard serial ports at 38400 baud |
|||
- Includes support for BQ4842 RTC |
|||
- Includes support for onboard PPIDE |
|||
- Support for Dyno floppy controllers may be enabled in config |
|||
@ -0,0 +1,10 @@ |
|||
@echo off |
|||
setlocal |
|||
|
|||
if exist *.spr del *.spr |
|||
if exist *.com del *.com |
|||
if exist *.sys del *.sys |
|||
if exist *.pat del *.pat |
|||
if exist *.dat del *.dat |
|||
if exist *.zpm del *.zpm |
|||
if exist *.spr del *.spr |
|||
@ -0,0 +1,7 @@ |
|||
TOOLS = ../../Tools |
|||
MOREDIFF := $(shell $(TOOLS)/unix/casefn.sh *.spr) |
|||
|
|||
include $(TOOLS)/Makefile.inc |
|||
|
|||
clean:: |
|||
@rm -f *.spr *.com *.sys *.dat *.zpm |
|||
@ -0,0 +1,17 @@ |
|||
*********************************************************************** |
|||
*** *** |
|||
*** R o m W B W *** |
|||
*** *** |
|||
*** Z80/Z180 System Software *** |
|||
*** *** |
|||
*********************************************************************** |
|||
|
|||
This directory contains the ZPM3 system files for the RomWBW ZPM3 |
|||
adaptation. All of these files are already included on the ZPM3 |
|||
boot disk images. However if you are creating a CP/M 3 boot disk |
|||
manually, you should copy all of these files to the boot disk. |
|||
|
|||
These files should also be copied to any ZPM3 boot disks on your |
|||
system when you upgrade your ROM firmware. Some of these files |
|||
*must* match the version of the RomWBW firmware you are using for |
|||
proper operation of your system. |
|||
@ -0,0 +1,6 @@ |
|||
@echo off |
|||
setlocal |
|||
|
|||
pushd Source && call Build %* || exit /b & popd |
|||
|
|||
if "%*" == "" pause |
|||
@ -0,0 +1,42 @@ |
|||
# Contributing to RomWBW |
|||
|
|||
> **WARNING**: The `dev` branch of RomWBW has been deprecated as of v3.4. All Pull Requests should now target the `master` branch. |
|||
|
|||
Contributions of all kinds to RomWBW are welcomed and greatly appreciated. |
|||
|
|||
- Reporting bug(s) and suggesting new feature(s) |
|||
- Discussing the current state of the code |
|||
- Submitting a fixes and enhancements |
|||
|
|||
## RomWBW GitHub Repository |
|||
|
|||
The [RomWBW GitHub Repository](https://github.com/wwarthen/RomWBW) is the primary location for developing, supporting, and distributing RomWBW. Although input is gladly accepted from almost any channel, the GitHub Repository is preferred. |
|||
|
|||
- Use **Issues** to report bugs, request enhancements, or ask usage questions. |
|||
- Use **Discussions** to interact with others |
|||
- Use **Pull Requests** to submit content (code, documentation, etc.) |
|||
|
|||
## Submitting Content |
|||
|
|||
This RomWBW Project uses the standard [GitHub Flow](https://docs.github.com/en/get-started/quickstart/github-flow). Submission of content changes (including code) are ideally done via Pull Requests. |
|||
|
|||
- Submitters are advised to contact [Wayne Warthen](mailto:wwarthen@gmail.com) or start a GitHub Discussion prior to starting any significant work. This is simply to ensure that submissions are consistent |
|||
with the overall goals and intentions of RomWBW. |
|||
- All submissions should be based on the `master` branch. To create your submission, fork the RomWBW repository and create your branch from `master`. Make (and test) your changes in your personal fork. |
|||
- Please update relevant documentation and the `ChangeLog` found in the `Doc` folder. |
|||
- You are encouraged to comment your submissions to ensure your work is properly attributed. |
|||
- When ready, submit a Pull Request to merge your forked branch into the RomWBW master branch. |
|||
|
|||
## Coding Style |
|||
|
|||
Due to the nature of the project, you will find a variety of coding styles. When making changes to existing code, please try to be consistent with the existing coding style. You may not like the current style, but no one likes mixed styles |
|||
in one file/module. |
|||
|
|||
Be careful with white space. RomWBW is primarily assembly langauge code. The use of tab stops at every 8 characters is pretty standard for assembler. If you use something else, then your code will look odd when viewed by others. |
|||
|
|||
In most cases, the use of `<cr><lf>` line endings is preferred. This is standard for the operating systems of the era that RomWBW provides. Also note that CP/M text files should end with a ctrl-Z (0x1A). This is not magically added by the |
|||
tools that generate the disk images. |
|||
|
|||
## License |
|||
|
|||
RomWBW is licensed under GPLv3. When you submit code changes, your submissions are understood to be under the same [GPLv3 License](https://www.gnu.org/licenses/gpl-3.0.html) that covers the project. |
|||
@ -0,0 +1,5 @@ |
|||
@echo off |
|||
setlocal |
|||
|
|||
pushd Binary && call Clean || exit /b 1 & popd |
|||
pushd Source && call Clean || exit /b 1 & popd |
|||
Binary file not shown.
@ -1,186 +0,0 @@ |
|||
|
|||
FLASH4 (c) 2014 William R Sowerbutts <will@sowerbutts.com> |
|||
http://sowerbutts.com/8bit/ |
|||
|
|||
= Warning = |
|||
|
|||
FLASH4 has been tested and confirmed working on: |
|||
* N8VEM SBCv2 |
|||
* N8VEM N8-2312 |
|||
* N8VEM Mark IV SBC |
|||
* DX-Designs P112 |
|||
* ZETA SBC v2 |
|||
|
|||
However it remains somewhat experimental. If it works for you, please let me |
|||
know. If it breaks please also let me know so I can fix it! |
|||
|
|||
|
|||
= Introduction = |
|||
|
|||
FLASH4 is a CP/M program which can read, write and verify Flash ROM contents to |
|||
or from an image file stored on a CP/M filesystem. It is intended for in-system |
|||
programming of Flash ROM chips on Z80 and Z180 systems. |
|||
|
|||
FLASH4 aims to support a range of Flash ROM chips. Ideally I would like to |
|||
support all Flash ROM chips that are in use in Z80/Z180 N8VEM machines. If |
|||
FLASH4 does not support your chip please let me know and I will try to add |
|||
support. |
|||
|
|||
When writing to the Flash ROM chip, FLASH4 will only reprogram the sectors |
|||
whose contents have changed. This helps to reduce wear on the flash memory, |
|||
makes the reprogram operation faster, and reduces the risk of leaving the |
|||
system unbootable if power fails during a reprogramming operation. FLASH4 |
|||
always performs a full verify operation after writing to the chip to confirm |
|||
that the correct data has been loaded. |
|||
|
|||
FLASH4 is reasonably fast. Reprogramming and verifying every sector on a 512KB |
|||
SST 39F040 chip takes 21 seconds on my Mark IV SBC, versus 45 seconds to |
|||
perform the same task using a USB MiniPro TL866 EEPROM programmer under Linux |
|||
on my PC. If only a subset of sectors require reprogramming FLASH4 will be |
|||
even faster. |
|||
|
|||
FLASH4 works with binary ROM image files, it does not support Intel Hex format |
|||
files. Hex files can be easily converted to or from binaries using "hex2bin" or |
|||
the "srec_cat" program from SRecord: |
|||
|
|||
$ srec_cat image.hex -intel -fill 0xFF 0 0x80000 -output image.bin -binary |
|||
$ srec_cat image.bin -binary -output image.hex -intel |
|||
|
|||
FLASH4 can use several different methods to access the Flash ROM chip. The best |
|||
available method is determined automatically at run time. Alternatively you may |
|||
provide a command-line option to force the use of a specific method. |
|||
|
|||
The first two methods use bank switching to map sections of the ROM into the |
|||
CPU address space. FLASH4 will detect the presence of RomWBW or UNA BIOS and |
|||
use the bank switching methods they provide. |
|||
|
|||
On P112 systems the P112 B/P BIOS is detected and P112 bank switching is used. |
|||
|
|||
If no bank switching method can be auto-detected, and the system has a Z180 |
|||
CPU, FLASH4 will use the Z180 DMA engine to access the Flash ROM chip. This |
|||
does not require any bank switching but it is slower and will not work on all |
|||
platforms. |
|||
|
|||
Z180 DMA access requires the flash ROM to be linearly mapped into the lower |
|||
region of physical memory, as it is on the Mark IV SBC (for example). The |
|||
N8-2312 has additional memory mapping hardware, consequently Z180 DMA access on |
|||
the N8-2312 is NOT SUPPORTED and if forced will corrupt the contents of RAM; |
|||
use one of the supported bank switching methods instead. |
|||
|
|||
Z180 DMA access requires the Z180 CPU I/O base control register configured to |
|||
locate the internal I/O addresses at 0x40 (ie ICR bits IOA7, IOA6 = 0, 1). |
|||
|
|||
|
|||
= Usage = |
|||
|
|||
The three basic operations are: |
|||
|
|||
FLASH4 WRITE filename [options] |
|||
|
|||
This will rewrite the flash ROM contents from the named file. The file size |
|||
must exactly match the size of the ROM chip. After the write operation, a |
|||
verify operation will be performed automatically. |
|||
|
|||
FLASH4 VERIFY filename [options] |
|||
|
|||
This will read out the flash ROM contents and report if it matches the contents |
|||
of the named file. The file size must exactly match the size of the ROM chip. |
|||
|
|||
FLASH4 READ filename [options] |
|||
|
|||
This will read out the entire flash ROM contents and write it to the named |
|||
file. |
|||
|
|||
If your ROM chip is larger than the image you wish to write, use the "/PARTIAL" |
|||
(or "/P") command line option. To avoid accidentally flashing the wrong file, |
|||
the image file must be an exact multiple of 32KB in length. The portion of the |
|||
ROM not occupied by the image file is left either unmodified or erased. |
|||
|
|||
If you are using an ROM/EPROM/EEPROM chip which cannot be programmed in-system, |
|||
FLASH4 will not be able to recognise it, however the software can still |
|||
usefully READ and VERIFY the chip. Use the "/ROM" command line option to enable |
|||
"READ" or "VERIFY" mode with unrecognised chips. This mode assumes a 512K ROM |
|||
is fitted; smaller ROMs will be treated as a 512K ROM with the data repated |
|||
multiple times -- with a 256K chip the data is repeated twice, four times for a |
|||
128K chip, etc. |
|||
|
|||
One of the following optional command line arguments may be specified at the |
|||
end of the command line to force FLASH4 to use a particular method to access |
|||
the flash ROM chip: |
|||
|
|||
BIOS interfaces: |
|||
/ROMWBW For ROMWBW BIOS version 2.6 and later |
|||
/ROMWBWOLD For ROMWBW BIOS version 2.5 and earlier |
|||
/UNABIOS For UNA BIOS |
|||
|
|||
Direct hardware interfaces: |
|||
/Z180DMA For Z180 DMA |
|||
/P112 For DX-Designs P112 |
|||
/N8VEMSBC For N8VEM SBC (v1, v2), Zeta (v1) SBC |
|||
|
|||
If no option is specified FLASH4 attempts to determine the best available |
|||
method automatically. |
|||
|
|||
|
|||
= Supported chips and features = |
|||
|
|||
FLASH4 will interrogate your flash ROM chip to identify it automatically. |
|||
FLASH4 assumes that you have a single flash ROM device and it is located at the |
|||
bottom of the physical memory map. |
|||
|
|||
FLASH4 does not support setting or resetting the protection bits on individual |
|||
sectors within Flash ROM devices. If your Flash ROM chip has protected sectors |
|||
you will need to unprotect them by other means before FLASH4 can erase and |
|||
reprogram them. |
|||
|
|||
AT29C series chips employ an optional "software data protection" feature. This |
|||
is supported by FLASH4 and is left activated after programming the chip to |
|||
prevent accidental reprogramming of sectors. |
|||
|
|||
The following chips are supported: |
|||
|
|||
AT29F010 |
|||
AT29F040 |
|||
M29F010 |
|||
M29F040 |
|||
MX29F040 |
|||
SST 39F010 |
|||
SST 39F020 |
|||
SST 39F040 |
|||
AT29C512 |
|||
AT29C040 |
|||
AT29C010 |
|||
AT29C020 |
|||
|
|||
The following chips are supported but have unequal sector sizes; FLASH4 will |
|||
only erase and reprogram the entire chip at once rather than its normal |
|||
sector-by-sector operation: |
|||
|
|||
AT49F001NT |
|||
AT49F001N |
|||
AT49F002N |
|||
AT49F002NT |
|||
AT49F040 |
|||
|
|||
If you use a flash ROM chip that is not listed above please email me |
|||
(will@sowerbutts.com) and I will try to add support for it. |
|||
|
|||
|
|||
= Compiling = |
|||
|
|||
The software is written in a mix of C and assembler. It builds using the SDCC |
|||
toolchain and the SRecord tools. A Makefile is provided to build the executable |
|||
in Linux and I imagine it can be easily modified to build in Windows. |
|||
|
|||
You may need to adjust the path to the SDCC libraries in the Makefile if your |
|||
sdcc installation is not in /usr/local |
|||
|
|||
|
|||
= License = |
|||
|
|||
FLASH4 is licensed under the The GNU General Public License version 3 (see |
|||
included "LICENSE.txt" file). |
|||
|
|||
FLASH4 is provided with NO WARRANTY. In no event will the author be liable for |
|||
any damages. Use of this program is at your own risk. May cause rifts in space |
|||
and time. |
|||
Binary file not shown.
Binary file not shown.
@ -0,0 +1,39 @@ |
|||
|
|||
PPI Signal PPIDE PPISD DSKY DSKYNG (PROTO) DSKYNG (FINAL) |
|||
---------- ----- ----- ----- ----- ----- |
|||
PA0 <>D0 >ID0 <>D0 <>D0 |
|||
PA1 <>D1 >ID1 <>D1 <>D1 |
|||
PA2 <>D2 >ID2 <>D2 <>D2 |
|||
PA3 <>D3 >ID3 <>D3 <>D3 |
|||
PA4 <>D4 >ID4 /SHUTDOWN <>D4 <>D4 |
|||
PA5 <>D5 >ID5 /DECODE <>D5 <>D5 |
|||
PA6 <>D6 >ID6 HEXA/CODEB <>D6 <>D6 |
|||
PA7 <>D7 >ID7 DAT_COMING <>D7 <>D7 |
|||
|
|||
PB0 <>D8 +<ROW5 |
|||
PB1 <>D9 +<ROW4 |
|||
PB2 <>D10 +<ROW3 |
|||
PB3 <>D11 +<ROW2 |
|||
PB4 <>D12 +<ROW1 |
|||
PB5 <>D13 +<ROW0 |
|||
PB6 <>D14 + |
|||
PB7 <>D15 <MISO + |
|||
|
|||
PC0 >DA0 >MOSI >COL0 >A0 >A0 |
|||
PC1 >DA1 >CLK >COL1 >/WR |
|||
PC2 >DA2 >COL2 >/RD |
|||
PC3 >CS0* >COL3 >CS&* >CS&* |
|||
PC4 >CS1* >/CS >CS&* >CS&* |
|||
PC5 >DIOW* >/WR |
|||
PC6 >DIOR* >/WR >/RD |
|||
PC7 >RESET* >MODE >RESET >RESET |
|||
|
|||
* Inverted by adapter |
|||
+ Pullup |
|||
& Both signals must be asserted |
|||
|
|||
Compatibility: |
|||
|
|||
- PPISD & DSKY |
|||
- PPIDE & DSKYNG |
|||
- PPISD & DSKYNG |
|||
Binary file not shown.
@ -1,564 +0,0 @@ |
|||
|
|||
DDTZ v2.7 |
|||
by C.B. Falconer |
|||
edited by George A. Havach |
|||
|
|||
Introduction: |
|||
============ |
|||
DDTZ v2.7 is a complete replacement for DDT, Digital Research's |
|||
famous Dynamic Debugging Tool, with improved functionality, bug |
|||
extermination, and full Z80 support. In general, DDTZ is fully |
|||
compatible with the original utility, but it has extra and |
|||
extended commands and many fewer quirks. All Z80-specific |
|||
instructions can be (dis)assembled, though in Intel rather then |
|||
Zilog format. Furthermore, DDTZ will correctly trace ('T' and 'U' |
|||
commands) both 8080 and Z80 instructions, depending on which CPU |
|||
is operating. On startup, the program announces which CPU it is |
|||
running on. |
|||
|
|||
DDTZ v2.7 now handles the 64180 added opcodes. It does NOT test |
|||
for a 64180 CPU, since this cannot be done without executing |
|||
illegal Z80 instructions, which in turn will crash some |
|||
simulators. However v2.7 does not execute any 64180 instructions |
|||
internally, only in the subject program. |
|||
|
|||
This issue supplies the "M" version assembled, to avoid errors |
|||
when switching between MSDOS and CPM systems. The command table |
|||
is updated accordingly. Most CPM users are also MSDOS users, but |
|||
not vice-versa. |
|||
|
|||
The program is invoked by typing |
|||
|
|||
ddtz<ret> |
|||
or |
|||
ddtz [d:]filespec<ret> |
|||
|
|||
In the second form, DDTZ will load the specified file into |
|||
memory starting at 0100H, unless it's a .HEX file that sets its |
|||
own load address. Besides reporting the NEXT free address and |
|||
the PC (program counter) after a successful load, DDTZ also shows |
|||
the number of memory pages needed for a SAVE. Instead of having |
|||
to write all this down, just use the 'X' command at any time to |
|||
redisplay these three values for the current application. |
|||
|
|||
NOTE: loading more code above the NEXT pointer revises these |
|||
values. |
|||
|
|||
As in DDT, when a program is loaded above the area holding the |
|||
'A' and 'U' (and now 'W') command code, these commands are |
|||
disabled, and the extra memory is released to the user. Thus, |
|||
DDTZ can occupy as little as 3K total memory space. Unlike DDT, |
|||
however, DDTZ will not overwrite itself or the system on program |
|||
loads (except .HEX files). |
|||
|
|||
At initialization, the stack pointer (SP) points to a return to |
|||
DDTZ, just like for the CCP. Thus, programs that normally return |
|||
to the CCP will be returned to DDTZ. The 'B' command |
|||
reinitializes this condition. |
|||
|
|||
|
|||
The intercept vector copies the BDOS version number, etc., so |
|||
an object program does not know that DDTZ is running (except |
|||
for BIOS-BDOS vector size). Thus, programs that check the version |
|||
number should execute correctly under DDTZ. |
|||
|
|||
All input parameters can now be entered in any of three formats: |
|||
|
|||
(1) hexadecimal (as in DDT), |
|||
(2) decimal, by adding a leading '#' character, |
|||
(3) ASCII, by enclosing between either single or double |
|||
quotes; either one or two characters are allowed. |
|||
|
|||
Leading blanks in command lines and parameters are absorbed. |
|||
Either a comma or a (single) space is a valid delimiter. |
|||
Either uppercase or lowercase input is accepted. |
|||
|
|||
The default command (for anything not otherwise recognizable) |
|||
is 'H'. This allows convenient calculation, along with the other |
|||
features described below. So, to convert a number, just enter |
|||
it! |
|||
|
|||
As in DDT, the prompt character is '-', and the only error |
|||
message is the query ('?'), which generally kicks you back to |
|||
command mode. |
|||
|
|||
New Commands (Over DDT): |
|||
======================= |
|||
|
|||
NOTE: letters in parenthesis, e.g. "(U)", show the equivalent |
|||
command for DDTZM version (compatible with MSDOS debug). |
|||
|
|||
@ Sets or shows (with no parameter) the internally stored |
|||
"base" value. Also used with the 'S' and 'D' commands as |
|||
an optional parameter (though without the '@') to display |
|||
memory from an arbitrary base marker (offset). When set to |
|||
zero (the default), it does not affect any screen displays. |
|||
|
|||
B B)egin: resets the USER stack pointer to its initial value, |
|||
such that any program that exits by an RET will return to |
|||
DDTZ. DDTZ provides a default stack space of |
|||
approximately 24 bytes for user programs. |
|||
|
|||
C C)ompare first_address,last_address,against_address: shows |
|||
all the byte differences between two memory areas, in the |
|||
format |
|||
|
|||
XXXX aa YYYY bb |
|||
|
|||
where XXXX and YYYY are the comparative memory addresses, |
|||
and aa and bb are the corresponding byte values. Can be |
|||
used to verify the identity of two files by first |
|||
loading them into different memory areas with the 'R' |
|||
command (see below). |
|||
|
|||
|
|||
W Write: stores the modified memory area to disk under the |
|||
(K) filename specified by the 'I' command, overwriting the |
|||
original file from which it was loaded (the user is queried |
|||
before doing so). By default, the image of memory from |
|||
0100H through the "NEXT" value -1 is saved. "K first_addr, |
|||
last_address" overrides this and allows writing ANY memory |
|||
area to a file. Almost a necessity for CPM 3.0 (no SAVE!). |
|||
K)eep on DDTZ |
|||
|
|||
X eXamine: redisplays the "NEXT PC SAVE" report at any time. |
|||
(Q) Q)uery size on DDTZ. |
|||
|
|||
S S)earch first_address, last_addr, value: searches the |
|||
(W) specified memory area for the value (a 16-bit word, not a |
|||
byte) and shows the locations of all such. Very useful for |
|||
finding CALL's or JMP's to a particular address, etc. |
|||
W)here on DDTZ |
|||
|
|||
Y Y)our_option parm1,parm2,address: executes an arbitrary |
|||
routine at the specified address, with the BC and DE |
|||
registers set to parm1 and parm2, respectively. |
|||
|
|||
Z Displays (but does not alter) the Z80's alternate register |
|||
set, including the index registers (disabled if running on |
|||
an 8080). On Z80's, automatically included as the last |
|||
part of the display by the 'X' command. |
|||
|
|||
|
|||
Based (Offset) Displays: |
|||
======================= |
|||
|
|||
The 'D' and 'E' commands can use a stored base value (offset), |
|||
as set by the '@' command. The current @ value may be |
|||
overridden for a single execution of these commands by adding the |
|||
base as an extra parameter in the command line. The effect is |
|||
to add this value to the first/last address and display |
|||
accordingly. The address listing on the left becomes XXXX:YYYY, |
|||
where XXXX is the offset address and YYYY is the actual memory |
|||
address being displayed. For example, if you have a data area |
|||
located at 42B7H and wish to preserve easy access, just enter |
|||
"@42b7". Now, "d0,3f" will dump memory starting at 4237H. |
|||
|
|||
|
|||
Further Changes from DDT: |
|||
======================== |
|||
|
|||
A A)ssemble now accepts the full Z80 as well as 8080 |
|||
instruction set, although it expects them in Intel rather |
|||
than Zilog format (see notes below under the 'L' |
|||
command). When in doubt, see the mnemnonic list below. |
|||
|
|||
D D)isplay or D)ump will accept an optional third parameter |
|||
to set the base value for a single execution only. Format |
|||
has been cleaned up. |
|||
|
|||
H H)ex_arithmetic on two values also shows their |
|||
difference in decimal. With only one value, converts to |
|||
hexadecimal, decimal, and ASCII (low-order byte only). |
|||
|
|||
|
|||
N N)ame now allows drive specification (d:...) and sets up |
|||
(I) the complete command line, including both FCB's (at |
|||
addresses 005CH and 006CH). The tail (stored at 0081H up) |
|||
is NOT upshifted. |
|||
I)nput on DDTZ |
|||
|
|||
U U)nassemble now displays the raw hexcode, especially handy |
|||
(L) when examining non-code areas. Intel (8080 style) mnemonics |
|||
are used, so some disassembled instructions may look |
|||
strange. E.g., the Z80's 'IN B,(C)' and 'OUT (C),B' become |
|||
'INP B' and 'OUTP B', respectively; 'LD (nnnn),BC' becomes |
|||
'SBCD nnnn', 'ADD IX, BC' becomes 'DADX B', and 'JP (IX)' |
|||
becomes 'PCIX'. |
|||
L)ist on DDTZ |
|||
|
|||
L L)oad now permits loading a file into memory with an |
|||
(R) offset, which is added to the default load address of |
|||
0100H. When reading in a .HEX file with a preset bias, |
|||
the 'R' command will not transfer control to an invalid |
|||
execution point. Another execution of the 'R' command will |
|||
reread the input file, e.g.: |
|||
|
|||
n blah<ret> |
|||
l<ret> |
|||
...modify the code and generally mess about... |
|||
l<ret> |
|||
|
|||
The original file is reloaded, and the modifications are |
|||
removed. |
|||
R)ead on DDTZ |
|||
|
|||
E E)nter, like D)isplay, now accepts an optional second |
|||
(S) parameter to set the base value for a single execution |
|||
only. |
|||
S)ubstitute or S)et on DDTZ |
|||
|
|||
T T)rap/trace on termination now shows the complete CPU |
|||
state. Traps and traces no longer lock up when a user RST |
|||
7 instruction is executed. Tracing of BDOS/BIOS calls is |
|||
heavily trun cated, avoiding clutter and preventing system |
|||
crashes. |
|||
|
|||
NOTE: Most of the UNDOCUMENTED Z80 op-codes are handled. Others |
|||
can crash the system. |
|||
|
|||
R R)egisters also shows what two-byte values the HL and SP |
|||
(X) registers are actually pointing to. On Z80's, displays the |
|||
alternate register set. |
|||
eX)amine on DDTZ |
|||
|
|||
NOTE: Any use of the 'W' or 'L' command resets the system DMA |
|||
transfer address to the standard default value of 0080H. |
|||
|
|||
|
|||
; This is the output of DDTZ when disassembling OPTYPE.TRY |
|||
NOP LDA 06A4 MOV M,H |
|||
LXI B,06A4 DCX SP MOV M,L |
|||
STAX B INR A HLT |
|||
INX B DCR A MOV M,A |
|||
INR B MVI A,20 MOV A,B |
|||
DCR B CMC MOV A,C |
|||
MVI B,20 MOV B,B MOV A,D |
|||
RLC MOV B,C MOV A,E |
|||
EXAF MOV B,D MOV A,H |
|||
DAD B MOV B,E MOV A,L |
|||
LDAX B MOV B,H MOV A,M |
|||
DCX B MOV B,L MOV A,A |
|||
INR C MOV B,M ADD B |
|||
DCR C MOV B,A ADD C |
|||
MVI C,20 MOV C,B ADD D |
|||
RRC MOV C,C ADD E |
|||
DJNZ 0134 MOV C,D ADD H |
|||
LXI D,06A4 MOV C,E ADD L |
|||
STAX D MOV C,H ADD M |
|||
INX D MOV C,L ADD A |
|||
INR D MOV C,M ADC B |
|||
DCR D MOV C,A ADC C |
|||
MVI D,20 MOV D,B ADC D |
|||
RAL MOV D,C ADC E |
|||
JR 0134 MOV D,D ADC H |
|||
DAD D MOV D,E ADC L |
|||
LDAX D MOV D,H ADC M |
|||
DCX D MOV D,L ADC A |
|||
INR E MOV D,M SUB B |
|||
DCR E MOV D,A SUB C |
|||
MVI E,20 MOV E,B SUB D |
|||
RAR MOV E,C SUB E |
|||
JRNZ 0134 MOV E,D SUB H |
|||
LXI H,06A4 MOV E,E SUB L |
|||
SHLD 06A4 MOV E,H SUB M |
|||
INX H MOV E,L SUB A |
|||
INR H MOV E,M SBB B |
|||
DCR H MOV E,A SBB C |
|||
MVI H,20 MOV H,B SBB D |
|||
DAA MOV H,C SBB E |
|||
JRZ 0134 MOV H,D SBB H |
|||
DAD H MOV H,E SBB L |
|||
LHLD 06A4 MOV H,H SBB M |
|||
DCX H MOV H,L SBB A |
|||
INR L MOV H,M ANA B |
|||
DCR L MOV H,A ANA C |
|||
MVI L,20 MOV L,B ANA D |
|||
CMA MOV L,C ANA E |
|||
JRNC 0134 MOV L,D ANA H |
|||
LXI SP,06A4 MOV L,E ANA L |
|||
STA 06A4 MOV L,H ANA M |
|||
INX SP MOV L,L ANA A |
|||
INR M MOV L,M XRA B |
|||
DCR M MOV L,A XRA C |
|||
MVI M,20 MOV M,B XRA D |
|||
STC MOV M,C XRA E |
|||
JRC 0134 MOV M,D XRA H |
|||
DAD SP MOV M,E XRA L |
|||
|
|||
|
|||
XRA M JPE 06A4 SLAR M |
|||
XRA A XCHG SLAR A |
|||
ORA B CPE 06A4 SRAR B |
|||
ORA C XRI 20 SRAR C |
|||
ORA D RST 5 SRAR D |
|||
ORA E RP SRAR E |
|||
ORA H POP PSW SRAR H |
|||
ORA L JP 06A4 SRAR L |
|||
ORA M DI SRAR M |
|||
ORA A CP 06A4 SRAR A |
|||
CMP B PUSH PSW SLLR B |
|||
CMP C ORI 20 SLLR C |
|||
CMP D RST 6 SLLR D |
|||
CMP E RM SLLR E |
|||
CMP H SPHL SLLR H |
|||
CMP L JM 06A4 SLLR L |
|||
CMP M EI SLLR M |
|||
CMP A CM 06A4 SLLR A |
|||
RNZ CPI 20 SRLR B |
|||
POP B RST 7 SRLR C |
|||
JNZ 06A4 RLCR B SRLR D |
|||
JMP 06A4 RLCR C SRLR E |
|||
CNZ 06A4 RLCR D SRLR H |
|||
PUSH B RLCR E SRLR L |
|||
ADI 20 RLCR H SRLR M |
|||
RST 0 RLCR L SRLR A |
|||
RZ RLCR M BIT 0,B |
|||
RET RLCR A BIT 0,C |
|||
JZ 06A4 RRCR B BIT 0,D |
|||
CZ 06A4 RRCR C BIT 0,E |
|||
CALL 06A4 RRCR D BIT 0,H |
|||
ACI 20 RRCR E BIT 0,L |
|||
RST 1 RRCR H BIT 0,M |
|||
RNC RRCR L BIT 0,A |
|||
POP D RRCR M BIT 1,B |
|||
JNC 06A4 RRCR A BIT 1,C |
|||
OUT 20 RALR B BIT 1,D |
|||
CNC 06A4 RALR C BIT 1,E |
|||
PUSH D RALR D BIT 1,H |
|||
SUI 20 RALR E BIT 1,L |
|||
RST 2 RALR H BIT 1,M |
|||
RC RALR L BIT 1,A |
|||
EXX RALR M BIT 2,B |
|||
JC 06A4 RALR A BIT 2,C |
|||
IN 20 RARR B BIT 2,D |
|||
CC 06A4 RARR C BIT 2,E |
|||
SBI 20 RARR D BIT 2,H |
|||
RST 3 RARR E BIT 2,L |
|||
RPO RARR H BIT 2,M |
|||
POP H RARR L BIT 2,A |
|||
JPO 06A4 RARR M BIT 3,B |
|||
XTHL RARR A BIT 3,C |
|||
CPO 06A4 SLAR B BIT 3,D |
|||
PUSH H SLAR C BIT 3,E |
|||
ANI 20 SLAR D BIT 3,H |
|||
RST 4 SLAR E BIT 3,L |
|||
RPE SLAR H BIT 3,M |
|||
PCHL SLAR L BIT 3,A |
|||
|
|||
|
|||
BIT 4,B RES 3,D SET 2,H |
|||
BIT 4,C RES 3,E SET 2,L |
|||
BIT 4,D RES 3,H SET 2,M |
|||
BIT 4,E RES 3,L SET 2,A |
|||
BIT 4,H RES 3,M SET 3,B |
|||
BIT 4,L RES 3,A SET 3,C |
|||
BIT 4,M RES 4,B SET 3,D |
|||
BIT 4,A RES 4,C SET 3,E |
|||
BIT 5,B RES 4,D SET 3,H |
|||
BIT 5,C RES 4,E SET 3,L |
|||
BIT 5,D RES 4,H SET 3,M |
|||
BIT 5,E RES 4,L SET 3,A |
|||
BIT 5,H RES 4,M SET 4,B |
|||
BIT 5,L RES 4,A SET 4,C |
|||
BIT 5,M RES 5,B SET 4,D |
|||
BIT 5,A RES 5,C SET 4,E |
|||
BIT 6,B RES 5,D SET 4,H |
|||
BIT 6,C RES 5,E SET 4,L |
|||
BIT 6,D RES 5,H SET 4,M |
|||
BIT 6,E RES 5,L SET 4,A |
|||
BIT 6,H RES 5,M SET 5,B |
|||
BIT 6,L RES 5,A SET 5,C |
|||
BIT 6,M RES 6,B SET 5,D |
|||
BIT 6,A RES 6,C SET 5,E |
|||
BIT 7,B RES 6,D SET 5,H |
|||
BIT 7,C RES 6,E SET 5,L |
|||
BIT 7,D RES 6,H SET 5,M |
|||
BIT 7,E RES 6,L SET 5,A |
|||
BIT 7,H RES 6,M SET 6,B |
|||
BIT 7,L RES 6,A SET 6,C |
|||
BIT 7,M RES 7,B SET 6,D |
|||
BIT 7,A RES 7,C SET 6,E |
|||
RES 0,B RES 7,D SET 6,H |
|||
RES 0,C RES 7,E SET 6,L |
|||
RES 0,D RES 7,H SET 6,M |
|||
RES 0,E RES 7,L SET 6,A |
|||
RES 0,H RES 7,M SET 7,B |
|||
RES 0,L RES 7,A SET 7,C |
|||
RES 0,M SET 0,B SET 7,D |
|||
RES 0,A SET 0,C SET 7,E |
|||
RES 1,B SET 0,D SET 7,H |
|||
RES 1,C SET 0,E SET 7,L |
|||
RES 1,D SET 0,H SET 7,M |
|||
RES 1,E SET 0,L SET 7,A |
|||
RES 1,H SET 0,M DADX B |
|||
RES 1,L SET 0,A DADX D |
|||
RES 1,M SET 1,B LXI X,06A4 |
|||
RES 1,A SET 1,C SIXD 06A4 |
|||
RES 2,B SET 1,D INX X |
|||
RES 2,C SET 1,E DADX X |
|||
RES 2,D SET 1,H LIXD 06A4 |
|||
RES 2,E SET 1,L DCX X |
|||
RES 2,H SET 1,M INR [X+05] |
|||
RES 2,L SET 1,A DCR [X+05] |
|||
RES 2,M SET 2,B MVI [X+05],20 |
|||
RES 2,A SET 2,C DADX SP |
|||
RES 3,B SET 2,D MOV B,[X+05] |
|||
RES 3,C SET 2,E MOV C,[X+05] |
|||
|
|||
|
|||
MOV D,[X+05] DSBC B DADY B |
|||
MOV E,[X+05] SBCD 06A4 DADY D |
|||
MOV H,[X+05] NEG LXI Y,06A4 |
|||
MOV L,[X+05] RETN SIYD 06A4 |
|||
MOV [X+05],B IM0 INX Y |
|||
MOV [X+05],C LDIA DADY Y |
|||
MOV [X+05],D INP C LIYD 06A4 |
|||
MOV [X+05],E OUTP C DCX Y |
|||
MOV [X+05],H DADC B INR [Y+05] |
|||
MOV [X+05],L LBCD 06A4 DCR [Y+05] |
|||
MOV [X+05],A RETI MVI [Y+05],2 |
|||
MOV A,[X+05] LDRA DADY SP |
|||
ADD [X+05] INP D MOV B,[Y+05] |
|||
ADC [X+05] OUTP D MOV C,[Y+05] |
|||
SUB [X+05] DSBC D MOV D,[Y+05] |
|||
SBB [X+05] SDED 06A4 MOV E,[Y+05] |
|||
ANA [X+05] IM1 MOV H,[Y+05] |
|||
XRA [X+05] LDAI MOV L,[Y+05] |
|||
ORA [X+05] INP E MOV [Y+05],B |
|||
CMP [X+05] OUTP E MOV [Y+05],C |
|||
POP X DADC D MOV [Y+05],D |
|||
XTIX LDED 06A4 MOV [Y+05],E |
|||
PUSH X IM2 MOV [Y+05],H |
|||
PCIX LDAR MOV [Y+05],L |
|||
SPIX INP H MOV [Y+05],A |
|||
RLCR [X+05] OUTP H MOV A,[Y+05] |
|||
RRCR [X+05] DSBC H ADD [Y+05] |
|||
RALR [X+05] shld 06A4 ADC [Y+05] |
|||
RARR [X+05] RRD SUB [Y+05] |
|||
SLAR [X+05] INP L SBB [Y+05] |
|||
SRAR [X+05] OUTP L ANA [Y+05] |
|||
SRLR [X+05] DADC H XRA [Y+05] |
|||
BIT 0,[X+05] lhld 06A4 ORA [Y+05] |
|||
BIT 1,[X+05] RLD CMP [Y+05] |
|||
BIT 2,[X+05] INP M POP Y |
|||
BIT 3,[X+05] OUTP M XTIY |
|||
BIT 4,[X+05] DSBC SP PUSH Y |
|||
BIT 5,[X+05] SSPD 06A4 PCIY |
|||
BIT 6,[X+05] INP A SPIY |
|||
BIT 7,[X+05] OUTP A RLCR [Y+05] |
|||
RES 0,[X+05] DADC SP RRCR [Y+05] |
|||
RES 1,[X+05] LSPD 06A4 RALR [Y+05] |
|||
RES 2,[X+05] LDI RARR [Y+05] |
|||
RES 3,[X+05] CCI SLAR [Y+05] |
|||
RES 4,[X+05] INI SRAR [Y+05] |
|||
RES 5,[X+05] OTI SRLR [Y+05] |
|||
RES 6,[X+05] LDD BIT 0,[Y+05] |
|||
RES 7,[X+05] CCD BIT 1,[Y+05] |
|||
SET 0,[X+05] IND BIT 2,[Y+05] |
|||
SET 1,[X+05] OTD BIT 3,[Y+05] |
|||
SET 2,[X+05] LDIR BIT 4,[Y+05] |
|||
SET 3,[X+05] CCIR BIT 5,[Y+05] |
|||
SET 4,[X+05] INIR BIT 6,[Y+05] |
|||
SET 5,[X+05] OTIR BIT 7,[Y+05] |
|||
SET 6,[X+05] LDDR RES 0,[Y+05] |
|||
SET 7,[X+05] CCDR RES 1,[Y+05] |
|||
INP B INDR RES 2,[Y+05] |
|||
OUTP B OTDR RES 3,[Y+05] |
|||
|
|||
|
|||
RES 4,[Y+05] SET 0,[Y+05] SET 4,[Y+05] |
|||
RES 5,[Y+05] SET 1,[Y+05] SET 5,[Y+05] |
|||
RES 6,[Y+05] SET 2,[Y+05] SET 6,[Y+05] |
|||
RES 7,[Y+05] SET 3,[Y+05] SET 7,[Y+05] |
|||
|
|||
; These are the result of disassembling 64180OPS.TRY |
|||
; These opcodes are available ONLY on the 64180 CPU |
|||
; DDTZ will both assemble and disassemble these. |
|||
IN0 B,20 TST E MLT B |
|||
OUT0 20,B IN0 H,20 MLT D |
|||
TST B OUT0 20,H TSTI 20 |
|||
IN0 C,20 TST H MLT H |
|||
OUT0 20,C IN0 L,20 TSIO 20 |
|||
TST C OUT0 20,L SLP |
|||
IN0 D,20 TST L MLT SP |
|||
OUT0 20,D TST M OTIM |
|||
TST D IN0 A,20 OTDM |
|||
IN0 E,20 OUT0 20,A OIMR |
|||
OUT0 20,E TST A ODMR |
|||
|
|||
; The following are UNDOCUMENTED z80 opcodes from XTDOPS.TRY. |
|||
; DDTZ will disassemble these, but will not assemble them. |
|||
; They use xh/xl (or yh/yl) as separate byte registers. |
|||
; Use these at your own risk. |
|||
INRX H ACXR H MOVY H,B |
|||
DCRX H ACXR L MOVY H,C |
|||
MVIX H,20 SUXR H MOVY H,D |
|||
INRX L SUXR L MOVY H,E |
|||
DCRX L SBXR H MOVY H,A |
|||
MVIX L,20 SBXR L MOVY L,B |
|||
MOVX B,H NDXR H MOVY L,C |
|||
MOVX B,L NDXR L MOVY L,D |
|||
MOVX C,H XRXR H MOVY L,E |
|||
MOVX C,L XRXR L MOVY L,A |
|||
MOVX D,H ORXR H MOVY A,H |
|||
MOVX D,L ORXR L MOVY A,L |
|||
MOVX E,H CPXR H ADYR H |
|||
MOVX E,L CPXR L ADYR L |
|||
MOVX H,B INRY H ACYR H |
|||
MOVX H,C DCRY H ACYR L |
|||
MOVX H,D MVIY H,20 SUYR H |
|||
MOVX H,E INRY L SUYR L |
|||
MOVX H,A DCRY L SBYR H |
|||
MOVX L,B MVIY L,20 SBYR L |
|||
MOVX L,C MOVY B,H NDYR H |
|||
MOVX L,D MOVY B,L NDYR L |
|||
MOVX L,E MOVY C,H XRYR H |
|||
MOVX L,A MOVY C,L XRYR L |
|||
MOVX A,H MOVY D,H ORYR H |
|||
MOVX A,L MOVY D,L ORYR L |
|||
ADXR H MOVY E,H CPYR H |
|||
ADXR L MOVY E,L CPYR L |
|||
|
|||
|
|||
Command Summary: |
|||
=============== |
|||
|
|||
DDTZM command DDTZ command |
|||
============= ============ |
|||
@ (base) |
|||
A)ssemble first_address A |
|||
B)egin {i.e., initialize stack and return} B |
|||
C)ompare first_address,last_address,against_address C |
|||
D)ump first_address[,last_address[,base]] D |
|||
E)nter_in_memory first_address[,base] S)ubstitute |
|||
F)ill first_address,last_address,value F |
|||
G)o_to [address][,trap1[,trap2]] G |
|||
H)ex_arithmetic value1(,value2) H |
|||
L)oad_file (offset) R)ead |
|||
M)ove first_address,last_address,destination M |
|||
N)nput FCBs_command_line I)nput |
|||
Q)uit (not avail) |
|||
R)egister examine/change [register|flag] X)amine |
|||
S)earch first_address,last_address,word W)hereis |
|||
T)race_execution [count] T |
|||
Untrace_execution [count] (i.e. do count instr) U)ntrace |
|||
U)nassemble_code first_address[,last_address] L)ist code |
|||
W)rite [first_address,last_address] K)eep |
|||
X)amine {i.e. display memory parameters for application} Q)uery |
|||
Y)our_option BC:=parm1,DE:=parm2,call_address Y |
|||
Z)80_register_display Z |
|||
|
|||
|
|||
If you find this program useful, contributions will be gratefully |
|||
accepted and will encourage further development and release of |
|||
useful CPM programs. My practice is to include source. |
|||
|
|||
C.B. Falconer |
|||
680 Hartford Turnpike, |
|||
Hamden, Conn. 06517 (203) 281-1438 |
|||
|
|||
DDTZ and its associated documentation and other files are |
|||
copyright (c) 1980-1988 by C.B. Falconer. They may be freely |
|||
copied and used for non-commercial purposes ONLY. |
|||
ôÙ |
|||
@ -1,514 +0,0 @@ |
|||
================================================================ |
|||
Floppy Disk Utility (FDU) v5.3 for RetroBrew Computers |
|||
Disk IO / Zeta / Dual-IDE / N8 / RC2014 / SmallZ80 / Dyno |
|||
================================================================ |
|||
|
|||
Updated January 5, 2020 |
|||
by Wayne Warthen (wwarthen@gmail.com) |
|||
|
|||
Application to test the hardware functionality of the Floppy |
|||
Disk Controller (FDC) on the ECB DISK I/O, DISK I/O V3, ZETA |
|||
SBC, Dual IDE w/ Floppy, or N8 board. |
|||
|
|||
The intent is to provide a testbed that allows direct testing |
|||
of all possible media types and modes of access. The |
|||
application supports read, write, and format by sector, track, |
|||
and disk as well as a random read/write test. |
|||
|
|||
The application supports access modes of polling, interrupt, |
|||
INT/WAIT, and DRQ/WAIT. At present, it supports 3.5" media at |
|||
DD (720KB) and HD (1.44MB) capacities. It also now supports |
|||
5.25" media (720KB and 1.2MB) and 8" media (1.11MB) as well. |
|||
Additional media will be added when I have time and access to |
|||
required hardware. Not all modes are supported on all |
|||
platforms and some modes are experimental in all cases. |
|||
|
|||
In many ways this application is merely reinventing the wheel |
|||
and performs functionality similar to existing applications, |
|||
but I have not seen any other applications for RetroBrew |
|||
Computers hardware that provide this range of functionality. |
|||
|
|||
While the application is now almost entirely new code, I would |
|||
like to acknowledge that much was derived from the previous |
|||
work of Andrew Lynch and Dan Werner. I also want to credit |
|||
Sergio Gimenez with testing the 5.25" drive support and Jim |
|||
Harre with testing the 8" drive support. Support for Zeta 2 |
|||
comes from Segey Kiselev. Thanks! |
|||
|
|||
General Usage |
|||
------------- |
|||
|
|||
In general, usage is self explanatory. At invocation, you |
|||
must select the floppy disk controller (FDC) that you are |
|||
using. Subsequently, the main menu allows you to set the |
|||
unit, media, and mode to test. These settings MUST match your |
|||
situation. Read, write, format, and verify functions are |
|||
provided. A sub-menu will allow you to choose sector, track, |
|||
disk, or random tests. |
|||
|
|||
The verify function requires a little explanation. It will |
|||
take the contents of the current in-memory disk buffer, save |
|||
it, and compare it to the selected sectors. So, you must |
|||
ensure that the sectors to be verified already have been |
|||
written with the same pattern as the buffer contains. I |
|||
typically init the buffer to a pattern, write the pattern to |
|||
the entire disk, then verify the entire disk. |
|||
|
|||
Another submenu is provided for FDC commands. This sub-menu |
|||
allows you to send low-level commands directly to FDC. You |
|||
*must* know what you are doing to use this sub-menu. For |
|||
example, in order to read a sector using this sub-menu, you |
|||
will need to perform specify, seek, sense int, and read |
|||
commands specifying correct values (nothing is value checked |
|||
in this menu). |
|||
|
|||
Required Hardware/BIOS |
|||
---------------------- |
|||
|
|||
Of course, the starting point is to have a supported hardware |
|||
configuration. The following Z80 / Z180 based CPU boards are |
|||
supported: |
|||
|
|||
- SBC V1/2 |
|||
- Zeta |
|||
- Zeta 2 |
|||
- N8 |
|||
- Mark IV |
|||
- RC2014 w/ SMC |
|||
- RC2014 w/ WDC |
|||
- SmallZ80 |
|||
- Dyno |
|||
|
|||
You must be using either a RomWBW or UBA based OS version. |
|||
|
|||
You must have one of the following floppy disk controllers: |
|||
|
|||
- Disk IO ECB Board FDC |
|||
- Disk IO 3 ECB Board FDC |
|||
- Dual-IDE ECB Board FDC |
|||
- Zeta SBC onboard FDC |
|||
- Zeta 2 SBC onboard FDC |
|||
- N8 SBC onboard FDC |
|||
- RC2014 Scott Baker SMC-based Floppy Module |
|||
- RC2014 Scott Baker WDC-based Floppy Module |
|||
|
|||
Finally, you will need a floppy drive connected via an |
|||
appropriate cable: |
|||
|
|||
Disk IO - no twist in cable, drive unit 0/1 must be selected by jumper on drive |
|||
DISK IO 3, Zeta, Zeta 2, RC2014, Dyno - cable with twist, unit 0 after twist, unit 1 before twist |
|||
DIDE, N8, Mark IV, SmallZ80 - cable with twist, unit 0 before twist, unit 1 after twist |
|||
|
|||
Note that FDU does not utilize your systems ROM or OS to |
|||
access the floppy system. FDU interacts directly with |
|||
hardware. Upon exit, you may need to reset your OS to get the |
|||
floppy system back into a state that is expected. |
|||
|
|||
The Disk I/O should be jumpered as follows: |
|||
|
|||
J1: depends on use of interrupt modes (see interrupt modes below) |
|||
J2: pins 1-2, & 3-4 jumpered |
|||
J3: hardware dependent timing for DMA mode (see DMA modes below) |
|||
J4: pins 2-3 jumpered |
|||
J5: off |
|||
J6: pins 2-3 jumpered |
|||
J7: pins 2-3 jumpered |
|||
J8: off |
|||
J9: off |
|||
J10: off |
|||
J11: off |
|||
J12: off |
|||
|
|||
Note that J1 can be left on even when not using interrupt |
|||
modes. As long as the BIOS is OK with it, that is fine. Note |
|||
also that J3 is only relevant for DMA modes, but also can be |
|||
left in place when using other modes. |
|||
|
|||
The Disk I/O 3 board should be jumpered at the default settings: |
|||
|
|||
JP2: 3-4 |
|||
JP3: 1-2 for int mode support, otherwise no jumper |
|||
JP4: 1-2, 3-4 |
|||
JP5: 1-2 |
|||
JP6: 1-2 |
|||
JP7: 1-2, 3-4 |
|||
|
|||
Zeta & Zeta 2 do not have any relevant jumper settings. The |
|||
hardwired I/O ranges are assumed in the code. |
|||
|
|||
The Dual-IDE board should be jumpered as follows: |
|||
|
|||
K3 (DT/R or /RD): /RD |
|||
P5 (bd ID): 1-2, 3-4 (for $20-$3F port range) |
|||
|
|||
There are no specific N8 jumper settings, but the default |
|||
I/O range starting at $80 is assumed in the published code. |
|||
|
|||
The RC2014 Scott Baker SMC-based floppy module should be jumpered |
|||
for I/O base address 0x50 (SV1: 11-12), JP1 (TS) shorted, |
|||
JP2 (/FAULT) shorted, JP3 (MINI): 2-3, JP4 (/DC/RDY): 2-3. |
|||
|
|||
The RC2014 Scott Baker WDC-based floppy module should be jumpered |
|||
for I/O base address 0x50 (SV1: 11-12), JP1 (/DACK): 1-2, |
|||
JP2 (TC): 2-3. |
|||
|
|||
SmallZ80 does not have any relevant jumper settings. The |
|||
hardwired I/O ranges are assumed in the code. |
|||
|
|||
Dyno does not have any relevant jumper settings. The |
|||
hardwired I/O ranges are assumed in the code. |
|||
|
|||
Modes of Operation |
|||
------------------ |
|||
|
|||
You can select the following test modes. Please refer to the |
|||
chart that follows to determine which modes should work with |
|||
combinations of Z80 CPU speed and media format. |
|||
|
|||
WARNING: In general, only the polling mode is considered fully |
|||
reliable. The other modes are basically experimental and |
|||
should only be used if you know exactly what you are doing. |
|||
|
|||
Polling: Traditional polled input/output. Works well and very |
|||
reliable with robust timeouts and good error recovery. Also, |
|||
the slowest performance which precludes it from being used |
|||
with 1.44MB floppy on a 4MHz Z80. This is definitely the mode |
|||
you want to get working before any others. It does not require |
|||
J1 (interrupt enable) on DISK I/O and does not care about the |
|||
setting of J3. |
|||
|
|||
Interrupt: Relies on FDC interrupts to determine when a byte |
|||
is ready to be read/written. It does *not* implement a |
|||
timeout during disk operations. For example, if there is no |
|||
disk in the drive, this mode will just hang until a disk is |
|||
inserted. This mode *requires* that the host has interrupts |
|||
active using interrupt mode 1 (IM1) and interrupts attached to |
|||
the FDC controller. The BIOS must be configured to handle |
|||
these interrupts safely. |
|||
|
|||
Fast Interrupt: Same as above, but sacrifices additional |
|||
reliability for faster operation. This mode will allow a |
|||
1.44MB floppy to work with a 4MHz Z80 CPU. However, if any |
|||
errors occur (even a transient read error which is not |
|||
unusual), this mode will hang. The same FDC interrupt |
|||
requirements as above are required. |
|||
|
|||
INT/WAIT: Same as Fast Interrupt, but uses CPU wait instead of |
|||
actual interrupt. This mode is exclusive to the original Disk |
|||
IO board. It is subject to all the same issues as Fast |
|||
Interrupt, but does not need J1 shorted. J3 is irrelevant. |
|||
|
|||
DRQ/WAIT: Uses pseudo DMA to handle input/output. Does not |
|||
require that interrupts (J1) be enabled on the DISK I/O. |
|||
However, it is subject to all of the same reliability issues |
|||
as "Fast Interrupt". This mode is exclusive to the original |
|||
Disk IO board. At present, the mode is *not* implemented! |
|||
|
|||
The chart below attempts to describe the combinations that |
|||
work for me. By far, the most reliable mode is Polling, but |
|||
it requires 8MHz CPU for HD disks. |
|||
|
|||
DRQ/WAIT --------------------------------+ |
|||
INT/WAIT -----------------------------+ | |
|||
Fast Interrupt --------------------+ | | |
|||
Interrupt ----------------------+ | | | |
|||
Polling ---------------------+ | | | | |
|||
| | | | | |
|||
CPU Speed --------------+ | | | | | |
|||
| | | | | | |
|||
| | | | | | |
|||
|
|||
3.5" DD (720K) ------ 4MHz Y Y Y Y X |
|||
8MHz+ Y Y Y Y X |
|||
|
|||
3.5" HD (1.44M) ----- 4MHz N N Y Y X |
|||
8MHz+ Y Y Y Y X |
|||
|
|||
5.25" DD (360K) ----- 4MHz Y Y Y Y X |
|||
8MHz+ Y Y Y Y X |
|||
|
|||
5.25" HD (1.2M) ----- 4MHz N N Y Y X |
|||
8MHz+ Y Y Y Y X |
|||
|
|||
8" DD (1.11M) ------- 4MHz N N Y Y X |
|||
8MHz+ Y Y Y Y X |
|||
|
|||
Y = Yes, works |
|||
N = No, does not work |
|||
X = Experimental, probably won't work |
|||
|
|||
Tracing |
|||
------- |
|||
|
|||
Command/result activity to/from the FDC will be written out if |
|||
the trace setting is changed from '00' to '01' in setup. |
|||
Additionally, if a command failure is detected on any command, |
|||
that specific comand and results are written regardless of the |
|||
trace setting. |
|||
|
|||
The format of the line written is: |
|||
<OPERATION>: <COMMAND BYTES> --> <RESULT BYTES> [<RESULT>] |
|||
|
|||
For example, this is the output of a normal read operation: |
|||
READ: 46 01 00 00 01 02 09 1B FF --> 01 00 00 00 00 02 02 [OK] |
|||
|
|||
Please refer to the i8272 data sheet for information on the |
|||
command and result bytes. |
|||
|
|||
Note that the sense interrupt command can return a non-OK |
|||
result. This is completely normal in some cases. It is |
|||
necessary to "poll" the drive for seek status using sense |
|||
interrupt. If there is nothing to report, then the result |
|||
will be INVALID COMMAND. Additionally, during a recalibrate |
|||
operation, it may be necessary to issue the command twice |
|||
because the command will only step the drive 77 times looking |
|||
for track 0, but the head may be up to 80 tracks away. In |
|||
this case, the first recalibrate fails, but the second should |
|||
succeed. Here is what this would look like if trace is turned |
|||
on: |
|||
|
|||
RECALIBRATE: 07 01 --> <EMPTY> [OK] |
|||
SENSE INTERRUPT: 08 --> 80 [INVALID COMMAND] |
|||
... |
|||
... |
|||
... |
|||
SENSE INTERRUPT: 08 --> 80 [INVALID COMMAND] |
|||
SENSE INTERRUPT: 08 --> 71 00 [ABNORMAL TERMINATION] |
|||
RECALIBRATE: 07 01 --> <EMPTY> [OK] |
|||
SENSE INTERRUPT: 08 --> 21 00 [OK] |
|||
|
|||
Another example is when the FDC has just been reset. In this |
|||
case, you will see up to 4 disk change errors. Again these |
|||
are not a real problem and to be expected. |
|||
|
|||
When tracing is turned off, the application tries to be |
|||
intelligent about error reporting. The specific errors from |
|||
sense interrupt documented above will be suppressed because |
|||
they are not a real problem. All other errors will be |
|||
displayed. |
|||
|
|||
Error Handling |
|||
-------------- |
|||
|
|||
There is no automated error retry logic. This is very |
|||
intentional since the point is to expose the controller and |
|||
drive activity. Any error detected will result in a prompt to |
|||
abort, retry, or continue. Note that some number of errors is |
|||
considered normal for this technology. An occasional error |
|||
would not necessarily be considered a problem. |
|||
|
|||
CPU Speed |
|||
--------- |
|||
|
|||
Starting with v5.0, the application adjusts it's timing loops |
|||
to the actual system CPU speed by querying the BIOS for the |
|||
current CPU speed. |
|||
|
|||
Interleave |
|||
---------- |
|||
|
|||
The format command now allows the specification of a sector |
|||
interleave. It is almost always the case that the optimal |
|||
interleave will be 2 (meaning 2:1). |
|||
|
|||
360K Media |
|||
---------- |
|||
|
|||
The 360K media definition should work well for true 360K |
|||
drives. However, it will generally not work with 1.2M |
|||
drives. This is because these drives spin at 360RPM instead |
|||
of the 300RPM speed of true 360K drives. Additionally, 1.2M |
|||
drives are 80 tracks and 360K drives are 40 tracks and, so |
|||
far, there is no mechanism in FD to "double step" as a way to |
|||
use 40 track media in 80 track drives. |
|||
|
|||
With this said, it is possible to configure some 1.2M 5.25" |
|||
drives to automatically spin down to 300RPM based on a density |
|||
select signal (DENSEL). This signal is asserted by FD for |
|||
360K media, so IF you have configured your drive to react to |
|||
this signal correctly, you will be able to use the 360K media |
|||
defintion. Most 1.2M 5.25" drives are NOT configured this way |
|||
by default. TEAC drives are generally easy to modify and have |
|||
been tested by the author and do work in this manner. Note |
|||
that this does not address the issue of double stepping above; |
|||
you will just be using the first 40 of 80 tracks. |
|||
|
|||
Support |
|||
------- |
|||
|
|||
I am happy to answer questions as fast and well as I am able. |
|||
Best contact is wwarthen@gmail.com or post something on the |
|||
RetroBrew Computers Forum |
|||
https://www.retrobrewcomputers.org/forum/. |
|||
|
|||
Changes |
|||
------- |
|||
|
|||
WW 8/12/2011 |
|||
|
|||
Removed call to pulse TC in the FDC initialization after |
|||
determining that it periodically caused the FDC to write bad |
|||
sectors. I am mystified by this, but definitely found it to |
|||
be true. Will revisit at some point -- probably a timing |
|||
issue between puslsing TC and whatever happens next. |
|||
|
|||
Non-DMA mode was being set incorrectly for FAST-DMA mode. It |
|||
was set for non-DMA even though we were doing DMA. It is |
|||
interesting that it worked fine anyway. Fixed it anyway. |
|||
|
|||
DIO_SETMEDIA was not clearing DCD_DSKRDY as it should. Fixed. |
|||
|
|||
WW 8/26/2011: v1.1 |
|||
|
|||
Added support for Zeta. Note that INT/WAIT and DRQ/WAIT are |
|||
not available on Zeta. Note that Zeta provides the ability to |
|||
perform a reset of the FDC independent of a full CPU reset. |
|||
This is VERY useful and the FDC is reset anytime a drive reset |
|||
is required. |
|||
|
|||
Added INT/WAIT support. |
|||
|
|||
WW 8/28/2011: V1.2 |
|||
|
|||
All changes in this version are Zeta specific. Fixed FDC |
|||
reset logic and motor status display for Zeta (code from |
|||
Sergey). |
|||
|
|||
Modified Zeta disk change display to include it in the command |
|||
output line. This makes more sense because a command must be |
|||
issued to select the desired drive first. You can use the |
|||
SENSE INT command id you want to check the disk change value |
|||
at any time. It will also be displayed with any other command |
|||
output display. |
|||
|
|||
WW 9/1/2011: V1.3 |
|||
|
|||
Added CPUFREQ configuration setting to tune delays based on |
|||
cpu speed. The build app is set for 8MHz which also seems to |
|||
work well for 4MHz CPU's. Faster CPU speeds will probably |
|||
require tuning this setting. |
|||
|
|||
WW 9/5/2011: V1.4 |
|||
|
|||
Changed the polling execution routines to utilize CPUFREQ |
|||
variable to optimize timeout counter. Most importantly, this |
|||
should allow the use of faster CPUs (like 20MHz). |
|||
|
|||
WW 9/19/2011: V1.5 |
|||
|
|||
Zeta changes only. Added a call to FDC RESET after any |
|||
command failure. This solves an issue where the drive remains |
|||
selected if a command error occurs. Also added FDC RESET to |
|||
FDC CONTROL menu. |
|||
|
|||
WW 10/7/2011: V2.0 |
|||
|
|||
Added support for DIDE. Only supports polling IO and it does |
|||
not appear any other modes are possible given the hardware |
|||
constraints. |
|||
|
|||
WW 10/13/2011: V2.1 |
|||
|
|||
Modified to support N8. N8 is essentially identical to Dual |
|||
IDE. The only real change is the IO addresses. In theory, I |
|||
should be able to support true DMA on N8 and will work on that. |
|||
|
|||
WW 10/20/2011: v2.2 |
|||
|
|||
I had some problems with the results being read were sometimes |
|||
missing a byte. Fixed this by taking a more strict approach |
|||
to watching the MSR for the exact bits that are expected. |
|||
|
|||
WW 10/22/2011: V2.3 |
|||
|
|||
After spending a few days trying to track down an intermittent |
|||
data corruption issue with my Dual IDE board, I added a verify |
|||
function. This helped me isolate the problem very nicely |
|||
(turned out to be interference from the bus monitor). |
|||
|
|||
WW 11/25/2011: V2.4 |
|||
|
|||
Preliminary support for DISKIO V3. Basically just assumed |
|||
that it operates just like the Zeta. Needs to be verified |
|||
with real hardware as soon as I can. |
|||
|
|||
WW 1/9/2012: V2.5 |
|||
|
|||
Modified program termination to use CP/M reset call so that a |
|||
warm start is done and all drives are logged out. This is |
|||
important because media may have been formatted during the |
|||
program execution. |
|||
|
|||
WW 2/6/2012: v2.6 |
|||
|
|||
Added support for 5.25" drives as tested by Sergio. |
|||
|
|||
WW 4/5/2012: v2.7 |
|||
|
|||
Added support for 8" drives as tested by Jim Harre. |
|||
|
|||
WW 4/6/2012: v2.7a |
|||
|
|||
Fixed issue with media selection menu to remove duplicate |
|||
entries. |
|||
|
|||
WW 4/8/2012: v2.7b |
|||
|
|||
Corrected the handling of the density select signal. |
|||
|
|||
WW 5/22/2012: v2.8 |
|||
|
|||
Added new media definitions (5.25", 320K). |
|||
|
|||
WW 6/1/2012: v2.9 |
|||
|
|||
Added interleave capability on format. |
|||
|
|||
WW 6/5/2012: v3.0 |
|||
|
|||
Documentation cleanup. |
|||
|
|||
WW 7/1/2012: v3.1 |
|||
|
|||
Modified head load time (HLT) for 8" media based on YD-180 |
|||
spec. Now set to 50ms. |
|||
|
|||
WW 6/17/2013: v3.2 |
|||
|
|||
Cleaned up SRT, HLT, and HUT values. |
|||
|
|||
SK 2/10/2015: v3.3 |
|||
|
|||
Added Zeta SBC v2 support (Sergey Kiselev) |
|||
|
|||
WW 3/25/2015: v4.0 |
|||
|
|||
Renamed from FDTST --> FD |
|||
|
|||
WW 9/2/2017: v5.0 |
|||
|
|||
Renamed from FD to FDU. |
|||
Added runtime selection of FDC hardware. |
|||
Added runtime timing adjustment. |
|||
|
|||
WW 12/16/2017: v5.1 |
|||
|
|||
Improved polling version of read/write to fix occasional overrun errors. |
|||
|
|||
WW 1/8/2018: v5.2 |
|||
|
|||
Added support for RC2014 hardware: |
|||
- Scott Baker SMC 9266 FDC module |
|||
- Scott Baker WDC 37C65 FDC module |
|||
|
|||
WW 9/5/2018: v5.3 |
|||
- Removed use of pulsing TC to end R/W operations after one sector and |
|||
instead set EOT = R (sector number) so that after desired sector is |
|||
read, R/W stops with end of cylinder error which is a documented |
|||
method for controling number of sectors R/W. This specific termination |
|||
condition is no longer considered an error, but a successful end of |
|||
operation. |
|||
- Added support for SmallZ80 |
|||
|
|||
WW 5/1/2020: v5.4 |
|||
- Added support for Dyno (based on work by Steve Garcia) |
|||
File diff suppressed because it is too large
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
@ -0,0 +1,765 @@ |
|||
A Personal Note |
|||
=============== |
|||
|
|||
Somehow, I've managed to get by for the last 14 years using just ZCPR. |
|||
But like some of you, I have fiddled with the standard ZCPR and |
|||
modified it to suit my tastes. As I added new commands or enriched old |
|||
ones, I've always remained compatible with existing programs, all the |
|||
BDOS replacements, and, most important of all, stayed within the 800H |
|||
space allocation of the original Digital Research CCP. Here are the |
|||
fruits of my labors, I hope you enjoy this CCP replacement as much as I |
|||
do. |
|||
|
|||
Don Kirkpatrick |
|||
17595 S.W. Pheasant Lane |
|||
Beaverton, Oregon 97006 |
|||
<Donald.C.Kirkpatrick@tek.com> |
|||
|
|||
|
|||
Introduction |
|||
============ |
|||
|
|||
This console replacement is designed to run under CP/M 2.2 or any of |
|||
the 2.2 BDOS replacements. It requires a Z80 or better. If you are |
|||
running DRI's CCP or older versions of ZCPR1, this program is a |
|||
significant improvement. If you are running ZCPR3, CP/M 3.0, CP/M |
|||
Plus, or MP/M, this will probably be a disappointment. |
|||
|
|||
If you are familiar with ZCPR3, you will recognize many of the |
|||
enhancements here: comments on a command line, search path for the .com |
|||
file, drive/user change with simple du:, CLEVEL3 command processing, |
|||
proper SUBMIT file facility, and so on. Nothing has been removed from |
|||
DRI's CCP, only new features added. AND IT ALL STILL FITS IN THE |
|||
ORIGINAL 800H, THE SAME SPACE AS THE DIGITAL RESEARCH FIVE COMMAND |
|||
CCP. |
|||
|
|||
Many of the standard commands have been enhanced. For example, TYPE |
|||
and LIST now have options to turn on or off page breaks. Moreover, the |
|||
console check for abort has been improved. |
|||
|
|||
Two commands have been added for use in submit files - SAK and BELL. |
|||
These commands allow you to pause or ring the bell during submit file |
|||
execution. |
|||
|
|||
Before you install this version of ZCPR onto your boot disks, try it by |
|||
running it as a .com file. Just edit the few customizing options and |
|||
assemble the source. After you decide it really is better, load it |
|||
onto your boot track and make it your standard. Complete instructions |
|||
are located at the end of this document. |
|||
|
|||
The complete built-in command list is: |
|||
|
|||
DIR - directory command enhanced to list optionally all user areas |
|||
REN - standard rename command |
|||
USER- move to new user number area on same drive |
|||
SAVE- save specified number of TPA pages or records in a file |
|||
TYPE- display a file on the console with optional page break pauses |
|||
LIST- print command plus optional form feed insertion |
|||
PAGE- send form feed to list device |
|||
ERA - standard file erase command |
|||
ERAQ- file erase with confirmation query at each file |
|||
DFU - set default user number for .com search path |
|||
BELL- send a bell character to the console |
|||
SAK - pause until a key is struck on the console (Strike Any Key) |
|||
SCL - toggle multiple commands per line (Single Command on a Line) |
|||
GET - load a file into the TPA at any specified location |
|||
JUMP- process command tail and execute program at specified address |
|||
GO - process command tail and execute program loaded at 100H |
|||
PEEK- display hexadecimal byte string starting with specified address |
|||
POKE- load hexadecimal byte string starting with specified address |
|||
BOOT- execute BIOS cold boot routine |
|||
|
|||
|
|||
Filename Processing |
|||
=================== |
|||
|
|||
The standard ZCPR3 du: drive/user file specification has been |
|||
implemented. Any filename can be in the du:fn.ft form. For example: |
|||
|
|||
A>era c4:junk*.* |
|||
|
|||
erases files on the C drive, user area 4 without leaving drive A user |
|||
0. When a user number is found in a filename, that user number is |
|||
placed in S1 of the default FCB. Bit 7 of S1 is set to inform the |
|||
program using the FCB a user number was found. |
|||
|
|||
The * in an ambiguous file name has been improved. Now a trailing * |
|||
causes the remainder of the ambiguous name to be filled with '?', not |
|||
just the fn field. For example: |
|||
|
|||
A>era c4:junk* |
|||
|
|||
is the same as the example above. Previously, junk* was defined as |
|||
'junk????. '. If you need the ft field blank, type 'junk*.'. The |
|||
question mark still works as a single character wild card. |
|||
|
|||
|
|||
Command Line Processing |
|||
======================= |
|||
|
|||
The current user number is included as part of the command prompt for |
|||
all non-zero user numbers. The prompt is of the form du>, for example |
|||
A2> or B10>. If the SUPRES equate is true, the user number is |
|||
suppressed for user 0 only. |
|||
|
|||
Multiple commands are typed on a single line separated by a command |
|||
separator character. Occasionally, you need to type the separator |
|||
character in a command tail. The SCL command toggles the multiple |
|||
command enable. The CMDCHR equate determines the command separator |
|||
character. A ';' has been chosen as the separator character in this |
|||
distribution version. |
|||
|
|||
Comments are allowed on a command line. When the comment separator |
|||
character is encountered as the first character of a command, the |
|||
remainder of the line is ignored. The COMCHR equate determines the |
|||
comment separator character. A ';' has been chosen as the separator |
|||
character in this distribution version. Here is an example containing |
|||
comments and multiple commands on a single line: |
|||
|
|||
A>get 100 junk;peek 100;;this is a comment. |
|||
A>;this is also a comment. |
|||
|
|||
There exists a built-in search path for transient commands. First, the |
|||
current drive/user is searched. Next, the current drive/default user |
|||
is searched. Last, drive A/default user is searched. The DEFUSR |
|||
equate determines the default user number, currently set to user 0 in |
|||
this distribution version. The default user is temporarily changed |
|||
with the DFU command. If a drive is specified in the transient |
|||
command, the current and default user areas on the specified drive are |
|||
searched. If a user number is specified, that user area on the current |
|||
and default drive are searched. If both the drive and user number are |
|||
specified, no search is performed. The same drive/user area is never |
|||
searched twice. |
|||
|
|||
Transient commands are always "called." If a program terminates via a |
|||
return rather than a warm boot, subsequent multiple commands on the |
|||
command line are executed. Any program exiting by a warm boot reloads |
|||
ZCPR and the subsequent commands lost. |
|||
|
|||
A default command can be placed in the command buffer and control |
|||
passed to ZCPR for processing. The only thing required, besides |
|||
placing the command in the buffer and jumping to CPRLOC, is to |
|||
initialize the command character counter at the start of the buffer. |
|||
The procedure is compatible with the original DRI CCP default command |
|||
processing. If ZCPR is entered at CPRLOC+3 jump, default command |
|||
processing is suppressed. Either way, register C must contain a valid |
|||
drive/user, just like the original CCP. |
|||
|
|||
|
|||
Submit File Processing |
|||
====================== |
|||
|
|||
A basic design choice had to be made in the design of ZCPR concerning |
|||
the execution of submit files. The original CCP had a problem. It |
|||
ALWAYS looked for the $$$.SUB file on drive A and the submit program |
|||
would place it on the current default drive. When the you were logged |
|||
onto drive B and you issued a submit command, the $$$.SUB was placed on |
|||
drive B and not executed. |
|||
|
|||
After much debate it was decided to have ZCPR perform the same type of |
|||
function as CCP (look for the $$$.SUB file on drive A), but the problem |
|||
with SUBMIT.COM still exists. Hence, RGF designed SuperSUB and RLC |
|||
took his SuperSUB and designed SUB from it; both programs are set up to |
|||
allow the selection at assembly time of creating the $$$.SUB on the |
|||
default drive or on drive A. If you don't have one of these newer |
|||
submit programs, a procedure for patching the standard SUBMIT.COM has |
|||
been included at the end. |
|||
|
|||
The fixed drive choice permits a submit file to contain a series of |
|||
commands exactly as they would be entered from a CP/M console. This |
|||
permits things like: |
|||
|
|||
A>dir |
|||
A>b: |
|||
B>dir |
|||
|
|||
to be executed, even though the currently default drive is changed |
|||
during execution. If the $$$.SUB file were present on the default |
|||
drive, the above series of commands would not work. ZCPR would be |
|||
looking for $$$.SUB on the default drive, and switching default drives |
|||
without moving the $$$.SUB file would cause processing to abort. Note |
|||
that the same problem occurs if the user number of the $$$.SUB file is |
|||
not predefined. ZCPR assumes that the $$$.SUB file is located on user 0 |
|||
of drive A. |
|||
|
|||
The trick of using the $ flag returned by the BDOS disk reset is used |
|||
to speed the search for a $*.* file on drive A. This trick will not |
|||
work if the $$$.SUB file were located on another drive. |
|||
|
|||
The '>' prompt character is replaced by a special character while a |
|||
submit file is in execution. The SPRMPT equate defines this special |
|||
character, currently set to '$' in this distribution version. |
|||
|
|||
|
|||
Command Syntax |
|||
============== |
|||
|
|||
Multiple commands can be placed on one line. If the comment character |
|||
is encountered where a command should start, the rest of the line is |
|||
ignored. Any command can be renamed by editing the command table. |
|||
Command names can be up to eight characters long and are terminated by |
|||
bit 7 high. If there is a conflict between an internal ZCPR command |
|||
and a transient program of the same name, the internal command is |
|||
executed. Type the command with the du: included if the external |
|||
transient command is the one desired. Here is a complete alphabetized |
|||
list of all the resident commands with their syntax: |
|||
|
|||
============================================================================= |
|||
|
|||
Command: BELL |
|||
|
|||
Function: To ring terminal bell. |
|||
|
|||
Forms: BELL |
|||
|
|||
Options: None. |
|||
|
|||
Uses: This command is designed to be placed in a submit file to |
|||
ring the bell to indicate significant checkpoints. |
|||
|
|||
============================================================================= |
|||
|
|||
Command: BOOT |
|||
|
|||
Function: To execute BIOS cold boot routine. |
|||
|
|||
Forms: BOOT |
|||
|
|||
Options: REBOOT equate controls the inclusion/exclusion of this command. |
|||
|
|||
Uses: Reboots the system without pushing the reset button. The |
|||
cold boot entry point in the BIOS must be supported for this |
|||
command to work. |
|||
|
|||
============================================================================= |
|||
|
|||
Command: DFU |
|||
|
|||
Function: To set the Default User Number for transient commands. |
|||
|
|||
Forms: DFU <usrnum> |
|||
|
|||
Options: DEFUSR equate defines the default user choice until this |
|||
command is entered. |
|||
|
|||
NUMBASE equate defines the character that specifies a |
|||
hexadecimal number. The distribution version is set to 'H'. |
|||
|
|||
Uses: The default user area is searched after a transient command |
|||
cannot be found in the current user area. If the transient |
|||
command still has not been found, the default user on the |
|||
default drive is searched last. The new default user number |
|||
is in decimal, but hexadecimal numbers are entered by |
|||
appending an 'H'. The next warm boot will restore the |
|||
original default user number. |
|||
|
|||
============================================================================= |
|||
|
|||
Command: DIR |
|||
|
|||
Function: To display a directory listing of the files on a drive. |
|||
|
|||
Forms: DIR <afn> Display the DIR files |
|||
DIR <afn> S Display the SYS files |
|||
DIR <afn> B Display both DIR and SYS files |
|||
DIR <afn> A Display both DIR and SYS files for all user areas |
|||
|
|||
Options: TWOCOL equate controls the number of columns in the display. |
|||
Forty-column terminals are limited to two-column displays. |
|||
|
|||
WIDE equate controls the spacing between the columns and |
|||
change the horizontal width of a directory display. |
|||
|
|||
FENCE equate specifies the character separator between the |
|||
directory columns. |
|||
|
|||
USRDLM equate specifies the character between the user number |
|||
and the filename. |
|||
|
|||
USRFLG, SYSFLG, and SOFLG equates specify the command line |
|||
tail character that control the display of system and |
|||
non-system files. |
|||
|
|||
Uses: Displays a directory listing of files in specific drive/user |
|||
area. |
|||
|
|||
============================================================================= |
|||
|
|||
Command: ERA |
|||
|
|||
Function: To erase files. |
|||
|
|||
Forms: ERA <afn> |
|||
|
|||
Options: None. |
|||
|
|||
Uses: Deletes files. Names of erased files are displayed. |
|||
|
|||
============================================================================= |
|||
|
|||
Command: ERAQ |
|||
|
|||
Function: To erase files with individual query. |
|||
|
|||
Forms: ERAQ <afn> |
|||
<afn>? y File erased |
|||
<afn>? <CR> File not erased |
|||
|
|||
Options: None. |
|||
|
|||
Uses: Deletes a subset of a set of ambiguously specified files. |
|||
Any answer other than 'Y' (either case) will cause the file |
|||
to be skipped and not erased. |
|||
|
|||
============================================================================= |
|||
|
|||
Command: GET |
|||
|
|||
Function: To load the specified file from disk to the specified address. |
|||
|
|||
Forms: GET <hexadr> <ufn> |
|||
|
|||
Options: None. |
|||
|
|||
Uses: Loads a file into the TPA for patching purposes. This command |
|||
searches for the specified file along the same search path as |
|||
the transient command loader. |
|||
|
|||
|
|||
============================================================================= |
|||
|
|||
Command: GO |
|||
|
|||
Function: To call the program in the TPA without loading from disk. |
|||
|
|||
Forms: GO <command tail> |
|||
|
|||
Options: None. |
|||
|
|||
Uses: Most useful to rerun a program already loaded into the TPA. |
|||
Saves time and wear on disk drives. The command tail is |
|||
entered exactly as it would appear if GO were replaced by the |
|||
program name. Same as JUMP 100H, but more convenient, |
|||
especially when used with parameters for programs like STAT. |
|||
|
|||
============================================================================= |
|||
|
|||
Command: JUMP |
|||
|
|||
Function: To call the program at a specified address. |
|||
|
|||
Forms: JUMP <hexadr> <command tail> |
|||
|
|||
Options: None. |
|||
|
|||
Uses: Executes code not located at 100H. For example, JUMP 0 |
|||
warm boots. The code must already reside at the specified |
|||
address. |
|||
|
|||
============================================================================= |
|||
|
|||
Command: LIST |
|||
|
|||
Function: To print specified file on list device. |
|||
- |
|||
Forms: LIST <ufn> Print file |
|||
LIST <ufn> P Print file without default paging |
|||
|
|||
Options: NLINEP equate determines the number of lines per page. |
|||
|
|||
FFKILL equate controls the suppression of form feeds before |
|||
printable text. |
|||
|
|||
PGDFLG equate determines the command line tail character that |
|||
toggles the default form feed insertion every NLINEP lines. |
|||
|
|||
NOSTAT equate controls the use of the BIOS list status call. |
|||
|
|||
Uses: Prints files with/without pagination on LST: device. A |
|||
listing is aborted by a console ^C. Any submit file in |
|||
process is terminated and control is returned gracefully to |
|||
the console prompt. |
|||
|
|||
============================================================================= |
|||
|
|||
Command: PAGE |
|||
|
|||
Function: To eject a page on list device via a form feed. |
|||
|
|||
Forms: PAGE |
|||
|
|||
Options: NOSTAT equate controls the use of the BIOS list status call. |
|||
|
|||
Uses: Sends a form feed to the LST: device. The page eject can |
|||
be aborted by a console ^C if the system hangs because the |
|||
printer is not ready. If aborted, any submit file in process |
|||
is terminated and control is returned gracefully to the |
|||
console prompt. |
|||
|
|||
============================================================================= |
|||
|
|||
Command: PEEK |
|||
|
|||
Function: To display hex values beginning at a specified address. |
|||
|
|||
Forms: PEEK <hexadr> [<hexcnt>] |
|||
|
|||
Options: None. |
|||
|
|||
Uses: Displays hexadecimal values anywhere in the entire address |
|||
space. The maximum value for <hexcnt> is 0FFH, but the |
|||
default <hexcnt> is 256. |
|||
|
|||
============================================================================= |
|||
|
|||
Command: POKE |
|||
|
|||
Function: To poke a string of hex values into a set of consecutive |
|||
addresses. |
|||
|
|||
Forms: POKE <hexadr> <hexval> [...<hexval>] |
|||
|
|||
Options: None. |
|||
|
|||
Uses: Modifies values anywhere in the entire address space. Each |
|||
<hexval> represents one byte and is separated from the next |
|||
by a space. The number of <hexval> are limited only by the |
|||
size of the command line buffer. The address is incremented |
|||
for each <hexval>. Excellent for hand patching code. |
|||
|
|||
============================================================================= |
|||
|
|||
Command: REN |
|||
|
|||
Function: To change the name of an existing file. |
|||
|
|||
Forms: REN <newufn>=<oldufn> |
|||
REN <newufn>=<oldufn> Existing <newufn> |
|||
Delete? y File deleted |
|||
|
|||
Options: None. |
|||
|
|||
Uses: Changes the names of files. Any du: on <oldufn> is ignored; |
|||
the optional du: is on <newufn>. If there already exists a |
|||
<newufn>, the console is queried for conformation. Any |
|||
response except 'Y' (either case) aborts the command, kills |
|||
any submit file in process, and returns gracefully to the |
|||
command prompt. |
|||
|
|||
============================================================================= |
|||
|
|||
Command: SAK |
|||
|
|||
Function: To pause until a key is struck. |
|||
|
|||
Forms: SAK |
|||
? <any key> |
|||
|
|||
Options: None. |
|||
|
|||
Uses: Pauses a submit file until a keystroke is entered. Any |
|||
character other than a ^C will resume execution. A ^C kills |
|||
the submit file, any commands remaining on the command the |
|||
line are ignored, and control returns gracefully to the |
|||
prompt. |
|||
|
|||
============================================================================= |
|||
|
|||
Command: SAVE |
|||
|
|||
Function: To save the contents of TPA onto disk as a file. |
|||
|
|||
Forms: SAVE <Number of Pages> <ufn> |
|||
SAVE <Number of Records> <ufn> R |
|||
|
|||
Options: RECFLG equate determines the command tail character that |
|||
specifies records rather than pages. |
|||
|
|||
NUMBASE equate defines the character that specifies a |
|||
hexadecimal number. The distribution version is set to 'H'. |
|||
|
|||
Uses: Saves the TPA to a file. Records are 128 bytes long, pages |
|||
are 256 bytes long. Number of pages or records is in |
|||
decimal, but a hexadecimal number is entered by appending an |
|||
'H'. Saved area begins at 100H. |
|||
|
|||
============================================================================= |
|||
|
|||
Command: SCL |
|||
|
|||
Function: To force ZCPR to parse only a single command per line. |
|||
|
|||
Forms: SCL |
|||
|
|||
Options: MULTPL equate determines the inclusion/exclusion of this |
|||
command and whether or not multiple commands are allowed. |
|||
|
|||
CMDCHR equate determines the character separating multiple |
|||
commands. |
|||
|
|||
Uses: Some transient commands require the command separator in the |
|||
command tail. This command turns off multiple command |
|||
parsing so the entire command tail is sent to the transient |
|||
program. Multiple command format is reset at the next warm |
|||
boot. SCL toggles. |
|||
|
|||
============================================================================= |
|||
|
|||
Command: TYPE |
|||
|
|||
Function: To display specified file on console. |
|||
|
|||
Forms: TYPE <ufn> Display file |
|||
TYPE <ufn> P Display file without default paging |
|||
|
|||
Options: NLINES equate determines the number of lines per screen. |
|||
|
|||
FFKILL equate controls the suppression of form feeds before |
|||
printable text. |
|||
|
|||
PGDFLG equate determines the command line tail character that |
|||
toggles the default form feed insertion every NLINEP lines. |
|||
|
|||
Uses: Displays files with/without pagination on CON: device. A |
|||
display is aborted by a console ^C. If aborted, any submit |
|||
file in process terminates and control returns gracefully to |
|||
the console prompt. When page breaks are enabled, any |
|||
console character except ^C will display the next page of |
|||
text. |
|||
|
|||
============================================================================= |
|||
|
|||
Command: USER |
|||
|
|||
Function: To change current user number. |
|||
|
|||
Forms: USER <usrnum> |
|||
|
|||
Options: SUPRES equate controls the display of the user number in the |
|||
prompt when the user number is zero. |
|||
|
|||
MAXUSR equate controls the maximum allowable user number. |
|||
|
|||
NUMBASE equate defines the character that specifies a |
|||
hexadecimal number. The distribution version is set to 'H'. |
|||
|
|||
Uses: This command changes the current user number. The new user |
|||
number is in decimal, but a hexadecimal number is entered by |
|||
appending an 'H'. This command has been retained for |
|||
compatibility purposes only. It is far easier to change |
|||
disk/user by typing du:. |
|||
|
|||
============================================================================= |
|||
|
|||
|
|||
Error Messages |
|||
============== |
|||
|
|||
If any error is encountered as a command line is being parsed, a |
|||
message will be printed and, for serious errors, the remainder of the |
|||
line is ignored. Below is a complete list of all ZCPR error messages. |
|||
Any error message encountered that is not on this list came from some |
|||
program other than ZCPR. |
|||
|
|||
"?" |
|||
|
|||
An error was detected in the command. The an item on the command |
|||
line was not what was expected. The command line is echoed up to |
|||
the position where the error was detected, as close as can be |
|||
determined, and the "?" printed. Any commands remaining on the |
|||
command the line are ignored and any $$$.SUB file erased. |
|||
|
|||
"Full" |
|||
|
|||
If ZCPR was attempting to load a transient program, one of two |
|||
things has gone wrong: either the program is so large that it won't |
|||
fit into the TPA or a read error was returned from the BDOS. If |
|||
ZCPR was attempting to save a file, the BDOS write call returned |
|||
failure. Either the disk or the directory is full. Any commands |
|||
remaining on the command line are ignored and any $$$.SUB file |
|||
erased. |
|||
|
|||
"No File" |
|||
|
|||
No file could be found matching the filename specified in the |
|||
command. This message is also be printed if the BDOS read command |
|||
returns failure. If ZCPR was looking for a transient command, any |
|||
commands remaining on the command line are ignored and any $$$.SUB |
|||
file erased. |
|||
|
|||
"Name Error" |
|||
|
|||
The specified filename has a user number larger than the allowable |
|||
maximum or an ambiguous filename was entered where only an |
|||
unambiguous filename is permitted. Any commands remaining on the |
|||
command line are ignored and any $$$.SUB file erased. |
|||
|
|||
"Delete?" |
|||
|
|||
Not really an error, but there already exists a file with the same |
|||
name as the requested new name in the REN command. Any response |
|||
except 'Y' (either case) aborts the command, any commands remaining |
|||
on the command line are ignored, and any $$$.SUB file erased. |
|||
|
|||
"All?" |
|||
|
|||
Not really an error, but a check to verify that all files on the |
|||
drive/user area are to be erased. Any response except 'Y' (either |
|||
case) aborts the command and any commands remaining on the command |
|||
line are ignored. |
|||
|
|||
|
|||
Installation Instructions |
|||
========================= |
|||
|
|||
1) The first task is to determine the location of your BDOS because you |
|||
MUST set the P2DOS equate to this value. If you do not know the |
|||
location of your BDOS, use ZCPRDEMO to find it. If you do not |
|||
already have ZCPRDEMO.COM, assemble ZCPR with the TEST equate true |
|||
to make it. A bootstrap loader will be included and you can run the |
|||
.com file. This program assembles without errors using Microsoft's |
|||
M80/L80: |
|||
|
|||
A>m80 =zcpr |
|||
A>l80 zcpr,zcprdemo/n/e |
|||
|
|||
Other assemblers can be used, but ZCPR.MAC will probably require |
|||
editing to convert it to a form compatible. The major decision in |
|||
converting is to determine how the .PHASE pseudo is to be handled. |
|||
Probably the best solution to the .PHASE is to generate a .hex |
|||
file and load it with an offset using DDT/SID/ZSID. Consult the |
|||
"r" command in the DDT/SID/ZSID manaul. |
|||
|
|||
Run ZCPRDEMO and peek at low memory: |
|||
|
|||
A>zcprdemo |
|||
A<peek 0 10 |
|||
0000 C3 03 F2 00 00 C3 06 E4 00 00 00 00 00 00 00 00 |
|||
A<^C |
|||
|
|||
Notice the prompt character has changed from a '>' to a '<'. This |
|||
tells you the special debug version of ZCPR is running. See the |
|||
debug section at the end for details. Address 0 contains a jump 3 |
|||
beyond the start of the BIOS and address 5 contains a jump 6 beyond |
|||
the start of the BDOS. |
|||
|
|||
Be careful if you attempt to execute a transient program from |
|||
ZCPRDEMO. Some transient programs, like NSWP, return rather than |
|||
warm boot when done. These programs don't know that ZCPRDEMO is at |
|||
address 8000H rather than just under the BDOS. If they overwrite |
|||
ZCPRDEMO, then the return is to random code. Of course, this is not |
|||
a problem when ZCPR is installed just under the BDOS. |
|||
|
|||
2) You MUST edit the code to place your BDOS/P2DOS/Z80DOS/ZRDOS start |
|||
address in the P2DOS equate. Set COMLD true (and TEST false if you |
|||
set it true in step 1 above) and make ZCPR.COM. A bootstrap loader |
|||
will be included. |
|||
|
|||
Assuming you successfully assemble it, just type "zcpr" to run it. |
|||
However, every time there is a warm boot, it will be replaced by |
|||
the boot track CCP. If you like what you see, place a copy on the |
|||
boot track to make it available all the time. |
|||
|
|||
3) Reassemble, this time with COMLD false to make ZCPRNBLD.COM (ZCPR |
|||
No Boot LoaDer). |
|||
|
|||
4) Run SYSGEN to load a copy of the boot track into memory. |
|||
|
|||
B>; Sample terminal session for integrating ZCPR |
|||
B>sysgen |
|||
SYSGEN VER 2.2 |
|||
SOURCE DRIVE NAME (OR RETURN TO SKIP)a |
|||
SOURCE ON A, THEN TYPE RETURN <cr> |
|||
FUNCTION COMPLETE |
|||
DESTINATION DRIVE NAME (OR RETURN TO REBOOT) <cr> |
|||
|
|||
|
|||
5) Run SAVE to save a track image to a file (eg: SAVE 32 BOOTFILE). |
|||
The number on the save command depends on the size of your boot |
|||
track loader; it can be as small as 31 and as large as 44. If you |
|||
have extra disk space or are not sure, play it safe and use 44. |
|||
|
|||
B>save 44 cpm56.com <-- We now have a SYSGEN image of CP/M |
|||
|
|||
6) Find the location of the stock CCP by peeking at the boot file. It |
|||
is normally located at address 980H in the file. Using ZCPR: |
|||
|
|||
B>zcpr <-- Reload zcpr.com version |
|||
B>get 100 cpm56.com |
|||
|
|||
and search for the start of the console processor: |
|||
|
|||
B>peek 980 |
|||
0980 C3 xx xx C3 xx xx 7F 00 43 4F 50 59 52 49 47 48 |
|||
0990 54 20 ... |
|||
|
|||
If you don't find the start of the CCP at 980H, don't be |
|||
discouraged. It is there, but at a higher address. Keep looking. |
|||
|
|||
7) When you find the location of the CCP, patch it with the new ZCPR |
|||
image. |
|||
|
|||
B>get 980 zcprnbld.com |
|||
|
|||
8) Place the new file onto the boot track of a test disk, not your |
|||
original, using SYSGEN, and try it out. |
|||
|
|||
B>sysgen |
|||
SYSGEN VER 2.2 |
|||
SOURCE DRIVE NAME (OR RETURN TO SKIP) <cr> <-- Use memory image |
|||
DESTINATION DRIVE NAME (OR RETURN TO REBOOT)b <-- Load onto drive B |
|||
DESTINATION ON B, THEN TYPE RETURN <cr> |
|||
FUNCTION COMPLETE |
|||
DESTINATION DRIVE NAME (OR RETURN TO REBOOT) <cr> |
|||
|
|||
You should now have a ZCPR system boot disk. Notice you did all |
|||
your work on drive B so you wouldn't destroy the original. |
|||
|
|||
|
|||
|
|||
This may seem like a great number of steps, but each is only a single |
|||
CP/M command line, total time is only 5 minutes or so after you get |
|||
ZCPR to run as a .com file. |
|||
|
|||
|
|||
Debugging ZCPR |
|||
============== |
|||
|
|||
Special provisions have been make to ease the debugging of ZCPR. |
|||
Setting the TEST equate true causes the assembler to build a version of |
|||
ZCPR that executes in the TPA. This allows the use of a debugger like |
|||
DDT, ZSID, or Z8E to load and monitor execution. To identify the debug |
|||
version, the prompt character is changed from '>' to '<' when it runs. |
|||
|
|||
CPRLOC for the test version is 8000H. A bootstrap loader is included |
|||
at the beginning to move the image to this address. Do not try to set |
|||
a breakpoint until after the loader has moved ZCPR. The easiest way to |
|||
accomplish this is to single-step through the loader and then set your |
|||
breakpoints. Change the execution address to something lower if 8000H |
|||
does not leave enough space for the debugger. |
|||
|
|||
A small amount of code is also added at the end of the debug version to |
|||
compute the BIOS list status and cold boot entry points at run time. |
|||
This permits the demo version to execute properly without setting the |
|||
BDOS location equate. |
|||
|
|||
Patching SUBMIT.COM |
|||
=================== |
|||
|
|||
SUBMIT.COM is patched to run with ZCPR by the following procedure. |
|||
This is recommended if the user does not have one of the newer public |
|||
domain versions of submit. This patch simply makes SUBMIT.COM always |
|||
place the $$$.SUB file on drive A. Illustrative terminal session |
|||
follows: |
|||
|
|||
A>get 100 submit.com;peek 5bb 2 |
|||
05BB 00 24 <-- Patch is at 5BB Hex |
|||
A>poke 5bb 1 <-- Change 0 (default drive) to 1 (drive A) |
|||
A>peek 5b0 20 <-- Let's check just to make sure |
|||
05B0 00 00 00 00 00 00 30 30 31 20 24 01 24 24 24 20 |
|||
05C0 20 20 20 20 53 55 42 00 00 00 1A 1A 1A 1A 1A 1A |
|||
A>save 5 newsubmt.com <-- Save new SUBMIT.COM file |
|||
|
|||
Pretty simple, huh? |
|||
ny error message encountered that is not on this list came from some |
|||
prog |
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,19 +1,31 @@ |
|||
all: |
|||
cd Tools/unix ; make |
|||
cd Source ; make |
|||
cd Source/Images ; make |
|||
.PHONY: tools source clean clobber diff dist |
|||
|
|||
.ONESHELL: |
|||
.SHELLFLAGS = -cex |
|||
|
|||
all: tools source |
|||
|
|||
tools: |
|||
$(MAKE) --directory Tools |
|||
|
|||
source: |
|||
$(MAKE) --directory Source |
|||
|
|||
clean: |
|||
cd Tools/unix ; make clean |
|||
cd Source ; make clean |
|||
cd Binary ; make clean |
|||
$(MAKE) --directory Tools clean |
|||
$(MAKE) --directory Source clean |
|||
$(MAKE) --directory Binary clean |
|||
rm -f make.log |
|||
|
|||
clobber: |
|||
cd Tools/unix ; make clobber |
|||
cd Source ; make clobber |
|||
cd Binary ; make clobber |
|||
rm -f typescript |
|||
clobber: clean |
|||
|
|||
diff: |
|||
cd Source ; make diff |
|||
$(MAKE) --directory Source diff |
|||
|
|||
dist: |
|||
$(MAKE) ROM_PLATFORM=dist |
|||
$(MAKE) --directory Tools clean |
|||
$(MAKE) --directory Source clean |
|||
|
|||
distlog: |
|||
$(MAKE) dist 2>&1 | tee make.log |
|||
|
|||
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -1,49 +0,0 @@ |
|||
this tree now contains makefiles and tools to build on Linux and MacosX |
|||
Linux is rather more thoroughly tested compared to os-x. |
|||
|
|||
to get here, TASM and the propeller generation tools needed to be replaced, |
|||
and since the unix filesystem is usually case-sensitive, and CP/M and windows |
|||
are not, the cpm tools were made case-insensitive. |
|||
|
|||
TASM was replaced with uz80as, which implements a subset of TASM and fixes some |
|||
bugs. however, I needed to add some functionality to make it build the sources |
|||
as they exist in this tree. in particular, one thing to be very careful of is |
|||
that TASM is not entirely consistent with respect to the .DS directive. |
|||
it's usually a bad idea to mix .DS, .FILL, .DB with .ORG. |
|||
.DS n is best thought of as .ORG $ + n |
|||
.ORG changes the memory pointer, but does not change the file output point. |
|||
it works a lot more like M80, SLR* .phase |
|||
|
|||
it assumes that you have some standard system tools and libraries installed |
|||
specifically: gcc, gnu make, libncurses |
|||
|
|||
to build: |
|||
cd to the top directory and type make. |
|||
|
|||
heavy use is made of make's include facility and pattern rules. |
|||
the master rule set is in Tools/Makefile.inc. changes here will affect |
|||
almost every Makefile, and where exceptions are needed, the overrides are |
|||
applied in the lower Makefiles. |
|||
|
|||
these tools can run a windows-linux regression test, where all the binaries are |
|||
compared to a baseline windows build. |
|||
|
|||
Credit: |
|||
|
|||
uz80as was written by Jorge Giner Cordero, jorge.giner@hotmail.com, |
|||
and the original source can be found at https://github.com/jorgicor/uz80as |
|||
|
|||
the propeller tools use bstc and openspin, parallax tools from |
|||
http://www.fnarfbargle.com/bst.html https://github.com/parallaxinc/OpenSpin |
|||
note that bst is not open source or even currently maintained, so I could |
|||
not generate a version for 64 bit osx. |
|||
|
|||
cpmtools were the most current I could find, and it has been hacked to do |
|||
case-insensitivity. these are not marked, and are not extensive. |
|||
|
|||
zx is from distributed version, and also has local hacks for case insensitivity. |
|||
both zx and cpmtools ship with an overly complicated makefile generation system |
|||
and this is ignored. |
|||
|
|||
this whole linux build framework is the work of Curt Mayer, curt@zen-room.org. |
|||
use it for whatever you like; this is not my day job. |
|||
File diff suppressed because it is too large
@ -1,48 +1,48 @@ |
|||
@echo off |
|||
setlocal |
|||
|
|||
set TOOLS=../../Tools |
|||
set TOOLS=..\..\Tools |
|||
set APPBIN=..\..\Binary\Apps |
|||
|
|||
set PATH=%TOOLS%\tasm32;%TOOLS%\zx;%PATH% |
|||
|
|||
set PATH=%TOOLS%\tasm32;%TOOLS%\zxcc;%PATH% |
|||
set TASMTABS=%TOOLS%\tasm32 |
|||
|
|||
set ZXBINDIR=%TOOLS%/cpm/bin/ |
|||
set ZXLIBDIR=%TOOLS%/cpm/lib/ |
|||
set ZXINCDIR=%TOOLS%/cpm/include/ |
|||
|
|||
call :asm SysCopy || goto :eof |
|||
call :asm Assign || goto :eof |
|||
call :asm Format || goto :eof |
|||
call :asm Talk || goto :eof |
|||
call :asm Mode || goto :eof |
|||
call :asm RTC || goto :eof |
|||
call :asm Timer || goto :eof |
|||
call :asm180 IntTest || goto :eof |
|||
|
|||
zx Z80ASM -SYSGEN/F |
|||
|
|||
zx MAC SURVEY.ASM -$PO |
|||
zx MLOAD25 -SURVEY.COM=SURVEY.HEX |
|||
|
|||
setlocal & cd XM && call Build || exit /b 1 & endlocal |
|||
setlocal & cd FDU && call Build || exit /b 1 & endlocal |
|||
setlocal & cd Tune && call Build || exit /b 1 & endlocal |
|||
setlocal & cd FAT && call Build || exit /b 1 & endlocal |
|||
|
|||
copy *.com %APPBIN%\ |
|||
set CPMDIR80=%TOOLS%/cpm/ |
|||
|
|||
call :asm syscopy || exit /b |
|||
call :asm assign || exit /b |
|||
call :asm format || exit /b |
|||
call :asm talk || exit /b |
|||
call :asm mode || exit /b |
|||
call :asm rtc || exit /b |
|||
call :asm timer || exit /b |
|||
call :asm rtchb || exit /b |
|||
|
|||
zxcc Z80ASM -SYSGEN/F || exit /b |
|||
|
|||
pushd XM && call Build || exit /b & popd |
|||
pushd FDU && call Build || exit /b & popd |
|||
pushd Tune && call Build || exit /b & popd |
|||
pushd FAT && call Build || exit /b & popd |
|||
pushd Test && call Build || exit /b & popd |
|||
pushd ZMP && call Build || exit /b & popd |
|||
pushd ZMD && call Build || exit /b & popd |
|||
pushd Dev && call Build || exit /b & popd |
|||
pushd VGM && call Build || exit /b & popd |
|||
pushd cpuspd && call Build || exit /b & popd |
|||
pushd Survey && call Build || exit /b & popd |
|||
pushd HTalk && call Build || exit /b & popd |
|||
|
|||
copy *.com %APPBIN%\ || exit /b |
|||
|
|||
goto :eof |
|||
|
|||
:asm |
|||
echo. |
|||
echo Building %1... |
|||
tasm -t80 -g3 -fFF %1.asm %1.com %1.lst |
|||
tasm -t80 -g3 -fFF %1.asm %1.com %1.lst || exit /b |
|||
goto :eof |
|||
|
|||
:asm180 |
|||
echo. |
|||
echo Building %1... |
|||
tasm -t180 -g3 -fFF %1.asm %1.com %1.lst |
|||
tasm -t180 -g3 -fFF %1.asm %1.com %1.lst || exit /b |
|||
goto :eof |
|||
|
|||
@ -0,0 +1,14 @@ |
|||
@echo off |
|||
setlocal |
|||
|
|||
set TOOLS=../../../Tools |
|||
set PATH=%TOOLS%\tasm32;%PATH% |
|||
set TASMTABS=%TOOLS%\tasm32 |
|||
|
|||
echo Building Dev... |
|||
tasm -t80 -g3 -fFF dev.asm dev.com %dev.lst || exit /b |
|||
|
|||
copy /Y dev.com ..\..\..\Binary\Apps\ || exit /b |
|||
rem copy /Y *.ovr ..\..\..\Binary\Apps\ || exit /b |
|||
rem copy /Y *.hlp ..\..\..\Binary\Apps\ || exit /b |
|||
rem copy /Y *.doc ..\..\..\Binary\Apps\ || exit /b |
|||
@ -0,0 +1,7 @@ |
|||
@echo off |
|||
setlocal |
|||
|
|||
if exist dev.com del dev.com |
|||
if exist *.hex del *.hex |
|||
if exist *.lst del *.lst |
|||
if exist *.zip del *.zip |
|||
@ -0,0 +1,10 @@ |
|||
OBJECTS = dev.com |
|||
#DOCS = dev.txt
|
|||
DEST = ../../../Binary/Apps |
|||
DOCDEST = ../../../Binary/Apps |
|||
TOOLS = ../../../Tools |
|||
include $(TOOLS)/Makefile.inc |
|||
|
|||
%.com: USETASM=1 |
|||
|
|||
|
|||
@ -0,0 +1 @@ |
|||
THE DEV DIRECTORY IS A SKELETON DIRECTORY TO AID SETTING UP A BUILD PROCESS FOR A NEW PROGRAM |
|||
@ -0,0 +1,32 @@ |
|||
;=============================================================================== |
|||
; Dev - Developement Stub |
|||
;=============================================================================== |
|||
; |
|||
; AUTHOR: |
|||
; |
|||
; Usage: |
|||
; |
|||
;_______________________________________________________________________________ |
|||
; |
|||
; Change Log: |
|||
; |
|||
;_______________________________________________________________________________ |
|||
; |
|||
; ToDo: |
|||
; |
|||
;_______________________________________________________________________________ |
|||
; |
|||
;=============================================================================== |
|||
; Definitions |
|||
;=============================================================================== |
|||
; |
|||
; |
|||
;=============================================================================== |
|||
; Code Section |
|||
;=============================================================================== |
|||
; |
|||
; |
|||
.org $100 |
|||
ret |
|||
.end |
|||
|
|||
Binary file not shown.
@ -0,0 +1,125 @@ |
|||
# RomWBW HBIOS CP/M FAT Utility ("FAT.COM") |
|||
|
|||
Author: Wayne Warthen \ |
|||
Updated: 6-Jan-2024 |
|||
|
|||
This application allows copying files between CP/M filesystems and FAT |
|||
filesystems (DOS, Windows, Mac, Linux, etc.). The application runs on |
|||
RomWBW hosted CP/M (and compatible) operating systems. The application |
|||
also has limited file management capabilities on FAT filesystems |
|||
including directory listing, renaming, deleting, and sub-directory |
|||
creation. |
|||
|
|||
### Usage: |
|||
|
|||
``` |
|||
FAT DIR <path> |
|||
FAT COPY <src> <dst> |
|||
FAT REN <from> <to> |
|||
FAT DEL <path>[<file>|<dir>] |
|||
FAT MD <path> |
|||
FAT FORMAT <drv> |
|||
``` |
|||
|
|||
CP/M filespec: \<d\>:FILENAME.EXT (\<d\> is CP/M drive letter A-P) \ |
|||
FAT filespec: \<u\>:/DIR/FILENAME.EXT (\<u\> is disk unit #) |
|||
|
|||
### Notes: |
|||
|
|||
- Partitioned or non-partitioned media is handled automatically. |
|||
A floppy drive is a good example of a non-partitioned FAT |
|||
filesystem and will be recognized. Larger media will typically |
|||
have a partition table which will be recognized by the |
|||
application to find the FAT filesystem. |
|||
|
|||
- Although RomWBW-style CP/M media does not know anything about |
|||
partition tables, it is entirely possible to have media that |
|||
has both CP/M and FAT file systems on it. This is accomplished |
|||
by creating a FAT filesystem on the media that starts on a track |
|||
beyond the last track used by CP/M. Each CP/M slice can occupy |
|||
up to 8MB. So, make sure to start your FAT partition beyond |
|||
(slice count) * 9MB. |
|||
|
|||
- The application infers whether you are attempting to reference |
|||
a FAT or CP/M filesystem via the drive specifier (char before ':'). |
|||
A numeric drive character specifies the HBIOS disk unit number |
|||
for FAT access. An alpha (A-P) character indicates a CP/M |
|||
file system access targeting the specified drive letter. If there |
|||
is no drive character specified, the current CP/M filesystem and |
|||
current CP/M drive is assumed. For example: |
|||
|
|||
`2:README.TXT` refers to FAT file README.TXT on disk unit #2 \ |
|||
`C:README.TXT` refers to CP/M file README.TXT on CP/M drive C: \ |
|||
`README.TXT` refers to CP/M file README.TXT on current CP/M drive |
|||
|
|||
- FAT files with SYS, HIDDEN, or R/O attributes are not given |
|||
any special treatment. Such files are found and processed |
|||
like any other file. However, any attempt to write to a |
|||
read-only file will fail and the application will abort. |
|||
|
|||
- It is not currently possible to reference CP/M user areas other |
|||
than the current user. To copy files to alternate user areas, |
|||
you must switch to the desired user number first or use an |
|||
additional step to copy the file to the desired user area. |
|||
|
|||
- Accessing FAT filesystems on a floppy requires the use of |
|||
RomWBW HBIOS v2.9.1-pre.13 or greater. |
|||
|
|||
- Only the first 8 RomWBW disk units (0-7) can be referenced. |
|||
|
|||
- Files written are not verified. |
|||
|
|||
- Wildcard matching in FAT filesystems is a bit unusual as |
|||
implemented by FatFs. See FatFs documentation. |
|||
|
|||
### License: |
|||
|
|||
GNU GPLv3 (see file LICENSE.txt) |
|||
|
|||
### Build Notes: |
|||
|
|||
- Source is maintained on GitHub at <https://github.com/wwarthen/FAT>. |
|||
|
|||
- Application is based on FatFs. FatFs source is included. See |
|||
<http://elm-chan.org/fsw/ff/>. |
|||
|
|||
- SDCC compiler v4.3 or greater is required to build. New calling |
|||
conventions introduced in v4.3 are assumed. |
|||
|
|||
- See Build.cmd for sample build script under Windows. References |
|||
to SDCC must be updated for your environment. |
|||
|
|||
- Note that ff.c (core FatFs code) generates quite a few compiler |
|||
warnings (all appear to be benign). |
|||
|
|||
### To Do: |
|||
|
|||
- Allow ^C to abort any operation in progress. |
|||
|
|||
- Allow referencing more than the first 8 RomWBW disk units. |
|||
|
|||
- Handle wildcards in destination, e.g.: |
|||
|
|||
`FAT REN 2:/*.TXT 2:/*.BAK` |
|||
|
|||
- Do something intelligent with R/O and SYS file attributes |
|||
|
|||
- Support UNA |
|||
|
|||
### History: |
|||
|
|||
| Date | Version | Notes | |
|||
|------------:|-------- |-------------------------------------------------------------| |
|||
| 2-May-2019 | v0.9 | (beta) initial release | |
|||
| 7-May-2019 | v0.9.1 | (beta) added REN and DEL | |
|||
| 8-May-2019 | v0.9.2 | (beta) handle file collisions w/ user prompt | |
|||
| 8-Oct-2019 | v0.9.3 | (beta) fixed incorrect filename buffer size (MAX_FN) | |
|||
| 10-Oct-2019 | v0.9.4 | (beta) upgraded to FatFs R0.13c | |
|||
| 10-Oct-2019 | v0.9.5 | (beta) added MD (make directory) | |
|||
| 10-Oct-2019 | v0.9.6 | (beta) added FORMAT | |
|||
| 11-Oct-2019 | v0.9.7 | (beta) fix FORMAT to use existing partition table entries | |
|||
| | | add attributes to directory listing | |
|||
| 12-Apr-2021 | v0.9.8 | (beta) support CP/NET drives | |
|||
| 12-Oct-2023 | v0.9.9 | (beta) handle updated HBIOS Disk Device call | |
|||
| 6-Jan-2024 | v1.0.0 | updated to latest FsFat (v0.15) | |
|||
| | | updated to latest SDCC (v4.3) | |
|||
@ -1,101 +0,0 @@ |
|||
RomWBW HBIOS CP/M FAT Utility ("FAT.COM") |
|||
|
|||
Author: Wayne Warthen |
|||
Updated: 11-Oct-2019 |
|||
|
|||
Application to manipulate and exchange files with a FAT (DOS) |
|||
filesystem. Runs on any HBIOS hosted CP/M implementation. |
|||
|
|||
USAGE: |
|||
FAT DIR <path> |
|||
FAT COPY <src> <dst> |
|||
FAT REN <from> <to> |
|||
FAT DEL <path>[<file>|<dir>] |
|||
FAT MD <path> |
|||
FAT FORMAT <drv> |
|||
|
|||
CP/M filespec: <d>:FILENAME.EXT (<d> is CP/M drive letter A-P) |
|||
FAT filespec: <u>:/DIR/FILENAME.EXT (<u> is disk unit #) |
|||
|
|||
LICENSE: |
|||
GNU GPLv3 (see file LICENSE.txt) |
|||
|
|||
NOTES: |
|||
- Partitioned or non-partitioned media is handled automatically. |
|||
A floppy drive is a good example of a non-partitioned FAT |
|||
filesystem and will be recognized. Larger media will typically |
|||
have a partition table which will be recognized by the |
|||
application to find the FAT filesystem. |
|||
|
|||
- Although RomWBW-style CP/M media does not know anything about |
|||
partition tables, it is entirely possible to have media that |
|||
has both CP/M and FAT file systems on it. This is accomplished |
|||
by creating a FAT filesystem on the media that starts on a track |
|||
beyond the last track used by CP/M. Each CP/M slice on a |
|||
media will occupy a little over 8MB. So, make sure to start |
|||
your FAT partition beyond (slice count) * 8MB. |
|||
|
|||
- The application infers whether you are attempting to reference |
|||
a FAT or CP/M filesystem via the drive specifier (char before ':'). |
|||
A numeric drive character specifies the HBIOS disk unit number |
|||
for FAT access. An alpha (A-P) character indicates a CP/M |
|||
file system access targeting the specified drive letter. If there |
|||
is no drive character specified, the current CP/M filesystem and |
|||
current CP/M drive is assumed. For example: |
|||
|
|||
"2:README.TXT" refers to FAT file README.TXT on disk unit #2 |
|||
"C:README.TXT" refers to CP/M file README.TXT on CP/M drive C |
|||
"README.TXT" refers to CP/M file README.TXT on current CP/M drive |
|||
|
|||
- Files with SYS, HIDDEN, or R/O only attributes are not given |
|||
any special treatment. Such files are found and processed |
|||
like any other file. However, any attempt to write to a |
|||
read-only file will fail and the application will abort. |
|||
|
|||
- It is not currently possible to reference CP/M user areas other |
|||
than the current user. To copy files to alternate user areas, |
|||
you must switch to the desired user number first or use an |
|||
additional step to copy the file to the desired user area. |
|||
|
|||
- Accessing FAT filesystems on a floppy requires the use of |
|||
RomWBW HBIOS v2.9.1-pre.13 or greater. |
|||
|
|||
- Files written are not verified. |
|||
|
|||
- Wildcard matching in FAT filesystems is a bit unusual as |
|||
implemented by FatFs. See FatFs documentation. |
|||
|
|||
BUILD NOTES: |
|||
- Source is maintained on GitHub at https://github.com/wwarthen/FAT |
|||
|
|||
- Application is based on FatFs. FatFs source is included. |
|||
|
|||
- SDCC compiler is required to build (v3.9.0 known working). |
|||
|
|||
- ZX CP/M emulator is required to build (from RomWBW distribution). |
|||
|
|||
- See Build.cmd for sample build script under Windows. References |
|||
to SDCC and ZX must be updated for your environment. |
|||
|
|||
- Note that ff.c (core FatFs code) generates quite a few compiler |
|||
warnings (all appear to be benign). |
|||
|
|||
TO DO: |
|||
- Allow ^C to abort any operation in progress. |
|||
|
|||
- Handle wildcards in destination, e.g.: |
|||
"FAT REN 2:/*.TXT 2:/*.BAK" |
|||
|
|||
- Do something intelligent with R/O and SYS files on FAT |
|||
|
|||
HISTORY: |
|||
2-May-2019: v0.9 (beta) initial release |
|||
7-May-2019: v0.9.1 (beta) added REN and DEL |
|||
8-May-2019: v0.9.2 (beta) handle file collisions w/ user prompt |
|||
8-Oct-2019: v0.9.3 (beta) fixed incorrect filename buffer size (MAX_FN) |
|||
10-Oct-2019: v0.9.4 (beta) upgraded to FatFs R0.13c |
|||
10-Oct-2019: v0.9.5 (beta) added MD (make directory) |
|||
10-Oct-2019: v0.9.6 (beta) added FORMAT |
|||
11-Oct-2019: v0.9.7 (beta) fix FORMAT to use existing partition table entries |
|||
add attributes to directory listing |
|||
|
|||
Binary file not shown.
File diff suppressed because it is too large
@ -1,514 +0,0 @@ |
|||
================================================================ |
|||
Floppy Disk Utility (FDU) v5.3 for RetroBrew Computers |
|||
Disk IO / Zeta / Dual-IDE / N8 / RC2014 / SmallZ80 / Dyno |
|||
================================================================ |
|||
|
|||
Updated January 5, 2020 |
|||
by Wayne Warthen (wwarthen@gmail.com) |
|||
|
|||
Application to test the hardware functionality of the Floppy |
|||
Disk Controller (FDC) on the ECB DISK I/O, DISK I/O V3, ZETA |
|||
SBC, Dual IDE w/ Floppy, or N8 board. |
|||
|
|||
The intent is to provide a testbed that allows direct testing |
|||
of all possible media types and modes of access. The |
|||
application supports read, write, and format by sector, track, |
|||
and disk as well as a random read/write test. |
|||
|
|||
The application supports access modes of polling, interrupt, |
|||
INT/WAIT, and DRQ/WAIT. At present, it supports 3.5" media at |
|||
DD (720KB) and HD (1.44MB) capacities. It also now supports |
|||
5.25" media (720KB and 1.2MB) and 8" media (1.11MB) as well. |
|||
Additional media will be added when I have time and access to |
|||
required hardware. Not all modes are supported on all |
|||
platforms and some modes are experimental in all cases. |
|||
|
|||
In many ways this application is merely reinventing the wheel |
|||
and performs functionality similar to existing applications, |
|||
but I have not seen any other applications for RetroBrew |
|||
Computers hardware that provide this range of functionality. |
|||
|
|||
While the application is now almost entirely new code, I would |
|||
like to acknowledge that much was derived from the previous |
|||
work of Andrew Lynch and Dan Werner. I also want to credit |
|||
Sergio Gimenez with testing the 5.25" drive support and Jim |
|||
Harre with testing the 8" drive support. Support for Zeta 2 |
|||
comes from Segey Kiselev. Thanks! |
|||
|
|||
General Usage |
|||
------------- |
|||
|
|||
In general, usage is self explanatory. At invocation, you |
|||
must select the floppy disk controller (FDC) that you are |
|||
using. Subsequently, the main menu allows you to set the |
|||
unit, media, and mode to test. These settings MUST match your |
|||
situation. Read, write, format, and verify functions are |
|||
provided. A sub-menu will allow you to choose sector, track, |
|||
disk, or random tests. |
|||
|
|||
The verify function requires a little explanation. It will |
|||
take the contents of the current in-memory disk buffer, save |
|||
it, and compare it to the selected sectors. So, you must |
|||
ensure that the sectors to be verified already have been |
|||
written with the same pattern as the buffer contains. I |
|||
typically init the buffer to a pattern, write the pattern to |
|||
the entire disk, then verify the entire disk. |
|||
|
|||
Another submenu is provided for FDC commands. This sub-menu |
|||
allows you to send low-level commands directly to FDC. You |
|||
*must* know what you are doing to use this sub-menu. For |
|||
example, in order to read a sector using this sub-menu, you |
|||
will need to perform specify, seek, sense int, and read |
|||
commands specifying correct values (nothing is value checked |
|||
in this menu). |
|||
|
|||
Required Hardware/BIOS |
|||
---------------------- |
|||
|
|||
Of course, the starting point is to have a supported hardware |
|||
configuration. The following Z80 / Z180 based CPU boards are |
|||
supported: |
|||
|
|||
- SBC V1/2 |
|||
- Zeta |
|||
- Zeta 2 |
|||
- N8 |
|||
- Mark IV |
|||
- RC2014 w/ SMC |
|||
- RC2014 w/ WDC |
|||
- SmallZ80 |
|||
- Dyno |
|||
|
|||
You must be using either a RomWBW or UBA based OS version. |
|||
|
|||
You must have one of the following floppy disk controllers: |
|||
|
|||
- Disk IO ECB Board FDC |
|||
- Disk IO 3 ECB Board FDC |
|||
- Dual-IDE ECB Board FDC |
|||
- Zeta SBC onboard FDC |
|||
- Zeta 2 SBC onboard FDC |
|||
- N8 SBC onboard FDC |
|||
- RC2014 Scott Baker SMC-based Floppy Module |
|||
- RC2014 Scott Baker WDC-based Floppy Module |
|||
|
|||
Finally, you will need a floppy drive connected via an |
|||
appropriate cable: |
|||
|
|||
Disk IO - no twist in cable, drive unit 0/1 must be selected by jumper on drive |
|||
DISK IO 3, Zeta, Zeta 2, RC2014, Dyno - cable with twist, unit 0 after twist, unit 1 before twist |
|||
DIDE, N8, Mark IV, SmallZ80 - cable with twist, unit 0 before twist, unit 1 after twist |
|||
|
|||
Note that FDU does not utilize your systems ROM or OS to |
|||
access the floppy system. FDU interacts directly with |
|||
hardware. Upon exit, you may need to reset your OS to get the |
|||
floppy system back into a state that is expected. |
|||
|
|||
The Disk I/O should be jumpered as follows: |
|||
|
|||
J1: depends on use of interrupt modes (see interrupt modes below) |
|||
J2: pins 1-2, & 3-4 jumpered |
|||
J3: hardware dependent timing for DMA mode (see DMA modes below) |
|||
J4: pins 2-3 jumpered |
|||
J5: off |
|||
J6: pins 2-3 jumpered |
|||
J7: pins 2-3 jumpered |
|||
J8: off |
|||
J9: off |
|||
J10: off |
|||
J11: off |
|||
J12: off |
|||
|
|||
Note that J1 can be left on even when not using interrupt |
|||
modes. As long as the BIOS is OK with it, that is fine. Note |
|||
also that J3 is only relevant for DMA modes, but also can be |
|||
left in place when using other modes. |
|||
|
|||
The Disk I/O 3 board should be jumpered at the default settings: |
|||
|
|||
JP2: 3-4 |
|||
JP3: 1-2 for int mode support, otherwise no jumper |
|||
JP4: 1-2, 3-4 |
|||
JP5: 1-2 |
|||
JP6: 1-2 |
|||
JP7: 1-2, 3-4 |
|||
|
|||
Zeta & Zeta 2 do not have any relevant jumper settings. The |
|||
hardwired I/O ranges are assumed in the code. |
|||
|
|||
The Dual-IDE board should be jumpered as follows: |
|||
|
|||
K3 (DT/R or /RD): /RD |
|||
P5 (bd ID): 1-2, 3-4 (for $20-$3F port range) |
|||
|
|||
There are no specific N8 jumper settings, but the default |
|||
I/O range starting at $80 is assumed in the published code. |
|||
|
|||
The RC2014 Scott Baker SMC-based floppy module should be jumpered |
|||
for I/O base address 0x50 (SV1: 11-12), JP1 (TS) shorted, |
|||
JP2 (/FAULT) shorted, JP3 (MINI): 2-3, JP4 (/DC/RDY): 2-3. |
|||
|
|||
The RC2014 Scott Baker WDC-based floppy module should be jumpered |
|||
for I/O base address 0x50 (SV1: 11-12), JP1 (/DACK): 1-2, |
|||
JP2 (TC): 2-3. |
|||
|
|||
SmallZ80 does not have any relevant jumper settings. The |
|||
hardwired I/O ranges are assumed in the code. |
|||
|
|||
Dyno does not have any relevant jumper settings. The |
|||
hardwired I/O ranges are assumed in the code. |
|||
|
|||
Modes of Operation |
|||
------------------ |
|||
|
|||
You can select the following test modes. Please refer to the |
|||
chart that follows to determine which modes should work with |
|||
combinations of Z80 CPU speed and media format. |
|||
|
|||
WARNING: In general, only the polling mode is considered fully |
|||
reliable. The other modes are basically experimental and |
|||
should only be used if you know exactly what you are doing. |
|||
|
|||
Polling: Traditional polled input/output. Works well and very |
|||
reliable with robust timeouts and good error recovery. Also, |
|||
the slowest performance which precludes it from being used |
|||
with 1.44MB floppy on a 4MHz Z80. This is definitely the mode |
|||
you want to get working before any others. It does not require |
|||
J1 (interrupt enable) on DISK I/O and does not care about the |
|||
setting of J3. |
|||
|
|||
Interrupt: Relies on FDC interrupts to determine when a byte |
|||
is ready to be read/written. It does *not* implement a |
|||
timeout during disk operations. For example, if there is no |
|||
disk in the drive, this mode will just hang until a disk is |
|||
inserted. This mode *requires* that the host has interrupts |
|||
active using interrupt mode 1 (IM1) and interrupts attached to |
|||
the FDC controller. The BIOS must be configured to handle |
|||
these interrupts safely. |
|||
|
|||
Fast Interrupt: Same as above, but sacrifices additional |
|||
reliability for faster operation. This mode will allow a |
|||
1.44MB floppy to work with a 4MHz Z80 CPU. However, if any |
|||
errors occur (even a transient read error which is not |
|||
unusual), this mode will hang. The same FDC interrupt |
|||
requirements as above are required. |
|||
|
|||
INT/WAIT: Same as Fast Interrupt, but uses CPU wait instead of |
|||
actual interrupt. This mode is exclusive to the original Disk |
|||
IO board. It is subject to all the same issues as Fast |
|||
Interrupt, but does not need J1 shorted. J3 is irrelevant. |
|||
|
|||
DRQ/WAIT: Uses pseudo DMA to handle input/output. Does not |
|||
require that interrupts (J1) be enabled on the DISK I/O. |
|||
However, it is subject to all of the same reliability issues |
|||
as "Fast Interrupt". This mode is exclusive to the original |
|||
Disk IO board. At present, the mode is *not* implemented! |
|||
|
|||
The chart below attempts to describe the combinations that |
|||
work for me. By far, the most reliable mode is Polling, but |
|||
it requires 8MHz CPU for HD disks. |
|||
|
|||
DRQ/WAIT --------------------------------+ |
|||
INT/WAIT -----------------------------+ | |
|||
Fast Interrupt --------------------+ | | |
|||
Interrupt ----------------------+ | | | |
|||
Polling ---------------------+ | | | | |
|||
| | | | | |
|||
CPU Speed --------------+ | | | | | |
|||
| | | | | | |
|||
| | | | | | |
|||
|
|||
3.5" DD (720K) ------ 4MHz Y Y Y Y X |
|||
8MHz+ Y Y Y Y X |
|||
|
|||
3.5" HD (1.44M) ----- 4MHz N N Y Y X |
|||
8MHz+ Y Y Y Y X |
|||
|
|||
5.25" DD (360K) ----- 4MHz Y Y Y Y X |
|||
8MHz+ Y Y Y Y X |
|||
|
|||
5.25" HD (1.2M) ----- 4MHz N N Y Y X |
|||
8MHz+ Y Y Y Y X |
|||
|
|||
8" DD (1.11M) ------- 4MHz N N Y Y X |
|||
8MHz+ Y Y Y Y X |
|||
|
|||
Y = Yes, works |
|||
N = No, does not work |
|||
X = Experimental, probably won't work |
|||
|
|||
Tracing |
|||
------- |
|||
|
|||
Command/result activity to/from the FDC will be written out if |
|||
the trace setting is changed from '00' to '01' in setup. |
|||
Additionally, if a command failure is detected on any command, |
|||
that specific comand and results are written regardless of the |
|||
trace setting. |
|||
|
|||
The format of the line written is: |
|||
<OPERATION>: <COMMAND BYTES> --> <RESULT BYTES> [<RESULT>] |
|||
|
|||
For example, this is the output of a normal read operation: |
|||
READ: 46 01 00 00 01 02 09 1B FF --> 01 00 00 00 00 02 02 [OK] |
|||
|
|||
Please refer to the i8272 data sheet for information on the |
|||
command and result bytes. |
|||
|
|||
Note that the sense interrupt command can return a non-OK |
|||
result. This is completely normal in some cases. It is |
|||
necessary to "poll" the drive for seek status using sense |
|||
interrupt. If there is nothing to report, then the result |
|||
will be INVALID COMMAND. Additionally, during a recalibrate |
|||
operation, it may be necessary to issue the command twice |
|||
because the command will only step the drive 77 times looking |
|||
for track 0, but the head may be up to 80 tracks away. In |
|||
this case, the first recalibrate fails, but the second should |
|||
succeed. Here is what this would look like if trace is turned |
|||
on: |
|||
|
|||
RECALIBRATE: 07 01 --> <EMPTY> [OK] |
|||
SENSE INTERRUPT: 08 --> 80 [INVALID COMMAND] |
|||
... |
|||
... |
|||
... |
|||
SENSE INTERRUPT: 08 --> 80 [INVALID COMMAND] |
|||
SENSE INTERRUPT: 08 --> 71 00 [ABNORMAL TERMINATION] |
|||
RECALIBRATE: 07 01 --> <EMPTY> [OK] |
|||
SENSE INTERRUPT: 08 --> 21 00 [OK] |
|||
|
|||
Another example is when the FDC has just been reset. In this |
|||
case, you will see up to 4 disk change errors. Again these |
|||
are not a real problem and to be expected. |
|||
|
|||
When tracing is turned off, the application tries to be |
|||
intelligent about error reporting. The specific errors from |
|||
sense interrupt documented above will be suppressed because |
|||
they are not a real problem. All other errors will be |
|||
displayed. |
|||
|
|||
Error Handling |
|||
-------------- |
|||
|
|||
There is no automated error retry logic. This is very |
|||
intentional since the point is to expose the controller and |
|||
drive activity. Any error detected will result in a prompt to |
|||
abort, retry, or continue. Note that some number of errors is |
|||
considered normal for this technology. An occasional error |
|||
would not necessarily be considered a problem. |
|||
|
|||
CPU Speed |
|||
--------- |
|||
|
|||
Starting with v5.0, the application adjusts it's timing loops |
|||
to the actual system CPU speed by querying the BIOS for the |
|||
current CPU speed. |
|||
|
|||
Interleave |
|||
---------- |
|||
|
|||
The format command now allows the specification of a sector |
|||
interleave. It is almost always the case that the optimal |
|||
interleave will be 2 (meaning 2:1). |
|||
|
|||
360K Media |
|||
---------- |
|||
|
|||
The 360K media definition should work well for true 360K |
|||
drives. However, it will generally not work with 1.2M |
|||
drives. This is because these drives spin at 360RPM instead |
|||
of the 300RPM speed of true 360K drives. Additionally, 1.2M |
|||
drives are 80 tracks and 360K drives are 40 tracks and, so |
|||
far, there is no mechanism in FD to "double step" as a way to |
|||
use 40 track media in 80 track drives. |
|||
|
|||
With this said, it is possible to configure some 1.2M 5.25" |
|||
drives to automatically spin down to 300RPM based on a density |
|||
select signal (DENSEL). This signal is asserted by FD for |
|||
360K media, so IF you have configured your drive to react to |
|||
this signal correctly, you will be able to use the 360K media |
|||
defintion. Most 1.2M 5.25" drives are NOT configured this way |
|||
by default. TEAC drives are generally easy to modify and have |
|||
been tested by the author and do work in this manner. Note |
|||
that this does not address the issue of double stepping above; |
|||
you will just be using the first 40 of 80 tracks. |
|||
|
|||
Support |
|||
------- |
|||
|
|||
I am happy to answer questions as fast and well as I am able. |
|||
Best contact is wwarthen@gmail.com or post something on the |
|||
RetroBrew Computers Forum |
|||
https://www.retrobrewcomputers.org/forum/. |
|||
|
|||
Changes |
|||
------- |
|||
|
|||
WW 8/12/2011 |
|||
|
|||
Removed call to pulse TC in the FDC initialization after |
|||
determining that it periodically caused the FDC to write bad |
|||
sectors. I am mystified by this, but definitely found it to |
|||
be true. Will revisit at some point -- probably a timing |
|||
issue between puslsing TC and whatever happens next. |
|||
|
|||
Non-DMA mode was being set incorrectly for FAST-DMA mode. It |
|||
was set for non-DMA even though we were doing DMA. It is |
|||
interesting that it worked fine anyway. Fixed it anyway. |
|||
|
|||
DIO_SETMEDIA was not clearing DCD_DSKRDY as it should. Fixed. |
|||
|
|||
WW 8/26/2011: v1.1 |
|||
|
|||
Added support for Zeta. Note that INT/WAIT and DRQ/WAIT are |
|||
not available on Zeta. Note that Zeta provides the ability to |
|||
perform a reset of the FDC independent of a full CPU reset. |
|||
This is VERY useful and the FDC is reset anytime a drive reset |
|||
is required. |
|||
|
|||
Added INT/WAIT support. |
|||
|
|||
WW 8/28/2011: V1.2 |
|||
|
|||
All changes in this version are Zeta specific. Fixed FDC |
|||
reset logic and motor status display for Zeta (code from |
|||
Sergey). |
|||
|
|||
Modified Zeta disk change display to include it in the command |
|||
output line. This makes more sense because a command must be |
|||
issued to select the desired drive first. You can use the |
|||
SENSE INT command id you want to check the disk change value |
|||
at any time. It will also be displayed with any other command |
|||
output display. |
|||
|
|||
WW 9/1/2011: V1.3 |
|||
|
|||
Added CPUFREQ configuration setting to tune delays based on |
|||
cpu speed. The build app is set for 8MHz which also seems to |
|||
work well for 4MHz CPU's. Faster CPU speeds will probably |
|||
require tuning this setting. |
|||
|
|||
WW 9/5/2011: V1.4 |
|||
|
|||
Changed the polling execution routines to utilize CPUFREQ |
|||
variable to optimize timeout counter. Most importantly, this |
|||
should allow the use of faster CPUs (like 20MHz). |
|||
|
|||
WW 9/19/2011: V1.5 |
|||
|
|||
Zeta changes only. Added a call to FDC RESET after any |
|||
command failure. This solves an issue where the drive remains |
|||
selected if a command error occurs. Also added FDC RESET to |
|||
FDC CONTROL menu. |
|||
|
|||
WW 10/7/2011: V2.0 |
|||
|
|||
Added support for DIDE. Only supports polling IO and it does |
|||
not appear any other modes are possible given the hardware |
|||
constraints. |
|||
|
|||
WW 10/13/2011: V2.1 |
|||
|
|||
Modified to support N8. N8 is essentially identical to Dual |
|||
IDE. The only real change is the IO addresses. In theory, I |
|||
should be able to support true DMA on N8 and will work on that. |
|||
|
|||
WW 10/20/2011: v2.2 |
|||
|
|||
I had some problems with the results being read were sometimes |
|||
missing a byte. Fixed this by taking a more strict approach |
|||
to watching the MSR for the exact bits that are expected. |
|||
|
|||
WW 10/22/2011: V2.3 |
|||
|
|||
After spending a few days trying to track down an intermittent |
|||
data corruption issue with my Dual IDE board, I added a verify |
|||
function. This helped me isolate the problem very nicely |
|||
(turned out to be interference from the bus monitor). |
|||
|
|||
WW 11/25/2011: V2.4 |
|||
|
|||
Preliminary support for DISKIO V3. Basically just assumed |
|||
that it operates just like the Zeta. Needs to be verified |
|||
with real hardware as soon as I can. |
|||
|
|||
WW 1/9/2012: V2.5 |
|||
|
|||
Modified program termination to use CP/M reset call so that a |
|||
warm start is done and all drives are logged out. This is |
|||
important because media may have been formatted during the |
|||
program execution. |
|||
|
|||
WW 2/6/2012: v2.6 |
|||
|
|||
Added support for 5.25" drives as tested by Sergio. |
|||
|
|||
WW 4/5/2012: v2.7 |
|||
|
|||
Added support for 8" drives as tested by Jim Harre. |
|||
|
|||
WW 4/6/2012: v2.7a |
|||
|
|||
Fixed issue with media selection menu to remove duplicate |
|||
entries. |
|||
|
|||
WW 4/8/2012: v2.7b |
|||
|
|||
Corrected the handling of the density select signal. |
|||
|
|||
WW 5/22/2012: v2.8 |
|||
|
|||
Added new media definitions (5.25", 320K). |
|||
|
|||
WW 6/1/2012: v2.9 |
|||
|
|||
Added interleave capability on format. |
|||
|
|||
WW 6/5/2012: v3.0 |
|||
|
|||
Documentation cleanup. |
|||
|
|||
WW 7/1/2012: v3.1 |
|||
|
|||
Modified head load time (HLT) for 8" media based on YD-180 |
|||
spec. Now set to 50ms. |
|||
|
|||
WW 6/17/2013: v3.2 |
|||
|
|||
Cleaned up SRT, HLT, and HUT values. |
|||
|
|||
SK 2/10/2015: v3.3 |
|||
|
|||
Added Zeta SBC v2 support (Sergey Kiselev) |
|||
|
|||
WW 3/25/2015: v4.0 |
|||
|
|||
Renamed from FDTST --> FD |
|||
|
|||
WW 9/2/2017: v5.0 |
|||
|
|||
Renamed from FD to FDU. |
|||
Added runtime selection of FDC hardware. |
|||
Added runtime timing adjustment. |
|||
|
|||
WW 12/16/2017: v5.1 |
|||
|
|||
Improved polling version of read/write to fix occasional overrun errors. |
|||
|
|||
WW 1/8/2018: v5.2 |
|||
|
|||
Added support for RC2014 hardware: |
|||
- Scott Baker SMC 9266 FDC module |
|||
- Scott Baker WDC 37C65 FDC module |
|||
|
|||
WW 9/5/2018: v5.3 |
|||
- Removed use of pulsing TC to end R/W operations after one sector and |
|||
instead set EOT = R (sector number) so that after desired sector is |
|||
read, R/W stops with end of cylinder error which is a documented |
|||
method for controling number of sectors R/W. This specific termination |
|||
condition is no longer considered an error, but a successful end of |
|||
operation. |
|||
- Added support for SmallZ80 |
|||
|
|||
WW 5/1/2020: v5.4 |
|||
- Added support for Dyno (based on work by Steve Garcia) |
|||
File diff suppressed because it is too large
@ -0,0 +1,545 @@ |
|||
================================================================ |
|||
Floppy Disk Utility (FDU) v5.9 for RetroBrew Computers |
|||
Disk IO / Zeta / Dual-IDE / N8 / RCBus / SmallZ80 / Dyno / Nhyodyne / Duodyne |
|||
================================================================ |
|||
|
|||
Updated December 12, 2023 |
|||
by Wayne Warthen (wwarthen@gmail.com) |
|||
|
|||
Application to test the hardware functionality of the Floppy |
|||
Disk Controller (FDC) on the ECB DISK I/O, DISK I/O V3, ZETA |
|||
SBC, Dual IDE w/ Floppy, N8, RCBus, SmallZ80, Dyno, Nhyodyne, |
|||
Duodyne systems. |
|||
|
|||
The intent is to provide a testbed that allows direct testing |
|||
of all possible media types and modes of access. The |
|||
application supports read, write, and format by sector, track, |
|||
and disk as well as a random read/write test. |
|||
|
|||
The application supports access modes of polling, interrupt, |
|||
INT/WAIT, and DRQ/WAIT. At present, it supports 3.5" media at |
|||
DD (720KB) and HD (1.44MB) capacities. It also now supports |
|||
5.25" media (720KB and 1.2MB) and 8" media (1.11MB) as well. |
|||
Additional media will be added when I have time and access to |
|||
required hardware. Not all modes are supported on all |
|||
platforms and some modes are experimental in all cases. |
|||
|
|||
In many ways this application is merely reinventing the wheel |
|||
and performs functionality similar to existing applications, |
|||
but I have not seen any other applications for RetroBrew |
|||
Computers hardware that provide this range of functionality. |
|||
|
|||
While the application is now almost entirely new code, I would |
|||
like to acknowledge that much was derived from the previous |
|||
work of Andrew Lynch and Dan Werner. I also want to credit |
|||
Sergio Gimenez with testing the 5.25" drive support and Jim |
|||
Harre with testing the 8" drive support. Support for Zeta 2 |
|||
comes from Sergey Kiselev. Thanks! |
|||
|
|||
General Usage |
|||
------------- |
|||
|
|||
In general, usage is self explanatory. At invocation, you |
|||
must select the floppy disk controller (FDC) that you are |
|||
using. Subsequently, the main menu allows you to set the |
|||
unit, media, and mode to test. These settings MUST match your |
|||
situation. Read, write, format, and verify functions are |
|||
provided. A sub-menu will allow you to choose sector, track, |
|||
disk, or random tests. |
|||
|
|||
The verify function requires a little explanation. It will |
|||
take the contents of the current in-memory disk buffer, save |
|||
it, and compare it to the selected sectors. So, you must |
|||
ensure that the sectors to be verified already have been |
|||
written with the same pattern as the buffer contains. I |
|||
typically init the buffer to a pattern, write the pattern to |
|||
the entire disk, then verify the entire disk. |
|||
|
|||
Another submenu is provided for FDC commands. This sub-menu |
|||
allows you to send low-level commands directly to FDC. You |
|||
*must* know what you are doing to use this sub-menu. For |
|||
example, in order to read a sector using this sub-menu, you |
|||
will need to perform specify, seek, sense int, and read |
|||
commands specifying correct values (nothing is value checked |
|||
in this menu). |
|||
|
|||
Required Hardware/BIOS |
|||
---------------------- |
|||
|
|||
Of course, the starting point is to have a supported hardware |
|||
configuration. The following Z80 / Z180 based CPU boards are |
|||
supported: |
|||
|
|||
- SBC V1/2 |
|||
- Zeta |
|||
- Zeta 2 |
|||
- N8 |
|||
- Mark IV |
|||
- RCBus |
|||
- SmallZ80 |
|||
- Dyno |
|||
- Nhyodyne (MBC) |
|||
- Duodyne (DUO) |
|||
|
|||
You must be using either a RomWBW or UNA based OS version. |
|||
|
|||
You must have one of the following floppy disk controllers: |
|||
|
|||
- Disk IO ECB Board FDC |
|||
- Disk IO 3 ECB Board FDC |
|||
- Dual-IDE ECB Board FDC |
|||
- Zeta SBC onboard FDC |
|||
- Zeta 2 SBC onboard FDC |
|||
- N8 SBC onboard FDC |
|||
- RCBus Scott Baker SMC-based Floppy Module |
|||
- RCBus Scott Baker WDC-based Floppy Module |
|||
- SmallZ80 FDC |
|||
- Dyno FDC |
|||
- Nhyodyne (MBC) FDC |
|||
- Duodyne (DUO) FDC |
|||
|
|||
Finally, you will need a floppy drive connected via an |
|||
appropriate cable: |
|||
|
|||
Disk IO - no twist in cable, drive unit 0/1 must be selected by jumper on drive |
|||
DISK IO 3, Zeta, Zeta 2, RCBus, Dyno - cable with twist, unit 0 after twist, unit 1 before twist |
|||
DIDE, N8, Mark IV, SmallZ80 - cable with twist, unit 0 before twist, unit 1 after twist |
|||
|
|||
Note that FDU does not utilize your systems ROM or OS to |
|||
access the floppy system. FDU interacts directly with |
|||
hardware. Upon exit, you may need to reset your OS to get the |
|||
floppy system back into a state that is expected. |
|||
|
|||
The Disk I/O should be jumpered as follows: |
|||
|
|||
J1: depends on use of interrupt modes (see interrupt modes below) |
|||
J2: pins 1-2, & 3-4 jumpered |
|||
J3: hardware dependent timing for DMA mode (see DMA modes below) |
|||
J4: pins 2-3 jumpered |
|||
J5: off |
|||
J6: pins 2-3 jumpered |
|||
J7: pins 2-3 jumpered |
|||
J8: off |
|||
J9: off |
|||
J10: off |
|||
J11: off |
|||
J12: off |
|||
|
|||
Note that J1 can be left on even when not using interrupt |
|||
modes. As long as the BIOS is OK with it, that is fine. Note |
|||
also that J3 is only relevant for DMA modes, but also can be |
|||
left in place when using other modes. |
|||
|
|||
The Disk I/O 3 board should be jumpered at the default settings: |
|||
|
|||
JP2: 3-4 |
|||
JP3: 1-2 for int mode support, otherwise no jumper |
|||
JP4: 1-2, 3-4 |
|||
JP5: 1-2 |
|||
JP6: 1-2 |
|||
JP7: 1-2, 3-4 |
|||
|
|||
Zeta & Zeta 2 do not have any relevant jumper settings. The |
|||
hardwired I/O ranges are assumed in the code. |
|||
|
|||
The Dual-IDE board should be jumpered as follows: |
|||
|
|||
K3 (DT/R or /RD): /RD |
|||
P5 (bd ID): 1-2, 3-4 (for $20-$3F port range) |
|||
|
|||
There are no specific N8 jumper settings, but the default |
|||
I/O range starting at $80 is assumed in the published code. |
|||
|
|||
The RCBus Scott Baker SMC-based floppy module should be jumpered |
|||
for I/O base address 0x50 (SV1: 11-12), JP1 (TS) shorted, |
|||
JP2 (/FAULT) shorted, JP3 (MINI): 2-3, JP4 (/DC/RDY): 2-3. |
|||
|
|||
The RCBus Scott Baker WDC-based floppy module should be jumpered |
|||
for I/O base address 0x50 (SV1: 11-12), JP1 (/DACK): 1-2, |
|||
JP2 (TC): 2-3. Note that pin 1 of JPX jumpers is toward the bottom |
|||
of the board. |
|||
|
|||
The RCBus FDC by Alan Cox (Etched Pixels) needs to be strapped |
|||
for base I/O address 0x48. |
|||
|
|||
SmallZ80 does not have any relevant jumper settings. The |
|||
hardwired I/O ranges are assumed in the code. |
|||
|
|||
Dyno does not have any relevant jumper settings. The |
|||
hardwired I/O ranges are assumed in the code. |
|||
|
|||
The Nhyodyne (MBC) FDC is expected to be strapped to use neither INT |
|||
nor NMI. It is also not expected to use DMA. |
|||
|
|||
The Duodyne (DUO) FDC is expected to be strapped to use neither INT |
|||
nor NMI. It is also not expected to use DMA. |
|||
|
|||
Modes of Operation |
|||
------------------ |
|||
|
|||
You can select the following test modes. Please refer to the |
|||
chart that follows to determine which modes should work with |
|||
combinations of Z80 CPU speed and media format. |
|||
|
|||
WARNING: In general, only the polling mode is considered fully |
|||
reliable. The other modes are basically experimental and |
|||
should only be used if you know exactly what you are doing. |
|||
|
|||
Polling: Traditional polled input/output. Works well and very |
|||
reliable with robust timeouts and good error recovery. Also, |
|||
the slowest performance which precludes it from being used |
|||
with 1.44MB floppy on a 4MHz Z80. This is definitely the mode |
|||
you want to get working before any others. It does not require |
|||
J1 (interrupt enable) on DISK I/O and does not care about the |
|||
setting of J3. |
|||
|
|||
Interrupt: Relies on FDC interrupts to determine when a byte |
|||
is ready to be read/written. It does *not* implement a |
|||
timeout during disk operations. For example, if there is no |
|||
disk in the drive, this mode will just hang until a disk is |
|||
inserted. This mode *requires* that the host has interrupts |
|||
active using interrupt mode 1 (IM1) and interrupts attached to |
|||
the FDC controller. The BIOS must be configured to handle |
|||
these interrupts safely. |
|||
|
|||
Fast Interrupt: Same as above, but sacrifices additional |
|||
reliability for faster operation. This mode will allow a |
|||
1.44MB floppy to work with a 4MHz Z80 CPU. However, if any |
|||
errors occur (even a transient read error which is not |
|||
unusual), this mode will hang. The same FDC interrupt |
|||
requirements as above are required. |
|||
|
|||
INT/WAIT: Same as Fast Interrupt, but uses CPU wait instead of |
|||
actual interrupt. This mode is exclusive to the original Disk |
|||
IO board. It is subject to all the same issues as Fast |
|||
Interrupt, but does not need J1 shorted. J3 is irrelevant. |
|||
|
|||
DRQ/WAIT: Uses pseudo DMA to handle input/output. Does not |
|||
require that interrupts (J1) be enabled on the DISK I/O. |
|||
However, it is subject to all of the same reliability issues |
|||
as "Fast Interrupt". This mode is exclusive to the original |
|||
Disk IO board. At present, the mode is *not* implemented! |
|||
|
|||
The chart below attempts to describe the combinations that |
|||
work for me. By far, the most reliable mode is Polling, but |
|||
it requires 8MHz CPU for HD disks. |
|||
|
|||
DRQ/WAIT --------------------------------+ |
|||
INT/WAIT -----------------------------+ | |
|||
Fast Interrupt --------------------+ | | |
|||
Interrupt ----------------------+ | | | |
|||
Polling ---------------------+ | | | | |
|||
| | | | | |
|||
CPU Speed --------------+ | | | | | |
|||
| | | | | | |
|||
| | | | | | |
|||
|
|||
3.5" DD (720K) ------ 4MHz Y Y Y Y X |
|||
8MHz+ Y Y Y Y X |
|||
|
|||
3.5" HD (1.44M) ----- 4MHz N N Y Y X |
|||
8MHz+ Y Y Y Y X |
|||
|
|||
5.25" DD (360K) ----- 4MHz Y Y Y Y X |
|||
8MHz+ Y Y Y Y X |
|||
|
|||
5.25" HD (1.2M) ----- 4MHz N N Y Y X |
|||
8MHz+ Y Y Y Y X |
|||
|
|||
8" DD (1.11M) ------- 4MHz N N Y Y X |
|||
8MHz+ Y Y Y Y X |
|||
|
|||
Y = Yes, works |
|||
N = No, does not work |
|||
X = Experimental, probably won't work |
|||
|
|||
Tracing |
|||
------- |
|||
|
|||
Command/result activity to/from the FDC will be written out if |
|||
the trace setting is changed from '00' to '01' in setup. |
|||
Additionally, if a command failure is detected on any command, |
|||
that specific comand and results are written regardless of the |
|||
trace setting. |
|||
|
|||
The format of the line written is: |
|||
<OPERATION>: <COMMAND BYTES> --> <RESULT BYTES> [<RESULT>] |
|||
|
|||
For example, this is the output of a normal read operation: |
|||
READ: 46 01 00 00 01 02 09 1B FF --> 01 00 00 00 00 02 02 [OK] |
|||
|
|||
Please refer to the i8272 data sheet for information on the |
|||
command and result bytes. |
|||
|
|||
Note that the sense interrupt command can return a non-OK |
|||
result. This is completely normal in some cases. It is |
|||
necessary to "poll" the drive for seek status using sense |
|||
interrupt. If there is nothing to report, then the result |
|||
will be INVALID COMMAND. Additionally, during a recalibrate |
|||
operation, it may be necessary to issue the command twice |
|||
because the command will only step the drive 77 times looking |
|||
for track 0, but the head may be up to 80 tracks away. In |
|||
this case, the first recalibrate fails, but the second should |
|||
succeed. Here is what this would look like if trace is turned |
|||
on: |
|||
|
|||
RECALIBRATE: 07 01 --> <EMPTY> [OK] |
|||
SENSE INTERRUPT: 08 --> 80 [INVALID COMMAND] |
|||
... |
|||
... |
|||
... |
|||
SENSE INTERRUPT: 08 --> 80 [INVALID COMMAND] |
|||
SENSE INTERRUPT: 08 --> 71 00 [ABNORMAL TERMINATION] |
|||
RECALIBRATE: 07 01 --> <EMPTY> [OK] |
|||
SENSE INTERRUPT: 08 --> 21 00 [OK] |
|||
|
|||
Another example is when the FDC has just been reset. In this |
|||
case, you will see up to 4 disk change errors. Again these |
|||
are not a real problem and to be expected. |
|||
|
|||
When tracing is turned off, the application tries to be |
|||
intelligent about error reporting. The specific errors from |
|||
sense interrupt documented above will be suppressed because |
|||
they are not a real problem. All other errors will be |
|||
displayed. |
|||
|
|||
Error Handling |
|||
-------------- |
|||
|
|||
There is no automated error retry logic. This is very |
|||
intentional since the point is to expose the controller and |
|||
drive activity. Any error detected will result in a prompt to |
|||
abort, retry, or continue. Note that some number of errors is |
|||
considered normal for this technology. An occasional error |
|||
would not necessarily be considered a problem. |
|||
|
|||
CPU Speed |
|||
--------- |
|||
|
|||
Starting with v5.0, the application adjusts it's timing loops |
|||
to the actual system CPU speed by querying the BIOS for the |
|||
current CPU speed. |
|||
|
|||
Interleave |
|||
---------- |
|||
|
|||
The format command now allows the specification of a sector |
|||
interleave. It is almost always the case that the optimal |
|||
interleave will be 2 (meaning 2:1). |
|||
|
|||
360K Media |
|||
---------- |
|||
|
|||
The 360K media definition should work well for true 360K |
|||
drives. However, it will generally not work with 1.2M |
|||
drives. This is because these drives spin at 360RPM instead |
|||
of the 300RPM speed of true 360K drives. Additionally, 1.2M |
|||
drives are 80 tracks and 360K drives are 40 tracks and, so |
|||
far, there is no mechanism in FD to "double step" as a way to |
|||
use 40 track media in 80 track drives. |
|||
|
|||
With this said, it is possible to configure some 1.2M 5.25" |
|||
drives to automatically spin down to 300RPM based on a density |
|||
select signal (DENSEL). This signal is asserted by FD for |
|||
360K media, so IF you have configured your drive to react to |
|||
this signal correctly, you will be able to use the 360K media |
|||
defintion. Most 1.2M 5.25" drives are NOT configured this way |
|||
by default. TEAC drives are generally easy to modify and have |
|||
been tested by the author and do work in this manner. Note |
|||
that this does not address the issue of double stepping above; |
|||
you will just be using the first 40 of 80 tracks. |
|||
|
|||
Support |
|||
------- |
|||
|
|||
I am happy to answer questions as fast and well as I am able. |
|||
Best contact is wwarthen@gmail.com or post something on the |
|||
RetroBrew Computers Forum |
|||
https://www.retrobrewcomputers.org/forum/. |
|||
|
|||
Changes |
|||
------- |
|||
|
|||
WW 8/12/2011 |
|||
|
|||
Removed call to pulse TC in the FDC initialization after |
|||
determining that it periodically caused the FDC to write bad |
|||
sectors. I am mystified by this, but definitely found it to |
|||
be true. Will revisit at some point -- probably a timing |
|||
issue between puslsing TC and whatever happens next. |
|||
|
|||
Non-DMA mode was being set incorrectly for FAST-DMA mode. It |
|||
was set for non-DMA even though we were doing DMA. It is |
|||
interesting that it worked fine anyway. Fixed it anyway. |
|||
|
|||
DIO_SETMEDIA was not clearing DCD_DSKRDY as it should. Fixed. |
|||
|
|||
WW 8/26/2011: v1.1 |
|||
|
|||
Added support for Zeta. Note that INT/WAIT and DRQ/WAIT are |
|||
not available on Zeta. Note that Zeta provides the ability to |
|||
perform a reset of the FDC independent of a full CPU reset. |
|||
This is VERY useful and the FDC is reset anytime a drive reset |
|||
is required. |
|||
|
|||
Added INT/WAIT support. |
|||
|
|||
WW 8/28/2011: V1.2 |
|||
|
|||
All changes in this version are Zeta specific. Fixed FDC |
|||
reset logic and motor status display for Zeta (code from |
|||
Sergey). |
|||
|
|||
Modified Zeta disk change display to include it in the command |
|||
output line. This makes more sense because a command must be |
|||
issued to select the desired drive first. You can use the |
|||
SENSE INT command id you want to check the disk change value |
|||
at any time. It will also be displayed with any other command |
|||
output display. |
|||
|
|||
WW 9/1/2011: V1.3 |
|||
|
|||
Added CPUFREQ configuration setting to tune delays based on |
|||
cpu speed. The build app is set for 8MHz which also seems to |
|||
work well for 4MHz CPU's. Faster CPU speeds will probably |
|||
require tuning this setting. |
|||
|
|||
WW 9/5/2011: V1.4 |
|||
|
|||
Changed the polling execution routines to utilize CPUFREQ |
|||
variable to optimize timeout counter. Most importantly, this |
|||
should allow the use of faster CPUs (like 20MHz). |
|||
|
|||
WW 9/19/2011: V1.5 |
|||
|
|||
Zeta changes only. Added a call to FDC RESET after any |
|||
command failure. This solves an issue where the drive remains |
|||
selected if a command error occurs. Also added FDC RESET to |
|||
FDC CONTROL menu. |
|||
|
|||
WW 10/7/2011: V2.0 |
|||
|
|||
Added support for DIDE. Only supports polling IO and it does |
|||
not appear any other modes are possible given the hardware |
|||
constraints. |
|||
|
|||
WW 10/13/2011: V2.1 |
|||
|
|||
Modified to support N8. N8 is essentially identical to Dual |
|||
IDE. The only real change is the IO addresses. In theory, I |
|||
should be able to support true DMA on N8 and will work on that. |
|||
|
|||
WW 10/20/2011: v2.2 |
|||
|
|||
I had some problems with the results being read were sometimes |
|||
missing a byte. Fixed this by taking a more strict approach |
|||
to watching the MSR for the exact bits that are expected. |
|||
|
|||
WW 10/22/2011: V2.3 |
|||
|
|||
After spending a few days trying to track down an intermittent |
|||
data corruption issue with my Dual IDE board, I added a verify |
|||
function. This helped me isolate the problem very nicely |
|||
(turned out to be interference from the bus monitor). |
|||
|
|||
WW 11/25/2011: V2.4 |
|||
|
|||
Preliminary support for DISKIO V3. Basically just assumed |
|||
that it operates just like the Zeta. Needs to be verified |
|||
with real hardware as soon as I can. |
|||
|
|||
WW 1/9/2012: V2.5 |
|||
|
|||
Modified program termination to use CP/M reset call so that a |
|||
warm start is done and all drives are logged out. This is |
|||
important because media may have been formatted during the |
|||
program execution. |
|||
|
|||
WW 2/6/2012: v2.6 |
|||
|
|||
Added support for 5.25" drives as tested by Sergio. |
|||
|
|||
WW 4/5/2012: v2.7 |
|||
|
|||
Added support for 8" drives as tested by Jim Harre. |
|||
|
|||
WW 4/6/2012: v2.7a |
|||
|
|||
Fixed issue with media selection menu to remove duplicate |
|||
entries. |
|||
|
|||
WW 4/8/2012: v2.7b |
|||
|
|||
Corrected the handling of the density select signal. |
|||
|
|||
WW 5/22/2012: v2.8 |
|||
|
|||
Added new media definitions (5.25", 320K). |
|||
|
|||
WW 6/1/2012: v2.9 |
|||
|
|||
Added interleave capability on format. |
|||
|
|||
WW 6/5/2012: v3.0 |
|||
|
|||
Documentation cleanup. |
|||
|
|||
WW 7/1/2012: v3.1 |
|||
|
|||
Modified head load time (HLT) for 8" media based on YD-180 |
|||
spec. Now set to 50ms. |
|||
|
|||
WW 6/17/2013: v3.2 |
|||
|
|||
Cleaned up SRT, HLT, and HUT values. |
|||
|
|||
SK 2/10/2015: v3.3 |
|||
|
|||
Added Zeta SBC v2 support (Sergey Kiselev) |
|||
|
|||
WW 3/25/2015: v4.0 |
|||
|
|||
Renamed from FDTST --> FD |
|||
|
|||
WW 9/2/2017: v5.0 |
|||
|
|||
Renamed from FD to FDU. |
|||
Added runtime selection of FDC hardware. |
|||
Added runtime timing adjustment. |
|||
|
|||
WW 12/16/2017: v5.1 |
|||
|
|||
Improved polling version of read/write to fix occasional overrun errors. |
|||
|
|||
WW 1/8/2018: v5.2 |
|||
|
|||
Added support for RCBus hardware: |
|||
- Scott Baker SMC 9266 FDC module |
|||
- Scott Baker WDC 37C65 FDC module |
|||
|
|||
WW 9/5/2018: v5.3 |
|||
- Removed use of pulsing TC to end R/W operations after one sector and |
|||
instead set EOT = R (sector number) so that after desired sector is |
|||
read, R/W stops with end of cylinder error which is a documented |
|||
method for controling number of sectors R/W. This specific termination |
|||
condition is no longer considered an error, but a successful end of |
|||
operation. |
|||
- Added support for SmallZ80 |
|||
|
|||
WW 1/5/2020: v5.4 |
|||
- Added support for Dyno (based on work by Steve Garcia) |
|||
|
|||
WW 4/29/2020: v5.5 |
|||
- Added support for Etched Pixels FDC |
|||
|
|||
WW 12/12/2020: v5.6 |
|||
- Updated SmallZ80 support for new I/O map |
|||
|
|||
WW 3/24/2021: v5.7 |
|||
- Added support for a few single-sided formats |
|||
|
|||
WW 7/26/2021: v5.8 |
|||
- Added support for Nhyodyne (MBC) FDC |
|||
|
|||
WW 12/10/2023: v5.9 |
|||
- Added support for Duodyne (DUO) FDC |
|||
@ -1,214 +0,0 @@ |
|||
;=============================================================================== |
|||
; FORMAT - DISK FORMAT UTILITY FOR ROMWBW ADAPTATION OF CP/M 2.2 |
|||
;=============================================================================== |
|||
; |
|||
; AUTHOR: WAYNE WARTHEN (wwarthen@gmail.com) |
|||
;_______________________________________________________________________________ |
|||
; |
|||
; Usage: |
|||
; FORMAT D: |
|||
; ex: FORMAT (display version and usage) |
|||
; FORMAT /? (display version and usage) |
|||
; FORMAT C: (format drive C:) |
|||
;_______________________________________________________________________________ |
|||
; |
|||
; Change Log: |
|||
;_______________________________________________________________________________ |
|||
; |
|||
; ToDo: |
|||
; 1) Actually implement this |
|||
;_______________________________________________________________________________ |
|||
; |
|||
;=============================================================================== |
|||
; Definitions |
|||
;=============================================================================== |
|||
; |
|||
stksiz .equ $40 ; Working stack size |
|||
; |
|||
restart .equ $0000 ; CP/M restart vector |
|||
bdos .equ $0005 ; BDOS invocation vector |
|||
;; |
|||
;stamp .equ $40 ; loc of RomWBW CBIOS zero page stamp |
|||
; |
|||
rmj .equ 3 ; CBIOS version - major |
|||
rmn .equ 0 ; CBIOS version - minor |
|||
; |
|||
;=============================================================================== |
|||
; Code Section |
|||
;=============================================================================== |
|||
; |
|||
; |
|||
.org $100 |
|||
; |
|||
; setup stack (save old value) |
|||
ld (stksav),sp ; save stack |
|||
ld sp,stack ; set new stack |
|||
; |
|||
; initialization |
|||
call init ; initialize |
|||
jr nz,exit ; abort if init fails |
|||
; |
|||
; do the real work |
|||
call process ; parse and process command line |
|||
jr nz,exit ; done if error or no action |
|||
; |
|||
exit: ; clean up and return to command processor |
|||
call crlf ; formatting |
|||
ld sp,(stksav) ; restore stack |
|||
jp restart ; return to CP/M via restart |
|||
ret ; return to CP/M w/o restart |
|||
; |
|||
; Initialization |
|||
; |
|||
init: |
|||
; |
|||
; locate start of cbios (function jump table) |
|||
ld hl,(restart+1) ; load address of CP/M restart vector |
|||
ld de,-3 ; adjustment for start of table |
|||
add hl,de ; HL now has start of table |
|||
ld (bioloc),hl ; save it |
|||
; |
|||
; check for UNA (UBIOS) |
|||
ld a,($FFFD) ; fixed location of UNA API vector |
|||
cp $C3 ; jp instruction? |
|||
jr nz,initx ; if not, not UNA |
|||
ld hl,($FFFE) ; get jp address |
|||
ld a,(hl) ; get byte at target address |
|||
cp $FD ; first byte of UNA push ix instruction |
|||
jr nz,initx ; if not, not UNA |
|||
inc hl ; point to next byte |
|||
ld a,(hl) ; get next byte |
|||
cp $E5 ; second byte of UNA push ix instruction |
|||
jr nz,initx ; if not, not UNA |
|||
ld hl,unamod ; point to UNA mode flag |
|||
ld (hl),$FF ; set UNA mode flag |
|||
; |
|||
initx: |
|||
; |
|||
xor a |
|||
ret |
|||
; |
|||
; Process command line |
|||
; |
|||
process: |
|||
jr usage |
|||
; |
|||
xor a |
|||
ret |
|||
; |
|||
usage: |
|||
; |
|||
call crlf ; formatting |
|||
ld de,msgban1 ; point to version message part 1 |
|||
call prtstr ; print it |
|||
ld a,(unamod) ; get UNA flag |
|||
or a ; set flags |
|||
ld de,msghb ; point to HBIOS mode message |
|||
call z,prtstr ; if not UNA, say so |
|||
ld de,msgub ; point to UBIOS mode message |
|||
call nz,prtstr ; if UNA, say so |
|||
call crlf ; formatting |
|||
ld de,msgban2 ; point to version message part 2 |
|||
call prtstr ; print it |
|||
call crlf2 ; blank line |
|||
ld de,msguse ; point to usage message |
|||
call prtstr ; print it |
|||
xor a ; signal success |
|||
ret ; and return |
|||
; |
|||
; Print character in A without destroying any registers |
|||
; |
|||
prtchr: |
|||
push bc ; save registers |
|||
push de |
|||
push hl |
|||
ld e,a ; character to print in E |
|||
ld c,$02 ; BDOS function to output a character |
|||
call bdos ; do it |
|||
pop hl ; restore registers |
|||
pop de |
|||
pop bc |
|||
ret |
|||
; |
|||
; Print a zero terminated string at (HL) without destroying any registers |
|||
; |
|||
prtstr: |
|||
push de |
|||
; |
|||
prtstr1: |
|||
ld a,(de) ; get next char |
|||
or a |
|||
jr z,prtstr2 |
|||
call prtchr |
|||
inc de |
|||
jr prtstr1 |
|||
; |
|||
prtstr2: |
|||
pop de ; restore registers |
|||
ret |
|||
; |
|||
; Start a new line |
|||
; |
|||
crlf2: |
|||
call crlf ; two of them |
|||
crlf: |
|||
push af ; preserve AF |
|||
ld a,13 ; <CR> |
|||
call prtchr ; print it |
|||
ld a,10 ; <LF> |
|||
call prtchr ; print it |
|||
pop af ; restore AF |
|||
ret |
|||
; |
|||
; Invoke CBIOS function |
|||
; The CBIOS function offset must be stored in the byte |
|||
; following the call instruction. ex: |
|||
; call cbios |
|||
; .db $0C ; offset of CONOUT CBIOS function |
|||
; |
|||
cbios: |
|||
ex (sp),hl |
|||
ld a,(hl) ; get the function offset |
|||
inc hl ; point past value following call instruction |
|||
ex (sp),hl ; put address back at top of stack and recover HL |
|||
ld hl,(bioloc) ; address of CBIOS function table to HL |
|||
call addhl ; determine specific function address |
|||
jp (hl) ; invoke CBIOS |
|||
; |
|||
; Add the value in A to HL (HL := HL + A) |
|||
; |
|||
addhl: |
|||
add a,l ; A := A + L |
|||
ld l,a ; Put result back in L |
|||
ret nc ; if no carry, we are done |
|||
inc h ; if carry, increment H |
|||
ret ; and return |
|||
; |
|||
; Jump indirect to address in HL |
|||
; |
|||
jphl: |
|||
jp (hl) |
|||
; |
|||
;=============================================================================== |
|||
; Storage Section |
|||
;=============================================================================== |
|||
; |
|||
bioloc .dw 0 ; CBIOS starting address |
|||
; |
|||
unamod .db 0 ; $FF indicates UNA UBIOS active |
|||
; |
|||
stksav .dw 0 ; stack pointer saved at start |
|||
.fill stksiz,0 ; stack |
|||
stack .equ $ ; stack top |
|||
; |
|||
msgban1 .db "FORMAT v0.1a for RomWBW CP/M 2.2, 02-Sep-2017",0 |
|||
msghb .db " (HBIOS Mode)",0 |
|||
msgub .db " (UBIOS Mode)",0 |
|||
msgban2 .db "Copyright (C) 2017, Wayne Warthen, GNU GPL v3",0 |
|||
msguse .db "FORMAT command is not yet implemented!",13,10,13,10 |
|||
.db "Use FDU command to physically format floppy diskettes",13,10 |
|||
.db "Use CLRDIR command to (re)initialize directories",13,10 |
|||
.db "Use SYSCOPY command to make disks bootable",13,10 |
|||
.db "Use FDISK80 command to partition mass storage media",0 |
|||
; |
|||
.end |
|||
@ -0,0 +1,14 @@ |
|||
@echo off |
|||
setlocal |
|||
|
|||
set TOOLS=../../../Tools |
|||
set PATH=%TOOLS%\tasm32;%PATH% |
|||
set TASMTABS=%TOOLS%\tasm32 |
|||
|
|||
echo Building HTalk... |
|||
tasm -t80 -g3 -fFF htalk.asm htalk.com %htalk.lst || exit /b |
|||
|
|||
copy /Y htalk.com ..\..\..\Binary\Apps\ || exit /b |
|||
rem copy /Y *.ovr ..\..\..\Binary\Apps\ || exit /b |
|||
rem copy /Y *.hlp ..\..\..\Binary\Apps\ || exit /b |
|||
rem copy /Y *.doc ..\..\..\Binary\Apps\ || exit /b |
|||
@ -0,0 +1,5 @@ |
|||
@echo off |
|||
setlocal |
|||
|
|||
if exist *.com del *.com |
|||
if exist *.lst del *.lst |
|||
@ -0,0 +1,10 @@ |
|||
OBJECTS = htalk.com |
|||
#DOCS = htalk.txt
|
|||
DEST = ../../../Binary/Apps |
|||
DOCDEST = ../../../Binary/Apps |
|||
TOOLS = ../../../Tools |
|||
include $(TOOLS)/Makefile.inc |
|||
|
|||
%.com: USETASM=1 |
|||
|
|||
|
|||
@ -0,0 +1,725 @@ |
|||
;=============================================================================== |
|||
;HTALK - BARE MINIMUM TERMINAL INTERFACE |
|||
; |
|||
; CONSOLE TALKS TO ARBITRARY CHARACTER DEVICE. |
|||
;=============================================================================== |
|||
; |
|||
; AUTHOR: TOM PLANO (TOMPLANO@PROTON.ME) |
|||
; |
|||
; USAGE: |
|||
; HTALK $<CHAR_DEVICE_NUM> |
|||
; |
|||
;_______________________________________________________________________________ |
|||
; |
|||
; CHANGE LOG: |
|||
; I'VE NOTATED SECTIONS OF CODE THAT ARNT REQUIRED IF THIS APP IS |
|||
; INCORPORATED INTO DBGMOD WITH A <OPT> TAG |
|||
; |
|||
;_______________________________________________________________________________ |
|||
; |
|||
; TODO: |
|||
; SEE ENUM_DEV1 TODO |
|||
; |
|||
; |
|||
;_______________________________________________________________________________ |
|||
; |
|||
;=============================================================================== |
|||
; DEFINITIONS |
|||
;=============================================================================== |
|||
; |
|||
STKSIZ .EQU $FF |
|||
; |
|||
; HBIOS SYSTEM CALLS AND ID STRING ADDRESS |
|||
; |
|||
ROMWBW_ID .EQU $FFFE ; ROMWBW ID STRING ADDRESS |
|||
HBIOS_SYS .EQU $FFF0 ; HBIOS SYSCALL ADDRESS |
|||
|
|||
H_SYSGET .EQU $F8 ; GET SYSTEM INFO |
|||
H_CIOCNT .EQU $00 ; GET CHAR DEV COUNT SUBFUNCTION |
|||
|
|||
BF_CIOIN .EQU $00 ; HBIOS CHAR INPUT |
|||
BF_CIOOUT .EQU $01 ; HBIOS CHAR OUTPUT |
|||
BF_CIOIST .EQU $02 ; HBIOS CHAR INPUT STATUS |
|||
BF_CIOOST .EQU $03 ; HBIOS CHAR OUTPUT STATUS |
|||
BF_CIOINIT .EQU $04 ; HBIOS CHAR I/O INIT |
|||
BF_CIOQUERY .EQU $05 ; HBIOS CHAR I/O QUERY |
|||
BF_CIODEVICE .EQU $06 ; HBIOS CHAR I/O DEVICE |
|||
; |
|||
; SUPPORTED HBIOS CIO DEVICE TYPES |
|||
; |
|||
CIODEV_UART .EQU $00 ; 16C550 FAMILY SERIAL INTERFACE UART.ASM |
|||
CIODEV_ASCI .EQU $10 ; Z180 BUILT-IN SERIAL PORTS ASCI.ASM |
|||
CIODEV_TERM .EQU $20 ; TERMINAL ANSI.ASM |
|||
CIODEV_PRPCON .EQU $30 ; PROPIO SERIAL CONSOLE INTERFACE PRP.ASM |
|||
CIODEV_PPPCON .EQU $40 ; PARPORTPROP SERIAL CONSOLE INTERFACE PPP.ASM |
|||
CIODEV_SIO .EQU $50 ; ZILOG SERIAL PORT INTERFACE SIO.ASM |
|||
CIODEV_ACIA .EQU $60 ; MC68B50 ASYNCHRONOUS INTERFACE ACIA.ASM |
|||
CIODEV_PIO .EQU $70 ; ZILOG PARALLEL INTERFACE CONTROLLER PIO.ASM |
|||
CIODEV_UF .EQU $80 ; FT232H-BASED ECB USB FIFO UF.ASM |
|||
CIODEV_DUART .EQU $90 ; SCC2681 FAMILY DUAL UART DUART.ASM |
|||
CIODEV_Z2U .EQU $A0 ; ZILOG Z280 BUILT-IN SERIAL PORTS Z2U.ASM |
|||
CIODEV_LPT .EQU $B0 ; PARALLEL I/O CONTROLLER LPT.ASM |
|||
|
|||
; HBIOS CURRENT CONSOLE NUMBER |
|||
CIO_CONSOLE .EQU $80 |
|||
|
|||
; SPECIAL CHARS |
|||
CTRLC .EQU $03 |
|||
CHR_BEL .EQU $07 |
|||
CHR_CR .EQU $0D |
|||
CHR_LF .EQU $0A |
|||
CHR_BS .EQU $08 |
|||
CHR_ESC .EQU $1B |
|||
CHR_DEL .EQU $7F |
|||
|
|||
; |
|||
;=============================================================================== |
|||
; BEGIN MAIN PROGRAM |
|||
;=============================================================================== |
|||
; |
|||
.ORG $0100 |
|||
; |
|||
; SETUP STACK (SAVE OLD VALUE) |
|||
; <OPT> HANDLED BY DBGMON |
|||
LD (STKSAV),SP |
|||
LD SP,STACK |
|||
|
|||
|
|||
; |
|||
; INITIALIZATION + STARTUP MESSAGE + HBIOS DETECT |
|||
; <OPT> HANDLED BY DBGMON |
|||
CALL INIT_PROG |
|||
JP NZ,EXIT |
|||
; |
|||
; LIST HBIOS DEV OPTIONS FOR REFERENCE |
|||
; ALSO GETS MAX CONN |
|||
; |
|||
; <OPT> THIS IS OPTIONAL BECAUSE IF A CHAR DEVICE DOESNT EXIST, WE NEVER READ OR |
|||
; WRITE TO IT, WE SIMPLY CALL CIOIST AND CIOOST OVER AND OVER ON IT, WITHOUT |
|||
; EVER PUSHING DATA TO IT |
|||
CALL ENUM_DEV |
|||
JP NZ,EXIT |
|||
; |
|||
; PARSE COMMAND LINE |
|||
; |
|||
CALL PARSE |
|||
JP NZ,EXIT |
|||
; |
|||
; RUN CONVERSTION WITH CHAR DEVICE |
|||
; |
|||
CALL TALK |
|||
; |
|||
; DONE |
|||
JP EXIT |
|||
|
|||
|
|||
; |
|||
; CLEAN UP AND RETURN TO CALLING PROCESS |
|||
; |
|||
EXIT: |
|||
CALL NEWLINE ; ... |
|||
LD HL,STR_EXITMSG ; LOAD EXIT STRING |
|||
CALL PRTSTR ; PRINT IT |
|||
CALL NEWLINE ; ... |
|||
LD SP,(STKSAV) ; RESET STACK |
|||
RET ; RETURN TO CALLER |
|||
|
|||
|
|||
; |
|||
;=============================================================================== |
|||
; END MAIN PROGRAM |
|||
;=============================================================================== |
|||
; |
|||
|
|||
; |
|||
;=============================================================================== |
|||
; BEGIN MAIN PROGRAM SUBROUTINES |
|||
;=============================================================================== |
|||
; |
|||
|
|||
INIT_PROG: |
|||
LD HL, STR_BANNER ; LOAD WELCOME BANNER |
|||
CALL PRTSTR ; PRINT IT |
|||
CALL NEWLINE ; ... |
|||
LD HL,(ROMWBW_ID) ; GET FIRST BYTE OF ROMWBW MARKER |
|||
LD A,(HL) ; ... THROUGH HL |
|||
CP 'W' ; MATCH? |
|||
JP NZ,NOTHBIOS ; ABORT WITH INVALID CONFIG BLOCK |
|||
INC HL ; NEXT BYTE (MARKER BYTE 2) |
|||
LD A,(HL) ; LOAD IT |
|||
CP ~'W' ; MATCH? |
|||
JP NZ,NOTHBIOS ; ABORT WITH INVALID CONFIG BLOCK |
|||
LD HL,STR_HBIOS ; POINT TO HBIOS STR |
|||
CALL PRTSTR ; PRINT IT |
|||
CALL NEWLINE ; ... |
|||
RET |
|||
; |
|||
; HBOIS NOT DETECTED, BAIL OUT W/ ERROR |
|||
; |
|||
NOTHBIOS: |
|||
LD HL,STR_BIOERR ; LOAD HBIOS NOT FOUND STR |
|||
CALL PRTSTR ; PRINT IT |
|||
CALL NEWLINE ; ... |
|||
AND $FF ; SET FLAGS |
|||
RET |
|||
|
|||
ENUM_DEV: |
|||
; |
|||
; CHAR COUNT HEADER |
|||
; |
|||
LD HL,STR_DEVS_FOUND |
|||
CALL PRTSTR |
|||
; |
|||
;GET COUNT OF CHAR UNITS |
|||
; |
|||
LD B,H_SYSGET ; LOAD SYSGET HBIOS FUNCTION |
|||
LD C,H_CIOCNT ; LOAD SYSGET CHAR DEV COUNT SUBFUNCTION |
|||
CALL HBIOS_SYS ; JUMP TO HBIOS |
|||
OR A ; SET FLAGS |
|||
JP NZ, EXIT ; JUMP TO EXIT ON FAILED |
|||
LD A,E ; NUM CHAR DEVICES NOW IN A |
|||
|
|||
DEC A ; DEC NUM DEVICES TO BE 0 INDEXED |
|||
LD (CIODEV_CNT), A ; STORE BEFORE PRINT |
|||
LD (CIODEV_MAX), A ; STORE BEFORE PRINT |
|||
INC A ; RESTORE NUM DEVICES VALUE |
|||
|
|||
CALL PRTHEX ; PRINT NUMBER OF UNITS FOUND |
|||
CALL NEWLINE ; ... |
|||
|
|||
ENUM_DEV1: |
|||
|
|||
LD IX, TGT_DEV |
|||
; TODO: H AND L DONT ALWAYS GET SET BY THE DRIVERS. FIND SOME WAY TO MASK |
|||
; THEM OUT IF THEY ARE THE SAME BEFORE AND AFTER THE CALL? |
|||
LD B, BF_CIODEVICE ; LOAD HBIOS FUNCTION TO QUERRY DEVICE INFO |
|||
LD HL, CIODEV_CNT ; REQUEST A CHAR DEVICE |
|||
LD C, (HL) ; ... |
|||
LD (IX), C ; REMEMBER WHAT DEVICE WE ASKED FOR BEFORE BE |
|||
CALL HBIOS_SYS ; EXECUTE HBIOS SUBROUTINE |
|||
OR A ; SET FLAGS |
|||
RET NZ ; RETURN FAILED |
|||
; |
|||
; STORE RESULTS OF HBOIS DEVICE QUERRY |
|||
; |
|||
LD A,C ; MOVE C TO A |
|||
LD (IX+1), A ; STORE A DEVICE ATTRIBUTES, SKIP FIRST ENTRY |
|||
LD A,D |
|||
LD (IX+2), A |
|||
LD A,E |
|||
LD (IX+3), A |
|||
LD A,H |
|||
LD (IX+4), A |
|||
LD A,L |
|||
LD (IX+5), A |
|||
; |
|||
; PRINT FORMATED DATA LOOP |
|||
; |
|||
LD B, $06 ; PRINT THE 5 ELEMENTS OF DEV_STR_TBL |
|||
LD HL,DEV_STR_TBL ; TABLE BASE PTR |
|||
|
|||
PLOOP_BASE: |
|||
CALL PRTSTR ; PTRSTR INCREMENTS HL FOR US |
|||
LD A, (IX) |
|||
CALL PRTHEX |
|||
LD A, '|' |
|||
CALL COUT |
|||
INC IX |
|||
DJNZ PLOOP_BASE |
|||
|
|||
CALL NEWLINE |
|||
|
|||
LD A, (CIODEV_CNT) |
|||
DEC A |
|||
LD (CIODEV_CNT), A |
|||
JP P, ENUM_DEV1 ; JUMP WHILE CIODEV_CNT >=0 |
|||
AND $00 |
|||
RET |
|||
|
|||
|
|||
; |
|||
; RUN CONVERSTION WITH CHAR DEVICE |
|||
; |
|||
TALK: |
|||
; |
|||
; INIT PING PONG DEVICE POINTERS |
|||
; |
|||
LD IX, USER_CON ; LOAD VALUE AT ADDR USER_CON |
|||
LD A, (IX) ; LOAD VALUE AT ADDR USER_CON |
|||
LD (RF_DEV), A ; STORE TO ADDR RF_DEV |
|||
LD A, (IX+1) ; LOAD VALUE AT ADDR TARGET_CON |
|||
LD (WT_DEV), A ; STORE TO ADDR WT_DEV |
|||
; |
|||
; READ FROM RF_DEV -> WRITE TO WT_DEV |
|||
; |
|||
TALK_LOOP: |
|||
; |
|||
; CHECK FOR DATA ON RF_DEV |
|||
; |
|||
LD B,BF_CIOIST ; SET HBIOS FUNCTION TO RUN |
|||
LD HL, RF_DEV |
|||
LD C,(HL) |
|||
CALL HBIOS_SYS ; CHECK FOR CHAR PENDING ON INPUT BUFFER USING HBIOS |
|||
OR A ; SET FLAGS |
|||
JP Z,TALK_NEXT ; JUMP NO CHARACTERS READY |
|||
JP M,TALK_NEXT ; JUMP ERROR ON READ |
|||
; |
|||
; EXEC READ FROM RF_DEV |
|||
; |
|||
LD B,BF_CIOIN ; SET FUNCTION TO RUN |
|||
LD HL, RF_DEV |
|||
LD C,(HL) ; RETRIEVE CON_DEV_NUM TO READ/WRITE FROM ACTIVE CONSOLE |
|||
CALL HBIOS_SYS ; CHECK FOR CHAR PENDING USING HBIOS |
|||
LD A,E ; MOVE RESULT TO A |
|||
CP CTRLC ; CHECK FOR EXIT REQUEST (CTRL+C) |
|||
RET Z ; IF SO, BAIL OUT |
|||
PUSH AF ; SAVE THE CHAR WE READ |
|||
; |
|||
; CHECK FOR SPACE ON WT_DEV |
|||
; |
|||
LD B,BF_CIOOST ; SET HBIOS FUNCTION TO RUN |
|||
LD HL, WT_DEV |
|||
LD C,(HL) |
|||
CALL HBIOS_SYS ; CHECK FOR SPACE IN OUTPUT BUFFER USING HBIOS |
|||
|
|||
OR A ; 0 OR 1 IS A VALID RETURN |
|||
JP Z,TALK_NEXT ; JUMP NO SPACE |
|||
JP M,TALK_NEXT ; JUMP ERROR ON WRITE |
|||
; |
|||
; EXEC WRITE TO WT_DEV |
|||
; |
|||
LD B,BF_CIOOUT ; SET HBIOS FUNCTION TO RUN |
|||
LD HL, WT_DEV |
|||
LD C,(HL) ; RETRIEVE TGT_DEV_NUM TO READ/WRITE FROM TARGET CHAR DEVICE |
|||
; |
|||
POP AF ; RECOVER THE CHARACTER |
|||
LD E,A ; MOVE CHARACTER TO E |
|||
CALL HBIOS_SYS ; WRITE CHAR USING HBIOS |
|||
|
|||
TALK_NEXT: |
|||
; |
|||
; SWAP RF_DEV AND WT_DEV |
|||
; |
|||
LD IX, RF_DEV ; LOAD VALUE AT ADDR USER_CON |
|||
LD A, (IX) ; LOAD VALUE AT ADDR RF_DEV |
|||
LD B, (IX+1) ; LOAD VALUE AT ADDR WT_DEV |
|||
LD (IX+1), A ; STORE TO OLD RF_DEV TO ADDR WT_DEV |
|||
LD A, B ; MOVE OLD WT_DEV TO A |
|||
LD (IX), A ; STORE TO OLD WT_DEF TO ADDR RF_DEV |
|||
JP TALK_LOOP ; LOOP |
|||
|
|||
; |
|||
;=============================================================================== |
|||
; END MAIN PROGRAM SUBROUTINES |
|||
;=============================================================================== |
|||
; |
|||
|
|||
; |
|||
;=============================================================================== |
|||
; BEGIN ROUTINES THAT ARE NOT COMPATIBLE WITH DBGMON |
|||
;=============================================================================== |
|||
; |
|||
|
|||
|
|||
PARSE: |
|||
; |
|||
LD HL,$81 ; POINT TO START OF COMMAND TAIL (AFTER LENGTH BYTE) |
|||
CALL NONBLANK ; SKIP LEADING BLANKS, |
|||
CALL HEXBYTE |
|||
JP C,ERRHEXRD ; IF NOT, ERR |
|||
LD (TARGET_CON),A ; REQUESTED TARGET CONN |
|||
|
|||
LD B,A ; MOVE TO B |
|||
|
|||
LD HL,CIODEV_MAX ; GRAB MAX VALUE OF TARGETCON |
|||
LD A,(HL) |
|||
|
|||
CP B ; CHECK IF B<=A |
|||
JP M, ERROOR ; IF B>A, and both are less then 80 then S SET, ERR |
|||
JP C, ERROOR ; IF B> 80 carry set instead (signed numbers problem) |
|||
; swap A and B |
|||
|
|||
JP PE, ERROOR ; IF B>A, C SET, ERR |
|||
|
|||
LD HL, MSGTALKING ; PRINT TARGET DEVICE |
|||
CALL PRTSTR |
|||
LD A, B ; RETRIEVE TARGET CON |
|||
CALL PRTHEX |
|||
CALL NEWLINE |
|||
|
|||
AND $00 |
|||
RET |
|||
|
|||
|
|||
|
|||
; |
|||
;NOT COMPATIBLE WITH THE DBGMON FUNCTION OF THE SAME NAME |
|||
; |
|||
NONBLANK: |
|||
LD A,(HL) ; LOAD NEXT CHARACTER |
|||
OR A ; STRING ENDS WITH A NULL |
|||
RET Z ; IF NULL, RETURN POINTING TO NULL |
|||
CP ' ' ; CHECK FOR BLANK |
|||
RET NZ ; RETURN IF NOT BLANK |
|||
INC HL ; IF BLANK, INCREMENT CHARACTER POINTER |
|||
JR NONBLANK ; AND LOOP |
|||
|
|||
; |
|||
; |
|||
;=============================================================================== |
|||
; END ROUTINES THAT ARE NOT COMPATIBLE WITH DBGMON |
|||
;=============================================================================== |
|||
; |
|||
|
|||
|
|||
|
|||
|
|||
; |
|||
;=============================================================================== |
|||
; BEGIN ROUTINES THAT ARE LIFTED FROM DBGMON |
|||
;=============================================================================== |
|||
; |
|||
|
|||
|
|||
; |
|||
; PRINT THE VALUE IN A IN HEX WITHOUT DESTROYING ANY REGISTERS |
|||
; |
|||
PRTHEX: |
|||
PUSH DE ; SAVE DE |
|||
CALL HEXASCII ; CONVERT VALUE IN A TO HEX CHARS IN DE |
|||
LD A,D ; GET THE HIGH ORDER HEX CHAR |
|||
CALL COUT ; PRINT IT |
|||
LD A,E ; GET THE LOW ORDER HEX CHAR |
|||
CALL COUT ; PRINT IT |
|||
POP DE ; RESTORE DE |
|||
RET ; DONE |
|||
|
|||
; |
|||
; CONVERT BINARY VALUE IN A TO ASCII HEX CHARACTERS IN DE |
|||
; |
|||
|
|||
HEXASCII: |
|||
LD D,A ; SAVE A IN D |
|||
CALL HEXCONV ; CONVERT LOW NIBBLE OF A TO HEX |
|||
LD E,A ; SAVE IT IN E |
|||
LD A,D ; GET ORIGINAL VALUE BACK |
|||
RLCA ; ROTATE HIGH ORDER NIBBLE TO LOW BITS |
|||
RLCA |
|||
RLCA |
|||
RLCA |
|||
CALL HEXCONV ; CONVERT NIBBLE |
|||
LD D,A ; SAVE IT IN D |
|||
RET ; DONE |
|||
|
|||
; |
|||
; CONVERT LOW NIBBLE OF A TO ASCII HEX |
|||
; |
|||
HEXCONV: |
|||
AND $0F ; LOW NIBBLE ONLY |
|||
ADD A,$90 |
|||
DAA |
|||
ADC A,$40 |
|||
DAA |
|||
RET |
|||
; |
|||
|
|||
|
|||
; |
|||
; ADD THE VALUE IN A TO HL (HL := HL + A) |
|||
; |
|||
ADDHL: |
|||
ADD A,L ; A := A + L |
|||
LD L,A ; PUT RESULT BACK IN L |
|||
RET NC ; IF NO CARRY, WE ARE DONE |
|||
INC H ; IF CARRY, INCREMENT H |
|||
RET ; AND RETURN |
|||
|
|||
|
|||
; |
|||
;__________________________________________________________________________________________________ |
|||
; |
|||
; UTILITY PROCS TO PRINT SINGLE CHARACTERS WITHOUT TRASHING ANY REGISTERS |
|||
; |
|||
;__________________________________________________________________________________________________ |
|||
; |
|||
PC_SPACE: |
|||
PUSH AF |
|||
LD A,' ' |
|||
JR PC_PRTCHR |
|||
PC_COLON: |
|||
PUSH AF |
|||
LD A,':' |
|||
JR PC_PRTCHR |
|||
PC_CR: |
|||
PUSH AF |
|||
LD A,CHR_CR |
|||
JR PC_PRTCHR |
|||
|
|||
PC_LF: |
|||
PUSH AF |
|||
LD A,CHR_LF |
|||
JR PC_PRTCHR |
|||
|
|||
PC_PRTCHR: |
|||
CALL COUT |
|||
POP AF |
|||
RET |
|||
|
|||
NEWLINE2: |
|||
CALL NEWLINE |
|||
NEWLINE: |
|||
CALL PC_CR |
|||
CALL PC_LF |
|||
RET |
|||
|
|||
PRTSTR: |
|||
LD A,(HL) |
|||
INC HL |
|||
CP '$' |
|||
RET Z |
|||
CALL COUT |
|||
JR PRTSTR |
|||
|
|||
; |
|||
;__COUT_______________________________________________________________________ |
|||
; |
|||
; OUTPUT CHARACTER FROM A |
|||
;_____________________________________________________________________________ |
|||
; |
|||
COUT: |
|||
; SAVE ALL INCOMING REGISTERS |
|||
PUSH AF |
|||
PUSH BC |
|||
PUSH DE |
|||
PUSH HL |
|||
; |
|||
; OUTPUT CHARACTER TO CONSOLE VIA HBIOS |
|||
LD E,A ; OUTPUT CHAR TO E |
|||
LD C,CIO_CONSOLE ; CONSOLE UNIT TO C |
|||
LD B,BF_CIOOUT ; HBIOS FUNC: OUTPUT CHAR |
|||
CALL HBIOS_SYS ; HBIOS OUTPUTS CHARACTER |
|||
; |
|||
; RESTORE ALL REGISTERS |
|||
POP HL |
|||
POP DE |
|||
POP BC |
|||
POP AF |
|||
RET |
|||
; |
|||
;__CIN________________________________________________________________________ |
|||
; |
|||
; INPUT CHARACTER TO A |
|||
;_____________________________________________________________________________ |
|||
; |
|||
CIN: |
|||
; SAVE INCOMING REGISTERS (AF IS OUTPUT) |
|||
PUSH BC |
|||
PUSH DE |
|||
PUSH HL |
|||
; |
|||
; INPUT CHARACTER FROM CONSOLE VIA HBIOS |
|||
LD C,CIO_CONSOLE ; CONSOLE UNIT TO C |
|||
LD B,BF_CIOIN ; HBIOS FUNC: INPUT CHAR |
|||
CALL HBIOS_SYS ; HBIOS READS CHARACTER |
|||
LD A,E ; MOVE CHARACTER TO A FOR RETURN |
|||
; |
|||
; RESTORE REGISTERS (AF IS OUTPUT) |
|||
POP HL |
|||
POP DE |
|||
POP BC |
|||
RET |
|||
; |
|||
;__CST________________________________________________________________________ |
|||
; |
|||
; RETURN INPUT STATUS IN A (0 = NO CHAR, !=0 CHAR WAITING) |
|||
;_____________________________________________________________________________ |
|||
; |
|||
CST: |
|||
; SAVE INCOMING REGISTERS (AF IS OUTPUT) |
|||
PUSH BC |
|||
PUSH DE |
|||
PUSH HL |
|||
; |
|||
; GET CONSOLE INPUT STATUS VIA HBIOS |
|||
LD C,CIO_CONSOLE ; CONSOLE UNIT TO C |
|||
LD B,BF_CIOIST ; HBIOS FUNC: INPUT STATUS |
|||
CALL HBIOS_SYS ; HBIOS RETURNS STATUS IN A |
|||
; |
|||
; RESTORE REGISTERS (AF IS OUTPUT) |
|||
POP HL |
|||
POP DE |
|||
POP BC |
|||
RET |
|||
; |
|||
|
|||
|
|||
; |
|||
;__ISHEX______________________________________________________________________ |
|||
; |
|||
; CHECK BYTE AT (HL) FOR HEX CHAR, RET Z IF SO, ELSE NZ |
|||
;_____________________________________________________________________________ |
|||
; |
|||
ISHEX: |
|||
LD A,(HL) ; CHAR TO AS |
|||
CP '0' ; < '0'? |
|||
JR C,ISHEX1 ; YES, NOT 0-9, CHECK A-F |
|||
CP '9' + 1 ; > '9' |
|||
JR NC,ISHEX1 ; YES, NOT 0-9, CHECK A-F |
|||
XOR A ; MUST BE 0-9, SET ZF |
|||
RET ; AND DONE |
|||
ISHEX1: |
|||
CP 'A' ; < 'A'? |
|||
JR C,ISHEX2 ; YES, NOT A-F, FAIL |
|||
CP 'F' + 1 ; > 'F' |
|||
JR NC,ISHEX2 ; YES, NOT A-F, FAIL |
|||
XOR A ; MUST BE A-F, SET ZF |
|||
RET ; AND DONE |
|||
ISHEX2: |
|||
OR $FF ; CLEAR ZF |
|||
RET ; AND DONE |
|||
; |
|||
;__HEXBYTE____________________________________________________________________ |
|||
; |
|||
; GET ONE BYTE OF HEX DATA FROM BUFFER IN HL, RETURN IN A |
|||
;_____________________________________________________________________________ |
|||
; |
|||
HEXBYTE: |
|||
LD C,0 ; INIT WORKING VALUE |
|||
HEXBYTE1: |
|||
CALL ISHEX ; DO WE HAVE A HEX CHAR? |
|||
JR NZ,HEXBYTE3 ; IF NOT, WE ARE DONE |
|||
LD B,4 ; SHIFT WORKING VALUE (C := C * 16) |
|||
HEXBYTE2: |
|||
SLA C ; SHIFT ONE BIT |
|||
RET C ; RETURN W/ CF SET INDICATING OVERFLOW ERROR |
|||
DJNZ HEXBYTE2 ; LOOP FOR 4 BITS |
|||
CALL NIBL ; CONVERT HEX CHAR TO BINARY VALUE IN A & INC HL |
|||
OR C ; COMBINE WITH WORKING VALUE |
|||
LD C,A ; AND PUT BACK IN WORKING VALUE |
|||
JR HEXBYTE1 ; DO ANOTHER CHARACTER |
|||
HEXBYTE3: |
|||
LD A,C ; WORKING VALUE TO A |
|||
OR A ; CLEAR CARRY |
|||
RET |
|||
|
|||
; |
|||
;__NIBL_______________________________________________________________________ |
|||
; |
|||
; GET ONE BYTE OF HEX DATA FROM BUFFER IN HL, RETURN IN A |
|||
;_____________________________________________________________________________ |
|||
; |
|||
NIBL: |
|||
LD A,(HL) ; GET K B. DATA |
|||
INC HL ; INC KB POINTER |
|||
CP 40H ; TEST FOR ALPHA |
|||
JR NC,ALPH |
|||
AND 0FH ; GET THE BITS |
|||
RET |
|||
ALPH: |
|||
AND 0FH ; GET THE BITS |
|||
ADD A,09H ; MAKE IT HEX A-F |
|||
RET |
|||
|
|||
|
|||
; |
|||
;=============================================================================== |
|||
; END ROUTINES THAT ARE LIFTED FROM DBGMON |
|||
;=============================================================================== |
|||
; |
|||
|
|||
|
|||
|
|||
|
|||
; |
|||
;=============================================================================== |
|||
; ERROR RESPONCES |
|||
;=============================================================================== |
|||
; |
|||
|
|||
ERROOR: ; REQUESTED DEV OUT OF RANGE (SYNTAX) |
|||
CALL NEWLINE |
|||
LD A, 'R' |
|||
CALL COUT |
|||
LD HL,TARGET_CON |
|||
LD A,(HL) |
|||
CALL PRTHEX |
|||
|
|||
|
|||
LD A, ':' |
|||
CALL COUT |
|||
LD A, 'M' |
|||
CALL COUT |
|||
LD HL,CIODEV_MAX |
|||
LD A,(HL) |
|||
CALL PRTHEX |
|||
|
|||
LD HL,MSGOOR |
|||
JR ERROR |
|||
ERRHEXRD: ; COMMAND HEX READ ERROR (SYNTAX) |
|||
LD HL,MSGHEXRD |
|||
JR ERROR |
|||
ERRUSE: ; COMMAND USAGE ERROR (SYNTAX) |
|||
LD HL,MSGUSE |
|||
JR ERROR |
|||
ERRPRM: ; COMMAND PARAMETER ERROR (SYNTAX) |
|||
LD HL,MSGPRM |
|||
JR ERROR |
|||
ERROR: ; PRINT ERROR STRING AND RETURN ERROR SIGNAL |
|||
CALL NEWLINE ; PRINT NEWLINE |
|||
CALL PRTSTR ; PRINT ERROR STRING |
|||
OR $FF ; SIGNAL ERROR |
|||
RET ; DONE |
|||
|
|||
;=============================================================================== |
|||
; STORAGE SECTION |
|||
;=============================================================================== |
|||
; |
|||
|
|||
; CHAR DEV COUNT |
|||
CIODEV_CNT .DB $0 |
|||
CIODEV_MAX .DB $0 |
|||
|
|||
;TALK LOOP DATA, DEFAULT TO LOOPBACK |
|||
USER_CON .DB $80 |
|||
TARGET_CON .DB $80 |
|||
|
|||
; PING PONG POINTERS |
|||
RF_DEV .DB 0 |
|||
WT_DEV .DB 0 |
|||
|
|||
; TARGET CHARACTER DEVICE DATA |
|||
TGT_DEV: |
|||
.DB 0 ; HBIOS CHAR NUM |
|||
.DB 0 ; C: DEVICE ATTRIBUTES |
|||
.DB 0 ; D: DEVICE TYPE |
|||
.DB 0 ; E: DEVICE NUMBER |
|||
.DB 0 ; H: DEVICE MODE |
|||
.DB 0 ; L: DEVICE I/O BASE ADDRESS |
|||
|
|||
; STRING LITERALS |
|||
MSGUSE .TEXT "USAGE: HTALK <CIO_DEV_ID>$" |
|||
MSGPRM .TEXT "PARAMETER ERROR$" |
|||
MSGOOR .TEXT "CIO VAL TOO LARGE$" |
|||
MSGHEXRD .TEXT "HEX READ ERR$" |
|||
MSGTALKING .TEXT "CONNECTING TO CHAR:$" |
|||
|
|||
|
|||
DEV_STR_TBL: |
|||
.TEXT "CHAR:$" |
|||
.TEXT "ATTR:$" |
|||
.TEXT "TYPE:$" |
|||
.TEXT "NUMB:$" |
|||
.TEXT "MODE:$" |
|||
.TEXT "ADDR:$" |
|||
|
|||
STR_DEVS_FOUND .TEXT "NUM CHAR DEVICES FOUND - $" |
|||
STR_EXITMSG .TEXT "HTALK DONE$" |
|||
STR_BANNER .TEXT "HTALK V1.0 (CTRL-C TO EXIT)$" |
|||
STR_HBIOS .TEXT "HBIOS DETECTED$" |
|||
STR_BIOERR .TEXT "*** UNKNOWN BIOS - BAILING OUT ***$" |
|||
|
|||
STKSAV .DW 0 ; STACK POINTER SAVED AT START |
|||
.FILL STKSIZ,0 ; STACK |
|||
STACK .EQU $ ; STACK TOP |
|||
; |
|||
.END |
|||
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -1,725 +0,0 @@ |
|||
;***************************************; |
|||
; ; |
|||
; S U R V E Y ; |
|||
; ; |
|||
;***************************************; |
|||
|
|||
;By Michael Friese 9/22/79 |
|||
|
|||
|
|||
;* Lists Kbytes used and remaining plus number of files |
|||
; on all logged disks (up to 8) |
|||
;* Prints Memory map and synopsis of all machine memory |
|||
;* Lists all active I/O Ports |
|||
;* Uses disk allocation block for all disk calculations |
|||
; |
|||
;VERSION LIST - Most recent version first. |
|||
; |
|||
;16/Dec/17 - Handle 16-bit port addressing using |
|||
; Z80 IN A,(C) instruction. Wayne Warthen |
|||
; |
|||
;06/Jul/82 - Added Godbout DISK 1 equate and added SKIP equate |
|||
; Bill Bolton - Software Tools, Australia |
|||
; |
|||
;01/Jun/82 - Tidied up and fixed port display, added display |
|||
; of contents of low memory. David Bennett - Alfred |
|||
; Hospital, Australia |
|||
; |
|||
;29/Jun/80 - Added version number test and calculations for CP/M |
|||
; version 2 compatibility. This program should now work |
|||
; properly on all versions 1.4 and later. BRR |
|||
; |
|||
;28/Jun/80 - Added IMS400 equate (prevents Industrial Micro Systems |
|||
; controller from hanging up during port scan). BRR |
|||
; |
|||
;24/Jun/80 - Removed MACLIB statement, included required macros |
|||
; in source. Bruce R. Ratoff |
|||
; |
|||
|
|||
;*******************************; |
|||
; SYSTEM MACROS ; |
|||
;*******************************; |
|||
;Increments 16 bit memory location X |
|||
INXI MACRO X |
|||
LOCAL JUST8 |
|||
PUSH H |
|||
LXI H,X |
|||
INR M |
|||
JNZ JUST8 |
|||
INX H |
|||
INR M |
|||
JUST8: |
|||
POP H |
|||
ENDM |
|||
;.............................................................. |
|||
; |
|||
; SAVE MACRO SAVE SPECIFIED REGISTERS |
|||
; |
|||
; SAVE R1,R2,R3,R4 |
|||
; |
|||
; R1-R4 MAY BE B,D,H OR PSW SAVED IN ORDER SPECIFIED |
|||
; IF REGS ARE OMITTED SAVE B,D AND H |
|||
; |
|||
SAVE MACRO R1,R2,R3,R4 |
|||
IF NOT NUL R1&R2&R3&R4 |
|||
IRP R,<<R1>,<R2>,<R3>,<R4>> |
|||
IF NUL R |
|||
EXITM |
|||
ENDIF |
|||
PUSH R |
|||
ENDM |
|||
ELSE |
|||
IRPC REG,BDH |
|||
PUSH REG |
|||
ENDM |
|||
ENDIF |
|||
ENDM |
|||
; |
|||
; . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
|||
; |
|||
; RESTORE MACRO RESTORE REGISTERS (INVERSE OF SAVE) |
|||
; |
|||
; RESTORE R1,R2,R3,R4 |
|||
; |
|||
; R1-R4 MAY BE B,D,H OR PSW RESTORED IN ORDER SPECIFIED |
|||
; IF REGS OMITTED RESTORE H,D AND B |
|||
; |
|||
RESTORE MACRO R1,R2,R3,R4 |
|||
IF NOT NUL R1&R2&R3&R4 |
|||
IRP R,<<R1>,<R2>,<R3>,<R4>> |
|||
IF NUL R |
|||
EXITM |
|||
ENDIF |
|||
POP R |
|||
ENDM |
|||
ELSE |
|||
IRPC REG,HDB |
|||
POP REG |
|||
ENDM |
|||
ENDIF |
|||
ENDM |
|||
; |
|||
;.............................................................. |
|||
; |
|||
; CHAROUT MACRO CONSOLE OUTPUT FROM A |
|||
; |
|||
; CHAROUT ADDR |
|||
; |
|||
CHAROUT MACRO ADDR |
|||
IF NOT NUL ADDR |
|||
LDA ADDR |
|||
ENDIF |
|||
MVI C,2 ;;CONOUT |
|||
MOV E,A ;;CHAR TO E |
|||
CALL 5 ;;CALL BDOS |
|||
ENDM |
|||
; |
|||
; |
|||
;............................................................. |
|||
; |
|||
; DECOUT MACRO CONVERT A POSITIVE INTEGER TO DECIMAL AND OUTPUT |
|||
; TO THE CONSOLE. |
|||
; |
|||
; DECOUT ADDR |
|||
; |
|||
; IF ADDR OMITTED, NUMBER ASSUMED TO BE IN HL, ELSE LOADED TO HL |
|||
; LEADING ZEROS SUPRESSED. MAXIMUM NUMBER 65,767 |
|||
; |
|||
DECOUT MACRO ADDR |
|||
LOCAL ENDDEC,DX |
|||
JMP ENDDEC |
|||
@DECOUT: |
|||
SAVE ;;PUSH STACK |
|||
LXI B,-10 ;;RADIX FOR CONVERSION |
|||
LXI D,-1 ;;THIS BECOMES NO DIVIDED BY RADIX |
|||
DX: |
|||
DAD B ;;SUBTRACT 10 |
|||
INX D |
|||
JC DX |
|||
LXI B,10 |
|||
DAD B ;;ADD RADIX BACK IN ONCE |
|||
XCHG |
|||
MOV A,H |
|||
ORA L ;;TEST FOR ZERO |
|||
CNZ @DECOUT ;;RECURSIVE CALL |
|||
MOV A,E |
|||
ADI '0' ;;CONVERT FROM BCD TO HEX |
|||
MOV E,A ;;TO E FOR OUTPUT |
|||
CHAROUT ;;CONSOLE OUTPUT |
|||
RESTORE ;;POP STACK |
|||
RET |
|||
ENDDEC: |
|||
DECOUT MACRO ?ADDR |
|||
IF NOT NUL ?ADDR |
|||
LHLD ?ADDR |
|||
ENDIF |
|||
CALL @DECOUT ;;CALL THE SUBROUTINE |
|||
ENDM |
|||
DECOUT ADDR |
|||
ENDM |
|||
; |
|||
; |
|||
;.............................................................. |
|||
; |
|||
; HEXOUT MACRO CONVERT BINARY NO AND OUTPUT TO CONSOLE |
|||
; |
|||
; HEXOUT ADDR |
|||
; |
|||
; NUMBER ASSUMED IN A IF NO ARGUMENT |
|||
; |
|||
HEXOUT MACRO ADDR |
|||
LOCAL OUTCHR,HEXEND |
|||
JMP HEXEND |
|||
HEXPRN: |
|||
SAVE PSW |
|||
RRC |
|||
RRC |
|||
RRC |
|||
RRC ;;SHIFT RIGHT 4 |
|||
CALL OUTCHR |
|||
RESTORE PSW |
|||
OUTCHR: |
|||
ANI 0FH ;;MASK 4 BITS |
|||
ADI 90H ;;ADD OFFSET |
|||
DAA ;;DEC ADJUST |
|||
ACI 40H ;;ADD OFFSET |
|||
DAA ;;DEC ADJUST |
|||
MOV E,A ;;TO E FOR OUTPUT |
|||
MVI C,2 ;;CONOUT |
|||
JMP 5 ;;CALL BDOS |
|||
HEXEND: |
|||
|
|||
HEXOUT MACRO ?ADDR |
|||
IF NOT NUL ?ADDR |
|||
LDA ?ADDR |
|||
ENDIF |
|||
CALL HEXPRN |
|||
ENDM |
|||
HEXOUT ADDR |
|||
ENDM |
|||
; |
|||
; |
|||
|
|||
;*******************************; |
|||
; SYSTEM EQUATES ; |
|||
;*******************************; |
|||
TRUE EQU -1 |
|||
FALSE EQU NOT TRUE |
|||
TARBEL EQU FALSE ; Tarbell FDC dmb 31-may-82 |
|||
IMS400 EQU FALSE ; Industrial Micro Systems FDC |
|||
GODBOUT EQU FALSE ; Godbout Disk 1 FDC |
|||
GODBAS EQU 0C0H ; Base of Godbout FDC |
|||
TARBAS EQU 0F8H ; Base of Tarbell |
|||
SKIP EQU TARBEL OR IMS400 OR GODBOUT ; Will be true |
|||
; if any skip needed |
|||
IF TARBEL |
|||
SKIPORT EQU TARBAS+4 ; Port # to skip if Tarbell FDC |
|||
ENDIF |
|||
IF IMS400 |
|||
SKIPORT EQU 08FH ; Port # to skip if IMS FDC |
|||
ENDIF |
|||
IF GODBOUT |
|||
SKIPORT EQU GODBAS+1 ; Port # to skip if Disk 1 FDC |
|||
ENDIF |
|||
BDOS EQU 5 ; jump to BDOS |
|||
bios equ 0 ; jump to BIOS dmb 1-jun-82 |
|||
CRLF EQU 0A0DH ; CR LF sequence |
|||
CRLFE EQU 8A0DH ; CR LF with EOL |
|||
EOL EQU 80H ; End of line |
|||
TAB EQU 'I'-40H ; Tab character |
|||
ESC EQU 1BH ; Escape character |
|||
TABS EQU 9 ; Tab columns |
|||
|
|||
;***********************; |
|||
; MAIN PROGRAM ; |
|||
;***********************; |
|||
; |
|||
ORG 100H |
|||
; |
|||
START: |
|||
LXI H,0 ; Save stack pointer |
|||
DAD SP |
|||
SHLD OLDSP |
|||
LXI SP,FINIS+64 |
|||
CALL TYPE ; Type initial CRLF |
|||
DB TAB,TAB,'*** System Survey (December 17) ***' |
|||
DW CRLF,CRLFE |
|||
|
|||
;DISK SURVEY |
|||
LXI H,8 ; Init drive counter |
|||
MVI C,24 ; Get login vector |
|||
PUSH H |
|||
CALL BDOS |
|||
POP H |
|||
ROTBIT: |
|||
RAR ; RAR login bit to C |
|||
JNC NOTLOG ; Drive not logged |
|||
PUSH PSW ; Save login |
|||
PUSH H ; and counter |
|||
|
|||
;Print drive letter |
|||
CALL TYPE |
|||
DB 'Drive' |
|||
DB ' '+EOL |
|||
MVI A,'A' ; Get ASCII bias |
|||
ADD H ; Add to drive # |
|||
MOV E,A ; Print drive letter |
|||
CALL TCHR |
|||
CALL TYPE ; and colon |
|||
DB ':',' '+EOL |
|||
POP H ; Restore drive # |
|||
PUSH H |
|||
|
|||
;Print K already allocated |
|||
MOV E,H |
|||
MVI C,14 ; Log drive |
|||
CALL BDOS |
|||
MVI C,27 ; Index allocation vect |
|||
CALL BDOS |
|||
MOV L,A ; Put in decent regs |
|||
MOV H,B |
|||
PUSH H ; save for later |
|||
MVI C,12 ; get version # |
|||
CALL BDOS |
|||
MOV A,L ; zero if version 1 |
|||
ORA A |
|||
JNZ V2X ; otherwise, use 2.x style params |
|||
LHLD BDOS+1 ; get vers 1 style params |
|||
MVI L,3CH |
|||
MOV A,M ; get block shift factor |
|||
STA BLKSHF |
|||
INX H |
|||
INX H |
|||
MOV L,M ; get max. block number |
|||
MVI H,0 |
|||
SHLD MAXALL |
|||
MVI B,32 ; assume 32 bytes in block map |
|||
JMP GETALC ; continue |
|||
V2X: |
|||
MVI A,'?' ; Use wild user # |
|||
STA FCB ; in filename search |
|||
MVI C,31 ; Get 2.x parameter block |
|||
CALL BDOS |
|||
INX H |
|||
INX H |
|||
MOV A,M ; Get and save ablock shift factor |
|||
STA BLKSHF |
|||
INX H |
|||
INX H |
|||
INX H |
|||
MOV A,M ; Get maximum block number |
|||
INX H ; (double precision) |
|||
MOV H,M |
|||
MOV L,A |
|||
SHLD MAXALL |
|||
INX H |
|||
MVI B,3 ; map size is (MAXALL+1)/8 |
|||
V2SH: |
|||
MOV A,H |
|||
ORA A ; do 16 bit right shift |
|||
RAR |
|||
MOV H,A |
|||
MOV A,L |
|||
RAR |
|||
MOV L,A |
|||
DCR B ; 3 times |
|||
JNZ V2SH |
|||
MOV B,L |
|||
LDA MAXALL ; allow for leftover bits if any |
|||
ANI 3 |
|||
JZ GETALC |
|||
INR B |
|||
GETALC: |
|||
POP H |
|||
LXI D,0 ; Init group counter |
|||
NXBYTE: |
|||
MVI C,8 ; Bit counter for byte |
|||
MOV A,M ; Get map byte |
|||
NXBIT: |
|||
RAR ; Rotate to C |
|||
JNC NOBIT ; No group allocated |
|||
INX D ; Inc group counter |
|||
NOBIT: |
|||
DCR C ; Dec bit counter |
|||
JNZ NXBIT |
|||
INX H ; Index next byte |
|||
DCR B |
|||
JNZ NXBYTE |
|||
CALL SHF16 |
|||
PUSH H |
|||
CALL BINDEC |
|||
CALL TYPE |
|||
DB 'K bytes in',' '+EOL |
|||
|
|||
;Print number of files |
|||
LXI D,FCB ; Fake file cont block |
|||
MVI C,17 ; Search for 1st file |
|||
CALL BDOS |
|||
LXI H,0 ; File counter |
|||
LOOK: |
|||
CPI 255 ; Failure |
|||
JZ PFILE |
|||
ADD A ; File offset times 2 |
|||
ADD A ; 4 |
|||
ADD A ; 8 |
|||
ADD A ; 16 |
|||
ADD A ; 32 |
|||
ADI 80H ; Make sure it's not a deleted file |
|||
MOV E,A |
|||
MVI D,0 |
|||
LDAX D |
|||
CPI 0E5H |
|||
JZ LOOK1 |
|||
INX H ; Bump file counter |
|||
LOOK1: |
|||
LXI D,FCB ; Restore FCB |
|||
MVI C,18 ; Look for addtl files |
|||
PUSH H ; Save file counter |
|||
CALL BDOS |
|||
POP H |
|||
JMP LOOK |
|||
PFILE: |
|||
CALL BINDEC ; Print # of files |
|||
CALL TYPE |
|||
DB ' files with',' '+EOL |
|||
|
|||
;Print K remaining |
|||
LHLD MAXALL ; Get number of blocks |
|||
XCHG |
|||
INX D ; Inc for actual value |
|||
CALL SHF16 |
|||
XCHG |
|||
POP H |
|||
MOV A,H ; Ones comp & move |
|||
CMA |
|||
MOV H,A |
|||
MOV A,L |
|||
CMA |
|||
MOV L,A |
|||
INX H ; Twos complement |
|||
DAD D ; and subtract |
|||
CALL BINDEC ; K remaining |
|||
CALL TYPE |
|||
DB 'K bytes remaining' |
|||
DW CRLFE |
|||
|
|||
;Set up to print next drive |
|||
POP H ; Restore bit counter |
|||
POP PSW ; and bitmap byte |
|||
NOTLOG: |
|||
INR H ; Bump drive counter |
|||
DCR L ; Dec bit counter |
|||
JNZ ROTBIT |
|||
|
|||
;MEMORY SURVEY |
|||
;Create header |
|||
MSURV: |
|||
CALL TYPE |
|||
DW CRLF |
|||
DB 'Memory map:' |
|||
DW CRLF |
|||
DB '0',TAB,'8',TAB,'16',TAB,'24',TAB,'32' |
|||
DB TAB,'40',TAB,'48',TAB,'56',TAB,'64' |
|||
DW CRLF |
|||
REPT 8 |
|||
DB '|',TAB |
|||
ENDM |
|||
DB '|' |
|||
DW CRLF |
|||
db ' ' ; dmb 31-May-82 |
|||
DB 'T'+EOL |
|||
LXI H,RAM |
|||
MVI M,LOW 1023 ; Init RAM counter |
|||
INX H |
|||
MVI M,HIGH 1023 |
|||
MVI B,4 ; Clear ROM, EMP |
|||
CLREG: |
|||
INX H |
|||
MVI M,0 |
|||
DCR B |
|||
JNZ CLREG |
|||
LXI H,1024 ; Init memory pointer |
|||
MVI C,63 ; K to be checked |
|||
|
|||
;Start of analysis loop |
|||
BEGANA: |
|||
LXI D,1024 ; Byte counter |
|||
XRA A ; Clear flag bytes |
|||
STA RAMF |
|||
STA EMPF |
|||
ANALP: |
|||
MOV A,M ; Get test byte and |
|||
MOV B,A ; store for later |
|||
CMA |
|||
MOV M,A ; Put invertd tst byte |
|||
SUB M ; Check for good write |
|||
MOV M,B ; Restore orignl data |
|||
JNZ NOTMEM ; Wasn't good write |
|||
INXI RAM ; Bump memory counter |
|||
JMP NEXT ; To next byte |
|||
|
|||
NOTMEM: |
|||
STA RAMF ; Not considered RAM |
|||
MVI A,0FFH ; Is it empty space? |
|||
SUB B |
|||
JNZ NOTEMP ; Inc ROM, set flag |
|||
LDA EMPF ; Any non empty space |
|||
ANA A ; before here? |
|||
JZ NEXT |
|||
JMP NOTEM ; To next byte |
|||
NOTEMP: |
|||
STA EMPF ; Set no empty flag |
|||
NOTEM: |
|||
INXI ROM |
|||
NEXT: |
|||
INX H ; Index next byte |
|||
DCX D ; Decrement K counter |
|||
XRA A |
|||
ORA D |
|||
ORA E |
|||
JNZ ANALP ; K counter not 0 |
|||
PUSH B |
|||
PUSH H |
|||
LDA RAMF ; Is it RAM? |
|||
ANA A |
|||
JNZ NOTRAM ; No |
|||
dcr h ; drop H to make compares right |
|||
LDA BDOS+2 ; Is it under BDOS ? |
|||
CMP H |
|||
JC NOTTPA ; No |
|||
CALL TYPE ; Yes, it's TPA |
|||
DB 'T'+EOL |
|||
JMP NEXTK |
|||
NOTTPA: |
|||
lda bios+2 ; is it under bios ? |
|||
cmp h |
|||
jc nbdos |
|||
call type ; yes, it's BDOS |
|||
db 'C'+eol |
|||
jmp nextk |
|||
nbdos: |
|||
CALL TYPE ; Assume it's BIOS |
|||
DB 'B'+EOL |
|||
JMP NEXTK |
|||
; |
|||
NOTRAM: |
|||
LDA EMPF ; Is it empty? |
|||
ANA A |
|||
JZ NOMEM ; Yes, no memory |
|||
CALL TYPE ; No, must be ROM |
|||
DB 'R'+EOL |
|||
JMP NEXTK |
|||
NOMEM: |
|||
CALL TYPE |
|||
DB ' '+EOL |
|||
NEXTK: |
|||
POP H |
|||
POP B |
|||
DCR C ; Decrement K counter |
|||
JNZ BEGANA |
|||
CALL TYPE |
|||
DW CRLF |
|||
DB 'T=TPA',TAB,'C=CPM',TAB,'B=BIOS or unassigned' |
|||
DB TAB,'R=ROM or bad' |
|||
DW CRLFE |
|||
; |
|||
; contents of first page |
|||
call type |
|||
db 'BIOS at',' '+eol |
|||
hexout bios+2 |
|||
hexout bios+1 |
|||
call type |
|||
db tab,'iobyte',' '+eol |
|||
hexout bios+3 |
|||
call type |
|||
db tab,'drive',' '+eol |
|||
hexout bios+4 |
|||
call type |
|||
db tab,'BDOS at',' '+eol |
|||
hexout bdos+2 |
|||
hexout bdos+1 |
|||
call type |
|||
dw crlf,crlfe |
|||
; |
|||
;MEMORY SYNOPSIS |
|||
LHLD RAM |
|||
PUSH H ; Save RAM |
|||
CALL BINDEC ; Type RAM |
|||
CALL TYPE |
|||
DB ' Bytes RAM',TAB,TAB+EOL |
|||
LHLD ROM |
|||
PUSH H |
|||
CALL BINDEC ; Type ROM |
|||
CALL TYPE |
|||
DB ' Bytes ROM',TAB,TAB+EOL |
|||
LHLD BDOS+1 |
|||
CALL BINDEC |
|||
CALL TYPE |
|||
DB ' Bytes in TPA' |
|||
DW CRLFE |
|||
POP D ; Get RAM |
|||
POP H ; Get RAM |
|||
DAD D ; Add 'em |
|||
PUSH H ; and save result |
|||
LXI D,0 ; Subtract from this |
|||
MOV A,H ; Complement 16 bits |
|||
CMA |
|||
MOV H,A |
|||
MOV A,L |
|||
CMA |
|||
MOV L,A ; 2s comp bias in D |
|||
DAD D ; Subtract |
|||
CALL BINDEC |
|||
CALL TYPE |
|||
DB ' Bytes Empty ',TAB+EOL |
|||
POP H ; Restore RAM+ROM |
|||
CALL BINDEC |
|||
CALL TYPE |
|||
DB ' Total Active Bytes' |
|||
DW CRLF,CRLF |
|||
|
|||
;PORT SURVEY |
|||
DB 'Active I/O ports',':'+EOL |
|||
LXI H,1000H ; DELAY SO MESSAGE OUTPUT |
|||
PDLY: |
|||
DCX H ; DOESN'T GIVE A FALSE READING |
|||
MOV A,H ; ON CONSOLE STATUS PORT |
|||
ORA L |
|||
JNZ PDLY |
|||
LXI H,0 ; Init active port counter |
|||
mvi d,0 ; Init port counter |
|||
mvi e,0ffh ; init port group variable |
|||
PORTLP: |
|||
MOV A,D |
|||
|
|||
IF SKIP ; Single port mask |
|||
CPI SKIPORT |
|||
JZ ISPORT ; Print mask port |
|||
ENDIF |
|||
|
|||
mov c,a ; port number to reg c |
|||
mvi b,0 ; for 16 bit port addressing |
|||
db 0edh,078h ; z80: in a,(c) |
|||
; inactive port could return 0xFF or 0x78 |
|||
CPI 0FFH |
|||
JZ NEXTPT |
|||
cpi 078h |
|||
jz nextpt |
|||
ISPORT: |
|||
mov a,d ; got a live one, probably |
|||
ani 0f0h ; is port in same group as last ? |
|||
cmp e |
|||
jz nocrlf |
|||
call type ; no, start a new line |
|||
dw crlfe |
|||
mov a,d ; save for next time |
|||
ani 0f0h |
|||
mov e,a |
|||
nocrlf: |
|||
MOV A,D ; Get port # |
|||
PUSH D |
|||
PUSH H |
|||
HEXOUT |
|||
POP H |
|||
POP D |
|||
INX H ; count another one found |
|||
call type |
|||
db ' '+eol |
|||
NEXTPT: |
|||
INR D ; Bump port counter |
|||
JNZ PORTLP ; Not done |
|||
CALL TYPE ; Done |
|||
DW CRLFE |
|||
CALL BINDEC |
|||
CALL TYPE ; Type Active Ports |
|||
DB ' Ports active' |
|||
DW CRLFE |
|||
CCP: |
|||
LHLD OLDSP |
|||
SPHL |
|||
RET |
|||
|
|||
|
|||
;***********************; |
|||
; SUBROUTINES ; |
|||
;***********************; |
|||
|
|||
;Binary to decimal conversion |
|||
BINDEC: |
|||
DECOUT ; From LIB |
|||
RET |
|||
|
|||
;Types a string of text terminated with bit 7 high |
|||
TYPE: |
|||
XTHL ; Get string address |
|||
PUSH D |
|||
TYPELP: |
|||
MOV A,M ; Get type data |
|||
MOV D,A ; Save for later |
|||
ANI 7FH ; Mask ASCII |
|||
MOV E,A |
|||
PUSH H |
|||
PUSH D |
|||
CALL TCHR |
|||
POP D |
|||
POP H |
|||
INX H |
|||
MVI A,EOL ; End of line bit |
|||
ANA D |
|||
JP TYPELP ; Not done |
|||
POP D |
|||
XTHL ; Get return address |
|||
RET |
|||
|
|||
;Types a single character on console |
|||
TCHR: |
|||
MVI C,2 |
|||
JMP BDOS |
|||
|
|||
;Checks sectors per block and multiplies or divides block size |
|||
;Enter with data in D. Result returned in H,L |
|||
; |
|||
SHF16: |
|||
LDA BLKSHF ; Get shift factor (gives block size) |
|||
CPI 3 ; Is it 1K (std)? |
|||
JNZ NOT3 |
|||
MOV L,E ; Yes, use present # |
|||
ZH: |
|||
MVI H,0 |
|||
RET |
|||
; |
|||
NOT3: |
|||
CPI 2 ; Is it minifloppy? |
|||
JNZ NOT2 |
|||
MOV A,E ; Yes, divide by 2 |
|||
RRC |
|||
ANI 7FH |
|||
MOV L,A |
|||
JMP ZH |
|||
NOT2: |
|||
SUI 3 ; Must be something |
|||
MOV B,A ; larger like double |
|||
XCHG ; sided or double dens |
|||
BITSHF: |
|||
DAD H ; 16 bit 2^(B-1) |
|||
DCR B |
|||
JNZ BITSHF |
|||
RET |
|||
|
|||
|
|||
;***********************; |
|||
; DATA STORAGE ; |
|||
;***********************; |
|||
|
|||
FCB: DB 0,'???????????',0,0,0 ; File control block |
|||
DS 17 ; Extra FCB workspace |
|||
OLDSP: DS 2 ; Old stack pointer |
|||
RAM: DS 2 ; RAM counter |
|||
ROM: DS 2 ; ROM counter |
|||
RAMF: DS 1 ; RAM good flag |
|||
EMPF: DS 1 ; Empty so far flag |
|||
BLKSHF: DS 1 ; block shift factor |
|||
MAXALL: DS 2 ; maximum block number |
|||
FINIS EQU $ ; End of program |
|||
END |
|||
|
|||
@ -0,0 +1,16 @@ |
|||
@echo off |
|||
setlocal |
|||
|
|||
set TOOLS=..\..\..\Tools |
|||
|
|||
set PATH=%TOOLS%\zxcc;%PATH% |
|||
|
|||
set CPMDIR80=%TOOLS%/cpm/ |
|||
|
|||
:: zxcc MAC survey.asm -$PO || exit /b |
|||
:: zxcc MLOAD25 survey || exit /b |
|||
|
|||
zxcc M80 -,=survey/L/R |
|||
zxcc L80 -survey,survey/N/E |
|||
|
|||
copy /Y survey.com ..\..\..\Binary\Apps\ || exit /b |
|||
@ -0,0 +1,8 @@ |
|||
@echo off |
|||
setlocal |
|||
|
|||
if exist *.hex del *.hex |
|||
if exist *.rel del *.rel |
|||
if exist *.prn del *.prn |
|||
if exist *.lst del *.lst |
|||
if exist *.com del *.com |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue