Dec 092017
Small 'C' compiler.
File SMALLC.ZIP from The Programmer’s Corner in
Category C Source Code
Small ‘C’ compiler.
File Name File Size Zip Size Zip Type
CPC.EXE 39168 16170 deflated
CPCLIB.ASM 15893 4931 deflated
CPCLIB.OBJ 2304 1924 deflated
CPCN.C 49149 13188 deflated
FORMAT.C 415 229 deflated
FORMAT.DOC 3617 1436 deflated
FORMAT.EXE 14208 5280 deflated
FORMAT0.C 2677 989 deflated
FORMAT1.C 3423 1195 deflated
FORMAT2.C 5729 2021 deflated
FORMAT3.C 2677 964 deflated
FORMAT4.C 1963 808 deflated
SAMPLE-1.C 425 290 deflated
SAMPLE-2.C 756 371 deflated
SMALLC.DOC 36352 11845 deflated

Download File SMALLC.ZIP Here

Contents of the FORMAT.DOC file

.cm text format program: documentation
.cm Source: format.doc
.cm Version: June 3, 1981.
.he text format program: user guide
.fo " page #

.pl 66 page length for regular computer paper
.rm 60


This document tells you how to use format,
a text formatting program.
Format is a transliteration of the text formatting
program described in the book
Software Tools
by Brian W. Kernighan and P. J. Plauger.
This book is published by Addison-Wesley, 1976.

I recommend that you buy a copy of Software Tools
if you intend to make heavy use of this program.

The format program accepts a file of text
interspersed with formatting commands.
The format program produces an output file
which contains the formatted text.
The output file can then be printed using an
editor or the CP/M type command.

Format commands

Format commands are instructions to the format
program telling the program how to arrange text
on a page.
Any line which begins with a period in the first
column is assumed to be a command line.
Format commands all consist of two letters which
immediately follow the beginning period.
Unknown commands, as well as commands in upper case,
are also ignored.
I use .cm to indicate comment lines.
I also translate commands to upper case if I want
to temporarily disable a command.

Most commands can accept arguments.
If the argument is preceded by a plus or minus sign
then the argument changes an internal value by some
Otherwise, the internal value is set to the value
of the argument.
For example, the command .ls 2
sets the line spacing to 2,
while the command .ls +2 increases the line spacing
by 2 lines.

Here is a list of the format commands.
I am assuming that you have some experience using
similar text formatters because the description
of what these commands do is sketchy.
If you have doubts, read Software Tools.

command break? default action
.bp yes n=+1 begin page # n
.br yes cause break
.ce n yes n=1 center next n lines
.fi yes start fill mode
.fo no empty footer title
.he no empty header title
.in n no n=0 indent n spaces
.ls n no n=1 set line spacing=n
.nf yes stop fill mode
.pl n no n=66 set page length=n
.rm n no n=60 set right margin=n
.sp n yes n=1 space down n lines
.ti n yes n=0 temp indent n spaces
.ul n no n=1 underline next n lines

A break stops the filling of the current line.
Breaks are needed between paragraphs.

Lines containing nothing but blanks
always cause one blank line to be output.

A line which starts with a tab or blank
causes the temporary indent setting to be set
to the number of beginning spaces on that line.
Note that this feature overrides any .ti setting
in effect.

How to run this program

To run this program just type format while in
The format program will ask for a list
of input files, one file at a time.
The format program will format each file
and append the output to the file out.txt.
The file out.txt is erased before the output from the
first file is sent to it.
Exit the format program by typing carriage return
when asked for an input file.

 December 9, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>