[comp.sys.cbm] CBM C Compiler Talk

mclek@dcatla.UUCP (Larry E. Kollar) (10/21/87)

Is it REALLY true?  Power-C doesn't support the 1581 OR the 1700/1750 RAM
expanders?  Makes me glad I have Abacus....

FYI, the Abacus Super-C system supports the 1581 with absolutely no problems.
I just set it up as drive 9, and Super-C sees it as drive B:

RAM expanders are just a little bit of a hassle.  Abacus is giving away a 
10-line program to tell the system that it has more RAM in drive H:.  It
got published in the Letters column of the July '87 Transactor, so I don't
see a problem posting it here (uh-oh... source on comp.sys.cbm...)

	#include "h:stdio.h"
	file outchan;

	main()
	{
		*(char *)0xed06 = 0x7e; /* see comments below */

		outchan = open( 15, 15, "u:" );
		close( outchan );
	}

With a 1750, this gives you a 2016-block RAMdisk.  If you have a 1700,
replace the 0x7e with 0x20.

The only problem I've had with this is that you can't run in FAST mode and
use the RAMdisk.

On another topic, the source & .COM files for the public domain(?) Small-C
compiler were recently published in comp.os.cpm.  I'm still in the process
of getting these files onto my 1581, but I should know by tonight whether it
will work.  Small-C, if you don't know, is a reduced implementation of C
(no switch/case, for, do/while) that produces Z-80 assembly code.  Included
with the compiler is a Z-80 relocating assembler and linker.  THIS is what
I wish one of the "commercial" compilers would do -- generate assembly code
so I could go in & hand-optimize where needed!

Small-C should be available on your local RCP/M (ARPAnet/BITNET types can
get it from SIMTEL20).  More on this subject later.

	Larry Kollar	...!gatech!dcatla!mclek
	"I like the enchiladas and the teriyaki too,
	 I even like the chicken if the sauce is not too blue..."
			-- ZZ Top, "TV Dinners"

dwl10@amdahl.amdahl.com (Dave Lowrey) (10/22/87)

In article <1649@dcatla.UUCP> mclek@dcatla.UUCP (Larry E. Kollar) writes:
>
>Is it REALLY true?  Power-C doesn't support the 1581 OR the 1700/1750 RAM
>expanders?  Makes me glad I have Abacus....
>
>
>With a 1750, this gives you a 2016-block RAMdisk.  If you have a 1700,
>replace the 0x7e with 0x20.
>
No, you CAN use the 1581 disk drive with an un-modified C-Power (Power-C).
It looks just like a very large 1541.

The modifications I made to C-Power allowed you to make efficient use of
partitions on the 1581. It allows you to have you library files in
one partition, and you source files in another partition.

You are correct in that Ram Disks are not supported by C-Power.
-- 
-------------------------------------------------------------------

                  "Familiarity breeds attempt"

                          Dave Lowrey
                          Amdahl Corp.
                          Houston, Texas
                          (713)-850-8828
                         ...!{ihnp4,cbosgd,hplabs,oliveb}!amdahl!dwl10

[ The opinions expressed <may> be those of the author and not necessarily
  those of his most eminent employer. ]

prindle@NADC.ARPA (10/22/87)

From: prindle@NADC.ARPA (Frank Prindle)

I have used a 1581 and C Power 128 (AKA Power C - 128 version).  The real
power of a 1581 with C Power 128 is that the 1581 supports more than 144
directory entries per disk, even when not partitioned.  Thus, you can put
all the tools (boot, shell, compiler, editors, linker, librarian, headers, etc.)
*plus* all the libraries (math.l, stdlib.l, syslib.l, stdlib2.l, syslib2.l,
and all the object modules for the library functions) on each 1581 work disk
you use, and still have the most of the disk (>75%) free to hold your
own C programs (utilities, sources, objects, executables, etc.)!  The software
development scenario then becomes a dream.  Keep your temporary sources,
objects, and executables on the built-in ramdisk (this has nothing to do
whatever with the 17xx ram expansion modules!).  The compiler first pass loads
in 7 or 8 seconds (eat your heart out, 1541 owners!).  The whole compilation
of a trivial (e.g. 30 line) C program takes only about 25 seconds.  Now for
the best part - without swapping disks, link your object(s) and ask the linker
to search the libraries - library linking is quite a bit faster than either a
1541 *or* a 1571 due to the 1581 full track cache (the whole directory is read
from the disk during a single disk revolution).  Top all this off with the
ability to protect the boot sector (from deallocation by the DOS "Valdiate"
command) by using a 1 sector partition, and you can see how the 1581 mates
*very* nicely with C Power 128.  You have to work over the boot sector and
the BASIC program SHELL a little bit to get them to boot off of any device
instead of just 8 (presuming you want to keep a 1541 or 1571 as device 8 so
you can load all those games!).  Here is a typical development scenario
for a simple (1 file) program, where the turnaround time (for a small
program in the range 30-100 lines) is under 2 minutes (from completion of
editing to a runnable program):

BOOT U9
$ setu 0 9 0
$ setu 1 9 0
$ rdon
$ cp 0:myprog.c 2:
$ ed 2:myprog.c
  -- edit the program all you want --
$ cc 2:myprog.c
$ link
> 2:myprog.o
> ^
>
  enter program name: myprog
$ myprog
  -- run your modified program --
  -- maybe it still doesn't work quite right --
$ ed 2:myprog.c
$ cc 2:myprog.c
	.
	.
	.
  etc. until you get it right
	.
	.
	.
$ rm 0:myprog.*
$ cp 2:myprog.* 0:
$ bye


Sincerely,
Frank Prindle
Prindle@NADC.arpa