Thread View: comp.os.msdos.programmer
2 messages
2 total messages
Started by Richard Saunders CIRT
Sat, 07 Jul 1990 10:07
far call in C
Author: Richard Saunders CIRT
Date: Sat, 07 Jul 1990 10:07
Date: Sat, 07 Jul 1990 10:07
10 lines
1015 bytes
1015 bytes
Help! Some application interfaces, like XMS and Netware IPX/SPX, are
called with FAR CALLs instead of software interrupts. This poses no problem
to assembly language programmers, but I'm working in C and I'm pretty
inexperienced at 8086 assembly language. I need something similar to int86()
and int86x() that will let me load the various registers, do a far call, and
then examine the register contents in Microsoft C 5.0 || Mix Power C.
Surely I'm not the first to face this problem...
-- Richard Saunders
Re: far call in C
Author: Kevin D. Quitt
Date: Sat, 07 Jul 1990 18:59
Date: Sat, 07 Jul 1990 18:59
43 lines
2181 bytes
2181 bytes
In article <1990Jul7.100712.7027@ariel.unm.edu> saunders@carina.unm.edu (Richard Saunders CIRT) writes:
>
> Help! Some application interfaces, like XMS and Netware IPX/SPX, are
>called with FAR CALLs instead of software interrupts. This poses no problem
>to assembly language programmers, but I'm working in C and I'm pretty
>inexperienced at 8086 assembly language. I need something similar to int86()
>and int86x() that will let me load the various registers, do a far call, and
>then examine the register contents in Microsoft C 5.0 || Mix Power C.
> Surely I'm not the first to face this problem...
If the XMS and Netware libraries are written for C, then you need
only compile in large model (/AL) or declare the functions your are
using as far functions: e.g.
extern void far function_foo();
If they require values placed in specific registers, then you'll need
an assembly routine - but only one. Declare the function as above, and:
call_far_fn( function_foo, ax, bx, cx, dx );
where call_far_fn is an asembly routine that loads up the registers
as specified, then does the far call, and passes the return value back
to C (generally in AX, or DX:AX).
You could even define a macro like:
#define FN_foo(a, b, c, d) call_far_fn( function_foo, (a), (b), (c), (d))
then invoke it like:
FN_foo( ax, bx, cx, dx );
Good luck!
--
_
Kevin D. Quitt demott!kdq kdq@demott.com
DeMott Electronics Co. 14707 Keswick St. Van Nuys, CA 91405-1266
VOICE (818) 988-4975 FAX (818) 997-1190 MODEM (818) 997-4496 PEP last
96.37% of all statistics are made up.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads