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 / TURBOPAS / TPWARMST.PAT < prev    next >
Text File  |  2000-06-30  |  4KB  |  95 lines

  1. FILE:    TPWARMST.PAT
  2. VERSION: 1.00
  3. AUTHOR:  Ralph Iden
  4.  
  5. The following patches for Turbo Pascal versions 1.00, 2.00, and 3.01
  6. modify your program so that it doesn't automatically perform a warm
  7. boot at the conclusion of the program.
  8.  
  9. RCP/M and BBS programs can eliminate the needless reloading of CP/M
  10. thus saving a little (in some cases, a great deal) of time.
  11.  
  12. The principal used is as follows:  Instead of a jump to the CP/M warm
  13. start vector (0000h), we make the program execute a return which
  14. means, I guess, a return to the CCP (Console Command Processor).  In
  15. order to successfuly accomplish this, we must squirrel a copy of
  16. the stack pointer as it existed before the Pascal program was run.
  17.  
  18. <WARNING: AS I WAS WRITING THIS, A THOUGHT CAME INTO MY HEAD.  IF BY
  19.  EXECUTING A RETURN, WE ARE JUMPING TO THE CCP, WE MUST INSURE THAT
  20.  IT ISN'T OVERWRITTEN OR THE SYSTEM WILL CRASH.  YOU SHOULD PROBABLY
  21.  SET THE TOP OF MEMORY OF THE PROGRAM TO BE SOMEWHAT LESS (2K???)
  22.  THAN THE BEGINNING OF BDOS (ADDRESS LOCATED AT 0006H).  THIS WAY,
  23.  THE PASCAL PROGRAM WON'T CLOBBER THE CCP AND IT WILL STILL BE
  24.  THERE WHEN WE ARE READY TO RETURN.>
  25.  
  26. Whenever you modify a program for a soft warmstart, note the contents
  27. of 0101 and 0102.  Move these values to 010B and 010C respectfully.
  28. If you change the starting address of your Pascal program, these values
  29. will not be as shown below.
  30.  
  31. ------------------------------------------------------------------------
  32.  
  33. VERSION 1.00
  34.  
  35.    Address          Old                        New
  36.    -------  --------------------   --------------------------
  37.     0100:   C3 76 1D   jp  start    C3 06 01     jp  savstk
  38.     0103:   (No change)             (No change)
  39.     0106:   (Copyright message)     ED 73 0D 01  ld  (010D),sp
  40.                                     C3 76 1D     jp  start
  41.      Original stack storage -->     00 00        dw  0000
  42.     010F:                           ED 7B 0D 01  ld  sp,(010D)
  43.      (Return to CP/M via CCP)       C9           ret              
  44.  
  45.  
  46.     1D72:   2A DF 00   ld hl,(00DF) C3 0F 01     jp rststk
  47.             E9         jp (hl)
  48.  
  49.     00DF contains the address to jump
  50.     to at program end and is set to
  51.     0000H by the Pascal runtime.
  52.  
  53.  
  54. ------------------------------------------------------------------------
  55.  
  56. VERSION 2.00
  57.  
  58.    Address          Old                        New
  59.    -------  --------------------   --------------------------
  60.     0100:   C3 C9 1F   jp  start    C3 06 01     jp  savstk
  61.     0103:   (No change)             (No change)
  62.     0106:   (Copyright message)     ED 73 0D 01  ld  (010D),sp
  63.                                     C3 C9 1F     jp  start
  64.      Original stack storage -->     00 00        dw  0000
  65.     010F:                           ED 7B 0D 01  ld  sp,(010D)
  66.      (Return to CP/M via CCP)       C9           ret
  67.  
  68.  
  69.     1FC5:   2A DF 00   ld hl,(00DF) C3 0F 01     jp rststk
  70.             E9         jp (hl)
  71.  
  72.     00DF contains the address to jump
  73.     to at program end and is set to
  74.     0000H by the Pascal runtime.
  75.  
  76.  
  77. ------------------------------------------------------------------------
  78.  
  79. VERSION 3.01
  80.  
  81.    Address          Old                        New
  82.    -------  --------------------   --------------------------
  83.     0100:   C3 E3 20   jp  start    C3 06 01     jp  savstk
  84.     0103:   (No change)             (No change)
  85.     0106:   (Copyright message)     ED 73 0D 01  ld  (010D),sp
  86.                                     C3 E3 20     jp  start
  87.      Original stack storage -->     00 00        dw  0000
  88.     010F:                           ED 7B 0D 01  ld  sp,(010D)
  89.      (Return to CP/M via CCP)       C9           ret
  90.  
  91.  
  92.     20DC:   C3 00 00   jp warmstart C3 0F 01     jp rststk
  93.  
  94. ------------------------------------------------------------------------
  95.