🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #2880

Re: Porting UNIX apps. to MS-DOS

#2880
From: Derek R. Foster
Date: Thu, 01 Nov 1990 04:57
46 lines
2671 bytes
In article <5497@uqcspe.cs.uq.oz.au> rhys@batserver.cs.uq.oz.au writes:
>dfoster@jarthur.Claremont.EDU (Derek R. Foster) writes:
>>In article <1990Oct26.223541.26634@NCoast.ORG> catfood@NCoast.ORG (Mark W. Schumann) writes:
>>>DLV101@psuvm.psu.edu (Dwaine VanBibber) writes:
>>>>Does anyone have some general rules for porting C programs developed under
>>>>UNIX to MS-DOS?  [ ... etc ... ]
>
>>Although this is generally true in "nice" programs, there may be a somewhat
>>kludgy workaround for this.
>>	[ ... code to swap stacks, and do other ugly things ... ]
>
>EEK!!  This solution should be applied with "fingers crossed"!

Yes, definitely!

>[mention of using static buffers instead of automatic buffers when possible]
>
>This is not a "total" solution, but preferred to stack swaps wherever
>possible.
>
>Rhys.
>
>P.S. Derek, you changed _SS, but forgot about _SP.  Weird things could happen!

Quite true. I didn't realize that I had forgotten to set _SP in my code.
I might even venture to say that weird things WOULD happen. (especially
since I set _SS to where _SP was supposed to go...I must have been 
half-asleep that night! As written, the stack tromps all over non-buffer 
memory!) But then I did say that the code I presented almost certainly
wouldn't work :-) My code was mostly presented as a general sketch of what
could be done, not how precisely to do it. I'd rather leave that part
to someone who's done it before. 

Anyway, your method is certainly preferable to mine provided the savings
is adequate. I certainly don't endorse stack swaps. I just think that as
an emergency alternative to rewriting a large program, they have their
place, ugly / nonportable though they are. I would avoid them whenever
humanly possible, but it's a good idea to know that they are possible for
those rare moments when a kludge is desperately needed. 

>+===============================+==============================+
>||  Rhys Weatherley             |  University of Queensland,  ||
>||  rhys@batserver.cs.uq.oz.au  |  Australia.  G'day!!        ||
>+===============================+==============================+

Derek Riippa Foster
Technical Details
Message-ID: <9475@jarthur.Claremont.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!att!att!bu.edu!rpi!zaphod.mps.ohio-state.edu!usc!jarthur!dfoster
References: <1990Oct26.223541.26634@NCoast.ORG> <9449@jarthur.Claremont.EDU> <5497@uqcspe.cs.uq.oz.au>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!att!att!bu.edu!rpi!zaphod.mps.ohio-state.edu!usc!jarthur!dfoster
From: dfoster@jarthur.Claremont.EDU (Derek R. Foster)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Porting UNIX apps. to MS-DOS
Message-ID: <9475@jarthur.Claremont.EDU>
Date: 1 Nov 90 04:57:36 GMT
References: <1990Oct26.223541.26634@NCoast.ORG> <9449@jarthur.Claremont.EDU> <5497@uqcspe.cs.uq.oz.au>
Organization: Harvey Mudd College, Claremont, CA 91711
Lines: 46