Mail Archives: djgpp/1998/04/23/06:37:34
On Thu, 23 Apr 1998, Javier Calleja wrote:
> I read your FAQ files, and I found a version of the macro wich get a =
> far pointer with one segment and offset (MK_FP macro). But I didn`t find =
> any version of the FP_SEG and FP_OFF macros.
Please read the FAQ carefully, not just to cut-and-paste ready
solutions. In particular, note the following excerpt from the FAQ:
Macros that extract the segment and the offset from a far pointer (called
`FP_SEG' and `FP_OFF') are required in 16-bit code to pass addresses in
registers when calling real-mode DOS or BIOS services, like functions of
interrupt 21h. See How to call real-mode interrupt functions in Section
18.2, which describes how that should be done in DJGPP; here, too, you won't
need to port the macros but instead rewrite the code that calls the DOS or
BIOS service.
So please read section 18.2. There is no miraculous way these two macros
will work for you, because interfacing conventional memory from a DJGPP
program is *different*. In fact, even the version of MK_FP that the FAQ
presents is likely to not work in some cases. Don't use it blindly
without understanding what's involved.
- Raw text -