Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


replacing interrupt handlers (Dos game programming gurus, help)

This topic is 5983 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Please, help me if you can. Right now I have this annoying problem. Well, now I''m coding a keyboard reading function for a dos game and I really would like to replace the standard keyboard handler with my own handler. To do this I can''t use the interrupt 21h, because I''m programming in protected mode (djgpp & nasm). Well, before doing it, I''m trying to replace the interrupt 10h (video services) just for testing, and then trying to set the mode 13h with it. Ok if everything goes right, my program shouldn''t be able to set the mode. Well anyway, everything still feels to work correctly, and it sets the mode 13h. Damn! ;Ok, this is my nasm code, trying to replace the handler cli ;disable interrupts mov ebx, 40h ;the address of the pointer pointing to int 10h ;(I think) mov dword [ebx], 99999 ;now fucking the pointer up sti ;enable interrupts ret Ok, what am I doing wrong, please tell me.

Share this post

Link to post
Share on other sites
methinks you''re addressing [ebx] through ds, and are actually overwriting something in your data segment. i''d say you need to init one of the segment registers to point to 0 (right? or wherever) and use es:[ebx] or something.

don''t kill me if this doesn''t work.

Come to #directxdev IRC channel on AfterNET

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!