Posted: Thu Jul 14, 2016 10:44 am Post subject: call a interrupt by number stored in a variable
Hi!!
Under dos, using TASM i'm actually writing a little dos TSR to help me to get work the old dos utility Game Wizard32 (an old dos program cheat) with the game Quake (the first dos version).
For this purpose I need invoke an interrupt that I have just elaborated and stored in a variable (1 byte)
figure the follows:
CHEAT_INT_X0H db 50h (here is the int number I must call)
.some code
.
.
int CHEAT_INT_X0H
but this does not work,
so I have rearranged the code:
Code:
;call the interrupt with self modifying code
push ax
push si
mov al,CHEAT_INT_X0H
mov si,offset intr_C0h; abbreviazione per interrupt CHEAT_INT_X0H
mov [si+1],al ;change the 00 below to the contents of AL
pop si
pop ax
intr_C0h: int 00h ;call the interrupt (00 will be changed above)
I don't like this solution, maybe does exist another (simplest) way?
Many Thanks
instead you can find out the address of the interrupt by using
get interrupt vector and call it directly like a normal sub/func
That's a proper way or a messy way
modify the offset where the interrupt should be before executing interrupt which is not a good idea and very tedious to do so
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