home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
assemblr
/
library
/
lib4a86
/
lib
/
exec.bib
< prev
next >
Wrap
Text File
|
1992-02-13
|
2KB
|
203 lines
#IF !LIB4A86
#ELSE
#IF !INTERN_LIB4A86_S
INTERN_LIB4A86_S EQU 01
JMP START
#ENDIF
#ENDIF
PROGRAMMBLOCK STRUC [BX]
_PROGENV DW ?
_PROGPARM DW ?,?
_PROGFCB1 DW ?,?
_PROGFCB2 DW ?,?
ENDS
S1 DW 0
S2 DW 0
EXECPROGRAMM:
PUSH CX,DX,ES,DI,SI,BX,DS
PUSH BP
MOV BP,SP
CLD
MOV CS:S1,SP
MOV CS:S2,SS
SUB SP,TYPE PROGRAMMBLOCK
MOV DS,SS
MOV BX,SP
PUSH BX,DS
MOV AH,062H
INT 021H
MOV DS,BX
MOV CX,[02CH]
MOV AX,DS
POP DS,BX
MOV _PROGFCB1+2,AX
MOV _PROGFCB2+2,AX
MOV _PROGFCB1,05CH
MOV _PROGFCB2,06CH
MOV _PROGENV,CX
MOV AX,[BP+4]
MOV _PROGPARM,AX
MOV CX,[BP+2]
MOV _PROGPARM+2,CX
MOV DS,CX
MOV SI,AX
LODSB
XOR AH,AH
ADD SI,AX
MOV B[SI],0DH
MOV SI,[BP+6]
LODSB
MOV DX,SI
ADD SI,AX
MOV [SI],AH
MOV ES,SS
MOV AX,04B00H
INT 021H
CLI
MOV SS,CS:S2
MOV SP,CS:S1
STI
JC >L9
MOV AH,04DH
INT 021H
L9:
POP BP
POP DS,BX,SI,DI,ES,DX,CX
RET
S0 EQU [BP-128XD]
S1 EQU [BP-384XD]
S2 EQU [BP-386XD]
PATHVAR DB 4,'PATH',60 DUP 0
SEARCHFILE:
PUSH ES,DI,CX,DS,SI
PUSH BP
MOV BP,SP
SUB SP,386XD
CLD
MOV ES,SS
LEA DI,S0
XOR AH,AH
MOV W S2,1
MOV AL,[SI]
OR AL,AL
STC
IF Z JMP >L9
CMP B[SI+2],':'
JE >L10
CMP B[SI+1],'/'
JE >L10
CMP B[SI+1],'\'
JNE >L1
L10:
CALL GETFILEPATH
JC >L9
CALL INTERN_R0
JMP >L9
L1:
MOV SI,DI
MOV DS,SS
XOR DL,DL
CALL GETDIR
JC >L1
CALL INTERN_R1
JNC >L9
L1:
LEA DI,S1
MOV DS,CS
MOV SI,OFFSET PATHVAR
CALL SEARCHENVSTR
JC >L9
MOV DS,SS
MOV SI,DI
LODSB
XOR AH,AH
ADD SI,AX
MOV [SI],AH
LEA DI,S0
L0:
CALL INTERN_R2
JC >L9
CALL INTERN_R1
JC L0
L9:
MOV SP,BP
POP BP
POP SI,DS,CX,DI,ES
RET
INTERN_R1:
PUSH DS
LDS SI,[BP+2]
CALL CONCATSTR
POP DS
INTERN_R0:
MOV SI,DI
CALL EXISTFILE
JC >L9
MOV SI,DI
LES DI,[BP+2]
CALL MOVESTR
CLC
L9:
RET
INTERN_R2:
LEA SI,S1
XOR CX,CX
CMP B[SI],CL
STC
JE >L9
PUSH SI
PUSH DI
INC DI
ADD SI,S2
L0:
LODSB
OR AL,AL
JZ >L1
CMP AL,03BH
JE >L1
STOSB
INC CX
JMP L0
L1:
POP DI
MOV [DI],CL
INC CX
ADD S2,CX
POP SI
SUB [SI],CL
JNS >L9
MOV B[SI],0
CLC
L9:
RET
#IF !INTERN_CMARK0
INTERN_CMARK0 EQU 01H
INTERN_CMARK1:
PUSH BP
MOV BP,SP
MOV BX,06H
SUB CH,[BP+SI]
SUB AH,[BX+SI]
DEC SP
DEC CX
INC DX
XOR AL,041H
CMP B[02820H],DH
INC BX
SUB W[BX+SI],SP
INC DX
CS AND B[BP+DI+043H],DL
DEC AX
INC BP
DEC BP
DEC BP
INC BP
PUSH DX
AND B[BP+SI],CH
SUB CH,[BP+SI]
POP DX
MOV SP,BP
POP BP
RET
#ENDIF