|
Thank youwww_jamesfor your responses to all my questions, thank you!
turn. com file problem has been successful, but strangely, my source program contains
Mov word ptr old_print [2], es; segment address
Also successfully converted!
Here I hope to discuss withwww_james(of course, including friends who can help me understand):
1. All my questions are centered around one, modify the 17h interrupt service routine and make it always valid!
2. My .com file is a memory-resident program. I modify the interrupt address of 17h. I hope that all subsequent programs can enter my new entry program by calling int 17h.
3. The problem is that, as soon as the program I wrote ends, and then call int 17h with another assembler, the original interrupt service routine is executed again! !!
Please take a look at my code, is there anything wrong?
cseg segment
assume cs: cseg, ds: cseg
org 100h
start:
JMP Initialize
old_print dd?
new_print proc far; new interrupt service routine entry
assume cs: cseg, ds: cseg
STI
pushf
assume ds: nothing
push ax
push dx
mov al, 'M'
mov ah, 0
mov dx, 0
call dword ptr old_print
pop dx
pop ax
popf
NOP
IRET
new_print endp
Initialize:
assume cs: cseg, ds: cseg
mov bx, cs
mov ds, bx
mov al, 17h; save original interrupt vector
mov ah, 35h
int 21h
mov word ptr old_print, bx
mov word ptr old_print [2], es
mov dx, OFFSET new_print; set new interrupt vector
mov al, 17h
mov ah, 25h
int 21h
mov dx, offset Initialize
int 27h; Program memory before label Initialize in memory
cseg ends
end start
Thanks again! |
|