With my collection of CP/M systems growing, I decided to make my high speed version of IMP platform independent. I’ve removed the hardware-specific code from the main program but kept the code changes to support baud rate tables up to 115k. This means you can apply any existing IMP overlay now as long as you sequence your baud steps in this manner:
0=300 1=1200 2=2400, 3=9600, 4=19200, 5=38400, 6=57600, 7=115200
You don’t have to support all of the baud rates, just make sure the MSPEED index values in your overlay maps to the same numbers here. See IMPZ100.ASM and IMP-SIO.ASM as example overlays.
Download the new IMP246-HS.
Compiling IMP246 and Your Overlay
You only need MAC.COM and MLOAD.COM to compile IMP. The overlay, compilers and everything you need is included in the IMP246-HS.ZIP file. Example build and clean SUBMIT batch files have been included for the Z-100 overlay. You will need to modify the .SUB files to your overlay.
To clean: “SUBMIT cleanzimp”
To build: “SUBMIT bldzimp”
You will now have a stand-alone .COM file that will run on the CP/M platform whose overlay you used. IMP comes with some other helper programs like I2LIB.COM but these programs are geared towards setting up dialing profiles so unless you’re still using a modem, you probably only need IMP.COM. I’ve included all IMP files in the package, though, just for completeness.
To Use IMP
- E – Enters terminal mode
- M – Help menu
- set <baud> – Sets the baud rate. Ex: SET 38400
- r <filename> – receive a file name with XModem (you choose the filename)
- rb – YModem batch receive (file name is determined by sending program)
- s and sb are the respective send commands
- sxb *.* will upload everything in the user directory via YModem; this is great for easily archiving disks (the x param disables 1K transfers).
Update 4-Jan-2015: I recommend you use “sxb <filename> when transferring a large file (> 128 records) using YModem batch instead of just “sb”. The x parameter disables 1k transfers. If you’re transferring from floppies, the read cycle time for the next batch of blocks to transfer can sometimes cause the transmission to NAK out on you. You’ll lose a a few seconds of transfer time but not having your batch transfer abort in the middle of things is worth the trade-off.
Adapting an Existing Overlay
Here is a more detailed look at how to modify an existing overlay for higher speed baud rates.
1. Open your overlay (IMPZ00.ASM for example) and look for where MSPEED is being used:
Make sure the Compare-Immdediate (CPI) number for 300 is 0, 1200 is 1, 2400 is 2, etc. I removed some of the odd and never-used baud rates like 110, 4800, etc. so that the single digit index value would not be greater than 9, This means you will very likely have to re-sequence your baud rates in your overlay to match the new MSPEED index. Here is a code snippet from one of my overlays:
LDA MSPEED ; Get the selected value CPI 0 ; 300 bps JZ OK300 CPI 1 ; 1200 bps JZ OK1200 CPI 2 ; 2400 bps JZ OK2400
2. Move the correct mspeed index value into the baud table:
The same procedure applies here with MVI (Move-Immedidate). 0 maps to 300, 1 to 1200, 2, 2400, etc. However, your BD1200 value and LOADBD routine will be specific to your UART chip. Your existing overlay will already have the correct routines for setting basic values like 300, 1200 and 2400. You just need to add higher value settings. Consult the data sheet for your UART chip to see what baud rate settings it supports. UART chips seem to vary but most will support at least 19200 bps.
For example, say you want to add a 19200 baud rate setting. The easiest way to is to copy/paste the next lowest setting like 9600, change all 9600 references to 19200, and then modify the byte or bytes sent to the baud rate generator for 9600 bps originally to 19200 bps. For the 2661B chip used in the Z-100 it’s a one-byte change. For the SIO card I use with my Applicard, the Z80SIO/CTC ship combination is a little more complicated to program, but since you are probably already starting from an existing overlay, the hard work has been done for you, and all you are doing is locating the data sheet for your chip and changing a byte or two to clock at higher speeds.
OK1200: MVI A,1 MVI B,BD1200 JMP LOADBD
There should many CP/M systems out there with the ability to transfer serially at higher rates. The Z-100’s 2661 chip has a maximum baud rate of 38.4k while my high speed Z80 SIO chip with Z80SIO/CTC chips can clock in at 115K. My Kaypro 4-84’s GI-8116 has a max setting of 19200 for now unless I make motherboard changes.