Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • Ah yes, so one could write all the assembly-language functions assuming far pointers and far calls, and declare them appropriately in the C-language headers... (At some cost in stack usage however.) Commented Nov 21, 2019 at 17:33
  • @StephenKitt: Also at cost--sometimes significant and sometimes not--of having to deal with objects being in different segments. Commented Nov 21, 2019 at 17:36
  • Yes, indeed. In development terms, for a library capable of supporting far models, you’d need to write the code for that anyway... The cost here is really that nothing can be optimised for smaller memory models. Commented Nov 21, 2019 at 17:39
  • It might also be workable to put a far call wrapper around code written to use near natively, then use different link-time bindings to call either the near or far entry point depending on the memory model of the calling code, via macros in the include file for your library. This of course only works if the library is capable of working internally using near calls (i.e. it doesn't need to access data passed by the caller via far pointers). Commented Nov 21, 2019 at 18:21