home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Magazin 1997 February / CD_02_97.ISO / mztran / dietapi.doc < prev    next >
Text File  |  1995-08-29  |  9KB  |  118 lines

  1. ============================ DIETAPI.DOC ===============================
  2. ************************************************************************
  3. DIET APPLICATION INTERFACE version 1.43e copyright(c) 11/22/1991 by Teddy Matsumoto ************************************************************************
  4.  
  5. **Application Interface of DIET.EXE**
  6.  
  7. The following interrupts are designed to be used by application software authors to make easy controls over the status of DIET.EXE.
  8. Ealier Versions of DIET.EXE used to check its TSR status from the key words in MCB with certain offsets. This method is no more available since from this version on, DIET.EXE may stay as a program as well as a device driver. 
  9. I tried to device a routine to control DIET.EXE using simple DOS calls. 
  10. I present the details of the available service calls in the following for those who writes shells and other applications for DIET.EXE.
  11. DIET.EXE uses these interrupts to control its TSR part.
  12.  
  13. **INTERRUPT of DOS used **
  14.  
  15. INT 21h, AH=37h AL=D0h--DFh are used for the controls of TSR part of DIET.
  16. Here is the original description of INT 21h AH=37h from the documents Interrupt List Release 90.4 compiled by Ralf Brown,ralf@cs.cmu.edu.
  17.  
  18. ---------------------------------------------
  19. INT 21 - DOS 2+ internal - GET SWITCHAR AX = 3700h Return: AL = FFh unsupported subfunction DL = current switch character Notes: documented in some OEM versions of some releases of DOS supported by OS/2 compatibility box SeeAlso: AX=3701h 
  20. ---------------------------------------------
  21. INT 21 - DOS 2+ internal - SET SWITCHAR AX = 3701h DL = new switch character Return: AL = FFh unsupported subfunction Notes: documented in some OEM versions of some releases of DOS supported by OS/2 compatibility box SeeAlso: AX=3700h 
  22. ---------------------------------------------
  23. INT 21 - DOS 2.x and 4.0 only internal - AVAILDEV AH = 37h AL = subfunction 02h read device availability (as set by AL=03h) Return: DL = device availability (always FFh under DOS 4.0) 03h set device availability, where: DL = 00h means \DEV\ must preceed device names DL <> 00h means \DEV\ need not preceed device names Return: AL = FFh if invalid subfunction Notes: all versions of DOS from 2.00 allow \DEV\ to be prepended to device names without generating an error even if the directory \DEV does not actually exist (other paths generate an error if they do not exist).
  24. although DOS 4.0 accepts these calls, they have no effect 
  25. ---------------------------------------------
  26. The description above makes me convince that there is no other TSR program which makes use of this interrupt. I use this interrupt for API to make easier controls over the functions of DIET,EXE.
  27. To assure the safety further, I always set the BX register with ID BX = 899Dh ('DI'+'ET').
  28. **Available Functions **
  29. AX=37D0h        check TSR diet.exe AX=37D1h        get segment where diet.exe stays resident AX=37D2h        read TSR control flags.
  30. AX=37D3h        set TSR control flags. 
  31. AX=37D4h        read TSR options.
  32. AX=37D5h        set TSR options.
  33. AX=37D6h        read temporary directory names.
  34. AX=37D7h        set temporary directory.
  35. AX=37D8-37DBh   reseerved for future use by DIET.exe AX=37DCh        set address of external procedure.
  36. AX=37DDh        release external procedure.
  37. AX=37DEh        read EMS status.
  38. AX=37DFh        remove TSR part from memory.
  39.  
  40. * HOW to USE API of DIET.EXE **
  41. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ These calls can be used only after establishing that the Resident Part of DIET.EXE is in fact present, by making the call with AX=37D0h.
  42. ** Example.Disable TSR DIET.EXE temporarily for copying: 
  43.  
  44. AX=37D0h check if DIET.EXE is present as TSR program.
  45. AX=37D2h read TSR control flags and preserve on stacks.
  46. AX=37D3h disable TSR function of DIET.EXE Copy files if necessary AX=37D3h reset TSR control flags to the original state.
  47.  
  48.  
  49. ** DIET API specifications **
  50. All of the values in the resiters are preserved except those in Return values.
  51. -----------------------------------------------------------------------------
  52. ** Get DIET status**
  53. int 21h  AH = 37h  BX = 899Dh ('DI'+'ET') AL = D0h Return:  AX = 0  CX = 899Dh  DX = version ID DIET.EXE is present as TSR program.
  54. AL = -1 DIET.EXE is not present as TSR.
  55. AL = -1 is a default return value of DOS 2+ to 4.0.
  56. -----------------------------------------------------------------------------
  57. **Read Segment Address of TSR DIET.EXE int 21h  AH = 37h  BX = 899Dh ('DI'+'ET') AL = D1h Return:  AX = 0 CX = code segment of TSR part of DIET.EXE.
  58. DX = memory block segment of TSR DIET.EXE.
  59. DX = 0 if device=DIET.EXE in config.sys.
  60. -----------------------------------------------------------------------------
  61. ** Read control flags of TSR DIET.EXE int 21h  AH = 37h  BX=899Dh ('DI'+'ET') AL = D2h Return:  AX = 0 DL = 0 DIET.EXE is active else diable DH = Skip flag. 
  62. Note:  Skip flags takes non-zero value while TSR is active.
  63. -----------------------------------------------------------------------------
  64. ** Set TSR control flags INT 21h  AH = 37h  BX=899Dh ('DI'+'ET') AL = D3h DL = TSR control flag ; 
  65. = 0    : active 
  66. = else : disable DH = 0 :    Skipflag Return:  AX=0 
  67. ------------------------------------------------------------------------------
  68. **Read TSR otpitons int 21h  AH = 37h  BX = 899Dh ('DI'+'ET') AL = D4h Return:  AX = 0 DX = TSR options; bit 1: automated compression of DIETed file  option -p bit 2: automated compression of created file option -w bit 3: Supress DIET message                  option -m bit 4: Display Origianl File size            option -s bit 5-16: reserved 
  69. -----------------------------------------------------------------------------
  70. ** Set TSR options INT 21h  AX = 37h  BX=899Dh ('DI'+'ET') AL = D5h DX = TSR otpions bit 1: automated compression of DIETed file  option -p bit 2: automated compression of created file option -w bit 3: Supress DIET message                  option -m bit 4: Display Origianl File size            option -s bit 5ⁿ`16: must be 0, reserved Return:  AX = 0 
  71. -----------------------------------------------------------------------------
  72. ** Read Temproary directory name.
  73. INT 21h  AX = 37h  BX=899Dh ('DI'+'ET') AL = D6h Return:  AX = 0 DS:DX = Temporary directory name.
  74. Note:  DS:DX   NULL indicates the current directory.
  75. -----------------------------------------------------------------------------
  76. ** Set temporary directory.
  77. int 21h  AH = 37h  BX = 899Dh ('DI'+'ET') AL = D7h DS:DX = Temporary Directory Name.
  78. Return:  AX = 0 Note:  Set temporary directory. The PATH name must begin with the DRIVE name and must end with '\', the length of the name must be within 61 letters ending with 0. 'NULL' specification set the default, CURRENT directory.
  79. ------------------------------------------------------------------------------
  80. **Set address of an external procedure INT 21h  AH = 37h  BX = 899Dh ('DI'+'ET') AL = DCh DS:DX = Address of external procedure.
  81. Return:  AX = 0 Note:  Set address of the external procedure.
  82. Resident part calls external procedure at the beginning of decompression and on exiting compression by failure. Informations are stacked with pointers: 
  83.  
  84. SP+0,3      return address.
  85. SP+4,5      class;upon start  : file handle of DIETed file.
  86. upon failure: -1 file creation error 
  87. -2 fail to create by shortage of space 
  88. -3 fail to create by other reason SP+6,9      Pointer to the compressed filename.
  89. SP+10,13    Pointer to the decompressed,or temporary filename 
  90.  
  91. With these informations, you may write a program such as a small popup window reporting the process of decompressing and link with this call.
  92.  
  93. Do preserve ES,DS,BP,SI,DI resiters when you use this call.
  94. Expanded Memory is opened through a window in this call. Consequently, you must reset logical to physical memory mapping to the saved state and issue RETurn from procedure Far, lest you should hang up the system.
  95.  
  96. -----------------------------------------------------------------------------
  97. ** Release external procedure.
  98. INT 21h  AH = 37h  BX=899Dh ('DI'+'ET') AL = DDh Return:  nothing Note: Release external procedure linked by AH=37h, AL=DCh 
  99. -----------------------------------------------------------------------------
  100. ** Read Status in Expanded Memory INT 21h  AH =37h  BX=899Dh ('DI'+'ET') AL = DEh Return:  AX = 0 CX = 0: Expanded Memory not used.
  101. 1: Expanded Memory used as work area 2: Expanded Memory used for codes and as work area.
  102. DX = EMM handle when Expanded Memory is used.
  103. Note:  read the status of DIET.EXE in EMS.
  104. ------------------------------------------------------------------------------
  105. ** Remove TSR part from memory **
  106. int 21h  AX = 37h  BX = 899Dh ('DI'+'ET') AL = DFh Return:  AX = 00h  success in removal.
  107. AX = FFh  failure in removal.
  108. Note:  Remove TSR DIET.EXE, do not forget to check if TSR is resident.
  109. Expanded Memory Areas stay as they are.
  110.  
  111.  
  112. ** Finally **
  113. I have no plan to change the functions of those calls described above.
  114. though I may add functions to the reserved values of AL.
  115. Please test these APplication Interfaces if you are to design shells or help programs for DIET.EXE. 
  116.  
  117. ========================= end of DIETAPI.DOC ===========================
  118.