I would like teach a TSR function (Memory resident) that embedded in int 21h (MSDOS) to show every time texts when you start another application (com/exe). "MY Text do Show when a program started after me"
Ex:
User type mkdir
I would to show everytime when DOS start a program my text < from my application
“Sytaxerror” < from MSDOS
´´´
This code is resident and (I am very sure) it work. This code is between int 21h from MSDOS and the operation to the secondary function over this function that MSDOS make.
ex: MSDOS (int21h) start a com/exe file > my function code bottom > mirror every command from MSDos > MSDOS normally
My question is only, how I get a text output (I will replace in future with other functions too) before the application started with MSDOS.
ex:
MSDOS start a COM/EXE > my function botton /TSR (31h) > output a text "MY Text do Show when a program started$" > this text show before every startet com/exe. My code in bottom is between INT 21h primary and secondary. ´´´
I question is only, I insert this code:
mov dx offset MyText5
mov ah, 09h
int 21h
I would like show this text every time when MSDOS start a COM/EXE Ex: User type mkdir I would to show everytime when DOS start a program < from my application “Sytaxerror” < MSDOS
code segment
assume cs:code,ds:code
org 100h
start:
mov dx offset MyText5 ; I would to show everytime when DOS start a program$”
mov ah, 09h
int 21h
jmp instalar ;Jump to the installation
;routine.
;We put the original Int21 address in this variable.
old_21 dd 2
new_21:
;Here's the routine which hooks Int 21.
jmp cs:[old_21] ;Jump to the original int.
instalar:
;Obtain the original Int 21 Vector
mov ax, 3521h
int 21h
mov word ptr old_21, bx
mov word ptr old_21+2, es
;Set the new Int 21 vector.
mov ax,2521h
push cs
pop ds
mov dx, offset new_21
int 21h
;Now it's resident
mov ah, 31h
mov dx, 30d ;<--------- Number of paragraphs(16 bytes)
int 21h ;leave resident.
JMP DataJump
yText5 db "MY Text do Show when a program started$"
DataJump:
code ends
end start
´´´