flat assembler
Message board for the users of flat assembler.

Index > DOS > Jump in TSR proc

Author
Thread Post new topic Reply to topic
jentos



Joined: 30 Mar 2004
Posts: 8
Location: Russia
jentos
Hi all!
Can somebody tell me please what wrong in this code?
I try create simple TSR programm, initialisation going quite well Smile, but in "MyInt" instruction "jmp far dword [OldInt]" don`t jump to saved interrupt Sad. I try also "jmp far dword [cs:OldInt]", but at all work the same Sad.
Code:
        org     100h
        use16
;--------------------------------------------------------------------
        jmp init
OldInt: dd      0
;-------------------------------------------------------------------
MyInt:
        jmp far dword [OldInt]
;---------------------------------------------------
init:   mov     ax,3508h
        mov     word [OldInt+2],es
        mov     word [OldInt],bx
        int     21h
        ;
        mov     ax,2508h
        mov     dx,MyInt
        int     21h
        ;
        mov     ah,9
        mov     dx,Mes
        int     21h
        ;
        mov     dx,init
        int     27h
        ;
Mes     db 'TSR...',13,10,'$'    
Post 23 Feb 2007, 13:15
View user's profile Send private message Reply with quote
Goplat



Joined: 15 Sep 2006
Posts: 181
Goplat
jentos: You do have to jump through [CS:OldInt] since DS could be anywhere. There's another problem though: your code for getting the original vector is wrong. It needs to be like this
Code:
init:   mov     ax,3508h
        int     21h
        mov     word [OldInt+2],es
        mov     word [OldInt],bx    
Post 23 Feb 2007, 19:38
View user's profile Send private message Reply with quote
jentos



Joined: 30 Mar 2004
Posts: 8
Location: Russia
jentos
Embarassed
Thank you!
Smile
Post 24 Feb 2007, 07:55
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2019, Tomasz Grysztar.

Powered by rwasa.