Menu Close

High Speed IMP for the PCPI SIO Card

IMP is a great little terminal program written by Irvin Hoff and I thought it could use a speed upgrade along the same lines as QTerm. The result was IMP_SIO.ZIP. Imp is much simpler than QTerm. It’s one .ASM file and it doesn’t support Kermit, just XModem and YModem. While only one source file, Imp was actually a little bit more difficult to modify because the author originally assumed that no baud rate would ever be greater than 9600 bps (4 characters). I had to re-write the baud rate table to support variable length baud rates in addition to inlining the patch overlay routines. I once again easily achieved 57600 bps upload/download XModem data rates with my 6 MHz Applicard in an unaccelerated Apple //e. 115k uploads from the Apple II work fine as well but it’s not quite possible to receive at 115k. I think to properly do 115k data transfers both ways on my Applicard (or any CP/M system) will require my own terminal program written from the ground up.

While this version of IMP is specific to the Klein-Baker SIO card, the inlining techniques used here are fairly generic and should work with other Z80 systems. I’ve included the original IMP source code in the above .ZIP file for comparison should someone wish to alter IMP for another platform. The following baud rates are now supported in IMP: 1200 baud 2400 baud 9600 baud 19200 baud 38400 baud 57600 baud 115200 baud – Upload only for 115k.


To Use:

Run IMP.COM to launch the binary. The default baud rate is 57600 bps. See IMP.DOC for details on how to use IMP but here are some simple commands to get your started:

  • E – Enters terminal mode
  • ESC E  – Exit back to command mode when you’re in terminal mode
  • M – Display the help menu
  • M – Help menu
  • CPM – Exit back to CP/M
  • 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


To Compile:

SUB BLDIMP will will erase binary and symbol files and then compile IMP from source as well as apply the IMPSIO patch overlay. The result will be IMP.COM which can run as a stand-alone binary. The original unaltered IMP v2.45 source code is contained in IMP245S.LBR for comparison should someone wish to alter IMP for another platform. See the README.1ST file in the IMP_SIO.ZIP file for details on how to compile High Speed IMP.


Details on the baud rate table change to IMP

The original baud rate table assumed all baud rate strings were four digits or less (9600, 1200, 300, etc.). The table actually assumes three-digit baud rates then manual tacks on an extra 0 for the four-digit rates.  When someone added 19200 to the table, the code could never quite figure out the setting and would give you an error whenever you used the SET command like SET 19200.  Here is the original 8080 code for the baud table:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

PRTBAUD:LXI H,SPTBL    ; Start of baud rate speeds

    MVI D,0    ; Zero the ‘D’ register

    LDA MSPEED     ; Get speed indicator

    ADD A      ; Index into the baud rate table

    ADD A

    MOV E,A    ; Now have the index factor in ‘DE’

    DAD D      ; Add to ‘HL’

    XCHG           ; Put address in ‘DE’ regs.

    MVI C,PRINT    ; Show the baud

    CALL    BDOS

    LDA MSPEED

    CPI 5

    JC  PRTBD1     ; Adds a zero for 2400, 4800, 9600 bps

    CALL    ILPRT

    DB  ‘0’,0

;

PRTBD1: CALL    ILPRT

    DB  ‘ bps’,0

    RET

 

SPTBL:  DB  ‘110$’,’300$’,’450$’,’600$’,’710$’,’120$’,’240$’

    DB  ‘480$’,’960$’,’1920$’

The new baud rate table is more efficient and allows for variable length baud strings by using a table index that indicates where the next baud string starts in the table:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

;Eric N.–NEEDED TO INDEX THIS PROPERLY FOR HIGHER BAUD RATES (MORE THAN 4 CHARS)

;

PRTBAUD:MVI D,0    ; Zero the ‘D’ register

    LXI H,TBLIDX              ; HL gets address of TBLIDX

    LDA MSPEED     ; Speed indexes TBLIDX

    MOV E,A    ; Move MSPEED into DE reg

    DAD D      ; HL=HL+DE Want TBLIDX[MSPEED]

    MOV E,M    ; Get Real index value into DE

    LXI H,SPTBL    ; Start of baud rate speeds

    DAD D      ; Add to ‘HL’

    XCHG           ; Put address in ‘DE’ regs.

    MVI C,PRINT    ; Show the baud

    CALL    BDOS

;

;

PRTBD1: CALL    ILPRT

    DB  ‘ bps’,0

    RET

SPTBL:  DB  ‘300$’,’1200$’,’2400$’,’9600$’,’19200$’,’38400$’

    DB  ‘57600$’,’115200$’

 

;Index table for SPTBL

TBLIDX: DB  0,4,9,14,19,25,31,37

;…..

 Enjoy your high speed serial transfers and happy archiving!