[Coco] Converting ANSI-C to K&R(Microware) - Ansifront didn't work

gene heskett gheskett at wdtv.com
Sat Jan 8 21:06:50 EST 2011


On Saturday, January 08, 2011 08:03:56 pm Michael Furman did opine:

> I'm still hell-bent on getting a screen editor that works over
> serial/telnet on my coco, and vi-like would be the best. I have PVIC
> that compiles for the coco but the binary is too big to fit in memory
> and run (The binary is 77k)
> 
So am I FWIW.

> I thought about using Busybox's built-in VI.  Turns out someone already
> pulled it out as a standalone: http://freshmeat.net/projects/virus 
> This compiles and runs fine on my Mac but it's ANSI-C so need to
> translate it to compile on the Coco.  I tried with Ansifront and the
> program is so big it blew Ansifront's mind and ran out of stack space
> and memory.  Is there another way to convert ANSI C to K&R C
> automatically?  My searching on the interwebs found no hits-- all the
> hits were K&R to ANSI.  I don't care what OS it runs on
> (Linux/Windows/Mac/Nitros9)   Also the ansifront instructions say to
> run "c.prep" first, which leads into my second question....
> 
> The ansifront documentation mentions "Version 2.5 of CC" and I do see
> this on RTSI.  I'd appreciate it if someone could give me some pointers
> on how to cobble together the most recent C environment that runs on
> Nitros9, which libraries and Cprep to get to go along with this...

Any script that runs things in the correct order, piping the output of one 
function to the next in the proper order, will suffice.  The 'cc' 
architecture, while compiled, is very versatile, and I have placed the  
cc252.lzh archive on my web page shown below.  You can rebuild it to suit 
if it doesn't do what you want.

Ansifront012, AIUI it, should not ever have its mind blown as it is 
essentially a void to int translator, just treating the serial text stream 
that goes through it, making the appropriate substitutions.

Your apparent problems with it are really telling me that you are probably 
using the original c.prep that came with the compiler, and that utility 
chokes and passes garbage on to the rest of the compiler when the src code 
file size exceeds nominally 10k in size.  It is patently incapable of 
building a working rzsz-3.3.6, or even the original 3.1.6 version of it.  
That was one of the reasons that it was the subject of a re-write by a comp 
sci student way back when, who took it to the version 1.5 or 1.6 level.  
His code was very well organized, which allowed me to continue it for a bit 
after he got an A & went on to other things.  My final release that I know 
works for src code bases up to at least 36k, is known as cprep19.  It is 
available several places on the net, including my own machine at 
<http://gene.homelinux.net:85/gene/Genes-os9-stf> as cprep19.lzh

I don't proclaim that it will build all of your code, but it is at least 
worth the try.

If you are going to be doing transcendental math functions in C, I have the 
trig.l stuff in that same directory.  The .l stuff goes in /dd/LIB so the 
compiler and cc can find it.  This does trig functions to about 16.5 digits 
accuracy over an EE range of +-EE38 or so. There is a src package and a 
read.me.re.trig.l text file too

See also CnoY, for code intended to be run on a coco3 only, and a Copt2 
intended to do a bit more if it can if placed after the original c.opt, see 
the help message from cc (252) for additional hints once it is unpacked.

Yelp if you need anything else Michael, I probably have it squirreled away 
someplace.  Finding it might take a while though. ;-)

-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
The eternal feminine draws us upward.
		-- Goethe



More information about the Coco mailing list