Xref: news2.mv.net comp.os.msdos.djgpp:6115 From: Charles Sandmann Newsgroups: comp.os.msdos.djgpp Subject: Re: Near pointer improvements Date: Wed, 17 Jul 1996 16:26:45 CDT Organization: Houston Supernet& Tulsa Supernet Lines: 15 Message-ID: <31ed5a95.sandmann@dmccorp.com> References: Reply-To: sandmann AT dmccorp DOT com NNTP-Posting-Host: igate.dmccorp.com To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp > Yup. But I think setting the .._NEARPTR bit in _crt0_startup_flags would > solve the problem, as sbrk() checks for that. Is that right? Well not exactly. Setting this bit does prevent setting of limits in the sbrk() code for the current ds register and ds_alias - but it would prevent the needed update to reflect the correct limit in the DS which you were not using. You should also not set ds as ds_alias (allocate a new one...) unless you want to see some ugly crashes in some unique situations. You also need to review the code for places which assume things about ds - like crt0.s and exceptn.s - for things that will break. The only way to make the current sbrk() work right with your toggle scheme would be to have the "normal" small limit DS loaded when you call it. Your algorithm is a good idea, but we will need to re-write some code to implement it fully.