Path: utzoo!mnetor!uunet!husc6!bbn!mit-eddie!uw-beaver!tektronix!tekig!tekig5!johnbl From: johnbl@tekig5.TEK.COM (John Blankenagel) Newsgroups: comp.sys.ibm.pc Subject: Re: Plea for ROMable Compiler Message-ID: <2496@tekig5.TEK.COM> Date: 7 Mar 88 17:03:33 GMT References: <1124@ihu1h.ATT.COM> <2666@i.cc.purdue.edu> Organization: Tektronix Inc., Beaverton, Or. Lines: 21 Keywords: ROM'ed Application Program In article <2666@i.cc.purdue.edu>, aja@i.cc.purdue.edu (Miek Rowan) writes: > > >Is there any compiler available under MS-DOS that will produce a file > >that is suitable for EPROMming? The environment is: > >* Program development on MS-DOS, using all of it's glorious tools. > > > >PLEASE SEND ME EMAIL IF YOU KNOW OF ANY SOLUTIONS ! THEY ARE DESPERATE ! I have used Desmet C and Turbo C. All you have to do is write a simple loader type program that places a startup routine at high memory. I don't remember all addresses, but it must load the code segment address etc. You also need to re-write the startup routines for each. These simply set up the stack segment, code segment, extra segment, and stack pointer to point to wherever you want them in ram. If you are going to be doing memory allocation, you need to also set up the bottom and top of the heap. There are some routines in Turbo C that save variables in the code segment though, so be careful. The only one I have run into so far is malloc. I wrote my own version and it works fine. I have yet to find any problem at all with Desmet C using the code segment for data storage. I suspect the Borland programmers were just lazy or some such thing. If a novice programmer like me can write code correctly, they should be able to.