home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / assemblr / library / lib4a86 / lib / exec.bib < prev    next >
Text File  |  1992-02-13  |  2KB  |  203 lines

  1. #IF !LIB4A86
  2. #ELSE
  3. #IF !INTERN_LIB4A86_S
  4. INTERN_LIB4A86_S EQU 01
  5. JMP START
  6. #ENDIF
  7. #ENDIF
  8. PROGRAMMBLOCK STRUC [BX]
  9. _PROGENV DW ?
  10. _PROGPARM DW ?,?
  11. _PROGFCB1 DW ?,?
  12. _PROGFCB2 DW ?,?
  13. ENDS
  14. S1 DW 0
  15. S2 DW 0
  16. EXECPROGRAMM:
  17. PUSH CX,DX,ES,DI,SI,BX,DS
  18. PUSH BP
  19. MOV BP,SP
  20. CLD
  21. MOV CS:S1,SP
  22. MOV CS:S2,SS
  23. SUB SP,TYPE PROGRAMMBLOCK
  24. MOV DS,SS
  25. MOV BX,SP
  26. PUSH BX,DS
  27. MOV AH,062H
  28. INT 021H
  29. MOV DS,BX
  30. MOV CX,[02CH]
  31. MOV AX,DS
  32. POP DS,BX
  33. MOV _PROGFCB1+2,AX
  34. MOV _PROGFCB2+2,AX
  35. MOV _PROGFCB1,05CH
  36. MOV _PROGFCB2,06CH
  37. MOV _PROGENV,CX
  38. MOV AX,[BP+4]
  39. MOV _PROGPARM,AX
  40. MOV CX,[BP+2]
  41. MOV _PROGPARM+2,CX
  42. MOV DS,CX
  43. MOV SI,AX
  44. LODSB
  45. XOR AH,AH
  46. ADD SI,AX
  47. MOV B[SI],0DH
  48. MOV SI,[BP+6]
  49. LODSB
  50. MOV DX,SI
  51. ADD SI,AX
  52. MOV [SI],AH
  53. MOV ES,SS
  54. MOV AX,04B00H
  55. INT 021H
  56. CLI
  57. MOV SS,CS:S2
  58. MOV SP,CS:S1
  59. STI
  60. JC >L9
  61. MOV AH,04DH
  62. INT 021H
  63. L9:
  64. POP BP
  65. POP DS,BX,SI,DI,ES,DX,CX
  66. RET
  67. S0 EQU [BP-128XD]
  68. S1 EQU [BP-384XD]
  69. S2 EQU [BP-386XD]
  70. PATHVAR DB 4,'PATH',60 DUP 0
  71. SEARCHFILE:
  72. PUSH ES,DI,CX,DS,SI
  73. PUSH BP
  74. MOV BP,SP
  75. SUB SP,386XD
  76. CLD
  77. MOV ES,SS
  78. LEA DI,S0
  79. XOR AH,AH
  80. MOV W S2,1
  81. MOV AL,[SI]
  82. OR AL,AL
  83. STC
  84. IF Z JMP >L9
  85. CMP B[SI+2],':'
  86. JE >L10
  87. CMP B[SI+1],'/'
  88. JE >L10
  89. CMP B[SI+1],'\'
  90. JNE >L1
  91. L10:
  92. CALL GETFILEPATH
  93. JC >L9
  94. CALL INTERN_R0
  95. JMP >L9
  96. L1:
  97. MOV SI,DI
  98. MOV DS,SS
  99. XOR DL,DL
  100. CALL GETDIR
  101. JC >L1
  102. CALL INTERN_R1
  103. JNC >L9
  104. L1:
  105. LEA DI,S1
  106. MOV DS,CS
  107. MOV SI,OFFSET PATHVAR
  108. CALL SEARCHENVSTR
  109. JC >L9
  110. MOV DS,SS
  111. MOV SI,DI
  112. LODSB
  113. XOR AH,AH
  114. ADD SI,AX
  115. MOV [SI],AH
  116. LEA DI,S0
  117. L0:
  118. CALL INTERN_R2
  119. JC >L9
  120. CALL INTERN_R1
  121. JC L0
  122. L9:
  123. MOV SP,BP
  124. POP BP
  125. POP SI,DS,CX,DI,ES
  126. RET
  127. INTERN_R1:
  128. PUSH DS
  129. LDS SI,[BP+2]
  130. CALL CONCATSTR
  131. POP DS
  132. INTERN_R0:
  133. MOV SI,DI
  134. CALL EXISTFILE
  135. JC >L9
  136. MOV SI,DI
  137. LES DI,[BP+2]
  138. CALL MOVESTR
  139. CLC
  140. L9:
  141. RET
  142. INTERN_R2:
  143. LEA SI,S1
  144. XOR CX,CX
  145. CMP B[SI],CL
  146. STC
  147. JE >L9
  148. PUSH SI
  149. PUSH DI
  150. INC DI
  151. ADD SI,S2
  152. L0:
  153. LODSB
  154. OR AL,AL
  155. JZ >L1
  156. CMP AL,03BH
  157. JE >L1
  158. STOSB
  159. INC CX
  160. JMP L0
  161. L1:
  162. POP DI
  163. MOV [DI],CL
  164. INC CX
  165. ADD S2,CX
  166. POP SI
  167. SUB [SI],CL
  168. JNS >L9
  169. MOV B[SI],0
  170. CLC
  171. L9:
  172. RET
  173. #IF !INTERN_CMARK0
  174. INTERN_CMARK0 EQU 01H
  175. INTERN_CMARK1:
  176. PUSH BP
  177. MOV BP,SP
  178. MOV BX,06H
  179. SUB CH,[BP+SI]
  180. SUB AH,[BX+SI]
  181. DEC SP
  182. DEC CX
  183. INC DX
  184. XOR AL,041H
  185. CMP B[02820H],DH
  186. INC BX
  187. SUB W[BX+SI],SP
  188. INC DX
  189. CS AND B[BP+DI+043H],DL
  190. DEC AX
  191. INC BP
  192. DEC BP
  193. DEC BP
  194. INC BP
  195. PUSH DX
  196. AND B[BP+SI],CH
  197. SUB CH,[BP+SI]
  198. POP DX
  199. MOV SP,BP
  200. POP BP
  201. RET
  202. #ENDIF
  203.