C99REL1 does not have a C tuition guide with it, you need to buy a book on C! LEARNING C
Although C99 is only a subset of a subset of C, books on sale cover the whole C language - not to worry. all the bits we have are covered, and the rest nay be added later!
I found two types of tuition guide to C - one type assumed you had knowledge of a UNIX operating system- not a lot of good to us!
The other type worked by comparison to BASIC programs
I found a book in the January sales at one third cover price:
PROGRAMMING IN C FOR THE MICROCOMPUTER USER by Robert J Traister. Published by Prentice Hall. ISBN 0-13-729641-X. 190 pages.
As this may not now be readily available. a similar book can be found in:
C PROGRAMMING GUIDE by Jack Purdue, published by Que ISBN 0-88022-022-8. 250 pages.
Both books unfortunately start with PRINT and FOR...NEXT, not currently available with C99REL1. C99 does support PUTS and PUTCHAR. as well as WHILE. The main difference between PUTS and PRINTF is that PRINTF permits formatting commands whereas PUTS does not.
puts("\nEntry was a diqit")
printf("\nEntry was a digit")
have the same effect!
The Que book advises that printf generates more code than puts, and puts is to be preferred if the special provisions of printf are not required.
A complex use of printf would be
printf("x=%d and y=%d", 5, 8)
which could not easily be done using puts
If you can get hold of at least the book by Jack Purdham. then together with the documentation supplied with C99, you should be able to write possibly your first 'machine code' program.
Clint Pulley of Ontario. Canada has implemented Small-C for the TI99. lt has been released on the Freeware principle and is the best set of programs I have come across on the list! C99 - A Review by Stan Dixon:
c99 release 4 is available on my
I am certainly going to write to Clint and even going to enclose a money order.
As I obtained it the programs and tiles are contained on two single sided disks. They all fit with a bit of spare space onto a double sided disc. The original release fitted on a single sided disc but Clint decided to issue some source files and one or two other programs and utilities also. In order to write C99 programs you need an Editor, either the one supplied in the E/A package or TIW. If you use TIW you must save the file by using the Print option and naming a disc file as destination. (This avoids the problems caused by the format information included. when you save TIW files in the usual way.).
It is also necessary to be able to assemble 9900 assembly language source. Obviously the most convenient system is the Editor/Assembler module and its software. However it is possible to run that software using either MM or XB. You need special programs which are also available on the Freeware system.
( ss: At the present time, C99 will only run from the Editor/Assembler module. It is coded very tightly - including routines in scratchpad ram for speed and makes direct access to routines in the Editor Assembler GROM. A version for XB may appear later... keep tuned... ....ss)
The first step in writing a C99 program is to write the C99 source using an Editor and save it. As well as C99 source you can instruct the compiler to include other files and the library functions provided. Then using option 5 of the E/a module you run the c99 compiler. This writes 9900 assembly language source statements to a file of your choice.
[That was not a misprint.. think about that idea ] It can be convenient to let the output go to the screen as you check the program for errors. However the usual destination is a disc file. One option is to include the C99 source in this assembly language file as comments. Having done this and hopefully avoided errors, you now run the assembler against the file you have just produced with the compiler.
The usual assembler options are available although you never need to specify the R option. You can now run your program. First it is necessary to load CSUP, a C99 support file, any other library files that may be needed (perhaps for file handling), and then load your object file. This is with the E/a option 3. The program name is always START in these programs. At this stage we can hope that our program works as expected.
There is a full explanation of how to run the system on the release disc and a brief explanation of how the system was implemented. Two text books are recommended and I would add 'The Small-C Handbook' by James E. Hendryx to the list. The documentation does not try to teach the C language but there are several source files which are well commented and are useful as examples.
There are a number of utilities on the first disk. One tor locating compiler errors is of obvious use in developing programs. There is one undocumented utility. It is called OPT and appears, from comments in the source, to be a code optimiser. That is it reads the output from the compiler and chops out duplicated code. This shortens the files for assembly and could he vital if a large application is being attempted.
I have used it and it worked and the optimised program still ran. Clint has included a disk directory program which works extremely quickly and can be useful within the E/A environment.
Also provided are two files that permit us to save our working programs in program format. This is explained a little obscurely in the manual but I have managed to make that work.
One thing that struck me as peculiar was the fact that for one small program l ended up with three large program format files. However Stephen assures me that there is nothing to worry about. Apparently the program reserves large areas of memory when running, this affects the way the Save utility works.
This useful program means that it should be possible to write C99 programs and save the runnable versions to tape. ( ss. yes you can and it works. And we have a public domain program which enables ExBas to load these cassette files too .... ss).
With the availability of loaders for XB and MM we can see greater prospects of machine programs tor the unexpended machine. The second disk contains a source file tor the directory program on the first disk and the source and object for a TIW loader for the MM module.
Also included are XB and MM,E/A versions of a BREAKTHROUGH game that is well documented and very entertaining.
I certainly enjoyed playing with it though l usually find adventure games are more my style.
To move on to a C99 application which is supplied on the second disk. This is the source and object code lor a text formatter.
The program is called RUNOFF and allows the printing of TIW files and other DV80 text files without the need for embedded commands. It works nicely and lets you offset tables within the text in nofill mode.
(ss... RUNOFF has a significant advantage over TIW: the text tile is not stored in console ram, so a text file of
300 sectors may be printed : useful if you have created a mammoth text file by downloading from a bulletin board.
This version of Small-C does not have some of the usual features but it is likely that later revisions will have. I am sure that a positive response to Clint Pulley from some of the people who obtain this program will ensure further development. Stan Dixon.