;// TSR_2F.ASM ;// ;// 1. Check of program is already in memory ( Fn 0 ) ;// 2. Unload the program from memory ( Fn 1 ) ;// 3. Sleep the program in memory ( Fn 2 ) ;// 4. Awake the program in memory ( Fn 3 ) ;// ;// (c) Victor A.Voilevitch, 1994-1996. EXTRN _PROGRAM_ID : BYTE _TEXT SEGMENT BYTE PUBLIC 'CODE' DGROUP GROUP _DATA _TEXT ENDS PUBLIC _NEW_2F .MODEL SMALL .CODE _NEW_2F PROC FAR cmp ah, _PROGRAM_ID jne chain_2F cmp al, 0 jne next_01 xor al,0FFh iret next_01: cmp al, 1 jne next_02 push bx db 0BBh dw ? push ds mov ds,bx db 0A3h dw ? pop ds pop bx iret next_02: cmp al, 2 jne next_03 push bx db 0BBh dw ? push ds mov ds,bx db 0A3h dw ? pop ds pop bx iret next_03: cmp al, 3 jne chain_2F push bx db 0BBh dw ? push ds mov ds,bx mov ax, 0 db 0A3h dw ? pop ds pop bx iret chain_2F: db 0EAh _old_2F dd ? _NEW_2F ENDP END