Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


call a interrupt by number stored in a variable

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
danrevella
Master Cheater
Reputation: 2

Joined: 11 Jun 2008
Posts: 292

PostPosted: Thu Jul 14, 2016 10:44 am    Post subject: call a interrupt by number stored in a variable Reply with quote

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
Back to top
View user's profile Send private message
kantoboy69
Advanced Cheater
Reputation: 2

Joined: 31 Mar 2010
Posts: 71
Location: Manila

PostPosted: Fri Aug 05, 2016 2:20 am    Post subject: Reply with quote

You can't do that

Code:
intx:
   db 21h

mov ah, 40h
mov al, 21h
int intx


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



http://www.fysnet.net/ivect.htm

_________________
Cheater always prosper Hitler
Back to top
View user's profile Send private message
danrevella
Master Cheater
Reputation: 2

Joined: 11 Jun 2008
Posts: 292

PostPosted: Fri Aug 05, 2016 2:49 am    Post subject: Reply with quote

Many thanks, I understand the way you have proposed is the best.
Now Game wizard may work with Quake(dos) Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites