kgCCPCHAINASMKYCCPCHAINDOC6;CCPCHAINZ80 ;CCPCHAIN.ASM OCT. 1986 P.P.P. ; ; Attach this program to the end of your assembly ; language program. It will chain the program named ; in FILENAM to your program by inserting that file ; name into the CCP buffer. A jump to the CCP causes ; the named program to load and execute. ; ;************************************************* ;NOTE: THE FOLLOWING ARE THE VALUES FOR MY SYSTEM ;ACTUAL VALUES USED ARE RECALCULATED AND INSERTED ;FOR THE SYSTEM IN USE CCP EQU 0CB00H ; START OF CCP LENBIT EQU 0CB07H ; LENGTH OF CCP BUFFER CCPBUF EQU 0CB08H ; START OF CCP BUFFER PNTR EQU 0CB88H ; POINTER TO CCP BUFFER ;************************************************* BDOS EQU 5 CR EQU 0DH LF EQU 0AH ORG 100H ; ;*****PUT YOUR PROGRAM HERE************************ ; JMP FINDCCP MES1: DB CR,LF,LF,LF,LF,'CCPCHAIN.COM OCT. 1986 P.P.P.' DB CR,LF,LF,'*****PUT YOUR MESSAGE HERE*****' DB CR,LF,LF,'Attach this program to the end' DB CR,LF,'of your assembly language program.' DB CR,LF,'It will chain the program named in' DB CR,LF,'FILENAM to your program by inserting' DB CR,LF,'that file name into the CCP buffer.' DB CR,LF,'A jump to the CCP causes the named' DB CR,LF,'program to load and execute.' DB CR,LF,'$' FINDCCP:LHLD 6 ; CCP=BDOS-806H LXI D,0F7FAH ; (COMPLEMENT OF 806H-1) DAD D ; HL CONTAINS CCP ADDRESS SHLD CCP1+1 ; LXI D,7 ; DAD D ; ADDR. OF LENGTH BIT SHLD PNTR1+1 ; INX H ; ADDR. OF START OF BUFFER SHLD CCPBUF1+1 ; SHLD CCPBUF2+1 ; LXI D,80H ; DAD D ; POINTER TO CCP BUFFER SHLD PNTR1+1 MVI C,9 LXI D,MES1 CALL BDOS LXI H,FILENAM CCPBUF1:LXI D,CCPBUF LXI B,ENDNAM-STARTNAM LOOP1: XCHG LOOP2: LDAX D MOV M,A INX H INX D DCX B MOV A,B CPI 0 JNZ LOOP2 MOV A,C CPI 0 JNZ LOOP2 MVI A,ENDNAM-STARTNAM LENBIT1:STA LENBIT CCPBUF2:LXI H,CCPBUF PNTR1: SHLD PNTR LXI H,4 ; GET DRIVE # MOV C,M ; PLACE IT IN C CCP1: JMP CCP STARTNAM EQU $ FILENAM:DB 'DDT' ; PUT NAME OF PROGRAM HERE ENDMARK:DB 00H ENDNAM EQU $ END CCPCHAIN.DOC OCT. 1986 FOR: CPM-80/Assembly language programming PURPOSE: Attach this program to the end of your assembly language program. It will chain the program named in FILENAM to your program by inserting that file name into the CCP buffer. A jump to the CCP causes the named program to load and execute. Background: While setting up BYE510 to run on my Osborne I found that my modem needs to cycle on and off one time to work properly. It was easy to write an auto-start program to do this but then how do I get BYE up and running without entering a command from the console? Using the CCP buffer is ideal for this application because the computer doesn't know if the command came from the console or another program. Just be sure that the CCP hasn't been overwritten before you jump to it! Phil Pflager P.O. Box 435 Cupertino, California 95015 ;CCPCHAIN.ASM OCT. 1986 P.P.P. ; ;Attach this program to the end of your assembly ;language program. It will chain the program named ;in FILENAM to your program by inserting that file ;name into the CCP buffer. A jump to the CCP causes ;the named program to load and execute. ; ;************************************************* ;NOTE: THE FOLLOWING ARE THE VALUES FOR MY SYSTEM ;ACTUAL VALUES ARE CALCULATED AND INSERTED FOR THE ;SYSTEM IN USE CCP EQU 0CB00H ;START OF CCP LENBIT EQU 0CB07H ;LENGTH OF CCP BUFFER CCPBUF EQU 0CB08H ;START OF CCP BUFFER PNTR EQU 0CB88H ;POINTER TO CCP BUFFER ;************************************************* BDOS EQU 5 CR EQU 0DH LF EQU 0AH .ORIGIN 100H ;************************************************** ;*****PUT YOUR PROGRAM HERE************************ ;************************************************** JP FINDCCP MES1: DB CR,LF,LF,LF,LF,'CCPCHAIN.COM OCT. 1986 P.P.P.' DB CR,LF,LF,'*****PUT YOUR MESSAGE HERE*****' DB CR,LF,LF,'Attach this program to the end' DB CR,LF,'of your assembly language program.' DB CR,LF,'It will chain the program named in' DB CR,LF,'FILENAM to your program by inserting' DB CR,LF,'that file name into the CCP buffer.' DB CR,LF,'A jump to the CCP causes the named' DB CR,LF,'program to load and execute.' DB CR,LF,'$' FINDCCP:LD HL,(6) LD DE,806H SBC HL,DE LD (CCP1+1),HL ;CCP LD DE,7 ADD HL,DE LD (PNTR1+1),HL ;LENGTH BIT INC HL LD (CCPBUF1+1),HL ;START OF BUFFER LD (CCPBUF2+1),HL LD DE,80H ADD HL,DE LD (PNTR1+1),HL ;POINTER TO CCP BUFFER LD C,9 LD DE,MES1 CALL BDOS LD HL,FILENAM CCPBUF1:LD DE,CCPBUF LD BC,ENDNAM-STARTNAM LDIR LD A,ENDNAM-STARTNAM LENBIT1:LD (LENBIT),A CCPBUF2:LD HL,CCPBUF PNTR1: LD (PNTR),HL LD HL,4 ;GET DRIVE # LD C,(HL) ;PLACE IT IN C CCP1: JP CCP STARTNAM EQU $ FILENAM:DB 'DDT' ;PUT NAME OF PROGRAM HERE ENDMARK:DB 00H ENDNAM EQU $ .END