PDA

View Full Version : cpmtools and TRS-80 Model II Lifeboat CP/M disk images



JonB
October 1st, 2016, 06:26 AM
Hi

I have just installed cpmtools on my Windows 10 machine. The executables run fine.

I want to use the tools to read from and write to TRS-80 Model II disk images. I have a registered copy of 22DISK which I use for reading and writing 8" disks, but since getting the HxC working with the Model II I want to start using images. Anyway, my images are in TD0 format, and are Lifeboat CP/M.

There are some diskdefs for this format discussed here (http://www.vcfed.org/forum/showthread.php?51204) and I have transposed them into my diskdefs file. However, on attempting to read the images, I just get a load of random characters on the screen.

The diskdefs are as follows:


# TRS4 TRS-80, Lifeboat CP/M (256 bytes/sector) - SSDD 8" 256x26
diskdef trs4
seclen 256
tracks 77
sectrk 26
blocksize 2048
maxdir 128
skew 9
boottrk 2
os 2.2
end

# TRS5 TRS-80, Lifeboat CP/M (1024 bytes/sector) - SSDD 8" 1024x8
diskdef trs5
seclen 1024
tracks 77
sectrk 8
blocksize 2048
maxdir 128
skew 3
boottrk 2
os 2.2
end

Of these, the TRS4 definition is the most likely candidate and I use this with 22DISK. The parameters appear to be the same as the (working) 22DISK parameters, although 22DISK has quite a few more..

The TD0 image I am testing with is the one in the Maslin archive (trsIIlbt.td0) and I can boot the Model II directly from it (with HxC emulator) so I can see it is valid. Can anyone advise how best to proceed?

gslick
October 1st, 2016, 06:53 AM
Are you trying to use a Teledisk .TD0 image directly with cpmtools without first converting it to a plain sector image? Is that supported directly by cpmtools? When I have used cpmtools in the past I have always used it with plain sector image dumps and wasn't aware that it natively supported other image formats.

In the past I have used the ImageDisk TD02IMD.COM utility to convert Teledisk .TD0 images into plain sector image dumps.

http://www.classiccmp.org/dunfield/img/index.htm

JonB
October 1st, 2016, 07:20 AM
Hi gslick

I converted the TD0 to IMD using TD02IMD as you suggested (in Windows XP running in a VM no less!) and tried to read the IMD file using cpmls. Same result (screen garbage).

Cheers
JonB

gslick
October 1st, 2016, 07:27 AM
One more step. After you convert the TD0 to an IMD file, then use IMDU.COM with the /B option to convert the IMD file to a plain sector image dump.

JonB
October 1st, 2016, 07:38 AM
Same result, screen garbage. :(

Tried with a different image, there is a partial directory showing..


E:\Documents\cpmtools>cpmls -f trs4 LB224A.PSD
0:

☺ m◄xmm↨.j5b
!←k6
!←k6
nocol.rel
noreport.rel
nosel.rel
onedrive.com
pip.com
stat.com
submit.com
sysgen.com

1:

♀k ☺!

5:
*=mmm▼♦:.←k▼
mp♠:tm2←.k!m

6:
☺1♥m←♣c►.♠☺h

11:
m<m:.?k~
i!ak6

12:
c♫q♀y♀☺
m∟♂c-♀m‼.
2?

13:
!"k6☺!▼k.6☺c
☺sue*.♣md

26:
b6
>

27:
k2um!←k6.☺☺


E:\Documents\cpmtools>

pski
October 1st, 2016, 08:26 AM
We have some Lifeboat IMDs in the model2archive. Maybe give those a shot?

https://github.com/pski/model2archive/tree/master/Software/CPM/Lifeboat

JonB
October 1st, 2016, 08:28 AM
Hi Pete

I'm using the LB224A.IMD image (which is 100% fine, it boots the MII straight off the HxC emulator).

Looking at the disk image with IMDV, track 1 has 26 sectors of 256 bytes and tracks 2-77 have 8 sectors of 1024 bytes each.

This is the problem most likely. I have tried with the TRS5 definition - this is 8x1204 format per track, but it is still not working 100%.

Is there a way to get cpmtools to skip the first track in the diskdefs file?

JonB
October 1st, 2016, 09:00 AM
One more step. After you convert the TD0 to an IMD file, then use IMDU.COM with the /B option to convert the IMD file to a plain sector image dump.

By the way, I see no way of getting back to IMD format after adding files to the sector image dump generated by IMDU.COM...

(Edit: BIN2IMD.COM might do this, but I don't understand the parameters..)

JonB
October 16th, 2016, 06:48 AM
OK, have made some progress.

Realising the Lifeboat CP/M data is not in the same format as the boot tracks, and that the 22DISK defs refer to COM8 (a Compupro format), I had a look around and found this:


diskdef COM8 #= Compupro (Viasyn) 8/16 1,024 bytes/sector - SSDD 8"
#= MFM, HIGH DENSITY
seclen 1024 #= Sectors xx,1024
tracks 77 #= (Cylinders * Sides) = 77*1 = 77
sectrk 8 #= Sectors 8,xxx
blocksize 2048 #= (128*(BLM+1)) = 2048
maxdir 128 #= (DRM+1) = 128
datarate DD
fm NO
skew 3 #= may be 0 thru 6, or so
boottrk 2 #= OFS = 2
os 2.2 #= 2.2, or 2, or 3
end


Handy. With this definition, cpmtools is able to read the Lifeboat image's directory and even copy files from the image to the Linux directory. However on attempting to alter the image (say, by copying something to it, or attempting to delete a file), it always fails with an error indicating it cannot open the image file (cpmcp and cpmrm both do this). What's odd is that cpmcp doesn't error when copying FROM the image, only on copying TO it.

Pretty odd behaviour...

ldkraemer
October 16th, 2016, 06:16 PM
JonB,
I've been trying to access that same image and I haven't been able to get a good directory listing or copy good files
from the image. I used the .TD0 file to create a .IMD file with TD02IMD trsiilbt.td0
Then I created the .RAW image with IMDU trsiilbt.imd trsiilbt.raw /E /B

But, a cpmls -f com8 trsiilbt.raw doesn't give a good directory listing. The actual directory starts at 2D00 hex on the image.

I tried using the offset, but that doesn't work either.
offset 11520
boottrk 0

but that just gives an error. I'm thinking it might be good to email Michael and see if he can help.
I've normally had good success in getting files extracted or inserted in a .RAW file.

You should be able to use BIN2IMD to rebuild the .IMD file. The only information I've been able to locate so far
is at: https://winworldpc.com/winboards/viewtopic.php?t=6931
which is basically an explanation of the man pages.

disktrans which is included in libdsk above version 1.3.8 should be able to be used to create the .IMD file.

This is one sample I've used. I need to upgrade to ver 1.4.0 to test this more.
dsktrans -otype raw -format sin2 ElwroG1.dsk ElwroG1.raw

What is the Image name that you are able to access the directory listing?
Is your cpmtools built with libdsk 1.4.0?

Larry

JonB
October 16th, 2016, 09:53 PM
It's on the Model II OS Archive that pski maintains. Called "LBT225D.img", I think.

Edit: here: https://github.com/pski/model2archive/tree/master/Software/CPM/Lifeboat

ldkraemer
October 17th, 2016, 05:11 AM
JonB,
I get the same garbled directory listing on this image:
cpmls -f com8 LB225D.RAW0:

50hertz.sub
asm.com
cbas2.com
cbas207.com
cbasic.hlp
cbasic2.hlp
config.com
copy.com
crun2.com
crun207.com
crun236.com
crun237.com
crun238.com
d.com
ddt.com
dumbterm.asm
dumbterm.com
dump.asm
dump.com
ed.com
filecopy.com
format.com
i.com
load.com
memr.com
movcpm.com
nswp207.com
onedrive.com
pip.com
read-me.doc
stat.com
submit.com
sysgen.com
tof.com
vidtest.asm
vidtest.bas
vidtest.com
wsinstal.doc
xsub.com

1:
c2cm!.

3:


8:
.im

12:
1
4
7
:
.=
f
!

14:

m
larry@debian:

And if I copy any of the files to my Laptop, they are also garbage.

To get this directory I tried this offset, but it too isn't correct.
offset 11264 # half of 2D00 Hex -- Dir List starts at 2D00 Hex
boottrk 0


Larry

JonB
October 17th, 2016, 10:34 AM
You can read the LB225.IMD file directly without converting it first. You can also extract files, but as I said previously, you can't add or delete them.

Looks like I am using cpmtools-2.20 with libdisk-1.4.0. Interestingly, the version of cpmtools supplied with my version of Ubuntu-MATE is 2.17..

Anyway, note the command line. I'm not using the -T RAW option, although if I try to use it to write a file to the image, it corrupts the IMD file. Which means it is trying to write.


jon@x205:~/cpmtools-2.20$ cpmls -f COM8 ~/LB224A.IMD
0:
cbas2.com
cbas201.com
cbas202.com
cbas203.com
cbasic.txt
coltab.mac
config.com
copy.com
crun2.com
crun203.com
crun204.com
crun205.com
ddt.com
dump.com
ebctab.mac
ed.com
filecopy.com
format.com
install.com
load.com
mergprin.ovr
movcpm.com
nocol.rel
noerr.rel
noreport.rel
nosel.rel
onedrive.com
pip.com
read-me.bak
read-me.doc
sample.dat
sorlib.rel
sort.com
sort.rel
stat.com
submit.com
subrdemo.mac
syseqa.mac
sysgen.com
user.asm
wi.com
wi.toc
wi.wi
wimsgs.ovr
ws.com
wsmsgs.ovr
wsovly1.ovr
wsu.com
xref.com
xref201.com
xref202.com
xsub.com
jon@x205:~/cpmtools-2.20$

ldkraemer
October 18th, 2016, 06:12 AM
JonB,
But, if you try to access the .RAW or .IMD files with these commands you get garbage:
cpmls -f com8 -T raw,com8 -d LB224A.IMD
cpmls -f com8 -T raw,com8 -i LB224A.RAW
cpmls -f com8 -T logical,com8 -d LB224A.IMD
cpmls -f com8 -T logical,com8 -i LB224A.RAW

Do you have the TD0 files for this image? If so, try accessing it with this:
cpmls -f com8 -T tele,com8 -d LB224A.TD0
cpmcp -f com8 -T tele,com8 LB224A.TD0 0:cbasic.txt /home/user/path/to/folder

See if the cbasic.txt file is sane.

If I was aware that you could do a directory listing of a .IMD file, I forgot it. I typically use .RAW files.

ldkraemer
October 18th, 2016, 10:18 AM
Convert the 68K-INST.TD0 to a IMD with:

TD02IMD 68K-INST.TD0 > 68K-INST.LOG

then create the .RAW image with:

IMDU 68K-INST.IMD 68K-INST.RAW /D /E /B >> 68K-INST.LOG

68K-INST.LOG contains:
IMageDisk Utility 1.18 / Mar 07 2012
IMD TD 1.5 8" HD FM S-step, 1 sides ADV

Assuming 1:1 for Binary output
0/0 500 kbps SD 26x128
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
DE5DE5DE5DE5DE5DE5DE5DE5DE5DE5DE5DE5DE5DE5DE5DE5DE 5DE5DE5DE5DE5DE5DE5DE5DE5DE5
1/0 DE5DE5DE5DE5DE5DE5DE5DE5DE5DE5DE5DE5DE5DE5DE5DE5DE 5DE5DE5DE5DE5DE5DE5DE5DE5DE5
2/0 D DE5D D D D D DE5DE5D D D D DE5DE5D D D D D DE5D D D D D
3/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
4/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
5/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
6/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
7/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
8/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
9/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
10/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
11/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
12/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
13/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
14/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
15/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
16/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
17/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
18/0 D D D DE5D DE5D D D DE5D DE5D D D D D DE5D D D D D DE5D D
19/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
20/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
21/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
22/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
23/0 D D D D D D D D D D D D D D D D00D D D D D D00D D D D
24/0 D00D D DE5D00D D00D D DE5D00D D D D DE5D D D D D DE5D DE5D00D
25/0 DE5D D D D D DE5D D D D D D D D D D D D D D D D D D D
26/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
27/0 D D D D D DE5D D D D D DE5D DE5D D D DE5D DE5D D D DE5D DE5
28/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
29/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
30/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
31/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
32/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
33/0 D DE5D D D D D DE5D D D D D DE5DE5D D D D DE5DE5D D D D DE5
34/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
35/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
36/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
37/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
38/0 D D D D D00D D DE5D D D00D D DE5D D D00D D00D D D D D D00D
39/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
40/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
41/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
42/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
43/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
44/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
45/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
46/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
47/0 D00D D D D00D D00D D D D D D00D D D D D D00D D D D D D00D
48/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
49/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
50/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
51/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
52/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
53/0 D D D D D D D00D D D D D D D D D D D D D D D D D D D
54/0 D D D D00D D00D D D D D D00D D D D D D00D D D DE5D D00D D
55/0 DE5D D D DE5D DE5D D D D D DE5D D D D D DE5D D D D D DE5D
56/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
57/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
58/0 D D D DE5D D D D D DE5D D D D D D D D D D D D D D D D
59/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
60/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
61/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
62/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
63/0 D D D D D DE5D D D D D DE5D D D D D DE5D D D D D DE5D D
64/0 D D D D D D D D D D D D DE5D D D D D DE5D D D D D D D
65/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
66/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
67/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
68/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
69/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
70/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
71/0 D DE5DE5D DE5D D D DE5D D D D D DE5D DE5D D D DE5D DE5D DE5D
72/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
73/0 D D D D D D D D D D D D D D D D D D D D D D D D D D
74/0 D D D D DE5D D D D D DE5D D D D D DE5D D D D D D D DE5D
75/0 D D D D DE5D DE5D D D00D D DE5D00D D00D D DE5D D D00D00D DE5D
76/0 D00D D DE5D D D00D D DE5D D D00D D DE5D DE5D00D D00DE5D DE5D D
77 tracks(77/0), 2002 sectors (160 Compressed)


IMDA 68K-INST.IMD >> 68K-INST.LOG

68K-INST.LOG Contains:
IMageDisk Analyzer 1.18 / Mar 12 2012
IMD TD 1.5 8" HD FM S-step, 1 sides ADV

Required cylinders: 77
Required heads : 1
Data rate : 500kbps
Est. maximum track: 5623 bytes

Possible drives/options to write 68K-INST.IMD :

3.5" HD 80-track NOTE: *1 *2
Double-step: OFF

5.25" HD 80-track NOTE: *1
Double-step: OFF

8" 77-track
Double-step: OFF

*1 77 track image likely from 8" drive.
*2 Should fit on 360rpm drive, 300rpm drive will leave long end gap.


For the 68K-INST.RAW Image, this definition works:

# A1 Generic CP/M - SSSD 8" - 128 x 26
diskdef a1
seclen 128
tracks 77
sectrk 26
blocksize 1024
maxdir 64
skew 6
boottrk 2
os 2.2
end

cpmls -f a1 68K-INST.RAW
0:
ar68.68k
as68.68k
as68init
asm.sub
copy.68k
cpm68.sys
cpmldr.sys
ed.68k
find.68k
ldm68.com
lo68.68k
login.com
login.sub
m68.com
m68rsx.rsx
mov68cp+.sub
movcpm68.sub
newdisk.68k
pip.68k
reloc.68k
sd.68k
set.68k
stat.68k
vt52aton.com
vt52plus.com
vt52pnt.com
z80.68k

Copy a test file to verify it is sane with:

cpmcp -f a1 68K-INST.RAW 0:ASM.SUB /home/larry

ASM.SUB contains: (Needs to be a much longer text file or basic file, but none available on this image)

AS68 -L -P $1.S >$1.PRN

So, you should also be able to write to the .RAW image. But, first let's create a RAW file of the .IMD with dsktrans from libdsk.
We need a definition to insert in /home/user/.libdskrc

[a1]
description = A1 Generic CP/M - SSSD 8" - 128 x 26
cylinders = 77
heads = 1
secsize = 128
sectors = 26
secbase = 1
FM=Y
datarate = HD

To create the .RAW image with libdsk's dsktrans use:
dsktrans -itype imd -otype raw -format a1 68K-INST.IMD /home/larry/IMD-118/MODEL2/Test68K.RAW


The Test68K.RAW is an exact image of the 68K-INST.RAW file. (My software shows no changes)

sha256sum 68K-INST.RAW
0fb79e6c505f8f85353a3760031b4ae30ee196c86218fe5877 ebcf58be540ef2 68K-INST.RAW

sha256sum Test68K.RAW
0fb79e6c505f8f85353a3760031b4ae30ee196c86218fe5877 ebcf58be540ef2 Test68K.RAW

But, when I try to create the Tst68K.IMD I get a fault.

dsktrans -itype raw -otype imd -format a1 Test68K.RAW /home/larry/IMD-118/MODEL2/Tst68K.IMD

Input driver: Raw file driver
Output driver:IMD file driver
Segmentation fault


UPDATE 10/19/2016:
Just received a patch for drvimd.c (libdsk 1.4.0) from John.
I've got to rebuild libdsk to see if the dsktrans problem is fixed.

Patch libdsk 1.4.0 with the imd.diff file:
larry@debian:~/Downloads/cpmtools/libdsk-1.4.0/lib$ patch drvimd.c < imd.diff

Rebuild libdsk & cpmtools-2.20:
sudo updatedb
cd ~/Downloads/cpmtools/libdsk-1.3.5
sudo make uninstall
sudo make clean
which dsktrans

cd ..
sudo rm -rf ./libdsk-1.3.5

cd libdsk-1.4.0
./configure
make
sudo make install
sudo make install-man

cd ..
cd cpmtools-2.20
make clean
./configure --with-libdsk=/usr/local
make
sudo make install

Verify cpmls executes properly

cd ..
cpmls

cpmls
Usage: cpmls [-f format] [-T libdsk-type] [-d|-D|-F|-A|[-l][-c][-i]] image [file ...]


Try building the .IMD file again:
dsktrans -itype raw -otype imd -format a1 Test68K.RAW /home/larry/IMD-118/MODEL2/Tst68K.IMD
Input driver: Raw file driver
Output driver:IMD file driver


It all appears to work fine. I can access the directory and files:

larry@debian:~/IMD-118/MODEL2$ cpmls -f a1 Tst68K.IMD
0:
ar68.68k
as68.68k
as68init
asm.sub
copy.68k
cpm68.sys
cpmldr.sys
ed.68k
find.68k
ldm68.com
lo68.68k
login.com
login.sub
m68.com
m68rsx.rsx
mov68cp+.sub
movcpm68.sub
newdisk.68k
pip.68k
reloc.68k
sd.68k
set.68k
stat.68k
vt52aton.com
vt52plus.com
vt52pnt.com
z80.68k

Files to still process when I can do a valid directory listing with a proper cpmtools definition :
ATN223IS.IMD
ATN225BD.IMD
ATN225BD.IMD
FMG221.IMD
M2PT22MH.IMD




33917

THANKS, JOHN for the quick response.

Larry

lowen
October 19th, 2016, 05:08 AM
You can read the LB225.IMD file directly without converting it first. You can also extract files, but as I said previously, you can't add or delete them.

Looks like I am using cpmtools-2.20 with libdisk-1.4.0. Interestingly, the version of cpmtools supplied with my version of Ubuntu-MATE is 2.17..
...

The cpmtools libdsk IMD support is pretty recent; you may have found a bug. You would want to look in lib/drvcmd.c to see if mixed sector sizes and densities is supported. IMD support was first added in libdsk 1.3.7, so it's pretty new. New enough that IMD is not listed as a supported type.

ldkraemer
October 21st, 2016, 11:21 AM
Accessing the TRS-80 Model II M2PT22MH.IMD with cpmtools (built with libdsk 1.4.0) appears to function properly.

Imagedisk Utilities show the following for M2PT22MH.IMD:

IMageDisk Utility 1.18 / Mar 07 2012
IMD 1.11: 22/03/2006 22:27:10

Model II

Pickles & Trout CP/M 2

Version 2.2mH floppy/hard

Serial Number 2-163-21404

Assuming 1:1 for Binary output
0/0 500 kbps SD 26x128 = 0D00 Hex = 3328 Decimal
1/0 500 kbps DD 16x512 = 2000 Hex = 8192 Decimal
DIR @ =11520 Decimal = 2D00 Hex

77 tracks(77/0), 1242 sectors (126 Compressed)


IMageDisk Viewer 1.18 / Mar 07 2012
IMD 1.11: 22/03/2006 22:27:10

Model II

Pickles & Trout CP/M 2

Version 2.2mH floppy/hard

Serial Number 2-163-21404

IMageDisk Analyzer 1.18 / Mar 12 2012
IMD 1.11: 22/03/2006 22:27:10

Model II

Pickles & Trout CP/M 2

Version 2.2mH floppy/hard

Serial Number 2-163-21404

Required cylinders: 77
Required heads : 1
Data rate : 500kbps
Est. maximum track: 9637 bytes

Possible drives/options to write M2PT22MH.IMD :

3.5" HD 80-track NOTE: *1 *2
Double-step: OFF

5.25" HD 80-track NOTE: *1
Double-step: OFF

8" 77-track
Double-step: OFF

*1 77 track image likely from 8" drive.
*2 Should fit on 360rpm drive, 300rpm drive will leave long end gap.


IMageDisk Utility 1.18 / Mar 07 2012
IMD 1.11: 22/03/2006 22:27:10

Model II

Pickles & Trout CP/M 2

Version 2.2mH floppy/hard

Serial Number 2-163-21404

0/0 500 kbps SD 26x128
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
D D D D D D D D D D D D00D D D D D D D D D D D D D D00
1/0 500 kbps DD 16x512
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
D D D D D D D D D D D D D D00 D00 D00
2/0 D D D D D D DE5 DE5 D D D D D D D D
3/0 D D D D D D D D D D D D D D D D
4/0 D D D D D D D D D D D D D D D D
5/0 D D D D D D D D D D D D D D D D
6/0 D D D D D D D D D D D D D D D D
7/0 D D D D D D D D D D D D D D D D
8/0 D D D D D D D D D D D D D D D D
9/0 D D D D D D D00 D D D D D D D D D
10/0 D D00 D D D D00 D D D D D D D D D D
11/0 D D D D D D D D D D D D D D D D
12/0 D D D D D D D D D D D D D D D D
13/0 D D D D D D D D D D D D D D00 D00 D00
14/0 D00 D D D D D D D D D D D D D D D
15/0 D D D D D D D D D D D D D D D D
16/0 D D D D D D D D D D D D D D D D
17/0 D D D D D D D D D D D D D D D D
18/0 D D D D D D D D D D D D D D D D
19/0 D D D D D D D D D D D D D D D D
20/0 D D D D D D D D D D D D D D D D
21/0 D D D D D00 D D D D D D D D D D D
22/0 D D D D D D D D D D D D D D D D
23/0 D D D D D D D D D D D D D D D D
24/0 D D D D D D D D D D D D D D D D
25/0 D D D D D D D D D D D D D D D D
26/0 D D D D D D D D D D D D D D D D
27/0 D D D D D D D D D D D D D D D D
28/0 D D D D D D D D D D D D D D D D
29/0 D D D D D D D D D D D D D D D D
30/0 D D D D D D D D D D D D D D D D
31/0 D D D D D D D D D D D D D D D D
32/0 D D D D D D D D D D D D D D D D
33/0 D D D D D D D D D D D D D D D D
34/0 D D D D D D D D D D D D D D D D
35/0 D D D D D D D D D D D D D D D D
36/0 D D D D D D D D D D D D D D D D
37/0 D D D D D D D D D D D D D D D D
38/0 D D D D D D D D D D D D D D D D
39/0 D D D D D D D D D D D D D D D D
40/0 D D D D D D D D D D D D D D D D
41/0 D D D D D D D D D D D D D D D D
42/0 D D D D D D D D D D D D D D D D
43/0 D D D D D D D D D D D D D D D D
44/0 D D D D D D D D D D D D D D D D
45/0 D D D D D D D D D D D D D D D D
46/0 D D D D D D D D D D D D D D D D
47/0 D D D D D D D D D D D D D D D D
48/0 D D D D D D D D D D D D D D D D
49/0 D D D D D D D D D D D D D D D D
50/0 D D D D D D D D D D D D D D D D
51/0 D D D D D D D D D D D D D D D D
52/0 D D D D D D D D D D D D D D D D
53/0 D D D D D D D D D D D D D D D D
54/0 D D D D D D D D D D D D D D D D
55/0 D D D D D D D D D D D D D D D D
56/0 D D D D D D D D D D D D D D D D
57/0 D D D D D D D D D D D D D D D D
58/0 D D D D D D D D D D D D D D D D
59/0 D D D D D D D D D D D D D D D D
60/0 D D D D D D D D D D D D D D D D
61/0 D D D D D D D D D D D D D D D D
62/0 D D D D D D D D D D D D D D D D
63/0 D D D D D D D D D D D DE5 D D D DE5
64/0 D D DE5 DE5 D D DE5 DE5 D DE5 DE5 DE5 D D D D
65/0 D D D D00 D D D00 D00 D D D D00 D D D D
66/0 D D00 D00 D00 D D D D D D D D D D D D
67/0 D D D00 D00 D D D D D D D DE5 D D D D
68/0 D D D DE5 D D D D D D D D D D D D
69/0 D D D D00 D D D D D D D D00 D00 D00 D00 D00
70/0 D00 D00 D00 D00 D00 D00 D00 D00 D00 D00 D00 D00 D D00 D D
71/0 D D D D D D00 D00 D00 D00 D00 D00 D00 D00 D DE5 DE5
72/0 D DE5 DE5 DE5 D D D DE5 D D D00 D D DE5 DE5 DE5
73/0 D D D00 D D DE5 DE5 DE5 D D D D D00 D D DE5
74/0 DE5 DE5 DE5 DE5 DE5 DE5 DE5 DE5 DE5 DE5 DE5 DE5 DE5 DE5 DE5 DE5
75/0 DE5 DE5 DE5 DE5 DE5 DE5 DE5 DE5 DE5 DE5 DE5 DE5 DE5 DE5 DE5 DE5
76/0 DE5 DE5 DE5 DE5 DE5 DE5 DE5 DE5 DE5 DE5 DE5 DE5 DE5 DE5 DE5 DE5
77 tracks(77/0), 1242 sectors (126 Compressed)


The cpmtools and libdsk definitions:

# TRS6 TRS-80, Pickles & Trout CP/M - SSDD 8" - 512 x 16
diskdef trs6
seclen 512
tracks 77
sectrk 16
blocksize 2048
maxdir 128
skew 1
boottrk 2
os 2.2
end

# libdsk data below
[trs6]
description = TRS6 TRS-80, Pickles & Trout CP/M - SSDD 8" - 512 x 16
cylinders = 77
heads = 1
secsize = 512
sectors = 16
secbase = 1
datarate = ED


A directory of the IMD file is:

cpmls -f trs6 M2PT22MH.IMD
0:
access.com
asm.com
assign.com
bfbackup.com
bfrestor.com
biosmods.pnt
biosparm.pnt
bkmount.com
clean.com
cleardir.com
clone.com
crt.def
datime.com
ddt.com
density.com
diskchk.com
disktest.com
dump.asm
dump.com
ed.com
error.com
fastcopy.com
fig10-10.bas
fig10-5.bas
fig10-7.bas
fig10-9.bas
fig14-3.asm
fig14-4.bas
fig16-2.asm
fig16-3.pas
fig16-6.bas
fig16-7.mac
fig16-9.cmd
fig167.rel
fig7-2.bas
fig7-5.bas
fig7-9.bas
fig8-180.sub
fig8-182.sub
fig8-183.bas
fig8-185.cmd
fig8-3.asm
fig8-95.asm
fileback.com
format.com
hdcheck.com
hdconfig.001
hdconfig.002
hdconfig.com
hformat.com
hloader.com
kxedit.com
load.com
menu.com
menuoly1.com
modsel.com
page.com
patch.com
pip.com
sample.txt
setccb.com
setdate.com
setmisc.com
settime.com
setup.com
stat.com
submit.com
syncro.com
trs2cpm.com
vedit.com
vedit.set
vedset.com
verify.com
xsub.com

I extracted dump.asm to /home/user/temp:

; FILE DUMP PROGRAM, READS AN INPUT FILE AND PRINTS IN HEX
;
; COPYRIGHT (C) 1975, 1976, 1977, 1978
; DIGITAL RESEARCH
; BOX 579, PACIFIC GROVE
; CALIFORNIA, 93950
;
ORG 100H
BDOS EQU 0005H ;DOS ENTRY POINT
CONS EQU 1 ;READ CONSOLE
TYPEF EQU 2 ;TYPE FUNCTION
PRINTF EQU 9 ;BUFFER PRINT ENTRY
BRKF EQU 11 ;BREAK KEY FUNCTION (TRUE IF CHAR READY)
OPENF EQU 15 ;FILE OPEN
READF EQU 20 ;READ FUNCTION
;
FCB EQU 5CH ;FILE CONTROL BLOCK ADDRESS
BUFF EQU 80H ;INPUT DISK BUFFER ADDRESS
;
; NON GRAPHIC CHARACTERS
CR EQU 0DH ;CARRIAGE RETURN
LF EQU 0AH ;LINE FEED
;
; FILE CONTROL BLOCK DEFINITIONS
FCBDN EQU FCB+0 ;DISK NAME
FCBFN EQU FCB+1 ;FILE NAME
FCBFT EQU FCB+9 ;DISK FILE TYPE (3 CHARACTERS)
FCBRL EQU FCB+12 ;FILE'S CURRENT REEL NUMBER
FCBRC EQU FCB+15 ;FILE'S RECORD COUNT (0 TO 128)
FCBCR EQU FCB+32 ;CURRENT (NEXT) RECORD NUMBER (0 TO 127)
FCBLN EQU FCB+33 ;FCB LENGTH
;
; SET UP STACK
LXI H,0
DAD SP
; ENTRY STACK POINTER IN HL FROM THE CCP
SHLD OLDSP
; SET SP TO LOCAL STACK AREA (RESTORED AT FINIS)
LXI SP,STKTOP
; READ AND PRINT SUCCESSIVE BUFFERS
CALL SETUP ;SET UP INPUT FILE
CPI 255 ;255 IF FILE NOT PRESENT
JNZ OPENOK ;SKIP IF OPEN IS OK
;
; FILE NOT THERE, GIVE ERROR MESSAGE AND RETURN
LXI D,OPNMSG
CALL ERR
JMP FINIS ;TO RETURN
;
OPENOK: ;OPEN OPERATION OK, SET BUFFER INDEX TO END
MVI A,80H
STA IBP ;SET BUFFER POINTER TO 80H
; HL CONTAINS NEXT ADDRESS TO PRINT
LXI H,0 ;START WITH 0000
;
GLOOP:
PUSH H ;SAVE LINE POSITION
CALL GNB
POP H ;RECALL LINE POSITION
JC FINIS ;CARRY SET BY GNB IF END FILE
MOV B,A
; PRINT HEX VALUES
; CHECK FOR LINE FOLD
MOV A,L
ANI 0FH ;CHECK LOW 4 BITS
JNZ NONUM
; PRINT LINE NUMBER
CALL CRLF
;
; CHECK FOR BREAK KEY
CALL BREAK
; ACCUM LSB = 1 IF CHARACTER READY
RRC ;INTO CARRY
JC FINIS ;DON'T PRINT ANY MORE
;
MOV A,H
CALL PHEX
MOV A,L
CALL PHEX
NONUM:
INX H ;TO NEXT LINE NUMBER
MVI A,' '
CALL PCHAR
MOV A,B
CALL PHEX
JMP GLOOP
;
FINIS:
; END OF DUMP, RETURN TO CCP
; (NOTE THAT A JMP TO 0000H REBOOTS)
CALL CRLF
LHLD OLDSP
SPHL
; STACK POINTER CONTAINS CCP'S STACK LOCATION
RET ;TO THE CCP
;
;
; SUBROUTINES
;
BREAK: ;CHECK BREAK KEY (ACTUALLY ANY KEY WILL DO)
PUSH H! PUSH D! PUSH B; ENVIRONMENT SAVED
MVI C,BRKF
CALL BDOS
POP B! POP D! POP H; ENVIRONMENT RESTORED
RET
;
PCHAR: ;PRINT A CHARACTER
PUSH H! PUSH D! PUSH B; SAVED
MVI C,TYPEF
MOV E,A
CALL BDOS
POP B! POP D! POP H; RESTORED
RET
;
CRLF:
MVI A,CR
CALL PCHAR
MVI A,LF
CALL PCHAR
RET
;
;
PNIB: ;PRINT NIBBLE IN REG A
ANI 0FH ;LOW 4 BITS
CPI 10
JNC P10
; LESS THAN OR EQUAL TO 9
ADI '0'
JMP PRN
;
; GREATER OR EQUAL TO 10
P10: ADI 'A' - 10
PRN: CALL PCHAR
RET
;
PHEX: ;PRINT HEX CHAR IN REG A
PUSH PSW
RRC
RRC
RRC
RRC
CALL PNIB ;PRINT NIBBLE
POP PSW
CALL PNIB
RET
;
ERR: ;PRINT ERROR MESSAGE
; D,E ADDRESSES MESSAGE ENDING WITH "$"
MVI C,PRINTF ;PRINT BUFFER FUNCTION
CALL BDOS
RET
;
;
GNB: ;GET NEXT BYTE
LDA IBP
CPI 80H
JNZ G0
; READ ANOTHER BUFFER
;
;
CALL DISKR
ORA A ;ZERO VALUE IF READ OK
JZ G0 ;FOR ANOTHER BYTE
; END OF DATA, RETURN WITH CARRY SET FOR EOF
STC
RET
;
G0: ;READ THE BYTE AT BUFF+REG A
MOV E,A ;LS BYTE OF BUFFER INDEX
MVI D,0 ;DOUBLE PRECISION INDEX TO DE
INR A ;INDEX=INDEX+1
STA IBP ;BACK TO MEMORY
; POINTER IS INCREMENTED
; SAVE THE CURRENT FILE ADDRESS
LXI H,BUFF
DAD D
; ABSOLUTE CHARACTER ADDRESS IS IN HL
MOV A,M
; BYTE IS IN THE ACCUMULATOR
ORA A ;RESET CARRY BIT
RET
;
SETUP: ;SET UP FILE
; OPEN THE FILE FOR INPUT
XRA A ;ZERO TO ACCUM
STA FCBCR ;CLEAR CURRENT RECORD
;
LXI D,FCB
MVI C,OPENF
CALL BDOS
; 255 IN ACCUM IF OPEN ERROR
RET
;
DISKR: ;READ DISK FILE RECORD
PUSH H! PUSH D! PUSH B
LXI D,FCB
MVI C,READF
CALL BDOS
POP B! POP D! POP H
RET
;
; FIXED MESSAGE AREA
SIGNON: DB 'FILE DUMP VERSION 1.4$'
OPNMSG: DB CR,LF,'NO INPUT FILE PRESENT ON DISK$'

; VARIABLE AREA
IBP: DS 2 ;INPUT BUFFER POINTER
OLDSP: DS 2 ;ENTRY SP VALUE FROM CCP
;
; STACK AREA
DS 64 ;RESERVE 32 LEVEL STACK
STKTOP:
;
END


Which looks sane. sample.txt is also sane.


Larry

ldkraemer
October 21st, 2016, 11:35 AM
Accessing the TRS-80 Model II 68K-INST.IMD with cpmtools (built with libdsk 1.4.0) appears to function properly.

The cpmtools and libdsk definitions:

# A1 Generic CP/M - SSSD 8" - 128 x 26
diskdef a1
seclen 128
tracks 77
sectrk 26
blocksize 1024
maxdir 64
skew 6
boottrk 2
os 2.2
end

# libdsk data below
[a1]
description = A1 Generic CP/M - SSSD 8" - 128 x 26
cylinders = 77
heads = 1
secsize = 128
sectors = 26
secbase = 1
datarate = HD


A directory of the IMD file is:

cpmls -f a1 68K-INST.IMD
0:
ar68.68k
as68.68k
as68init
asm.sub
copy.68k
cpm68.sys
cpmldr.sys
ed.68k
find.68k
ldm68.com
lo68.68k
login.com
login.sub
m68.com
m68rsx.rsx
mov68cp+.sub
movcpm68.sub
newdisk.68k
pip.68k
reloc.68k
sd.68k
set.68k
stat.68k
vt52aton.com
vt52plus.com
vt52pnt.com
z80.68k


I extracted asm.sub to /home/user/temp:

AS68 -L -P $1.S >$1.PRN


Which looks sane.


Larry

ldkraemer
October 21st, 2016, 11:42 AM
Accessing the TRS-80 Model II LB225D.IMD with cpmtools (built with libdsk 1.4.0) appears to function properly.
I also accessed the TRSIILBT.IMD and extracted dumbterm.asm which appears sane.



The cpmtools and libdsk definitions:

# TRS5 TRS-80, Lifeboat CP/M (1024 bytes/sector) - SSDD 8" - 1024 x 8
diskdef trs5
seclen 1024
tracks 77
sectrk 8
blocksize 2048
maxdir 128
skew 3
boottrk 2
os 2.2
end

# libdsk data below
[trs5]
description = TRS5 TRS-80, Lifeboat CP/M (1024 bytes/sector) - SSDD 8" - 1024 x 8
cylinders = 77
heads = 1
secsize = 1024
sectors = 8
secbase = 1
datarate = ED


A directory of the IMD file is:

cpmls -f trs5 LB225D.IMD
0:
50hertz.sub
asm.com
cbas2.com
cbas207.com
cbasic.hlp
cbasic2.hlp
config.com
copy.com
crun2.com
crun207.com
crun236.com
crun237.com
crun238.com
d.com
ddt.com
dumbterm.asm
dumbterm.com
dump.asm
dump.com
ed.com
filecopy.com
format.com
i.com
load.com
memr.com
movcpm.com
nswp207.com
onedrive.com
pip.com
read-me.doc
stat.com
submit.com
sysgen.com
tof.com
vidtest.asm
vidtest.bas
vidtest.com
wsinstal.doc
xsub.com


I extracted wsinstal.doc to /home/user/temp:

PRINTER INSTALLATION NOTES
FOR LIFEBOAT CP/M ON THE TRS-80 MODEL II


A. Printer interface type

Lifeboat CP/M for the TRS-80 Model II comes with the list
device initially assigned to the parallel port. If your printer
has a Centronics type parallel interface you will be able to use
the printer immediately, and you can skip to section C below. If
your printer has an RS-232 serial interface, CPM must be modified
so that it will be able to communicate with the printer. These
modifications can easily be made by running the "CONFIG" program
which is supplied on the CP/M disk.


B. Using the CP/M Configuration program (CONFIG)

Starting from the MAIN Configuration Menu, option 1 must be
used to reassign the list device to one of the two serial ports,
and probably options 2 (baud rate) and 6 (mode - i.e. software
handshaking protocol) as well. Further detail on the use of
CONFIG.COM is provided below.

Option 1 = LIST Configuration Menu

From this menu, typing 2 or 4 will set the printer to Serial Port
A or B. Serial port B is generally used for printer interfaces.

Option 2 = BAUD RATE Menu

From this menu, type the number corresponding to the baud rate of
your printer. (Most serial printers have some method of varying
their baud rates, either through switch settings, jumpers, or
programming, and it is most advantageous to select the highest
baud rate that is supported by both your printer, and the CP/M).

Option 6 = Serial port PROTOCOL menu.

This menu will tell CP/M to send characters to the printer using
either XON/XOFF, ETX/ACK, hardware handshaking, or NO protocol.
Choosing the proper protocol is slightly tricky, because some
programs (such as WORDSTAR) may use a protocol, and your printer
will become very confused if both the CP/M and the program are
using a protocol. The purpose of a protocol is to allow your
printer to tell the computer that it is being sent characters
faster than it can print them. If the computer doesn't pause, the
error may not be detected and the printer will continue to print
whatever is not lost. The resulting loss of data may not be
detected by the operator.





Some printers are smarter, and can receive commands
interspersed with text. If they lose some command characters,
the printer will usually either stop printing, or may start
printing garbage. When this happens the printer may have to be
reset by turning the power off and then on again before it will
print.
If you are having trouble and a protocol can't be properly
selected, ask your dealer for help or call LifeBoat's Technical
Department for help (1-212-860-0300 weekdays, 9:00 a.m.-7:00 p.m.
N.Y. time). Also see suggestions under D below .

C. Installation of Wordstar with serial-interface Diablo printers

There are two ways to do it. If your printer supports
ETX/ACK or XON/XOFF protocol you can install the printer with "No
protocol or handled outside of Wordstar", and "CP/M LST: device "
selections on the "Install" menu. This is the easiest method of
installation .

If your printer does not support a software protocol or you
wish to bypass the CP/M, you can install the printer with the "P"
option in the Driver menu, for "Direct i/o to 8-bit port".


To do this, follow the steps below.


1) Set the printer baud rate (usually by means of a switch
on or inside the printer) . Using CONFIG, set the
serial port and baud rate to agree with that of the
printer. Also in CONFIG, set the no protocol option.
2) Run the Wordstar "Install" program and select your
printer from the menu (e.g., "E" for the Diablo
1640/1650)
3) On the "Communications Protocol Menu", select "E" for
ETX/ACK or "X" for XON/XOFF.
4) On the "Driver Menu", select "P" for direct i/o to 8-bit
port
5) Give the following answers to questions the Install
program asks.

The port numbers given below are for the TRS-80 Model
II.

Are printer ports I/O ports or memory-mapped? I
Do you wish Wordstar to determine the values or should
Wordstar accept them from you? A
What is the output port for your printer? f5
Do you wish Wordstar to determine values or should
Wordstar accept them from you? A
What is the output status port number in hex? f7
What are the bits that change, etc.? 4
Which bit changes from 0 to 1? 4



(Similar questions will be asked for the input port.)

Do you wish Wordstar to determine the values or should
Wordstar accept them from you? A
What is the input port for your printer? f5
Do you wish Wordstar to determine values or should
Wordstar accept them from you? A
What is the input status port number in hex? f7
What are the bits that change, etc. 1
Which bit changes from 0 to 1? 1



This completes the installation.


E. What to do if you have problems installing the printer

Begin with the simplest possible installation -- use CONFIG
to select a hardware handshaking protocol at 300 baud, which is a
slow enough baud rate for almost any printer. In Wordstar's
"INSTALL", select a backspacing TTY-like printer with no
protocol. If the printer is still dead, check physical
connections between printer and computer.
Once the printer is installed with this simple
configuration, you can move on to the fancier installations
described above.


Which looks sane.


Files remaining:
trsf ATN225BD.IMD DSHD
trse ATN225BS.IMD SSDD
trse ATN223IS.IMD SSDD
???? FMG221.IMD SSDD

Larry

JonB
October 23rd, 2016, 07:35 AM
Hi Larry

Did you succeed in writing to the images as well? That was what got me foxed - but eventually, I put Kermit on the Model II and can transfer files directly now.

Cheers
JonB

ldkraemer
October 25th, 2016, 03:01 PM
Accessing the Tandy Model II ATN225BD.RAW, ATN225BD.RAW, ATN223IS.RAW images with cpmtools (ver 2.21 built without libdsk 1.4.0) appears to function properly.

The Images require slightly modified cpmtools definitions:

ATN225BD.RAW trsf
ATN225BS.RAW trse
ATN223IS.RAW trse


# TRSE TRS-80 II/12/16 Aton CP/M - SSHD 8" - 1024 x 8
diskdef trse
seclen 1024
tracks 77
sectrk 8
blocksize 2048
maxdir 128
datarate DD
fm NO
skew 3
boottrk 0
offset 11520
os 2.2
end

# libdsk data below is not tested
[trse]
description = TRSE TRS-80 II/12/16 Aton CP/M - SSHD 8" - 1024 x 8
cylinders = 77
heads = 1
secsize = 1024
sectors = 8
secbase = 1
datarate = ED


# TRSF TRS-80 II/12/16 Aton CP/M - DSHD 8" - 1024 x 8
diskdef trsf
seclen 1024
tracks 154
sides alt
sectrk 8
blocksize 2048
maxdir 192
skew 3
boottrk 0
offset 11520
os 2.2
end

# libdsk data below is not tested
[trsf]
description = TRSF TRS-80 II/12/16 Aton CP/M - DSHD 8" - 1024 x 8
sides = alt
cylinders = 154
heads = 2
secsize = 1024
sectors = 8
secbase = 1
datarate = ED



ATN225BD.RAW, ATN225BD.RAW, ATN223IS.RAW were created from the original .IMD files with:

IMDU ATN225BD.IMD ATN225BD.RAW /D /E /B >> ATN225BD.LOG


cpmls -f trsf ATN225BD.RAW
cpmls -f trse ATN225BS.RAW
cpmls -f trse ATN223IS.RAW


larry@debian:~/Downloads/cpmtools/cpmtools-2.21$ cpmls -f trsf ATN225BD.RAW
0:
asm.com
autoexec.com
copy.com
copysys.com
cvpatch.sub
ddt.com
dump.asm
dump.com
ed.com
filex.com
getautok.com
getautok.mac
hdboot.com
hdinit.com
hdsys
level2.com
load.com
movcpm.com
pip.com
putautok.com
putautok.mac
rscpm.com
setlpp.com
setlpp.mac
stat.com
submit.com
sysdef.com
time.com
ws30pat.sub
ws33pat.sub
xsub.com


setlpp.mac is:

.Z80

;************************************************* ************************************
;
; WARNING!!! WARNING!!! WARNING!!! WARNING!!! WARNING!!! WARNING!!! WARNING!!!
;
; This program is copyrighted:
; (C) COPYRIGHT 1981, 1982, 1983, 1984 ATON INTERNATIONAL, INC.
; ALL RIGHTS RESERVED
;
; This program is the property of Aton International, Inc. and is to be used only
; in accordance with the written Aton license agreement. It is not to be used
; by parties who have not received written authorization from Aton International, Inc.
;
; Aton International, Inc., 1765 Scott Blvd., Suite 119, Santa Clara, California 95050
; Phone: (408) 554-9922
;
;************************************************* ************************************

TITLE SETLPP - SET LINES PER PAGE - Property of Aton International, Inc.

VERS DEFL 225 ;CP/M VERSION NUMBER
REV DEFL 'A' ;ATON REVISION LEVEL

.PHASE 0100H

SETLPP: LD SP,100H ;STACK NEEDS TO BE IN LOW 32K FOR INTERRUPTS TO
; BE ENABLED DURING BANK SWITCHING
;
LD A,(0CH)
CP 03EH
JR Z,STL200 ;JMP IF WE ARE OPERATING IN LEVEL 2
CALL BIOSAD ;GET ADDRESS OF WARM START ENTRY INTO BIOS
LD A,H
CP 0F0H
JR NC,STL100 ;JMP IF WE ARE OPERATING IN L80K
;
;WE ARE OPERATING IN LEVEL 1
;
CALL BIOSAD ;GET ADDRESS OF WARM START ENTRY INTO BIOS
LD DE,033H
ADD HL,DE ;POINT TO ADDRESS OF PARAMETERS
LD E,(HL)
INC HL
LD D,(HL)
EX DE,HL ;HL POINTS TO PARAMETERS
CALL PARMSB ;UPDATE PARAMETERS

JP 0 ;RETURN TO O/S
;
;WE ARE OPERATING IN L80K
;
STL100: DI

LD A,(CPUSAV)
PUSH AF ;SAVE CURRENT BANK NUMBER

LD A,(012H) ;GET ADDRESS OF O/S BANK
OUT (CPUCSR),A ;SELECT O/S BANK
LD (CPUSAV),A ;UPDATE CPUCSR SHADOW SO THAT INTERRUPTS WILL BE
; PROCESSED PROPERLY

EI

LD HL,(09636H) ;GET POINTER TO PARAMETERS
; THIS ADDRESS IS FIXED BY THE SIZE OF CCP AND BDOS

CALL PARMSB ;UPDATE PARAMETERS

POP AF
DI
OUT (CPUCSR),A ;SELECT TPA BANK
LD (CPUSAV),A ;UPDATE CPUCSR SHADOW
EI

JP 0 ;RETURN TO O/S
;
;WE ARE OPERATING IN LEVEL 2
;
STL200: CALL SWOUT ;BANK SWITCH TO LEVEL 2 I/O BANK

LD HL,(08000H) ;GET POINTER TO PARAMETERS
; THIS ADDRESS IS FIXED

CALL PARMSB ;UPDATE PARAMETERS

CALL SWBACK ;SWITCH BANKS BACK TO TPA BANK

JP 0 ;RETURN TO O/S
;
;GET BIOS WARM BOOT ADDRESS
; INPUT PARMS: NONE
; RETURN DATA: HL = ADDRESS OF WARM BOOT ENTRY INTO BIOS
;
BIOSAD: LD HL,(1)
LD A,L
CP 3
RET Z ;RETURN IF WE ARE NOT OPERATING WITH XSUB ACTIVE
DEC L
LD H,(HL) ;GET BIOS PAGE NUMBER
LD L,3
RET
;
;UPDATE SYSTEM PARAMETERS
; INPUT PARMS: HL = ADDRESS OF FIRST PARAMETER (CPUOPT) OF SYSTEM PARMS
; RETURN DATA: NONE
;
PARMSB: PUSH HL
LD DE,7000H
LD BC,1000H
LDIR ;MOVE SYSTEM PARAMETERS TO AREA WHERE THEY CAN
; BE EXAMINED BY DDT AFTER WE EXIT
POP HL
LD DE,PRTLPP-CPUOPT ;GET OFFSET TO LINES PER PAGE FOR PARALLEL
; PRINTER PORT
ADD HL,DE
LD (HL),63 ;CHANGE LINES PER PAGE TO 63. THIS IS EFFECTIVE
; UNTILL NEXT COLD BOOT.
RET
;
;SWITCH TO I/O BANK
; INPUT PARMS: NONE
; RETURN DATA: NONE
;
SWOUT: DI
LD HL,(M16LSV)
LD (LSAVE),HL
LD A,(CPUSAV)
LD (CSAVE),A ;SAVE BANK CONTROL PORT SHADOWS

LD A,(CPUSYS)
OUT (CPUCSR),A
LD (CPUSAV),A

LD A,(M16LSY)
OUT (M16L),A
LD (M16LSV),A

LD A,(M16HSY)
OUT (M16H),A
LD (M16HSV),A ;SELECT I/O BANK AND UPDATE SHADOWS

EI
RET
;
;SWITCH BACK TO TPA BANK
; INPUT PARMS: NONE
; RETURN DATA: NONE
;
SWBACK: DI
LD A,(CSAVE)
OUT (CPUCSR),A
LD (CPUSAV),A

LD A,(LSAVE)
OUT (M16L),A
LD (M16LSV),A

LD A,(LSAVE+1)
OUT (M16H),A
LD (M16HSV),A

EI
RET
;
LSAVE: DEFW 0 ;SAVE AREA FOR 68000 CONTROL PORT SHADOWS
CSAVE: DEFB 0 ;SAVE AREA FOR Z-80 CONTROL PORT SHADOW
;
;THE FOLLOWING STRUCTURE SHOWS THE LAYOUT OF THE SYSTEM PARAMETER AREA
; THE DEFAULT VALUES SHOWN ARE THOSE USED WHEN THE SYSTEM IS DELIVERED
;
CPUOPT: DEFB 4 ;CPU OPTIONS: BIT 0 = READ AFTER WRITE
; 1 = SCREEN FLASH ON BEL CODE
; 2 = SUPPRESS ACTION OF CTRL-8
; 3 = TIME UPDATED AT MINUTE INTERVAL
; 4 = CALL TPA FOR CHARACTER I/O BIOS CALLS
; 5 = CALL TPA FOR DISK I/O BIOS CALLS
; 6 = UPDATE CLOCK FROM P+T CCB
; 7 = RETAIN CTRL-P ON WARM BOOT
PBANKS: DEFW 0 ;PRIVATE BANKS
M16PCT: DEFB 0 ;NUMBER OF PRIVATE 16K BANKS IN 68000 MEMORY
BEEPLN: DEFB 25 ;BEEP LENGTH IN UNITS OF 10 MILLISECONDS
; 25 = 1/4 SECOND
CLIKCT: DEFB 5 ;MOD 12 KEY CLICK COUNTER IN 1 MILLISECOND UNITS
THINLN: DEFB 0 ;DISK DRIVE OPTIONS:
; THIN LINE DRIVE BIT MAP: 1 MEANS USE DISK CHANGE
; STATUS INSTEAD OF DRIVE NOT READY STATUS TO
; INDICATE THAT DRIVE DOOR IS OPEN. USED ONLY BY LEVEL 2.
; BIT 0: DRIVE 0 USES DISK CHANGE STATUS
; BIT 1: DRIVE 1 USES DISK CHANGE STATUS
; BIT 2: DRIVE 2 USES DISK CHANGE STATUS
; BIT 3: DRIVE 3 USES DISK CHANGE STATUS
; BIT 4: SUPPRESS IMMEDIATE PURGE OF MODIFIED
; BUFFERS FOR HARD DRIVES
RDYLIM: DEFB 10 ;DRIVE READY PAUSE IN 100 MILLISECOND UNITS.
; THIS NEEDS TO BE SET HIGH ENOUGH
; TO ALLOW MOTOR TO START UP ON THIN LINE DRIVES
; BEFORE SYSTEM CHECKS FOR DRIVE READY. ON MODEL 2
; MACHINES WHERE MOTOR IS ON ALL THE TIME, THIS
; VALUE CAN BE SET TO ZERO. SOME THIN LINE DRIVES
; CAN TAKE AS LONG AS 2.5 SECONDS ALTHOUGH THE
; DRIVES ARE SPEC'ED AT 0.8 SECONDS.
PBYLIM: DEFW 1000 ;PRINTER BUSY TIMOUT LIMIT IN 10 MILLISECOND UNITS
PDELAY: DEFB 1 ;PRINTER CHARACTER OUT DELAY. ALLOWS SETUP FOR
; PARALLEL PRINTER PORT

DELLIM: DEFB 160 ;ONE MILLISECOND COUNT
WRTLIM: DEFB 60 ;WRITE TIMEOUT OF 60 SECONDS
CHWLIM: DEFB 25 ;TIME LIMIT (10'S OF MILLISECONDS) FOR MODIFIED
; TRACK IN MEMORY AFTER CHARACTER I/O

CPOPTE DEFL $ ;END OF PRIMARY OPTIONS
;
CLOCK: DEFB 100 ;TICKS
DEFB 0 ;SECONDS
DEFB 0 ;MINUTES
DEFB 0 ;HOURS
DEFB 1 ;DAY OF WEEK
DEFB 16 ;DAY OF MONTH
DEFB 1 ;MONTH
DEFB 84 ;YEAR
;
RTC: DEFW 0,0 ;REAL TIME CLOCK

CRTPNT: DEFW CRTTAB ;CRT TRANSLATION TABLE POINTER
KBDPNT: DEFW KBDTAB ;KEYBOARD TRANSLATION TABLE POINTER
;
;
DEFB (CRTTBE-CRTTAB)/2 ;NUMBER OF ENTRIES IN CRTTAB
CRTTAB: DEFB ESC,0FFH ;0FFH = 8-BIT CRT CODES, 07FH = 7-BIT CRT CODES
DEFB NNUL,17
DEFB BS,1
DEFB LF,2
DEFB VT,3
DEFB FF,4
DEFB CR,5
DEFB 076H+80H,6 ;LOWER CASE 'V'
DEFB 077H+80H,7 ;LOWER CASE 'W'
DEFB SUBB,8
DEFB BEL,9
DEFB RS,10
DEFB US,11
DEFB '='+80H,12 ;THE +80H INDICATES ESCAPE SEQUENCE
DEFB 'T'+80H,13
DEFB 074H+80H,13 ;LOWER CASE 'T'
DEFB 'Y'+80H,14
DEFB 079H+80H,14 ;LOWER CASE 'Y'
DEFB '+'+80H,8
DEFB '*'+80H,8
DEFB ')'+80H,15
DEFB '('+80H,16
DEFB '$'+80H,18
DEFB '%'+80H,19
DEFB 0FFH
DEFS 8 ;ROOM FOR EXPANSION
CRTTBE DEFL $
;
;
DEFB ((KBDTBE-KBDTAB)/2)-1 ;NUMBER OF ENTIRES IN KBDTAB
KBDTAB: DEFB 000H,01EH ;HOLD KEY
DEFB 008H,07FH ;BACKSPACE KEY
DEFB 01CH,008H ;LEFT ARROW
DEFB 01DH,00CH ;RIGHT ARROW
DEFB 01EH,00BH ;UP ARROW
DEFB 01FH,00AH ;DOWN ARROW
DEFB 0C0H,000H ;CNTL ' KEY
DEFB 0DBH,01CH ;CNTL LEFT CURLY BRACKET KEY
DEFB 0DDH,01DH ;CNTL RIGHT CURLY BRACKET KEY
DEFB 0BAH,01FH ;CNTL ; KEY
DEFB 0ABH,060H ;CNTL = KEY
DEFB 0FFH,07FH ;END OF LIST, ERASE HIGH ORDER BIT
DEFS 20 ;ROOM FOR EXPANSION
KBDTBE DEFL $
;
;
CHPLIN: DEFW 80 ;CHARACTERS PER LINE ON SCREEN
LNPSCR: DEFW 24 ;LINES PER SCREEN
VIDCUR: DEFW VIDBUF ;DISPLAY SCREEN POINTER
CURSOR: DEFW 0 ;DISCRETE LINE-COLUMN CURSOR
REVVID: DEFB 0 ;0 = WHITE ON BLACK, 080H = BLACK ON WHITE
VIDPRT: DEFB 0 ;0 = REVVID ATTRIBUTE, 080H = NOT REVVID ATTRIBUTE
VSLINE: DEFW VIDBUF+2048-80 ;LEFTMOST POSITION ADDRESS OF STATUS LINE
VSTART: DEFW VIDBUF ;UPPER SCROLL LIMIT
VNLINE: DEFW VIDBUF+80 ;UPPER SCROLL LIMIT + CHPLIN
VSCNT: DEFW 23*80 ;NUMBER OF CHARS TO SCROLL
VLLINE: DEFW VIDBUF+23*80 ;ADDRESS OF FIRST CHAR OF LAST LINE
VLCHAR: DEFW VIDBUF+24*80-1 ;ADDRESS OF LAST CHAR ON SCREEN
DSLINE: DEFB 0FFH ;STATUS LINE DISPLAY ACTIVE FLAG
CONCOD: DEFB 60H + 7 ;CURSOR ON CODE

VIDPME DEFL $ ;END OF VIDEO PARAMETERS
;
;
PRTCLK: DEFB 0 ;TIMEOUT CLOCK
PRTHLT: DEFB 0 ;DEVICE DISABLE FLAG
PRTRSC: DEFB PIBDAT ;COMMAND/STATUS REGISTER
PRTDAT: DEFB PIBDAT ;DATA REGISTER
PRTIST: DEFW $-$ ;INPUT STATUS ROUTINE ADDRESS
PRTINP: DEFW $-$ ;INPUT DATA ROUTINE ADDRESS
PRTOST: DEFW $-$ ;OUTPUT STATUS ROUTINE ADDRESS
PRTOUT: DEFW $-$ ;OUTPUT DATA ROUTINE ADDRESS
PRTLFC: DEFB 0 ;INSERTED LINE FEED COUNT
PRTCLN: DEFB 1 ;CURRENT LINE NUMBER
PRTCHC: DEFB 0 ;CHARACTER COUNTER
PRTLCH: DEFB 0 ;LAST CHARACTER REMOVED FROM BUFFER
PRTBLC: DEFB 0 ;INSERTED BLANK COUNT
PRTIMK: DEFB 0 ;INPUT MASK
PRTOMK: DEFB 0FFH ;OUTPUT MASK
PRTPRT: DEFB 0 ;TRANSMISSION PROTOCOL
PRTCPL: DEFB 0 ;CHARACTERS PER LINE
PRTPL: DEFB 66 ;PAGE LENGTH
PRTLPP: DEFB 66 ;LINES PER PAGE
PRTOPT: DEFB 0BH ;PRINT OPTIONS
;
;
SOACLK: DEFB 0 ;TIMEOUT CLOCK
SOAHLT: DEFB 0 ;DEVICE DISABLE FLAG
SOARSC: DEFB SIACSR ;COMMAND/STATUS REGISTER
SOADAT: DEFB SIADAT ;DATA REGISTER
SOAIST: DEFW $-$ ;INPUT STATUS ROUTINE ADDRESS
SOAINP: DEFW $-$ ;INPUT DATA ROUTINE ADDRESS
SOAOST: DEFW $-$ ;OUTPUT STATUS ROUTINE ADDRESS
SOAOUT: DEFW $-$ ;OUTPUT DATA ROUTINE ADDRESS
SOALFC: DEFB 0 ;INSERTED LINE FEED COUNT
SOACLN: DEFB 1 ;CURRENT LINE NUMBER
SOACHC: DEFB 0 ;CHARACTER COUNTER
SOALCH: DEFB 0 ;LAST CHARACTER REMOVED FROM BUFFER
SOABLC: DEFB 0 ;INSERTED BLANK COUNT
SOAIMK: DEFB 0FFH ;INPUT MASK
SOAOMK: DEFB 0FFH ;OUTPUT MASK
SOAPRT: DEFB 1 ;TRANSMISSION PROTOCOL
SOACPL: DEFB 0 ;CHARACTERS PER LINE
SOAPL: DEFB 66 ;PAGE LENGTH
SOALPP: DEFB 66 ;LINES PER PAGE
SOAOPT: DEFB 4 ;PRINT OPTIONS
SOACPB: DEFB ETXBSZ ;CHARACTERS PER ETX/ACK BLOCK
;
;
SOBCLK: DEFB 0 ;TIMEOUT CLOCK
SOBHLT: DEFB 0 ;DEVICE DISABLE FLAG
SOBRSC: DEFB SIBCSR ;COMMAND/STATUS REGISTER
SOBDAT: DEFB SIBDAT ;DATA REGISTER
SOBIST: DEFW $-$ ;INPUT STATUS ROUTINE ADDRESS
SOBINP: DEFW $-$ ;INPUT DATA ROUTINE ADDRESS
SOBOST: DEFW $-$ ;OUTPUT STATUS ROUTINE ADDRESS
SOBOUT: DEFW $-$ ;OUTPUT DATA ROUTINE ADDRESS
SOBLFC: DEFB 0 ;INSERTED LINE FEED COUNT
SOBCLN: DEFB 1 ;CURRENT LINE NUMBER
SOBCHC: DEFB 0 ;CHARACTER COUNTER
SOBLCH: DEFB 0 ;LAST CHARACTER REMOVED FROM BUFFER
SOBBLC: DEFB 0 ;INSERTED BLANK COUNT
SOBIMK: DEFB 0FFH ;INPUT MASK
SOBOMK: DEFB 0FFH ;OUTPUT MASK
SOBPRT: DEFB 1 ;TRANSMISSION PROTOCOL
SOBCPL: DEFB 0 ;CHARACTERS PER LINE
SOBPL: DEFB 66 ;PAGE LENGTH
SOBLPP: DEFB 66 ;LINES PER PAGE
SOBOPT: DEFB 4 ;PRINT OPTIONS
SOBCPB: DEFB ETXBSZ ;CHARACTERS PER ETX/ACK BLOCK
;
;
NNUL DEFL 0
STX DEFL 2
ETX DEFL 3
ACK DEFL 6
BEL DEFL 7
BS DEFL 8
HT DEFL 9
LF DEFL 0AH
VT DEFL 0BH
FF DEFL 0CH
CR DEFL 0DH
SO DEFL 0EH
SI DEFL 0FH
DC1 DEFL 11H
DC3 DEFL 13H
DC4 DEFL 14H
SUBB DEFL 1AH
ESC DEFL 1BH
FS DEFL 1CH
GS DEFL 1DH
RS DEFL 1EH
US DEFL 1FH

ETXBSZ DEFL 120 ;NUMBER OF CHARACTERS PER BLOCK FOR
; ETX/ACK PROTOCOL

BDOS DEFL 5 ;BDOS ENTRY POINT

M16LSV DEFL 048H ;PORT DE SHADOW
M16HSV DEFL 049H ;PORT DF SHADOW
CPUSAV DEFL 00BH ;PORT FF SHADOW

M16LSY DEFL 01EH ;I/O BANK PORT DE ADDRESS
M16HSY DEFL 022H ;I/O BANK PORT DF ADDRESS
CPUSYS DEFL 01AH ;I/O BANK PORT FF ADDRESS
;
;MODEL 16 CONTROL REGISTERS
;
M16L DEFL 0DEH ;CONTROL LOW
M16H DEFL 0DFH ;CONTROL HIGH
;
;MODEL 12 CONTROL REGISTERS
;
BPCTL DEFL 0A0H ;BEEPER CONTROL (BIT 0 = BEEP ON,
; OTHER BITS = DON'T CARE)
LPAGE DEFL 0A8H ;LOW PAGE CONTROL (BIT 0 = DESELECT LOW 4K,
; OTHER BITS = DON'T CARE)
SOFTMR DEFL 0E8H ;SOFTWARE RESET OF FDC CHIP
;
;CPU COMMAND/STATUS REGISTER DEFINITIONS
;
CPUCSR DEFL 0FFH ;CPU COMMAND/STATUS REGISTER
VIDRAM DEFL 080H ;VIDEO RAM ENABLE
KBDIRQ DEFL 080H ;KEYBOARD CHARACTER READY
VIDOFF DEFL 040H ;VIDEO DISABLE
RTCENB DEFL 020H ;SCREEN REFRESH RATE CLOCK (NON-MASKABLE INTERRUPT)
CH40EN DEFL 010H ;40 CHARACTER LINE ENABLE
;
;CRT DEFINITIONS
;
CRTCSR DEFL 0FCH ;CRT COMMAND/STATUS (ADDRESS) REGISTER
CRTDAT DEFL 0FDH ;CRT DATA REGISTER

VIDBUF DEFL 0F800H ;VIDEO BUFFER ADDRESS
SLINE DEFL 2048-80 ;STATUS LINE INDEX IN VIDEO BUFFER
;
;KEYBOARD DEFINITIONS
;
KBDDAT DEFL 0FCH ;KEYBOARD DATA REGISTER
;
;PIO DEFINITIONS
;
PIACSR DEFL 0E2H ;PIO CHANNEL A COMMAND/STATUS REGISTER
PIBCSR DEFL 0E3H ;PIO CHANNEL B COMMAND/STATUS REGISTER
;
PIADAT DEFL 0E0H ;PIO CHANNEL A DATA REGISTER
PIBDAT DEFL 0E1H ;PIO CHANNEL B DATA REGISTER
;
;PIADAT IS THE PRINTER AND SECONDARY DISK COMMAND/STATUS REGISTER
PBUSY DEFL 080H ;PRINTER BUSY STATUS (WON'T ACCEPT DATA)
PEMPTY DEFL 040H ;PRINTER PAPER OUT STATUS
PDSLCT DEFL 020H ;PRINTER DESELECTED STATUS (OFF-LINE)
PFAULT DEFL 010H ;PRINTER FAULT STATUS
PPRIME DEFL 008H ;PRINTER PRIME COMMAND
DC DEFL 04H ;DISK CHANGE STATUS
TS DEFL 02H ;TWO SIDED STATUS
; (MAY BE RETURNED IF SA850 WITH OPEN DOOR!)
DSRQ DEFL 01H ;DISK SERVICE REQUEST STATUS (INTRQ)
;
;CTC DEFINITIONS
;
CT0CSR DEFL 0F0H ;CTC CHANNEL #0
CT1CSR DEFL 0F1H ;CTC CHANNEL #1
CT2CSR DEFL 0F2H ;CTC CHANNEL #2
CT3CSR DEFL 0F3H ;CTC CHANNEL #3
;
;
;SIO DEFINITIONS
;
SIACSR DEFL 0F6H ;CHANNEL A COMMAND/STATUS REGISTER
SIADAT DEFL 0F4H ;CHANNEL A DATA REGISTER
;
SIBCSR DEFL 0F7H ;CHANNEL B COMMAND/STATUS REGISTER
SIBDAT DEFL 0F5H ;CHANNEL B DATA REGISTER

END SETLPP



larry@debian:~/Downloads/cpmtools/cpmtools-2.21$ cpmls -f trse ATN225BS.RAW
0:
asm.com
autoexec.com
copy.com
copysys.com
cvpatch.sub
ddt.com
dump.asm
dump.com
ed.com
filex.com
getautok.com
getautok.mac
hdboot.com
hdinit.com
hdsys
level2.com
load.com
movcpm.com
pip.com
putautok.com
putautok.mac
rscpm.com
setlpp.com
setlpp.mac
stat.com
submit.com
sysdef.com
time.com
ws30pat.sub
ws33pat.sub
xsub.com


getautok.mac is:

.Z80

;************************************************* ************************************
;
; WARNING!!! WARNING!!! WARNING!!! WARNING!!! WARNING!!! WARNING!!! WARNING!!!
;
; This program is copyrighted:
; (C) COPYRIGHT 1981, 1982, 1983, 1984 ATON INTERNATIONAL, INC.
; ALL RIGHTS RESERVED
;
; This program is the property of Aton International, Inc. and is to be used only
; in accordance with the written Aton license agreement. It is not to be used
; by parties who have not received written authorization from Aton International, Inc.
;
; Aton International, Inc., 1765 Scott Blvd., Suite 119, Santa Clara, California 95050
; Phone: (408) 554-9922
;
;************************************************* ************************************

TITLE GETAUTOK - GET AUTO KEYS - Property of Aton International, Inc.

VERS DEFL 225 ;CP/M VERSION NUMBER
REV DEFL 'A' ;ATON REVISION LEVEL

.PHASE 0100H

GETAUT: LD SP,100H
;
LD A,(0CH)
CP 03EH
LD DE,L2MSG
JR NZ,TILT ;JMP IF WE ARE NOT OPERATING IN LEVEL 2

LD A,(05DH)
CP ' '
JR Z,ATK010 ;JMP IF NO COMMAND LINE ARGUMENT GIVEN - USE DEFAULT
LD BC,12
LD DE,FCB
LD HL,05CH
LDIR ;USE FILE NAME GIVEN ON COMMAND LINE

ATK010: LD C,15
LD DE,FCB
CALL BDOS ;OPEN AUTO KEY FILE
LD DE,FMISS
CP 0FFH
JR Z,TILT ;JMP IF FILE MISSING

LD DE,BUFF
CALL READ ;READ FIRST HALF OF AUTOKEY FILE
JR NZ,TILT ;JMP IF READ ERROR

LD DE,BUFF+128
CALL READ ;READ SECOND HALF OF AUTOKEY FILE
JR NZ,TILT ;JMP IF READ ERROR

LD C,16
LD DE,FCB
CALL BDOS ;CLOSE AUTO KEY FILE
LD DE,CLOSMS
CP 0FFH
JR Z,TILT ;JMP IF CLOSE ERROR

CALL SWOUT ;SWITCH TO I/O BANK
LD BC,256
LD DE,09D80H
LD HL,BUFF
LDIR ;MOVE AUTOKEY FILE TO AUTOKEY BUFFER
CALL SWBACK ;SWITCH BACK TO TPA BANK

LD C,9
LD DE,FINISH
CALL BDOS ;PRINT EXIT MESSAGE
JP 0
;
;LIST ERROR MESSAGE
;
TILT: LD C,9
CALL BDOS ;LIST ERROR MESSAGE TO CONSOLE
JP 0
;
;READ FILE BLOCK
; INPUT PARMS: DE = BUFFER ADDRESS
; RETURN DATA: Z = 0 IF READ ERROR
;
READ: LD C,26
CALL BDOS ;SET DMA ADDRESS
LD C,20
LD DE,FCB
CALL BDOS ;READ FILE BLOCK
LD DE,READER
CP 0
RET
;
;SWITCH TO I/O BANK
; INPUT PARMS: NONE
; RETURN DATA: NONE
;
SWOUT: DI
LD HL,(M16LSV)
LD (LSAVE),HL
LD A,(CPUSAV)
LD (CSAVE),A ;SAVE BANK CONTROL PORT SHADOWS

LD A,(CPUSYS)
OUT (CPUCSR),A
LD (CPUSAV),A

LD A,(M16LSY)
OUT (M16L),A
LD (M16LSV),A

LD A,(M16HSY)
OUT (M16H),A
LD (M16HSV),A ;SELECT I/O BANK AND UPDATE SHADOWS

EI
RET
;
;SWITCH BACK TO TPA BANK
; INPUT PARMS: NONE
; RETURN DATA: NONE
;
SWBACK: DI
LD A,(CSAVE)
OUT (CPUCSR),A
LD (CPUSAV),A

LD A,(LSAVE)
OUT (M16L),A
LD (M16LSV),A

LD A,(LSAVE+1)
OUT (M16H),A
LD (M16HSV),A

EI
RET
;
FCB: DEFB 0,'AUTOKEY BUF',0,0,0,0,0
DEFB 0,0,0,0,0,0,0,0
DEFB 0,0,0,0,0,0,0,0
;
LSAVE: DEFW 0 ;SAVE AREA FOR 68000 CONTROL PORT SHADOWS
CSAVE: DEFB 0 ;SAVE AREA FOR Z-80 CONTROL PORT SHADOW
FMISS: DEFB CR,LF,'AUTOKEY BUFFER FILE MISSING',CR,LF,'$'
READER: DEFB CR,LF,'AUTOKEY FILE READ ERROR',CR,LF,'$'
CLOSMS: DEFB CR,LF,'AUTOKEY FILE CLOSE ERROR',CR,LF,'$'
FINISH: DEFB CR,LF,'AUTOKEY FILE TRANSFER SUCCESSFUL',CR,LF,'$'
L2MSG: DEFB CR,LF,'THIS PROGRAM MUST BE EXECUTED IN LEVEL 2 ONLY',CR,LF,'$'
;
CR DEFL 0DH
LF DEFL 0AH

BDOS DEFL 5 ;BDOS ENTRY POINT
BUFF DEFL 4000H ;STORAGE AREA FOR AUTOKEY BUFFER FILE

M16LSV DEFL 048H ;PORT DE SHADOW
M16HSV DEFL 049H ;PORT DF SHADOW
CPUSAV DEFL 00BH ;PORT FF SHADOW

M16LSY DEFL 01EH ;I/O BANK PORT DE ADDRESS
M16HSY DEFL 022H ;I/O BANK PORT DF ADDRESS
CPUSYS DEFL 01AH ;I/O BANK PORT FF ADDRESS

M16L DEFL 0DEH ;68000 CONTROL PORT
M16H DEFL 0DFH ;68000 CONTROL PORT
CPUCSR DEFL 0FFH ;Z-80 CONTROL PORT

END GETAUTOK



larry@debian:~/Downloads/cpmtools/cpmtools-2.21$ cpmls -f trse ATN223IS.RAW
0:
asm.com
autoexec.com
copy.com
ddt.com
dump.asm
dump.com
ed.com
filex.com
level2.com
load.com
movcpm.com
pip.com
rscpm.com
stat.com
submit.com
sysdef.com
sysgen.com
time.com
xsub.com



dump.asm is:

; FILE DUMP PROGRAM, READS AN INPUT FILE AND PRINTS IN HEX
;
; COPYRIGHT (C) 1975, 1976, 1977, 1978
; DIGITAL RESEARCH
; BOX 579, PACIFIC GROVE
; CALIFORNIA, 93950
;
ORG 100H
BDOS EQU 0005H ;DOS ENTRY POINT
CONS EQU 1 ;READ CONSOLE
TYPEF EQU 2 ;TYPE FUNCTION
PRINTF EQU 9 ;BUFFER PRINT ENTRY
BRKF EQU 11 ;BREAK KEY FUNCTION (TRUE IF CHAR READY)
OPENF EQU 15 ;FILE OPEN
READF EQU 20 ;READ FUNCTION
;
FCB EQU 5CH ;FILE CONTROL BLOCK ADDRESS
BUFF EQU 80H ;INPUT DISK BUFFER ADDRESS
;
; NON GRAPHIC CHARACTERS
CR EQU 0DH ;CARRIAGE RETURN
LF EQU 0AH ;LINE FEED
;
; FILE CONTROL BLOCK DEFINITIONS
FCBDN EQU FCB+0 ;DISK NAME
FCBFN EQU FCB+1 ;FILE NAME
FCBFT EQU FCB+9 ;DISK FILE TYPE (3 CHARACTERS)
FCBRL EQU FCB+12 ;FILE'S CURRENT REEL NUMBER
FCBRC EQU FCB+15 ;FILE'S RECORD COUNT (0 TO 128)
FCBCR EQU FCB+32 ;CURRENT (NEXT) RECORD NUMBER (0 TO 127)
FCBLN EQU FCB+33 ;FCB LENGTH
;
; SET UP STACK
LXI H,0
DAD SP
; ENTRY STACK POINTER IN HL FROM THE CCP
SHLD OLDSP
; SET SP TO LOCAL STACK AREA (RESTORED AT FINIS)
LXI SP,STKTOP
; READ AND PRINT SUCCESSIVE BUFFERS
CALL SETUP ;SET UP INPUT FILE
CPI 255 ;255 IF FILE NOT PRESENT
JNZ OPENOK ;SKIP IF OPEN IS OK
;
; FILE NOT THERE, GIVE ERROR MESSAGE AND RETURN
LXI D,OPNMSG
CALL ERR
JMP FINIS ;TO RETURN
;
OPENOK: ;OPEN OPERATION OK, SET BUFFER INDEX TO END
MVI A,80H
STA IBP ;SET BUFFER POINTER TO 80H
; HL CONTAINS NEXT ADDRESS TO PRINT
LXI H,0 ;START WITH 0000
;
GLOOP:
PUSH H ;SAVE LINE POSITION
CALL GNB
POP H ;RECALL LINE POSITION
JC FINIS ;CARRY SET BY GNB IF END FILE
MOV B,A
; PRINT HEX VALUES
; CHECK FOR LINE FOLD
MOV A,L
ANI 0FH ;CHECK LOW 4 BITS
JNZ NONUM
; PRINT LINE NUMBER
CALL CRLF
;
; CHECK FOR BREAK KEY
CALL BREAK
; ACCUM LSB = 1 IF CHARACTER READY
RRC ;INTO CARRY
JC FINIS ;DON'T PRINT ANY MORE
;
MOV A,H
CALL PHEX
MOV A,L
CALL PHEX
NONUM:
INX H ;TO NEXT LINE NUMBER
MVI A,' '
CALL PCHAR
MOV A,B
CALL PHEX
JMP GLOOP
;
FINIS:
; END OF DUMP, RETURN TO CCP
; (NOTE THAT A JMP TO 0000H REBOOTS)
CALL CRLF
LHLD OLDSP
SPHL
; STACK POINTER CONTAINS CCP'S STACK LOCATION
RET ;TO THE CCP
;
;
; SUBROUTINES
;
BREAK: ;CHECK BREAK KEY (ACTUALLY ANY KEY WILL DO)
PUSH H! PUSH D! PUSH B; ENVIRONMENT SAVED
MVI C,BRKF
CALL BDOS
POP B! POP D! POP H; ENVIRONMENT RESTORED
RET
;
PCHAR: ;PRINT A CHARACTER
PUSH H! PUSH D! PUSH B; SAVED
MVI C,TYPEF
MOV E,A
CALL BDOS
POP B! POP D! POP H; RESTORED
RET
;
CRLF:
MVI A,CR
CALL PCHAR
MVI A,LF
CALL PCHAR
RET
;
;
PNIB: ;PRINT NIBBLE IN REG A
ANI 0FH ;LOW 4 BITS
CPI 10
JNC P10
; LESS THAN OR EQUAL TO 9
ADI '0'
JMP PRN
;
; GREATER OR EQUAL TO 10
P10: ADI 'A' - 10
PRN: CALL PCHAR
RET
;
PHEX: ;PRINT HEX CHAR IN REG A
PUSH PSW
RRC
RRC
RRC
RRC
CALL PNIB ;PRINT NIBBLE
POP PSW
CALL PNIB
RET
;
ERR: ;PRINT ERROR MESSAGE
; D,E ADDRESSES MESSAGE ENDING WITH "$"
MVI C,PRINTF ;PRINT BUFFER FUNCTION
CALL BDOS
RET
;
;
GNB: ;GET NEXT BYTE
LDA IBP
CPI 80H
JNZ G0
; READ ANOTHER BUFFER
;
;
CALL DISKR
ORA A ;ZERO VALUE IF READ OK
JZ G0 ;FOR ANOTHER BYTE
; END OF DATA, RETURN WITH CARRY SET FOR EOF
STC
RET
;
G0: ;READ THE BYTE AT BUFF+REG A
MOV E,A ;LS BYTE OF BUFFER INDEX
MVI D,0 ;DOUBLE PRECISION INDEX TO DE
INR A ;INDEX=INDEX+1
STA IBP ;BACK TO MEMORY
; POINTER IS INCREMENTED
; SAVE THE CURRENT FILE ADDRESS
LXI H,BUFF
DAD D
; ABSOLUTE CHARACTER ADDRESS IS IN HL
MOV A,M
; BYTE IS IN THE ACCUMULATOR
ORA A ;RESET CARRY BIT
RET
;
SETUP: ;SET UP FILE
; OPEN THE FILE FOR INPUT
XRA A ;ZERO TO ACCUM
STA FCBCR ;CLEAR CURRENT RECORD
;
LXI D,FCB
MVI C,OPENF
CALL BDOS
; 255 IN ACCUM IF OPEN ERROR
RET
;
DISKR: ;READ DISK FILE RECORD
PUSH H! PUSH D! PUSH B
LXI D,FCB
MVI C,READF
CALL BDOS
POP B! POP D! POP H
RET
;
; FIXED MESSAGE AREA
SIGNON: DB 'FILE DUMP VERSION 1.4$'
OPNMSG: DB CR,LF,'NO INPUT FILE PRESENT ON DISK$'

; VARIABLE AREA
IBP: DS 2 ;INPUT BUFFER POINTER
OLDSP: DS 2 ;ENTRY SP VALUE FROM CCP
;
; STACK AREA
DS 64 ;RESERVE 32 LEVEL STACK
STKTOP:
;
END


Larry

ldkraemer
October 30th, 2016, 05:18 PM
I sent John Elliott (libdsk author) an email asking why diskid gave an error code while trying to access the RAW Images for ATN225BD, ATN225BS, and ATN223IS.

His research found that these images do not follow the standard IMD structure, and that is what is causing the libdsk error.

I prepended the proper code according to the Imagedisk documentation, so now the updated images should work with diskid.

I'm wondering how the original images were created?

Larry

pski
October 31st, 2016, 03:43 AM
I sent John Elliott (libdsk author) an email asking why diskid gave an error code while trying to access the RAW Images for ATN225BD, ATN225BS, and ATN223IS.

His research found that these images do not follow the standard IMD structure, and that is what is causing the libdsk error.

I prepended the proper code according to the Imagedisk documentation, so now the updated images should work with diskid.

I'm wondering how the original images were created?

Larry

Are these from the model2archive? If so, then I believe they were imaged a while ago but not sure by who or how. I think the IMD comments mentioned being created by the HxC floppy emulator. I would appreciate the "fixed" images so we can update the archive.