Article View: comp.os.msdos.programmer
Article #5392Re: using int's in C
From: Gary A. Gilbreath
Date: Sat, 23 Mar 1991 05:57
Date: Sat, 23 Mar 1991 05:57
29 lines
1817 bytes
1817 bytes
From article <1991Mar23.021231.21131@grebyn.com>, by jmbj@grebyn.com (Jim Bittman):
> I learned something quite interesting from Microsoft Tech Support today.
> It turns out that "outport(PORTID,PORTVALUE)" is not a "nice" function.
> They said it must access the BIOS or DOS or something which makes it
> non re-entrant (i.e. unavailable for interrupt routines).
> Excuse me? Shouldn't this just translate to:
> mov dx,PORTID
> mov ax,PORTVALUE
> out dx,ax
I have found just the opposite. Both MSC 5.1 and 6.00A library routines
for inp(), inpw(), outp(), and outpw() are re-entrant. If you want
in-line routines you can either enable intrinsics with a command line
option, or put "#pragma intrinsic(inp, inpw, outp, outpw)" in the
source file.
> Not to mention the fact that for a hardware interrupt, an outport(20,20)
> needs to be executed to "EOI" the 8259. Anyway, this was their excuse
> for the fact that hardware ints don't seem to work properly.
I have just completed a program that uses both DMA and interrupts
without a single line of assembly. You do have to remember to turn off
run-time stack overflow checking and be very careful about which library
routines (if any) you call while in the interrupt routine, but it
does work.
Gary Gilbreath, Naval Ocean Systems Center, San Diego, CA
Internet: gag@manta.nosc.mil
uucp: {ihnp4,akgua,decvax,dcdwest,ucbvax}!sdcsvax!nosc!gag
Technical Details
Message-ID:
<1730@marlin.NOSC.MIL>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!ucsd!nosc!marlin!gagReferences:
<1991Mar23.021231.21131@grebyn.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!ucsd!nosc!marlin!gag From: gag@marlin.NOSC.MIL (Gary A. Gilbreath) Newsgroups: comp.os.msdos.programmer Subject: Re: using int's in C Message-ID: <1730@marlin.NOSC.MIL> Date: 23 Mar 91 05:57:35 GMT References: <1991Mar23.021231.21131@grebyn.com> Organization: Naval Ocean Systems Center, San Diego Lines: 29