Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!wuarchive!udel!new From: new@udel.edu (Darren New) Newsgroups: comp.sys.amiga.tech Subject: Making resident under Lattice C Message-ID: <12269@nigel.udel.EDU> Date: 26 Feb 90 20:12:18 GMT Sender: usenet@udel.EDU Reply-To: new@udel.edu (Darren New) Organization: University of Delaware Lines: 71 Thanks to Dan Riley, I've gotten my program to be residentable under the Lattice C compiler. Portions of the makefile are below. Note that if you compile everything with the -d switch, BLINK will tell you what line of your code has absolute references to writable data. In my case, an automatic array initialized as { auto char buf[2] = " "; } was the culprit. LC didn't complain, but looking twice, this looks illegal to me. I just changed it to buf[0] = ' '; buf[1] = 0;. Anyway, the glue file needed csect text,0,1,2,2 to make references to globals be A4 relative. Now when I compile and link I get pure files which are residentable. I havn't tried actually running it, but it should work. -- Darren INC=INCLUDE: #possibly compressed compiler headers DELETE=delete #use rm for unix AUXCFLG=-d5 #auxiliary compile flags (-d5 or -O usually) #don't use -d4 or -d2;compiler bugs SYMCHOICE=ADDSYM #NODEBUG or ADDSYM # You should uncomment one of the next three lines. # You might want CBACK for FAM and CATCHRESNR or CRES for DIO #STARTUP=CBACK #STARTUP=C STARTUP=CATCHRESNR #STARTUP=CRES # If you use -w -rr, make this LIB:lcsr.lib # If you use only -rr, make this LIB:lcr.lib # If you use only -w, make this LIB:lcs.lib # If you use neither -w nor -rr, make this LIB:lc.lib SUPLIB=LIB:lcr.lib CFLAGS= -i$(INC) -v -b1 -mat -rr1 -cafkrsu -q1w1e -d$(STARTUP) $(AUXCFLG) #note that FAMgrep should always be compiled w/o stack checking (-v) #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# FAM : FAM.o memX.o MinRexx.o RexxGlue.o -BLink