home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
pascal
/
das_buch
/
tsr
/
tsrinfo.asm
< prev
next >
Wrap
Assembly Source File
|
1993-06-04
|
5KB
|
262 lines
; ***************************************
; * Autor : Robert Flogaus *
; * Datum : 23.2.1993 *
; * Sprache: Turbo Assembler 2.0 *
; * Assemblierung: tasm tsrinfo *
; * tlink tsrinfo /t *
; * Zweck: Anzeige aller mit *
; * chktsr.exe *
; * veränderter TSRs im *
; * Speicher *
; ***************************************
.MODEL TINY
CODE SEGMENT BYTE
ASSUME CS:CODE,DS:CODE
ORG 100H
LOCALS
Flag EQU 0
OwnerPSP EQU 1
BlockSize EQU 3
Start:
MOV AX,3000H
INT 21H
CMP AL,3
JNB DosVersion_Ok
Illegal_DosVer:
MOV DX,OFFSET DosVer_Err
CALL Display_ExitMessage
INT 20H
Err_Exit:
MOV AL,01
JMP SHORT Terminate_Prog
Norm_Exit:
XOR AL,AL
Terminate_Prog:
CALL Display_ExitMessage
MOV AH,4CH
INT 21H
DosVersion_Ok:
MOV AX,OFFSET ProgEnd+100H
CMP SP,AX
MOV DX,OFFSET Out_Of_Stack
JB Err_Exit
MOV DX,OFFSET Copyright
MOV AH,9
INT 21H
CALL CBreak_Off
CALL Get_Umb_Link_State
CALL New_Umb_Link_State
CALL Get_First_MCB_Seg
JC Illegal_DosVer
CLD
@@MCB_Loop:
MOV ES,AX
INC AX
MOV DS,AX
MOV BP,ES:[OwnerPSP]
CMP BP,40H
JA @@Owner_Ok
JMP @@Next_Mcb
@@Owner_Ok:
MOV BX,CS
CMP BP,BX
JNE @@We_Do_Not_Own_It
JMP @@Next_Mcb
@@We_Do_Not_Own_It:
CMP WORD PTR DS:[Flag],'RF'
JNE @@Is_Not_RF
JMP SHORT @@No_Way_To_Remove
@@Is_Not_RF:
CMP WORD PTR DS:[Flag],'FR'
JE @@Is_Fr
JMP SHORT @@Next_Mcb
@@Is_Fr:
CALL Tst_Block_Size
JE @@FrBlock_Ok
JMP SHORT @@Next_Mcb
@@FrBlock_Ok:
MOV SI,4
CLD
XOR AH,AH
LODSB
ADD SI,AX
LODSB
MOV CX,AX
JCXZ @@Ints_Ok
@@ReadInts:
MOV AH,35H
LODSB
PUSH CX
PUSH ES
INT 21H
ADD SI,4
MOV DX,BP
CALL Mul16
LODSW
ADD DX,AX
ADC CX,0
MOV DI,DX
MOV AX,CX
MOV DX,ES
CALL Mul16
POP ES
ADD DX,BX
ADC CX,0
CMP DI,DX
JNE @@Error
CMP AX,CX
JNE @@Error
POP CX
LOOP @@ReadInts
JMP SHORT @@Ints_Ok
@@Write_Seg:
MOV AX,DS
PUSH CS
POP DS
ADD SI,[DI]
MOV [SI],AX
ADD WORD PTR [DI],2
CMP WORD PTR [DI],254
JAE @@Finished
JMP SHORT @@Next_Mcb
@@No_Way_To_Remove:
CALL Tst_Block_Size
JNE @@Next_Mcb
MOV SI,OFFSET TSRs_Not_To_Remove
MOV DI,OFFSET Not_Remove_Ptr
JMP @@Write_Seg
@@Error:
POP CX
MOV SI,OFFSET Other_TSRs
MOV DI,OFFSET Other_Ptr
JMP @@Write_Seg
@@Ints_Ok:
MOV SI,OFFSET TSRs_To_Remove
MOV DI,OFFSET Remove_Ptr
JMP @@Write_Seg
@@Next_Mcb:
MOV DH,ES:[Flag]
PUSH CS
POP DS
CALL Test_MCBFlag
JNC @@MCB_Found
JMP Err_Exit
@@MCB_Found:
JZ @@Finished
ADD AX,ES:[BlockSize]
JMP @@MCB_Loop
@@Finished:
CALL Old_UMB_Link_State
CALL Old_CBreak
MOV CX,[Remove_Ptr]
JCXZ @@Test_Others
MOV BYTE PTR [Something_Found],1
MOV DX,OFFSET RemoveTxt
MOV SI,OFFSET TSRs_To_Remove
CALL Display_Progs
@@Test_Others:
MOV CX,[Other_Ptr]
JCXZ @@Test_Irremovables
MOV BYTE PTR [Something_Found],1
MOV DX,OFFSET OthersTxt
MOV SI,OFFSET Other_TSRs
CALL Display_Progs
@@Test_Irremovables:
MOV CX,[Not_Remove_Ptr]
JCXZ @@Eop
MOV BYTE PTR [Something_Found],1
MOV DX,OFFSET Do_Not_RemoveTxt
MOV SI,OFFSET TSRs_Not_To_Remove
CALL Display_Progs
@@Eop:
CMP [Something_Found],0
JNE @@Something_Found
MOV DX,OFFSET None_Found
MOV AH,09
INT 21H
@@Something_Found:
MOV DX,OFFSET This_Is_It
JMP Norm_Exit
Display_Progs PROC NEAR
CALL CRLF
MOV BX,DS
MOV AH,09
INT 21H
CALL CRLF
SHR CX,1
@@Disp_Loop1:
LODSW
PUSH SI
PUSH CX
MOV DS,AX
MOV SI,4
LODSB
MOV CL,AL
CALL Space
@@Disp_Loop2:
LODSB
CMP AL,32
JB @@Exit_Loop
CALL CharOut
LOOP @@Disp_Loop2
@@Exit_Loop:
CALL CRLF
POP CX
POP SI
MOV DS,BX
LOOP @@Disp_Loop1
RET
Display_Progs ENDP
Tst_Block_Size PROC NEAR
PUSH ES
PUSH AX
MOV AX,BP
DEC AX
MOV ES,AX ;mcb of tsr psp
MOV SI,DS:[2]
CMP ES:[BlockSize],SI
POP AX
POP ES
RET
Tst_Block_Size ENDP
INCLUDE TSRINC.INC
Space PROC NEAR
MOV AL,32
REPT 6
CALL CharOut
ENDM
RET
Space ENDP
Orig_UMB_Link_State DB 0FFH
Not_Remove_Ptr DW 0
Remove_Ptr DW 0
Other_Ptr DW 0
TSRs_Not_To_Remove DW 128 DUP (0)
TSRs_To_Remove DW 128 DUP (0)
Other_TSRs DW 128 DUP (0)
Something_Found DB 0
Copyright DB 13,10,'TSRINFO 1.0, '
DB '(C) Robert Flogaus,'
DB ' 1993',13,10,'$'
OthersTxt DB 'TSR(s) which may '
DB 'not be uninstalled yet:$'
RemoveTxt DB 'TSR(s) which may be '
DB 'uninstalled:$'
Do_Not_RemoveTxt DB 'TSR(s) which can''t be uninstalled:$'
None_Found DB 'No relevant TSRs found.$'
MemErr_Msg DB 7,'MCB destroyed.$'
Out_Of_Stack DB 7,'Out of stack space.$'
DosVer_Err DB 7,'DOS 3.0 or higher required.$'
This_Is_It DB 'TSRINFO terminated.$'
ProgEnd:
CODE ENDS
END Start
END.