VC - VAX C SYSTEM (kluge boot version, subset only) Program files available: VCSTDIO.H - constants & extern declarations for I/O lib VCSTDDEF.H - define macros for compiler VCGLBDEF.C - global defs VCGLBDECL.C - global declarations VC1 - VC6.C - Compiler source code (for VAX C...probably can compile itself, but who knows really...?) VC.TSK - VMS .exe file (renamed..name back) LIBRARY VCDISKLIB.C IO function source VCUTILIB.C Utility functions VCRUNLIB.C C version of compiler support routines VCRTLIB.OLB VMS Runtime support This compiler is descended from Dr. Dobbs' Journal Small C with extensions all over the place. No support for floats and longs exists. Basically the C features from Unix v7 not found completely include Floats/longs multidimensional arrays structures sizeof typedef casts #line #undef Some of these have been added; experiment. Note that for VAX where addresses are 4 bytes long, integers may default to long integers.... Switches for VC -c Produce commented assembly output -o file Output becomes "file" (name object) -r Include I/O redirection ability in output files -t Trace messages in program (trace routine calls) -v Verbose mode toggle -x VAX macro code output (only kind available) +label# start generating internal labels of form cc"label#" (e.g. +label 50 starts producing labels at cc50:). Command lines use Unix or LBL Tools style redirection when that is included (as it generally is by default). Note: register declarations are generally no-ops. The code generator here is a real crock; its only virtue is that it IS native mode VAX assembly language, put out in about 20 primitives translated from the 8080 Small C compiler's. Function Library The following routines may exist: getchar() get char from stdin getkey() check for key input (returns char typed or eof) gets(s) read a string from stdin printf(fmt,arg1, arg2,...) Formatted print to stdout ; see fprintf for format. \n means newline. putchar(c) Write character c to stdout puts(s) Write string s to stdout fclose(fp) Close a file (note def of FILE type in qstdio.h) ; FILE *fp fflush(fp) Flush output file buffer fgets(s,n,fp) Get string from file ; char *s ; int n ;length of string max ; FILE *fp ;file pointer fopen(fnam,mod) Open a file ; char *fnam, *mode ;mode is "r" or "w" or "rb" ; ; or "wb" for binary fprintf(fp,fmt,arg1, ...) Write formatted output to a file ; FILE *fp ; char *format ; note Format works but the only conversions supported ; are %c (char), %s (string), %d (decimal), %u (unsigned ; decimal), %o (octal), and %x (hex). fputs(s,fp) Write string to file getc(fp) read char from file putc(c,fp) put char to file ungetc(c,fp) push a char back into an input file system I/O close(fd) Close a file ; fd is an int creat(fn,pm) Create new (or reuse old) file ; char *filename; ; int pmode ;protection mode , no-op open(fnam,rwmode) Open existing file ; char *fnam ; int rwmode (0=read, 1=write) (no mode 2=both) read(fd,buffer,n) Read file (in 1 block multiples) ; int fd,n ; char *buffer ;reads n bytes from file fd into buffer. write() Write file (in 1 block multiples) atoi(s) ASCII string to integer ; char *s ; example: atoi("123") returns 123 chlower() Convert uppercase letter to lowercase chupper() Convert lower to upper case letter index(s,c) Look for given character c in string s ; returns null or pointer to c in s itob(n,s,b) convert integer to string in base chosen in range 2-36 ; int n,b ;number, base ; char *s ;string pointer sprintf() format a string strcat(s1,s2) Apppend one string s2 to end of another s1 strcmp(s1,s2) Compare 2 strings strcpy(s1,s2) copy one string into another (copy s2 into s1) strlen(s) Length of string strmov(s1,s2) copy one string into another (copy s2 into s1) tolower(c) convert a character to lowercase toupper(c) convert a character to uppercase isalnum(c) Is char a letter or number? isalpha() ...a letter? isascii() ...an ASCII character iscntrl() ...a control char isdigit() ...a digit islower() ...a lower case letter isprint() ...a printable character ispunct() ...a punctuation mark isspace() ...white space isupper() ...an uppercase letter exit(n) exit program. n=0 ==>OK. Non-0 implies error. malloc(n) Allocate blk of free memory space ; unsigned int n = amount of mem to alloc. Start of space ; or 0 returns. maxsbrk() Report free memory size avail moat(size) Set size of stack space (unsigned int) ; sets size of area between dynam mem and stack imax(m,n) Max of 2 integers m,n imin(m,n) Min of 2 ints m,n peek(addr) Look at a byte of memory (unsigned addr) poke(addr,val) change a byte of memory wpeek() Look at a work of memory wpoke() change a memory word