COMMAND - command to compile multi-segment C programs.


nsc [sourcefile] [option]*
(+|-)18bitShorts (-)        (+|-)Clear (-)
(+|-)ControlComments (-)    (+|-)FAr (-)
(+|-)Hugepointers (-)       (+|-)Keep (-)
(+|-)Load (+)               (+|-)Rotate (-)
(+|-)StandardLibrary (+)    (+|-)Tables (-)
(+|-)TEST (-)               (+|-)Zdebug (-)
Configuration=file          Define=name=value
Entry=name                  FAr=bytes
Format=keyword              Heap=words
Include=catalog             LiSting=keywords
Library=library             LinK=filename
LoadOpts=options            Map=filename
Name=module                 Output=file
STI=string                  Stack=words
StandardInclude=catalog     StandardLibrary=lib
TEST=file                   USe=symbol


nsc /myfile.c o=/myfile.o


is a file containing C source code.
indicates that the program should use 18-bit integers to hold values declared as "short int" (signed and unsigned). Since 18-bit integers are not natural for the hardware to manipulate, this will increase the size and running time of your program. Note that the library is compiled with -18bitShorts. The only place where this causes problems is with the "scanf" family of functions. If you use "scanf" to read a "short" value, you MUST read it into a 36-bit machine word, even if you have +18bitShorts in effect.
is used in conjunction with the Update= option. The +Clear option initializes the given library before any LD object code is stored in the library. Any previous contents of the library are lost. This option must be specified when creating a new library.
specifies that the compiler should interpret the Lint control comments in the source code. Normally such comments are ignored, and only the corresponding pragmas are interpreted.
specifies that all objects are to be considered as 'far', regardless of size.
specifies that all objects are to be considered as 'near', including references to undimensioned arrays.
specifies that unqualified pointer types are to be treated as huge pointers. Indexing from huge pointers uses any carry or borrow from the word offset to change the SEGID, thus allowing the pointer to point to an array of objects spanning more than one hardware segment.
specifies that unqualified pointer types are to be treated as near pointers.
leaves the intermediate files in the AFT.
indicates that the output of the command should not be run through the LD pass of the compiler. -Load cannot be used with Format=LD (see below).
specifies that all conversions between pointer types and integral types treat the integral value as a byte offset. This means that the integral value will not have the same bit pattern as the pointer value; loosely speaking, the integer value makes it look like the address space is "flat" (a contiguous series of bytes) rather than segmented. The default behaviour (-Rotate) is to do the conversion as a one-to-one bitwise mapping.
suppresses the inclusion of standard libraries during the linking pass of the compiler.
generates local symbol tables for line numbers and auto variables.
asks to use test versions of the compiler passes and libraries. See the discussion "Driver Configuration File" below for more details.
performs various debugging operations. This option is intended for use by those maintaining the compiler; it is not of interest to normal users.
specifies a CPP configuration file. For more details, see "expl nsc cpp".
defines a preprocessor symbol named "name" with the given "string" value. For example,

defines a manifest NDEBUG with value 1. Single or double quotes may be used to enclose strings containing blanks. Any number of Define= options may be specified on the command line.

specifies an entry name. This is passed on to the LD link editing phase as the entry name for the program. For further details, see "expl ld". If no Entry= option is specified, the default entry name is "C$ENTRY". NOTE: People writing normal C programs should not use this option, since the default will provide optimal results.
specifies the threshold size for 'far' external objects. Any objects whose size is below the boundary will be linked and referenced placing the object within the first 32K words of the External Segment. Any object whose size is greater than or equal to this limit will be defined in an unbound section, and referenced with no assumptions as to binding. The default for this limit is 16K words (64k bytes).
indicates the desired format of the output file. The desired format is indicated by one of the following keywords.
output is in LD format. Output will be passed through the LD pass of the compiler to make it compact. This option may not be specified with -Load.
is only supported for test development. The output is an accomodation mode Q*, linked with a limited subset of the library for running under TSS.
output is a complete run-unit.
output is a single OM that contains the entire program. To produce an appropriate run-unit, just run the OM through LKED (without specifying libraries).
output is an OM that does not have standard library routines linked in. To produce a run-unit, you must run the OM through LKED, specifying libraries as appropriate.
does not specify a format. In this case, if you want to control what LD produces, you must use the LoadOpts= option.
specifies the size of the operand heap when LD writes a Run Unit. The heap will be broken into as many 256K word segments as are required. The default is 64K words. There is seldom any reason to change this default, since C normally grows the heap space as needed; however, in TP8 the heap space does not grow, so the Heap= option should be set as high as needed.
searches the given catalog for quoted "#include" files (if necessary). Up to eight such subcatalogs may be specified on the command line. Searching through these specified catalogs takes place after the compiler has searched through the subcatalog containing the source file and before it begins searching through the default "#include" catalog If multiple subcatalogs are specified, they will be searched in the order specified on the command line.
indicates an LD library containing routines that should be linked in with the source code being compiled. Several "Library=" options may be specified on the same command line.
specifies extra input files to be supplied to LD, along with the result of the compilation of the source file (if any), in the order specified on the command line.
specifies which parts of a listing should be produced. The keywords should be selected from abbreviations of the following, separated by commas:
Inputsource  - List the source and include files
Outputsource - List the output of the preprocessor
Xref         - List an identifier cross reference
Assembler    - List the generated machine code

The listing is written to standard output. If no keywords are supplied (that is, the option is just "LiSting="), a listing is generated which contains all of the above sections.

specifies options for the LD phase of the compiler. This option is not of interest to general users.
writes a load map into the specified file.
gives a name for the module being compiled.
tells the compiler where to write the output of the compilation. The default output file name depends on the Format=keyword option.
QStar format:     .h
Run_Unit format:  fc*v*
All others:       fc*o*
specifies the size of the software stack when LD writes a Run Unit. The default is 1k words, which is adequate for most C programs.
is similar to Include=catalog, but tells the compiler where to search for #include file names enclosed in <angle brackets>.
indicates the name of a system library to be searched.
specifies a 12 character STI number. This option is not normally used, but will affect where the compiler looks for its configuration file.
specifies a configuration file that defines where the compiler should look to find code for the different compiler passes, libraries, include files and other auxiliary files. See below for more details.
indicates that the output module should be edited into the library specified by "filename". Normally, LEDIT will be called to edit the compiled output into an LD library. However, if the Format= option is used LEDIT, LODL, OMLEDIT or RUED may be used. This option is not available in batch, where the same effect can easily be accomplished with a following job step.
forces LD to link in the routine(s) identified by the given name(s).


This command compiles C programs for execution in the GCOS-8 multi-segment environment. The command itself runs under TSS or batch.


This compiler gives more warning messages than many other versions of C. Programmers can use various #pragma directives to suppress some of these warnings, when the code in question is known to be correct.

Compiling in Batch

If your program is too big to compile under TSS, you can compile it in batch. You can do so with the JCL

$      select  &system/
$      run     rufile=&cv00rp/nsc_ru
$      data    cz
$      ascii
command line
$      enx

where "command line" is exactly like a command line that you would use under TSS. If necessary, you can continue the command line over several lines of input by putting a backslash at the end of every line but the last one, as in

nsc file \
    option \
    option \


The size supplied to FAr= is in bytes; the sizes supplied for Stack= and Heap= are in words. These sizes follow the C rules for radix: a value starting with "0x" or "0X" is in hexadecimal, a number starting with "0" is octal, and otherwise the number is decimal. The number may be followed by a 'k' or 'm', indicating kilo- or megabytes, respectively.

Driver Configuration File

The NSC driver uses a configuration file to locate other files used by the compiler. By default this is the file &SYSTEM/<current-sti>/files, but the STI= and TEST= options may be used to specify another version.

The file is organized as a set of lines of the form

keyword prod-path test-path

Lines beginning with "*" are treated as comments. The order of the keyword directives is not important, but all the following directives must be present.

CPP, TFD, Pass0, Pass1, LoaDer
These keyword directives give the location of the qstars for the TSS compiler passes. If the "+TEST" option is specified, and "test-path" does not exist then "prod-path" will be used instead.
This directive gives the location of the catalogue where the compiler will look for standard libraries. If "+TEST" is specified, the "test-path" catalogue will be checked first.
This directive gives the catalogue used for the standard includes. Although a "test-path" is required on the directive, the value is always ignored.

See Also:

expl linfo
displaying the contents of LD object libraries.
expl ledit
editing LD object libraries.
expl lint manual
for checking validity and portability of C programs.

Files Used:

fc**0, fc**1, fc**2 etc - work files
fc*99 - CPP config file
&system/<sti>/files - driver configuration file

Copyright © 2000, Thinkage Ltd.