| | |
TSR Help...
Please support our Assembly advertiser: Programming Forums - DaniWeb Sister Site
![]() |
I am trying to create an active TSR which prints an 'A'
when the ESC key is pressed, it doesn't work.
Can anyone tell me what's wrong?
when the ESC key is pressed, it doesn't work.
Can anyone tell me what's wrong?
Assembly Syntax (Toggle Plain Text)
bits 16 org 100h jmp init.tsr int1c: push ds push ax push cs pop ds call checkdos2 jc int1c_e cmp byte [hotkey_found], 1 jnz int1c_e call tsrapp int1c_e: pop ax pop ds iret int28: push ds push ax push cs pop ds call checkdos jc int28_e cmp byte [hotkey_found], 1 jnz int28_e call tsrapp int28_e: pop ax pop ds iret checkdos2: push bx push es les bx, [InDOS] mov al, 0 cmp al, byte [es:bx] jb checkdos2_e cmp al, byte [es:bx-1] checkdos2_e: pop es pop bx ret checkdos: push bx push es les bx, [InDOS] mov al, 1 cmp al, byte [es:bx] jb checkdos_e xor al, al cmp al, byte [es:bx-1] checkdos_e: pop es pop bx ret InDOS dd 0 Orig_isr9 dd 0 in_isr9 db 0 hotkey_found db 0 hotkey_idx dw 0 hotseq db 0x1b isr9: push ds push bx push ax push cs pop ds in al, 0x60 pushf cli call word far [Orig_isr9] mov ah, [in_isr9] or ah, [hotkey_found] jnz isr9_e inc byte [in_isr9] cmp al, byte [hotseq] jz isr9_foundkey jmp isr9_exit isr9_foundkey: mov byte [hotkey_found], 1 isr9_exit: dec byte [in_isr9] isr9_e: pop ax pop bx pop ds iret tsrapp: push dx mov ah, 0x2 mov dl, 0x41 int 0x21 pop dx ret pre equ $ init.tsr: mov ax, 0x3509 int 0x21 mov [Orig_isr9], bx mov [Orig_isr9+2], es mov dx, isr9 mov ax, 0x2509 int 0x21 mov dx, int28 mov ax, 0x2528 int 0x21 mov dx, int1c mov ax, 0x251c int 0x21 mov ax, 0x3400 int 0x21 mov [InDOS], bx mov [InDOS+2], es mov dx, pre add dx, 0xf shr dx, 4 mov ax, 0x3100 int 0x21
----------------------------------------------------------
To control a mind violates a man, and all it has been used for is
hurting and afflicting. Nowonder I progam in assembly...
--->Now available http://dotcoding.netai.net/
To control a mind violates a man, and all it has been used for is
hurting and afflicting. Nowonder I progam in assembly...
--->Now available http://dotcoding.netai.net/
•
•
Join Date: Nov 2006
Posts: 134
Reputation:
Solved Threads: 3
1
#2 Nov 1st, 2009
int 28h is called from within DOS, so the indos byte will always be greater than 0 when it is called. You should check that it is not greater than one.
Also, it was normal to hook int 8 as well as int 28h. When checking indos from within int 8 you should make sure that it is not greater than zero.
If you were writing a full scale TSR you would also need to hook int 10h and int 13h, and set a flag every time they were invoked. You should then check those flags, in the same way that you check indos, before popping up a TSR.
Also, it was normal to hook int 8 as well as int 28h. When checking indos from within int 8 you should make sure that it is not greater than zero.
If you were writing a full scale TSR you would also need to hook int 10h and int 13h, and set a flag every time they were invoked. You should then check those flags, in the same way that you check indos, before popping up a TSR.
Last edited by mathematician; Nov 1st, 2009 at 9:20 pm.
![]() |
Similar Threads
- C expert help me! Write a TSR program that changes the background color ... (C)
- how to write TSR's for windows enviorment (C)
- TSR program (C)
- Please tell me to write TSR's for windows enviorment (C)
Other Threads in the Assembly Forum
- Previous Thread: add [bx+si],al means what?
- Next Thread: Storing multiple things in a variable?
| Thread Tools | Search this Thread |





