delorie.com/archives/browse.cgi | search |
Xref: | news2.mv.net comp.os.msdos.djgpp:3941 |
From: | malcolm AT manawatu DOT gen DOT nz (Malcolm Taylor) |
Newsgroups: | comp.os.msdos.djgpp |
Subject: | Re: ___djgpp_hw_exception? |
Date: | Fri, 17 May 1996 01:36:14 GMT |
Organization: | Grafik Software |
Lines: | 25 |
Message-ID: | <4ngosd$n3o@news.manawatu.gen.nz> |
References: | <4n3b9e$rkf AT news1 DOT goodnet DOT com> |
Reply-To: | malcolm AT manawatu DOT gen DOT nz |
NNTP-Posting-Host: | malcolm.manawatu.gen.nz |
Mime-Version: | 1.0 |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
snarfy AT goodnet DOT com wrote: >Here's some of my code: >void my_timer_hook(void) >{ > asm("movb $0x99, %al > call ___djgpp_hw_exception"); >} >I'm installing the timer hook with >_go32_dpmi_chain_protected_mode_interrupt_vector(); Make sure that the timer hook above is has an interrupt wrapper. Use the _go32_allocate_iret_wrapper to get one (check out sb05_dj.zip for an example). Secondly you should make sure that your timer code is locked (lock the wrapper as well). The problem is that __djgpp_hw_exception invalidates ds (and ss) and so the next time your program uses the data segment or stack segment (ie pushs, pops or looks at a global variable) then the exception will get handled. This stops it happening in the interrupt. Without the wrapper etc. you might be causing the exception inside the interrupt. Malcolm
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |