🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc.programmer
Article #1381

Far code segments in the small or compact memory model

#1381
From: Paul Cohen
Date: Wed, 21 Feb 1990 13:52
21 lines
1361 bytes
I need some help with creating a far code segment under Microsoft C in
the Compact memory model.

I have a program which has just slightly too large a code size to fit in
one segment.  It has one function which is executed only once so putting
it into another segment seems a way to avoid changing to the Large
memory model (which slows down execution noticeably).  

My question is how to do this.  Simply declaring the function "far" 
doesn't do the trick.  I have several hypotheses about what more might 
be needed, but would prefer to avoid the trial and error approach.  
My hypotheses are:

	1. The far function should be in a separate source file from
	   any near functions.

	2. All functions called by the far function should be themselves
	   declared as far functions.

Can someone comment on these hypotheses or suggest any other magic that
might be needed?
Technical Details
Message-ID: <28396@necntc.nec.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!think!mintaka!mit-eddie!bu.edu!mirror!necntc!pec

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!think!mintaka!mit-eddie!bu.edu!mirror!necntc!pec
From: pec@necntc.nec.com (Paul Cohen)
Newsgroups: comp.sys.ibm.pc.programmer
Subject: Far code segments in the small or compact memory model
Keywords: far code, compact model
Message-ID: <28396@necntc.nec.com>
Date: 21 Feb 90 13:52:46 GMT
Distribution: usa
Organization: NEC Electronics Inc.  Natick, MA 01760
Lines: 21