home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / CCP / CCPCHAIN.LBR / CCPCHAIN.Z80 < prev   
Text File  |  2000-06-30  |  2KB  |  68 lines

  1. ;CCPCHAIN.ASM OCT. 1986  P.P.P.
  2. ;
  3. ;Attach this program to the end of your assembly 
  4. ;language program. It will chain the program named
  5. ;in FILENAM to your program by inserting that file 
  6. ;name into the CCP buffer. A jump to the CCP causes
  7. ;the named program to load and execute.
  8. ;
  9. ;*************************************************
  10. ;NOTE: THE FOLLOWING ARE THE VALUES FOR MY SYSTEM
  11. ;ACTUAL VALUES ARE CALCULATED AND INSERTED FOR THE
  12. ;SYSTEM IN USE
  13. CCP    EQU    0CB00H    ;START OF CCP
  14. LENBIT    EQU    0CB07H  ;LENGTH OF CCP BUFFER
  15. CCPBUF  EQU    0CB08H    ;START OF CCP BUFFER
  16. PNTR    EQU    0CB88H  ;POINTER TO CCP BUFFER
  17. ;*************************************************
  18. BDOS    EQU    5
  19. CR    EQU    0DH
  20. LF    EQU    0AH
  21.     .ORIGIN    100H
  22. ;**************************************************
  23. ;*****PUT YOUR PROGRAM HERE************************ 
  24. ;**************************************************
  25.     JP    FINDCCP
  26. MES1:    DB    CR,LF,LF,LF,LF,'CCPCHAIN.COM   OCT. 1986  P.P.P.'
  27.     DB    CR,LF,LF,'*****PUT YOUR MESSAGE HERE*****'
  28.     DB    CR,LF,LF,'Attach this program to the end'
  29.     DB    CR,LF,'of your assembly language program.'
  30.     DB    CR,LF,'It will chain the program named in'
  31.     DB    CR,LF,'FILENAM to your program by inserting'
  32.     DB    CR,LF,'that file name into the CCP buffer.'
  33.     DB    CR,LF,'A jump to the CCP causes the named'
  34.     DB    CR,LF,'program to load and execute.'
  35.     DB    CR,LF,'$'
  36. FINDCCP:LD    HL,(6)
  37.     LD    DE,806H
  38.     SBC    HL,DE
  39.     LD    (CCP1+1),HL       ;CCP
  40.     LD    DE,7
  41.     ADD    HL,DE
  42.     LD    (PNTR1+1),HL    ;LENGTH BIT
  43.     INC    HL
  44.     LD    (CCPBUF1+1),HL    ;START OF BUFFER
  45.     LD    (CCPBUF2+1),HL
  46.     LD    DE,80H
  47.     ADD    HL,DE
  48.     LD    (PNTR1+1),HL    ;POINTER TO CCP BUFFER
  49.     LD    C,9
  50.     LD    DE,MES1
  51.     CALL    BDOS    
  52.     LD    HL,FILENAM
  53. CCPBUF1:LD    DE,CCPBUF
  54.     LD    BC,ENDNAM-STARTNAM
  55.     LDIR
  56.     LD    A,ENDNAM-STARTNAM
  57. LENBIT1:LD    (LENBIT),A
  58. CCPBUF2:LD    HL,CCPBUF
  59. PNTR1:    LD    (PNTR),HL
  60.     LD    HL,4        ;GET DRIVE #
  61.     LD    C,(HL)        ;PLACE IT IN C
  62. CCP1:    JP    CCP
  63. STARTNAM EQU    $
  64. FILENAM:DB    'DDT'  ;PUT NAME OF PROGRAM HERE
  65. ENDMARK:DB    00H
  66. ENDNAM    EQU    $
  67.     .END
  68.