Jump to content
  • Advertisement

Archived

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

Puzzler183

NASM problem

This topic is 5421 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

Gah, I can''t find it in the docs, and it''s the only thing I can think that would make my code malfunction. All I want to do is revector the timer interrupt to my timer intterupt. push cs pop es mov ax, 2508h mov bx, timer_int int 21h My timer intterupt is after the label timer_int... Am I not passing it''s offset properly? If not then how do you get a label''s offset?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
If you''re trying to assemble a win32 program, the above code won''t work.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by Anonymous Poster
If you''re trying to assemble a win32 program, the above code won''t work.


Great comment! What do you think is the reason he asked for help in this forum?

I think you must point DS:DX to your new interrupt handler.
I have no assembler here to test it, but something like this should work:

mov ax,2508h
lds dx,dword ptr timer_int
int 21h

Hope this helps?

Share this post


Link to post
Share on other sites
D'oh, I think that might be right... I hate it when people put up references that are wrong...

EDIT: And BTW, thanks for mentioning the windows thing, I know, this is actually strictly for DOS.

[edited by - Puzzler183 on August 18, 2003 9:47:37 AM]

Share this post


Link to post
Share on other sites
Before you set an interrupt vector, especially the timer tick, you MUST collect the existing vector and call it yourself in your own interrupt routine.

You will use INT 21 3508 to collect the timer interrupt into ES:BX

This will be saved in a location as part of a far jump/call as part of your interrupt routine.

You will use INT 21 2508 with the entry point to your own interrupt routine in DS:DX to set the interrupt vector.

Before your program terminates, you MUST restore the original interrupt vector.

Hope this helps.



Stevie

Don''t follow me, I''m lost.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!