[net.micro.pc] Interupt initiated user-defined functions in 'C' on IBM/XT

ross@isis.UUCP (07/16/86)

We would appreciate any information about invoking user-written subroutines
through the use of an IBM/XT clocked interrupt (INT 0x1C).  Currently, we have
troubles obtaining the segment:offset representation of the interrupt vector.
The seg:offset obtained by ANDing a long pointer (AZTEC compiler V2.0) with  
0xFFFFL and ~0xFFFFL do not appear to correctly represent the location of the
function although AZTEC says the pointers are in 32-bit seg:offset formate.

Any information will be appreciated and may be put on the network or sent to:
Dave Knopp
c/o Vexcel Corp.
2905 Wilderness Pl.
Boulder, CO  80301

Thanks for the help.

kneller@ucsfcgl.UUCP (07/17/86)

In article <938@isis.UUCP> ross@isis.UUCP (Ross McConnell) writes:
>Currently, we have
>troubles obtaining the segment:offset representation of the interrupt vector.
>The seg:offset obtained by ANDing a long pointer (AZTEC compiler V2.0) with  
>0xFFFFL and ~0xFFFFL do not appear to correctly represent the location of the
>function although AZTEC says the pointers are in 32-bit seg:offset formate.
>
>Any information will be appreciated and may be put on the network or sent to:

I'm doing this from memory and my experience is with the Microsoft C
compiler, but I think that addresses are stored in memory in order as:
	low-word high-word

The pointer would thus have the order:
	offset   segment

Given a 32-bit function pointer funp, the offset should be
	*((unsigned int *) funp)

and the segment should be
	*((unsigned int *) funp + 1)
-- 
	Don Kneller
UUCP:	...ucbvax!ucsfcgl!kneller
ARPA:	kneller@ucsf-cgl.ARPA
BITNET:	kneller@ucsfcgl.BITNET

kneller@ucsfcgl.UUCP (07/17/86)

In article <9918@cgl.ucsf.edu.ucsfcgl.UUCP> kneller@cgl.ucsf.edu.UUCP (Don Kneller) writes:
>In article <938@isis.UUCP> ross@isis.UUCP (Ross McConnell) writes:
>>Currently, we have
>>troubles obtaining the segment:offset representation of the interrupt vector.
>>The seg:offset obtained by ANDing a long pointer (AZTEC compiler V2.0) with  
>>0xFFFFL and ~0xFFFFL do not appear to correctly represent the location of the
>>function although AZTEC says the pointers are in 32-bit seg:offset formate.
>>
>>Any information will be appreciated and may be put on the network or sent to:
>
>I'm doing this from memory and my experience is with the Microsoft C
>compiler, but I think that addresses are stored in memory in order as:
>	low-word high-word
>
>The pointer would thus have the order:
>	offset   segment
>
>Given a 32-bit function pointer funp, the offset should be
>	*((unsigned int *) funp)
>
>and the segment should be
>	*((unsigned int *) funp + 1)

My mistake.  I should have said the the offset and segment can be determined by:
	*((unsigned int *) &funp)	 for the offset and
	*((unsigned int *) &funp + 1)	 for the segment
Obviously, we want to look at the value of the function pointer, not at what
it points to.
-- 
	Don Kneller
UUCP:	...ucbvax!ucsfcgl!kneller
ARPA:	kneller@ucsf-cgl.ARPA
BITNET:	kneller@ucsfcgl.BITNET