Mix Power C v2.2.0

This commit is contained in:
davidly 2024-07-02 08:33:48 -07:00
parent 1a1aaf034e
commit 0b87814a1c
81 changed files with 5164 additions and 0 deletions

1
Mix Power C v22/ALLOC.H Normal file
View File

@ -0,0 +1 @@
#include <malloc.h>

14
Mix Power C v22/ASSERT.H Normal file
View File

@ -0,0 +1,14 @@
/*$no list*//*$no trace <<< assert.h >>> */
/* Copyright (c) Mix Software 1988 */
#undef assert
#if !defined(NDEBUG)
#if !Defined(_assert_fail)
void _assert_fail(char *filename, int line);
#endif
#define assert(exp) (void)( (!(exp)) ? _assert_fail(__FILE__, __LINE__) : 0)
#else
#define assert(exp) (void)0
#endif
/*$list*//*$trace <<< assert.h >>> */

115
Mix Power C v22/BARCHART.C Normal file
View File

@ -0,0 +1,115 @@
/*
Create a bar chart on the screen.
The command line may contain the graphics mode. If no
mode is specified, a default mode is used. EGA users
may wish to try modes 14 or 16.
*/
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <string.h>
#include <graphics.h>
#include "screen.c" /* include function that sets screen mode */
#define MODE CGA_320 /* default screen mode */
#define CHARWIDTH 8
#define CHARHEIGHT 8
#define DATASIZE 15
/*
display a bar chart
*/
main(int argc, char *argv[]) {
struct vconfig screen_data;
int oldmode, mode;
double data[DATASIZE] = {95.10, 96.11, 107.94, 135.76, 122.55,
140.64, 164.93, 167.24, 211.28, 242.17,
247.08, 277.72, 353.40, 330.22, 417.09};
static char title[] = "S&P 500 Average (12/31)";
static char pattern[] = {0, 0, 0, 0, 0, /* pattern for 0 color modes */
0, 1, 1, 1, 0,
0, 1, 0, 1, 0,
0, 1, 1, 1, 0,
0, 0, 0, 0, 0};
double vinterval = 50.0; /* labeling interval for vertical axis */
double maxval, value;
double height, vscale;
int width, base, i;
int year;
char color;
char text[30];
/* the screen mode may be specified on the command line */
if (argc > 1) mode = atoi(argv[1]); else mode = MODE;
oldmode = getvmode(); /* current screen mode */
if ((mode = screen(oldmode,mode)) == -1) {
puts("** Unable to set the screen to graphics mode **");
setvmode(oldmode);
return 1;
}
getvconfig(&screen_data); /* fetch the screen parameters */
/* draw axes */
pen_color(screen_data.colors-1);
clrscrn2(0);
base = screen_data.ypixels-CHARHEIGHT*2-4; /* allow space for title */
move_to(CHARWIDTH*4,base+1);
line_to(screen_data.xpixels-4,base+1); /* draw base line */
move_to(CHARWIDTH*4,base+1);
line_to(CHARWIDTH*4,4); /* draw vertical axis */
/* calculate scale factors */
maxval = data[0];
for (i = 1; i < DATASIZE; ++i)
if (maxval < data[i]) maxval = data[i];
height = (double) (vinterval * (int) (maxval + vinterval)/vinterval );
width = (screen_data.xpixels-CHARWIDTH*4-8)/DATASIZE;
vscale = (base - 4) / height;
/* label vertical axis */
if (screen_data.colors > 2) pen_color(2);
for (value = vinterval; value < height; value += vinterval) {
move_to(CHARWIDTH*3+CHARWIDTH/2 ,base - (int)(value*vscale) );
line_by(CHARWIDTH,0); /* axis marker */
move_by(-CHARWIDTH*4-CHARWIDTH/2,-CHARHEIGHT/2);
sprintf(text,"%3.0f",value);
plots(text);
}
/* label horizontal axis */
if ((CHARWIDTH*4+2) < width) {
for (year = 1977; year <= 1991; year++) {
move_to(CHARWIDTH*4+width*2/3+width*(year-1977)-CHARWIDTH*2,base+3);
sprintf(text,"%4d",year);
plots(text);
}
}
else {
for (year = 77; year <= 91; year++) {
move_to(CHARWIDTH*4+width*2/3+width*(year-77)-CHARWIDTH,base+3);
sprintf(text,"%2d",year);
plots(text);
}
}
/* label chart */
move_to(screen_data.xpixels/2 - (CHARWIDTH*strlen(title))/2,
base+CHARHEIGHT+3);
plots(title);
/* draw the bars */
pen_color(1);
color = 1;
if (screen_data.colors == 2) fill_style(&pattern,5,5);
else fill_style(&color,1,1);
line_style(&color,1);
for (i = 0; i < DATASIZE; ++i) {
move_to(CHARWIDTH*4+width/3+width*i,base);
box(width*2/3,(int)(-data[i]*vscale),1);
}
getch(); /* wait for a key */
setvmode(oldmode);
}

32
Mix Power C v22/BIOS.H Normal file
View File

@ -0,0 +1,32 @@
/*$no list*//*$no trace <<< bios.h >>> */
/* Copyright (c) Mix Software 1988 */
int bioscom(int operation, char data, int comport);
int biosdisk(int operation, char drive, int head,
int cylinder, int sector, int nsects, void *buffer);
int biosequip(void);
int bioskey(int operation);
int biosmemory(void);
int biosprint(int operation, int data, int prnport);
long biostime(int operation, long newtime);
void clrscrn(void);
void clrscrn2(int attr);
void cursblk(void);
void curslin(void);
int curscol(void);
int cursrow(void);
void cursoff(void);
void curson(void);
int getvmode(void);
void poscurs(int row, int col);
int readattr(void);
int readch(void);
int readdot(int row, int col);
void setcolor(int background, int palette);
int setvmode(int mode);
void sound(int freq, int duration);
void writech(int c);
void writechs(int c, int attr, int n);
void writedot(int row, int col, int pixel);
/*$list*//*$trace <<< bios.h >>> */

22
Mix Power C v22/CONIO.H Normal file
View File

@ -0,0 +1,22 @@
/*$no list*//*$no trace <<< conio.h >>> */
/* Copyright (c) Mix Software 1988 */
char *cgets(char string[]);
int cprintf(char *format, ...);
void cputs(char *string);
int cscanf(char *format, ...);
int getch(void);
int getche(void);
int getkey(void);
char *getpass(char *prompt);
int inp(unsigned port);
int inport(int port);
int inportb(int port);
int kbhit(void);
int outp(unsigned port, int c);
void outport(unsigned port, int word);
void outportb(int port, char c);
void putch(int c);
int ungetch(int c);
/*$list*//*$trace <<< conio.h >>> */

26
Mix Power C v22/CTYPE.H Normal file
View File

@ -0,0 +1,26 @@
/*$no list*//*$no trace <<< ctype.h >>> */
/* Copyright (c) Mix Software 1988 */
int isalnum(int c);
int isalpha(int c);
int iscntrl(int c);
int isdigit(int c);
int isgraph(int c);
int islower(int c);
int isprint(int c);
int ispunct(int c);
int isspace(int c);
int isupper(int c);
int isxdigit(int c);
int tolower(int c);
int toupper(int c);
#if !defined(ANSI)
int isascii(int c);
int isatty(int fd);
int toascii(int c);
int _tolower(int c);
int _toupper(int c);
#endif
/*$list*//*$trace <<< ctype.h >>> */

1
Mix Power C v22/DIR.H Normal file
View File

@ -0,0 +1 @@
#include <direct.h>

42
Mix Power C v22/DIRECT.H Normal file
View File

@ -0,0 +1,42 @@
/*$no list*//*$no trace <<< direct.h >>> */
/* Copyright (c) Mix Software 1988 */
/* structure for searching directory (used by findfirst, findnext) */
struct ffblk {
char ff_reserved[21]; /* used by dos */
char ff_attrib; /* attributes of the file */
int ff_ftime; /* time file last modified */
int ff_fdate; /* date file last modified */
long ff_fsize; /* size of file */
char ff_name[13]; /* name of file (xxxxxxxx.yyy) */
};
/* flags for fnsplit */
#define WILDCARDS 0x01
#define EXTENSION 0x02
#define FILENAME 0x04
#define DIRECTORY 0x08
#define DRIVE 0x10
/* buffer sizes for fnsplit */
#define MAXPATH 80
#define MAXDRIVE 3
#define MAXDIR 66
#define MAXFILE 9
#define MAXEXT 5
int chdir(char *path);
int findfirst(char *filename, struct ffblk *filedata, int attr);
int findnext(struct ffblk *filedata);
void fnmerge(char *path, char *drive, char *dir, char *file, char *ext);
int fnsplit(char *path, char *drive, char *dir, char *file, char *ext);
int getcurdir(int drive, char *dirname);
char *getcwd(char *path, int length);
int getdisk(void);
int mkdir(char *path);
char *mktemp(char *template);
int rmdir(char *name);
char *searchpath(char *filename);
int setdisk(int drive);
/*$list*//*$trace <<< direct.h >>> */

245
Mix Power C v22/DOS.H Normal file
View File

@ -0,0 +1,245 @@
/*$no list*//*$no trace <<< dos.h >>> */
/* Copyright (c) Mix Software 1988 */
#define time_t long
extern int _doserrno;
extern unsigned char _osmajor;
extern unsigned char _osminor;
extern unsigned int _psp;
extern unsigned int _version;
extern int _argc;
extern char *_argv[];
extern int _AX;
extern signed char _AH;
extern signed char _AL;
extern int _BX;
extern signed char _BH;
extern signed char _BL;
extern int _CX;
extern signed char _CH;
extern signed char _CL;
extern int _DX;
extern signed char _DH;
extern signed char _DL;
extern int _SI;
extern int _DI;
extern int _BP;
extern int _CS;
extern int _DS;
extern int _ES;
#define FP_SEG(farptr) (*((unsigned *)&(farptr) + 1))
#define FP_OFF(farptr) (*((unsigned *)&(farptr)))
#define MK_FP(seg,off) ((void far *) \
(((unsigned long)(seg) << 16) | (unsigned) (off)))
#define FA_NORMAL 0x0000
#define FA_RDONLY 0x0001
#define FA_HIDDEN 0x0002
#define FA_SYSTEM 0x0004
#define FA_LABEL 0x0008
#define FA_DIREC 0x0010
#define FA_ARCH 0x0020
#if !Defined(struct WORDREGS)
struct WORDREGS {
unsigned int ax;
unsigned int bx;
unsigned int cx;
unsigned int dx;
unsigned int si;
unsigned int di;
unsigned int cflag;
unsigned int flags;
};
#endif
#if !Defined(struct BYTEREGS)
struct BYTEREGS {
unsigned char al, ah;
unsigned char bl, bh;
unsigned char cl, ch;
unsigned char dl, dh;
};
#endif
#if !Defined(union REGS)
union REGS {
struct WORDREGS x;
struct BYTEREGS h;
struct WORDREGS word;
struct BYTEREGS byte;
};
#endif
#if !Defined(struct SREGS)
struct SREGS {
unsigned int es;
unsigned int cs;
unsigned int ss;
unsigned int ds;
};
#endif
#if !Defined(struct REGPACK)
struct REGPACK {
unsigned r_ax, r_bx, r_cx, r_dx;
unsigned r_bp, r_si, r_di;
unsigned r_ds, r_es, r_flags;
};
#endif
#if !Defined(struct DOSERROR)
struct DOSERROR {
int exterror;
char class;
char action;
char locus;
};
#endif
#if !Defined(struct date)
struct date {
int da_year;
char da_day;
char da_mon;
};
#endif
#if !Defined(struct time)
struct time {
unsigned char ti_min;
unsigned char ti_hour;
unsigned char ti_hund;
unsigned char ti_sec;
};
#endif
#if !Defined(struct dfree)
struct dfree {
unsigned df_avail; /* available clusters */
unsigned df_total; /* total clusters */
unsigned df_bsec; /* bytes per sector */
unsigned df_sclus; /* sectors per cluster */
};
#endif
#if !Defined(struct fatinfo)
struct fatinfo {
char fi_sclus; /* Sectors per cluster */
char fi_fatid; /* identification byte */
int fi_nclus; /* number of clusters */
int fi_bysec; /* bytes per sector */
};
#endif
#if !Defined(struct ftime)
struct ftime {
unsigned ft_tsec : 5; /* two seconds */
unsigned ft_min : 6; /* minutes */
unsigned ft_hour : 5; /* hours */
unsigned ft_day : 5; /* day of month */
unsigned ft_month: 4; /* month */
unsigned ft_year : 7; /* year - 1980 */
};
#endif
#if !Defined(struct fcb)
struct fcb {
char fcb_drive; /* drive number */
char fcb_name[8]; /* file name */
char fcb_ext[3]; /* file extension */
int fcb_curblk; /* block number */
int fcb_recsize; /* logical record size */
long fcb_filsize; /* file size */
int fcb_date; /* Date file was last written */
char fcb_resv[10]; /* Reserved for DOS */
char fcb_currec; /* record in block */
long fcb_random; /* random record number */
};
#endif
#if !Defined(struct country)
struct country {
int co_date; /* date format */
char co_curr[5]; /* currency symbol string */
char co_thsep[2]; /* thousands separator character */
char co_desep[2]; /* decimal separator character */
char co_dtsep[2]; /* date separator character */
char co_tmsep[2]; /* time separator character */
char co_currstyle; /* currency format */
char co_digits; /* number digits after decimal */
char co_timestyle; /* time format */
int (far *co_case)(); /* case map call address */
char co_dasep; /* data-list separator */
char co_fill[11]; /* reserved */
};
#endif
#if !Defined(_INT_STK)
extern int near _INT_STK; /* stack reserved for interrupt handlers */
#endif
int absread(int drive, int nsects, int sector, void *buffer);
int abswrite(int drive, int nsects, int sector, void *buffer);
int allocmem(unsigned size, unsigned *seg);
int asm(void *codeptr, void *dataptr);
int bdos(int fn, unsigned dx, unsigned al);
int bdosptr(int fn, void *address, unsigned al);
struct country *country(int code, struct country *info);
void ctrlbrk(int (*handler)(void));
void disable(void);
int dosexterr(struct DOSERROR *errinfo);
time_t dostounix(struct date *dosdate, struct time *dostime);
void enable(void);
int freemem(unsigned seg);
void geninterrupt(int intno);
int getcbrk(void);
int getcseg(void);
void getdate(struct date *datebuf);
void getdfree(int drive, struct dfree *diskdata);
int getdseg(void);
char far *getdta(void);
void getfat(int drive, struct fatinfo *fat);
void getfatd(struct fatinfo *fat);
unsigned getpsp(void);
void gettime(struct time *timebuf);
void interrupt (far *getvect(int intno))();
int getverify(void);
void harderr(int (*handler)(int error, int ax, int bp, int si));
void hardresume(int cmd);
void hardretn(int error);
int inp(unsigned port);
int inport(int port);
int inportb(int port);
int int86(int interrupt, union REGS *inregs, union REGS *outregs);
int int86x(int interrupt, union REGS *inregs, union REGS *outregs,
struct SREGS *segregs);
int intdos(union REGS *inregs, union REGS *outregs);
int intdosx(union REGS *inregs, union REGS *outregs,
struct SREGS *segregs);
void intr(int interrupt, struct REGPACK *regs);
void keep(int status, int size);
int outp(unsigned port, int c);
void outport(unsigned port, int word);
void outportb(int port, char c);
char *parsfnm(char *filename, struct fcb *buffer, int option);
int peek(unsigned segment, unsigned offset);
int peekb(unsigned segment, unsigned offset);
void poke(unsigned segment, unsigned offset, int value);
void pokeb(unsigned segment, unsigned offset, char value);
void segread(struct SREGS *sregs);
int setblock(unsigned seg, unsigned size);
int setcbrk(int flag);
void setdate(struct date *datebuf);
void setdta(char far *address);
void settime(struct time *timebuf);
void setvect(int intno, void interrupt (far *handler)());
void setverify(int flag);
void sleep(unsigned seconds);
void unixtodos(time_t timer, struct date *dosdate, struct time *dostime);
/*$list*//*$trace <<< dos.h >>> */

35
Mix Power C v22/E.C Normal file
View File

@ -0,0 +1,35 @@
#include <stdio.h>
#ifndef MWC
#include <string.h>
#include <stdlib.h>
#endif
#define DIGITS_TO_FIND 200 /*9009*/
int main() {
int N = DIGITS_TO_FIND;
int x = 0;
int a[ DIGITS_TO_FIND ];
int n;
for (n = N - 1; n > 0; --n) {
a[n] = 1;
}
a[1] = 2, a[0] = 0;
while (N > 9) {
n = N--;
while (--n) {
a[n] = x % n;
x = 10 * a[n-1] + x/n;
}
printf("%d", x);
}
printf( "\ndone\n" );
return 0;
}

39
Mix Power C v22/ERRNO.H Normal file
View File

@ -0,0 +1,39 @@
/*$no list*//*$no trace <<< errno.h >>> */
/* Copyright (c) Mix Software 1988 */
extern int errno;
#define EZERO 0
#define EINVFNC 1
#define ENOENT 2
#define ENOPATH 3
#define EMFILE 4
#define EACCES 5
#define EBADF 6
#define ECONTR 7
#define ENOMEM 8
#define EINVMEM 9
#define EINVENV 10
#define EINVFMT 11
#define EINVACC 12
#define EINVDAT 13
#define ENODEV 15
#define ECURDIR 16
#define EXDEV 17
#define ENMFILE 18
#define EINVAL 19
#define E2BIG 20
#define ENOEXEC 21
#define EDEADLOCK 22
#define ENOSPC 23
#define EEXIST 24
#define EDOM 33
#define ERANGE 34
#if !defined(ANSI)
extern int _doserrno;
extern int sys_nerr;
extern char *sys_errlist[];
#endif
/*$list*//*$trace <<< errno.h >>> */

BIN
Mix Power C v22/FASTHDR.EXE Normal file

Binary file not shown.

21
Mix Power C v22/FCNTL.H Normal file
View File

@ -0,0 +1,21 @@
/*$no list*//*$no trace <<< fcntl.h >>> */
/* Copyright (c) Mix Software 1988 */
#define O_RDONLY 0x0000
#define O_WRONLY 0x0001
#define O_RDWR 0x0002
#define O_APPEND 0x0008
#define O_CREAT 0x0100
#define O_TRUNC 0x0200
#define O_EXCL 0x0400
#define O_TEXT 0x4000
#define O_BINARY 0x8000
#define O_MODEMASK 0x00F3
#define O_DENYALL 0x0010
#define O_DENYNONE 0x0040
#define O_DENYREAD 0x0030
#define O_DENYWRITE 0x0020
#define O_NOINHERIT 0x0080
/*$list*//*$trace <<< fcntl.h >>> */

84
Mix Power C v22/FLOAT.H Normal file
View File

@ -0,0 +1,84 @@
/*$no list*//*$no trace <<< float.h >>> */
/* Copyright (c) Mix Software 1988 */
#define DBL_DIG 15
#define DBL_EPSILON 2.2204460492503131E-16
#define DBL_MANT_DIG 53
#define DBL_MAX 1.7976931348623158E+308
#define DBL_MAX_10_EXP +308
#define DBL_MAX_EXP +1024
#define DBL_MIN 2.2250738585072014E-308
#define DBL_MIN_10_EXP -307
#define DBL_MIN_EXP -1021
#define FLT_DIG 6
#define FLT_EPSILON 1.192092896E-07
#define FLT_MANT_DIG 24
#define FLT_MAX 3.402823466E+38
#define FLT_MAX_10_EXP +38
#define FLT_MAX_EXP +128
#define FLT_MIN 1.175494351E-38
#define FLT_MIN_10_EXP -37
#define FLT_MIN_EXP -125
#define LDBL_DIG DBL_DIG
#define LDBL_EPSILON DBL_EPSILON
#define LDBL_MANT_DIG DBL_MANT_DIG
#define LDBL_MAX DBL_MAX
#define LDBL_MAX_10_EXP DBL_MAX_10_EXP
#define LDBL_MAX_EXP DBL_MAX_EXP
#define LDBL_MIN DBL_MIN
#define LDBL_MIN_10_EXP DBL_MIN_10_EXP
#define LDBL_MIN_EXP DBL_MIN_EXP
#if !defined(ANSI)
#define FLT_GUARD 1
#define FLT_RADIX 2
#define DBL_RADIX 2
#define LDBL_RADIX 2
#define FLT_NORMALIZE 1
#define FLT_ROUNDS 1
#define DBL_ROUNDS 1
#define LDBL_ROUNDS 1
unsigned _clear87(void);
unsigned _control87(unsigned cw, unsigned mask);
void _fpreset(void);
unsigned _status87(void);
/* 8087/80287 Status Word format */
#define SW_INVALID 0x0001 /* Invalid operation */
#define SW_DENORMAL 0x0002 /* Denormalized operand */
#define SW_ZERODIVIDE 0x0004 /* Zero divide */
#define SW_OVERFLOW 0x0008 /* Overflow */
#define SW_UNDERFLOW 0x0010 /* Underflow */
#define SW_INEXACT 0x0020 /* Precision (Inexact result) */
/* 8087/80287 Control Word format */
#define MCW_EM 0x003f /* interrupt Exception Masks */
#define EM_INVALID 0x0001 /* invalid */
#define EM_DENORMAL 0x0002 /* denormal */
#define EM_ZERODIVIDE 0x0004 /* zero divide */
#define EM_OVERFLOW 0x0008 /* overflow */
#define EM_UNDERFLOW 0x0010 /* underflow */
#define EM_INEXACT 0x0020 /* inexact (precision) */
#define MCW_IC 0x1000 /* Infinity Control */
#define IC_AFFINE 0x1000 /* affine */
#define IC_PROJECTIVE 0x0000 /* projective */
#define MCW_RC 0x0c00 /* Rounding Control */
#define RC_CHOP 0x0c00 /* chop */
#define RC_UP 0x0800 /* up */
#define RC_DOWN 0x0400 /* down */
#define RC_NEAR 0x0000 /* near */
#define MCW_PC 0x0300 /* Precision Control */
#define PC_24 0x0000 /* 24 bits */
#define PC_53 0x0200 /* 53 bits */
#define PC_64 0x0300 /* 64 bits */
#endif /* ANSI */
#define CW_DEFAULT IC_AFFINE|RC_NEAR|PC_64|EM_DENORMAL|EM_UNDERFLOW|EM_INEXACT
/*$list*//*$trace <<< float.h >>> */

View File

@ -0,0 +1,92 @@
/*$no list*//*$no trace <<< graphics.h >>> */
/* Copyright (c) Mix Software 1988 */
/* video modes */
#define CGA_320 4 /* cga 320 x 200 four color */
#define CGA_BW 5 /* cga 320 x 200 black & white */
#define CGA_HR 6 /* cga 640 x 200 two color */
#define MONOCHROME 7 /* monochrome 80 x 25 text */
#define EGA_320 13 /* ega 320 x 200, 16 color */
#define EGA_640 14 /* ega 640 x 200, 16 color */
#define EGA_BW 15 /* ega 640 x 350, monochrome */
#define EGA_HR 16 /* ega 640 x 350, 4 or 16 color */
#define VGA_2 17 /* vga, mcga 640 x 480, two color */
#define VGA_16 18 /* vga, 640 x 480, 16 color */
#define VGA_256 19 /* vga, mcga 320 x 200, 256 color */
#define HERCMODE 99 /* Hercules monochrome graphics, 720 x 348 */
#define DEFAULTMODE -1 /* default video mode */
/* special colors for lines and patterns */
#define PENCOLOR 0xff
#define TRANSPARENT 0xfe
#define BACKGROUND 0x00
/* operators to control putimage */
#define COPY_PUT 0
#define XOR_PUT 1
#define OR_PUT 2
#define AND_PUT 3
#define NOT_PUT 4
extern int _vxcurs; /* current x position of graphics cursor */
extern int _vycurs; /* current y position of graphics cursor */
/* screen description */
#if !Defined(struct vconfig)
struct vconfig {
int xpixels; /* number of pixels in x direction */
int ypixels; /* number of pixels in y direction */
int textcols; /* number of text columns */
int textrows; /* number of text rows */
int colors; /* number of colors */
int bitsperpixel; /* number of bits for each pixel */
int pages; /* number of video pages */
int colormask; /* value to & with color for bitsperpixel */
int aspect_v; /* aspect ratio of screen is: */
int aspect_h; /* aspect_v/aspect_h */
/* ie. y = aspect_v/aspect_h * y0 for 1:1 */
};
#endif
/* desciption of a fill pattern (used in pie charts) */
#if !Defined(struct fill_pattern)
struct fill_pattern {
int width;
int height;
char *pattern;
};
#endif
void box(int width, int height, int fillflag);
void circle(int radius, int color);
void clrscrn2(int color);
void ellipse(int xradius, int yradius, int color);
void fill(int bordercolor);
void fill_style(char *colors, int width, int height);
void flood(int width, int height);
void getimage(int left, int top, int right, int bottom,
void far *buffer);
int getpixel(int x, int y);
int getvmode(void);
struct vconfig *getvconfig(struct vconfig *screen);
long imagesize(int left, int top, int right, int bottom);
void line_by(int xoffset, int yoffset);
void line_style(char *colors, int size);
void line_to(int x, int y);
void move_by(int xoffset, int yoffset);
void move_to(int x, int y);
int pen_color(int color);
void pie(int radius, double *data, int pieces,
struct fill_pattern *fillpat);
void plotch(int ch);
void plots(char *string);
void putimage(int left, int top, void far *buffer, int operation);
int readdot(int row, int col);
int setapage(int pageno);
void setcolor(int background, int palette);
int setvpage(int pageno);
void setpixel(int x, int y);
int setvmode(int mode);
void writedot(int row, int col, int pixel);
/*$list*//*$trace <<< graphics.h >>> */

BIN
Mix Power C v22/HEADERS.HHH Normal file

Binary file not shown.

58
Mix Power C v22/IO.H Normal file
View File

@ -0,0 +1,58 @@
/*$no list*//*$no trace <<< io.h >>> */
/* Copyright (c) Mix Software 1988 */
#define ISCTRL 0x4000
#define ISDEV 0x0080
#define ISNEOF 0x0040
#define ISBIN 0x0020
#define ISCLK 0x0008
#define ISNUL 0x0004
#define ISCOT 0x0002
#define ISCIN 0x0001
#define O_RDONLY 0x0000
#define O_WRONLY 0x0001
#define O_RDWR 0x0002
#define O_APPEND 0x0008
#define O_CREAT 0x0100
#define O_TRUNC 0x0200
#define O_EXCL 0x0400
#define O_TEXT 0x4000
#define O_BINARY 0x8000
#define O_DENYALL 0x0010
#define O_DENYNONE 0x0040
#define O_DENYREAD 0x0030
#define O_DENYWRITE 0x0020
#define O_NOINHERIT 0x0080
#define S_IREAD 0x0100
#define S_IWRITE 0x0080
int access(char *filename, int mode);
int chmod(char *filename, int permission);
int chsize(int fd, long size);
int close(int fd);
int creat(char *filename, int mode);
int dup(int fd);
int dup2(int fd1, int fd2);
int eof(int fd);
long filelength(int fd);
int getftime(int fd, struct ftime *date);
int ioctl(int fd, int operation, ... /* void *dx, int cx */);
int locking(int fd, int mode, long size);
long lseek(int fd, long offset, int origin);
char *mktemp(char *template);
int open(char *filename, int access, ... /* int mode */);
int read(int fd, char *buffer, unsigned number);
int remove(char *filename);
int rename(char *oldname, char *newname);
int setftime(int fd, struct ftime *date);
int setmode(int fd, int mode);
int sopen(char *filename, int access, int shared, ... /* int mode */);
long tell(int fd);
int umask(int mode);
int unlink(char *filename);
int write(int fd, char *buffer, int number);
/*$list*//*$trace <<< io.h >>> */

26
Mix Power C v22/LIMITS.H Normal file
View File

@ -0,0 +1,26 @@
/*$no list*//*$no trace <<< limits.h >>> */
/* Copyright (c) Mix Software 1988 */
#define CHAR_BIT 8
#if '\xff' == 255
#define CHAR_MAX 255
#define CHAR_MIN 0
#else
#define CHAR_MAX 127
#define CHAR_MIN -128
#endif
#define INT_MAX 32767
#define INT_MIN -32768
#define LONG_MAX 2147483647
#define LONG_MIN -2147483648
#define SCHAR_MAX 127
#define SCHAR_MIN -128
#define SHRT_MAX 32767
#define SHRT_MIN -32768
#define UCHAR_MAX 255U
#define UINT_MAX 65535U
#define ULONG_MAX 4294967295U
#define USHORT_MAX 65535U
#define USHRT_MAX 65535U
/*$list*//*$trace <<< limits.h >>> */

35
Mix Power C v22/LOCALE.H Normal file
View File

@ -0,0 +1,35 @@
/*$no list*//*$no trace <<< locale.h>>> */
/* Copyright (c) Mix Software 1988 */
#define LC_ALL 0
#define LC_COLLATE 1
#define LC_CTYPE 2
#define LC_NUMERIC 3
#define LC_TIME 4
#define LC_MONETARY 5
struct lconv {
char *decimal_point;
char *thousands_sep;
char *grouping;
char *int_curr_symbol;
char *currency_symbol;
char *mon_decimal_point;
char *mon_thousands_sep;
char *mon_grouping;
char *positive_sign;
char *negative_sign;
char int_frac_digits;
char frac_digits;
char p_cs_precedes;
char p_sep_by_space;
char n_cs_precedes;
char n_sep_by_space;
char p_sign_posn;
char n_sign_posn;
};
struct lconv *localeconv(void);
char *setlocale(int category, char *locale);
/*$list*//*trace <<< locale.h >>> */

78
Mix Power C v22/MALLOC.H Normal file
View File

@ -0,0 +1,78 @@
/*$no list*//*$no trace <<< malloc.h >>> */
/* Copyright (c) Mix Software 1988 */
#if !Defined(size_t)
typedef unsigned size_t;
#endif
void *alloca(unsigned n);
char *brk(void *endds);
void *calloc(size_t number, size_t size);
unsigned coreleft(void);
void *_expand(void *ptr, int size);
void far *farcalloc(unsigned long number, unsigned long size);
unsigned long farcoreleft(void);
void farfree(void far *ptr);
void far *farmalloc(unsigned long size);
void far *farmemccpy(void far *destaddr, void far *srcaddr, int c,
size_t n);
void far *farmemchr(void far *addr, int c, size_t n);
int farmemcmp(void far *addr1, void far *addr2, size_t n);
int farmemcpy(void far *destaddr, void far *srcaddr, size_t n);
int farmemicmp(void far *addr1, void far *addr2, size_t n);
int farmemmove(void far *destaddr, void far *srcaddr, size_t n);
void far *farmemset(void far *addr, int c, size_t n);
void farmemswap(void far *addr1, void far *addr2, size_t n);
void farmovmem(void far *srcaddr, void far *destaddr, size_t n);
void far *farrealloc(void far *ptr, unsigned long size);
void farrepmem(void far *address, void far *data, int size, int number);
void farsetmem(void far *addr, int n, char c);
unsigned farsetsize(unsigned maxsize);
char far *farstpcpy(char far *str1, char far *str2);
char far *farstrcat(char far *str1, char far *str2);
char far *farstrchr(char far *str, int c);
int farstrcmp(char far *str1, char far *str2);
int farstrcmpi(char far *str1, char far *str2);
char far *farstrcpy(char far *str1, char far *str2);
size_t farstrcspn(char far *str1, char far *str2);
char far *farstrdup(char far *str);
char far *farstristr(char far *str1, char far *str2);
size_t farstrlen(char far *str);
char far *farstrlwr(char far *str);
char far *farstrncat(char far *str1, char far *str2, size_t n);
int farstrncmp(char far *str1, char far *str2, size_t n);
char far *farstrncpy(char far *str1, char far *str2, size_t n);
int farstrnicmp(char far *str1, char far *str2, size_t n);
char far *farstrnset(char far *str, int c, size_t n);
char far *farstrpbrk(char far *str1, char far *str2);
char far *farstrrchr(char far *str, int c);
char far *farstrrev(char far *str);
char far *farstrsave(char far *str);
char far *farstrset(char far *str, int c);
size_t farstrspn(char far *str1, char far *str2);
char far *farstrstr(char far *str1, char far *str2);
char far *farstrtok(char far *str1, char far *str2);
char far *farstrupr(char far *str);
void farswab(char far *source, char far *destination, int n);
long fartol(void far *ptr);
void _ffree(void far *ptr);
void far *_fmalloc(unsigned size);
unsigned _fmsize(void far *ptr);
unsigned _freect(unsigned blksize);
void free(void *ptr);
void huge *halloc(long number, unsigned size);
void hfree(void huge *ptr);
void far *ltofar(long address);
void *malloc(size_t size);
void far *_farexpand(void far *ptr, long size);
unsigned _memavl(void);
unsigned _msize(void *ptr);
void near *_nexpand(void near *ptr, int size);
void _nfree(void near *ptr);
char near *_nmalloc(unsigned size);
unsigned _nmsize(void near *ptr);
void *realloc(void *ptr, size_t size);
char *sbrk(int increment);
unsigned stackavail(void);
/*$list*//*$trace <<< malloc.h >>> */

76
Mix Power C v22/MATH.H Normal file
View File

@ -0,0 +1,76 @@
/*$no list*//*$no trace <<< math.h >>> */
/* Copyright (c) Mix Software 1988 */
extern double HUGE;
#define HUGE_VAL HUGE
#define EDOM 33
#define ERANGE 34
double acos(double x);
double asin(double x);
double atan(double x);
double atan2(double y, double x);
double ceil(double x);
double cos(double x);
double cosh(double x);
double exp(double x);
double fabs(double x);
double floor(double x);
double fmod(double x, double y);
double frexp(double x, int *exp);
double hypot(double x, double y);
double ldexp(double x, int exp);
double log(double x);
double log10(double x);
double modf(double x, double *wholepart);
double pow(double x, double y);
double sin(double x);
double sinh(double x);
double sqrt(double x);
double tan(double x);
double tanh(double x);
#if !defined(ANSI)
extern int errno;
extern char _mathmsg;
#if !Defined(struct complex)
struct complex {
double x;
double y;
};
#endif
#if !Defined(struct exception)
struct exception {
int type; /* type of exception */
char *name; /* name of function */
double arg1; /* first argument to function */
double arg2; /* second argument to function */
double retval; /* value to be returned if error is not fatal */
};
#endif
/* exception types */
#define DOMAIN 1 /* not in domain of function */
#define SING 2 /* singularity (function not defined) */
#define OVERFLOW 3 /* result too large */
#define UNDERFLOW 4 /* result too small */
#define TLOSS 5 /* total loss of precision */
#define PLOSS 6 /* partial loss of precision */
double cabs(struct complex z);
double j0(double x);
double j1(double x);
double jn(int n, double x);
int matherr(struct exception *err);
double poly(double x, int degree, double coeff[]);
double pow10(int n);
double y0(double x);
double y1(double x);
double yn(int n, double x);
#endif /* ANSI */
/*$list*//*$trace <<< math.h >>> */

1
Mix Power C v22/MEM.H Normal file
View File

@ -0,0 +1 @@
#include <memory.h>

22
Mix Power C v22/MEMORY.H Normal file
View File

@ -0,0 +1,22 @@
/*$no list*//*$no trace <<< memory.h >>> */
/* Copyright (c) Mix Software 1988 */
#if !Defined(size_t)
typedef unsigned size_t;
#endif
void exitmsg(void);
void *memccpy(void *destaddr, void *srcaddr, int c, size_t n);
void *memchr(void *addr, int c, size_t n);
int memcmp(void *addr1, void *addr2, size_t n);
void memcpy(void *destaddr, void *srcaddr, size_t n);
int memicmp(void *addr1, void *addr2, size_t n);
void memmove(void *destaddr, void *srcaddr, size_t n);
void *memset(void *addr, int c, size_t n);
void memswap(void *addr1, void *addr2, size_t n);
void movedata(int srcseg, int srcoff,
int destseg, int destoff, unsigned size);
void repmem(void *address, void *data, int size, int number);
void setmem(void *addr, int n, char c);
/*$list*//*$trace <<< memory.h >>> */

BIN
Mix Power C v22/MERGE.EXE Normal file

Binary file not shown.

BIN
Mix Power C v22/MIX.EXE Normal file

Binary file not shown.

157
Mix Power C v22/PATTERNS.C Normal file
View File

@ -0,0 +1,157 @@
#include <graphics.h>
#include <malloc.h>
/* Create fill data patterns based on the number of available colors */
/* The first set of patterns are each of the available solid colors */
/* After the solid colors have been used, each pattern is used and */
/* the color is changed for each pattern. When the patterns are all */
/* used, they are repeated with a different starting color. */
struct fill_pattern *patterns(struct vconfig *screen_data, int sections)
{
#define PATS 22
/* Templates for the patterns */
static char fill1[] = { 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0};
static char fill2[] = { 0, 1, 0 };
static char fill3[] = { 1, 0, 0, 0, 0,
0, 1, 0, 0, 0,
0, 0, 1, 0, 0,
0, 0, 0, 1, 0,
0, 0, 0, 0, 1};
static char fill4[] = { 1, 1, 1,
0, 1, 0,
0, 1, 0};
static char fill5[] = { 0, 0, 0, 0, 0,
0, 1, 1, 1, 0,
0, 1, 0, 1, 0,
0, 1, 1, 1, 0,
0, 0, 0, 0, 0};
static char fill6[] = { 1, 1,
1, 0};
static char fill7[] = { 1, 0, 0, 0, 0, 0,
1, 0, 0, 0, 0, 0,
1, 1, 1, 1, 0, 0,
0, 0, 0, 1, 0, 0,
0, 0, 0, 1, 0, 0,
0, 0, 0, 1, 1, 1};
static char fill8[] = { 0, 0, 0, 0, 1,
0, 0, 0, 1, 0,
0, 0, 1, 0, 0,
0, 1, 0, 0, 0,
1, 0, 0, 0, 0};
static char fill9[] = { 0, 0, 1, 0, 0};
static char fill10[] ={ 1, 0, 0, 0, 1,
0, 1, 0, 1, 0,
0, 0, 1, 0, 0,
0, 0, 0, 0, 0 };
static char fill11[] ={ 0, 0, 0, 0, 0, 0,
0, 1, 1, 1, 1, 0,
0, 1, 0, 0, 1, 0,
0, 1, 0, 0, 1, 0,
0, 1, 1, 1, 1, 0,
0, 0, 0, 0, 0, 0};
static char fill12[] ={ 1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 1, 0, 0,
1, 0, 0, 0 };
static char fill13[] ={ 0, 0, 1,
0, 1, 0,
1, 0, 0};
static char fill14[] ={ 1, 0, 1,
0, 1, 0,
1, 0, 1};
static char fill15[] ={ 1, 1, 0, 0,
1, 1, 0, 0,
0, 0, 1, 1,
0, 0, 1, 1};
static char fill16[] ={ 1, 1, 1, 1, 1,
1, 0, 0, 0, 1,
1, 0, 0, 0, 1,
1, 0, 0, 0, 1,
1, 1, 1, 1, 1};
static char fill17[] ={ 1, 1, 1, 0, 0, 0,
1, 1, 1, 0, 0, 0,
1, 1, 1, 0, 0, 0,
0, 0, 0, 1, 1, 1,
0, 0, 0, 1, 1, 1,
0, 0, 0, 1, 1, 1};
static struct fill_pattern template[PATS] = {
{ 1, 1, fill1}, /* solid color */
{ 3, 3, fill1}, /* grey */
{ 5, 5, fill1}, /* light grey */
{ 1, 3, fill2}, /* horizontal lines */
{ 5, 5, fill3}, /* left to right diagonal */
{ 3, 3, fill4}, /* grid */
{ 5, 5, fill5}, /* small squares */
{ 2, 2, fill6}, /* 3/4 */
{ 6, 6, fill7}, /* diagonal wave */
{ 5, 5, fill8}, /* right to left diagonal */
{ 5, 1, fill9}, /* vertical lines */
{ 5, 4, fill10}, /* horizontal wave */
{ 6, 6, fill11}, /* large squares */
{ 2, 2, fill1}, /* dark grey */
{ 4, 4, fill1}, /* medium grey */
{ 4, 5, fill12}, /* vertical wave */
{ 3, 3, fill13}, /* close diagonal */
{ 3, 3, fill14}, /* x pattern */
{ 3, 1, fill2}, /* close vertical lines */
{ 4, 4, fill15}, /* small checker board */
{ 5, 5, fill16}, /* wide grid */
{ 6, 6, fill17} /* large checker board */
};
char startcolor;
char color;
int index, tpl, size, i;
struct fill_pattern *fill_data, *fill_ptr;
char *p, *q;
if (screen_data->colors == 2 && sections < PATS) return template;
/* create a set of patterns using colors */
fill_ptr = fill_data = calloc(sections,sizeof(struct fill_pattern));
index = 0;
/* first use each available solid color */
for (color = 1; color < screen_data->colors; ++color) {
if (index < sections) {
fill_ptr->height = 1;
fill_ptr->width = 1;
fill_ptr->pattern = calloc(1,sizeof(char));
*(fill_ptr->pattern) = color;
++index;
++fill_ptr;
}
else color = (char) screen_data->colors;
}
color = startcolor = 1;
tpl = 1;
while (index < sections) {
if (color >= screen_data->colors) color = 1;
if (tpl >= PATS) {
/* repeat template starting with next color */
tpl = 1;
if (++startcolor >= screen_data->colors) startcolor = 1;
color = startcolor;
}
fill_ptr->height = template[tpl].height;
fill_ptr->width = template[tpl].width;
size = template[tpl].height * template[tpl].width;
fill_ptr->pattern = p = calloc(size,sizeof(char));
q = template[tpl].pattern;
for (i = 0; i < size; ++i)
if (*q++ != 0) *p++ = color; else *p++ = 0;
++color;
++tpl;
++fill_ptr;
++index;
}
return fill_data;
#undef PATS
}

BIN
Mix Power C v22/PC.EXE Normal file

Binary file not shown.

BIN
Mix Power C v22/PC87.MIX Normal file

Binary file not shown.

BIN
Mix Power C v22/PCAUTO.MIX Normal file

Binary file not shown.

BIN
Mix Power C v22/PCDMY.MIX Normal file

Binary file not shown.

BIN
Mix Power C v22/PCIEEE.MIX Normal file

Binary file not shown.

BIN
Mix Power C v22/PCL.EXE Normal file

Binary file not shown.

BIN
Mix Power C v22/PCLIB.MIX Normal file

Binary file not shown.

BIN
Mix Power C v22/PCLIB2.MIX Normal file

Binary file not shown.

BIN
Mix Power C v22/PCLIB2L.MIX Normal file

Binary file not shown.

BIN
Mix Power C v22/PCLIB2S.MIX Normal file

Binary file not shown.

BIN
Mix Power C v22/PCLIBL.MIX Normal file

Binary file not shown.

BIN
Mix Power C v22/PCLIBS.MIX Normal file

Binary file not shown.

76
Mix Power C v22/PCMAC.ASM Normal file
View File

@ -0,0 +1,76 @@
; .sall
modbeg macro modname
name modname
module segment
assume cs:module
endm
;
procbeg macro procname,arg1,arg2,arg3,arg4
public procname
procname proc far
push bp
mov bp,sp
lea si,[bp+6]
ifnb <arg1>
mov arg1, word ptr [bp+6]
endif
ifnb <arg2>
mov arg2, word ptr [bp+8]
endif
ifnb <arg3>
mov arg3, word ptr [bp+10]
endif
ifnb <arg4>
mov arg4, word ptr [bp+12]
endif
endm
;
getarg macro number,register
mov register,word ptr [bp+(number*2+4)]
endm
;
callc macro funcname,parm1,parm2,parm3,parm4
ifndef funcname
extrn funcname:far
endif
ifnb <parm4>
push parm4
endif
ifnb <parm3>
push parm3
endif
ifnb <parm2>
push parm2
endif
ifnb <parm1>
push parm1
endif
call far ptr funcname
ifnb <parm4>
add sp,8
else
ifnb <parm3>
add sp,6
else
ifnb <parm2>
add sp,4
else
ifnb <parm1>
add sp,2
endif
endif
endif
endif
endm
;
procend macro procname
pop bp
ret
procname endp
endm
;
modend macro
module ends
end
endm

BIN
Mix Power C v22/PCO.EXE Normal file

Binary file not shown.

View File

@ -0,0 +1,18 @@
In an effort to make it easier for you to obtain your favorite software,
the latest updates of Tay-Jee Software's programs can be found on the BBSs
listed below. These BBSs are members of the ASP Hub Network (AHN).
The Consultant BBS (New York) (718)837-3236
The Break RBBS <East> (Virginia) (703)680-9269
The Twilight Zone (Wisconsin) (715)652-2758
The DataExchange BBS (Louisiana) (318)239-2122
Attention to Details BBS (California) (909)681-6221
Space BBS (California) (415)323-4398
Knightec BBS (Ontario) (519)940-0007
These BBSs are bound by special agreement with the ASP. In the case of
dispute contact the ASP Ombudsman.
All AHN BBSs allow free access to one file per day per caller.

View File

@ -0,0 +1,25 @@
SPECIAL OFFER for users registering BACK SOON! and Power C Shell:
Register your copy of the program and receive FREE an
electronic image of your signature for inclusion in word
processing and desktop publishing documents. This is a $10
value!
This offer is valid only if this file is printed, filled out,
and submitted with your registration order. See the file
SIGNME.TXT for details!
Name:_____________________________
Where did you obtain this program (complete address/phone)?
What image format would you like your signature sent in?
(Choose one only: .IMG, .PCX, .GIF, .PIX, .WPG)
Sign your name below in black ink:

View File

@ -0,0 +1,4 @@
Power C Shell-IDE for Power C Compiler [ASP]
Provides an integrated development environ-
ment for Power C by Mix Software. Pull-
down menus, help, project management, more.

Binary file not shown.

View File

@ -0,0 +1,916 @@
_______
____|__ | (TM)
--| | |-------------------
| ____|__ | Association of
| | |_| Shareware
|__| o | Professionals
-----| | |---------------------
|___|___| MEMBER
POWER C SHELL
VERSION 2.12
Copyright 1991-1993 by Chuck Steenburgh & Tay-Jee Software
Page 1
TABLE OF CONTENTS
Definition of Shareware . . . . . . . . . . 3
Distribution Limitations. . . . . . . . . . 3
ASP Ombudsman . . . . . . . . . . . . . 3
Disclaimer . . . . . . . . . . . . . . 3
Starting Power C Shell Version 2.12 . . . . . . 6
Environment variables 6
Running Power C Shell 7
Configuring PCS 8
Installing PCS 8
Power C Shell Display. . . . . . . . . . . 9
Power C Shell Menu Options . . . . . . . . . 10
Files Menu 10
Operations Menu 11
Configuration Menu 12
Quit Menu 14
Help . . . . . . . . . . . . . . . . 15
Page 2
DEFINITION OF SHAREWARE
Shareware distribution gives users a chance to try software
before buying it. If you try a Shareware program and continue
using it, you are expected to register. Individual programs
differ on details -- some request registration while others
require it, some specify a maximum trial period. With
registration, you get anything from the simple right to continue
using the software to an updated program with printed manual.
Copyright laws apply to both Shareware and commercial software,
and the copyright holder retains all rights, with a few specific
exceptions as stated below. Shareware authors are accomplished
programmers, just like commercial authors, and the programs are
of comparable quality. (In both cases, there are good programs
and bad ones!) The main difference is in the method of
distribution. The author specifically grants the right to copy
and distribute the software, either to all and sundry or to a
specific group. For example, some authors require written
permission before a commercial disk vendor may copy their
Shareware.
Shareware is a distribution method, not a type of software. You
should find software that suits your needs and pocketbook,
whether it's commercial or Shareware. The Shareware system makes
fitting your needs easier, because you can try before you buy.
And because the overhead is low, prices are low also. Shareware
has the ultimate money-back guarantee -- if you don't use the
product, you don't pay for it.
DISTRIBUTION LIMITATIONS: This is a copyrighted shareware
program. You have a limited license to try out this soft-
ware on a single computer for a period of 30 days. If you
continue to use the software after this 30-day trial period,
you must become a registered user.
OMBUDSMAN
This program is produced by a member of the Association of
Shareware Professionals (ASP). ASP wants to make sure that
the shareware principle works for you. If you are unable to
resolve a shareware-related problem with an ASP member by
contacting the member directly, ASP may be able to help. The
ASP Ombudsman can help you resolve a dispute or problem with
an ASP member, but does not provide technical support for
members' products. Please write to the ASP Ombudsman at 545
Grover Road, Muskegon, MI 49442 or send a CompuServe message
via CompuServe Mail to ASP Ombudsman, 70007,3536.
DISCLAIMER
The program described in this documentation is guaranteed
to do absolutely nothing! It has, however, in my experience
Page 3
performed essentially as described herein. The author will
not be responsible for any loss or damages caused through
the use of these programs. No warranty, express or implied,
is provided for this software's performance, merchantability,
or fitness for a particular purpose.
All trademarks are property of their respective owners. In
particular, "Power C" is a registered trademark of MIX Software.
The program and documentation are Copyright 1991-193 by Chuck
Steenburgh & Tay-Jee Software. You are encouraged to distribute
these programs provided the conditions specified in the
VENDOR.DOC file are met.
You may evaluate this program for up to 30 days on a free
trial basis. After 30 days, you should register your use of
the program. The registration fee is $20, payable to Tay-Jee
Software at the address given below. Please see the file
REGISTER.FRM on the distribution disk/archive.
Registration does have its advantages:
- We are improving the program all the time. Registration
will get you IMMEDIATELY a disk with the latest version.
- While we can't promise to include everyone's suggestions
in program updates, you can bet we'll listen to registered
users before any of you scrounges out there.
- You will also get an evaluation copy of our text file for-
matting program (used to produce the margins in this doc-
ument), and any other electronic creations we have decided
to unleash on a foolish, unsuspecting world.
- Registered users can obtain the source code for the program
at the cost of an additional $10.
Send comments/registrations to:
Tay-Jee Software
Post Office Box 835
Lexington, VA 24450
(703)464-5290
!!!VIRGINIA RESIDENTS ADD 4.5SALES TAX!!!
CIS 72330,1776 (we haunt the IBMSYS and IBMPRO forums)
Now that the semi-legal mumbo-jumbo is out of the way, welcome
to POWER C SHELL Version 2.12. This program began as a simple
aid to Power C programmers and blossomed into a much more am-
bitious project. POWER C SHELL Version 2.12 has the following
features:
Page 4
- Simplifies editing, compiling, and debugging
of POWER C programs without having to fool with
the DOS command line
- Customizable editor and viewer (use your favorites),
or use the very handy TDE public domain editor in-
cluded in the package
- Customizable compile & link options for Power C
compiler (with help screens to explain them all)
- Interface includes support of Power C Trace inter-
active debugging utility, available separately from
Mix Software.
- Ability to review C.ERR error listing without
leaving the shell
- Test run your executable programs without
leaving the shell
- Easy, one-step loading of complete projects
- Customizable screen colors
- Context-sensitive help (although the program is so
simple, I doubt you'll need it)
Page 5
STARTING POWER C SHELL VERSION 2.12
Power C Shell itself requires approximately 135K of free
memory to run. To this amount, however, you must add the
greater of the memory required by your editor, viewer, and
whatever C program you happen to be working on. Power C Shell
remains in memory when these programs are executing. The
Power C compiler, version 2.x, requires about 256K of free
memory. Basically, a 512K machine or better is a safe bet, al-
though you might get by with only 384K available. If you wish
to use Power C Trace with Power C Shell, you will need much more
available memory: 150k for Power C Trace, 135k for Power C
Shell, and whatever memory is required the program which you are
working on.
Environment Variables
=====================
Power C Shell can configure itself through the use of
environment variables. Power C Shell understands the following
environment variables:
PCEDIT: complete path of your editor
PCEDITP: any command line parameters used by your editor
PCVIEW: complete path of your viewer
PCVIEWP: any command line parameters used by your viewer
PCOPTIONS: default compile options to be used by PC.EXE
PCLINK: default link options to be used by PCL.EXE
Environment variables are established by use of the DOS
SET command. To set the name of your viewer to C:\LIST.COM,
simply type the following at the DOS command line:
SET PCVIEW=C:\LIST.COM
Use a similar procedure to set the other variables. To
set your default compile options to "/e/ms" (link file, use
small memory model), type the following on the DOS command
line:
SET PCOPTIONS=/e/ms
If, while entering your environment variables, you get
the message "Out of environment space" or something similar,
you need to edit your CONFIG.SYS file. Look for a state-
ment similar to the following:
SHELL=c:\dos\command.com c:\dos /p
To increase the environment space, change the statement
to something like this:
Page 6
SHELL=c:\dos\command.com c:\dos /p /e:384
In the example above, 384 is the new number of bytes re-
served for the environment (160 is the default). DOS will
always round this number to a multiple of 16. 384 bytes
should be enough for most users, although you may need more.
The limit is 32,768, although there should never be a need
for more than 1 or 2K. See your DOS manual for more de-
tails on setting the environment size. Note that you must
reboot your computer after editing your CONFIG.SYS file for
any changes to take effect.
The PCEDITP and PCVIEWP parameter variables assume that
your editor and viewer accept command line switches AFTER the
filename to edit/view. For example:
<PCEDIT> (filename) <PCEDITP>
edit program.c -x -e
If your editor/viewer only accept parameters and switches
BEFORE the filename, enter them as part of the PCEDIT or
PCVIEW varaibles. For example:
<PCEDIT> (filename)
edit -x -e program.c
you would enter the following command on the DOS command
line prior to starting Power C Shell:
SET PCEDIT=edit -x -e
Environment variables will override any options contained
in the PCSHELL.CFG configuration file.
Running Power C Shell
=====================
The syntax for starting Power C Shell is as follows:
PCS2 [filename] [/D-] [/H]
[filename] optional parameter specifying complete
name of source file to work on
[/D-] optional parameter telling PCS to ignore its
configured starting directory and use the
current directory
[/H] display a brief help screen
Page 7
Configuring PCS
=========== ===
Prior to using PCS, you will have to configure it. You may
do this either through the environment variables described above
or through the Configuration pull-down menu detailed below. At
a minimum, you will need to specify the name of your editor and
any compile options you would like used with the Power C.
Installing PCS
========== ===
It is recommended, but not necessary, to copy the PCS2.EXE
program file to the same directory containing your Power C com-
piler. If you would like to be able to use PCS from any direc-
tory, make sure the PCS2.EXE file is placed in a subdirectory
contained in your DOS PATH.
If you would like to use the TDE editor with PCS, place the
TDE program files in a directory accessible to PCS. If this
directory is not also on your DOS PATH, you will have to specify
the COMPLETE path for TDE when you configure PCS.
Page 8
POWER C SHELL DISPLAY
Project Board
The main display is divided up into three areas. The largest
area, in the upper left portion of the screen, is the "project
board" which lists information regarding the current project
being worked on.
Space here is used to list all currently open source files
(up to seven), the name of the project make file, the name of
the executable file being linked to, the current working dir-
ectory, the name of any object library specified, and the name
of the project include file.
Memory Management Display
To the right of the "project board" is the memory management
display, showing current allocations of stack, heap, and far
heap memory.
Status Board
In the bottom area of the screen is the "status board." This
area is used to display current Power C Shell settings such as
the name of the editor and viewer and their switches, and any
command line switches in effect for the Power C compiler, link-
er, and trace program.
Other Display Features
The bottom line of the display is used by the passive help
system (described below) and a copyright message. The top line
of the display contains the pull-down menu bar and a real-time
24-hour clock.
Page 9
POWER C SHELL MENU OPTIONS
Files Menu
===== ====
Pressing the Alt-F key combination will activate the Files
pull-down menu, which contains the following options:
Open
Selecting this menu choice will allow you to open a file for
editing and/or compiling. Up to seven files, all belonging to
the same project, may be open at one time in PCS v2.12. After
selecting this item, you'll be asked to enter a wildcard file
specification. The default is *.C; however, you may enter any
value you like. A list of all files matching the entered wild-
card pattern will be displayed in a box centered on the screen.
Using the cursor keys, position the highlight bar over the name
of the file you would like to open and then press <Enter>.
If you open a Power C project file with a .PRJ extension, all
of the associated source files of the project will be opened.
NOTE: This project file MUST be in PCS 2.12 format for this to
work properly. If you open a project file while other files are
open, they will be closed first and then the project will be
loaded.
If more than one file is open, you will be asked to choose an
"active file." The active file is the file which is loaded by
the "Edit" menu choice described below. Enter the file number
(1-7) of the file which you would like to be active. A pair
of flashing exclamation points appears next to the name of the
active file.
New file
Selecting this menu item will allow you to type the name of a
new C source file on upon which to begin work. Do NOT enter the
name of a project (*.PRJ) file. Again, if multiple files are
open, you will be asked to select the active file.
Switch
Selecting this item will allow you to change the active file.
Edit
Selecting this menu item will invoke your editor and load the
currently active file for editing.
Page 10
Close
This option allows you to remove a file from the list of
open source files. Type the number of the file you wish to
close in the dialog box. If more than one file remains open,
you will be asked to designate a new active file.
All Close
This option will remove ALL files from the open list.
Print
This option allows you to print one or more files associated
with the current project. In the dialog box that appears, press
"A" to print all source files, "I" to print the project #include
file (*.H), or the number of a single open file. Next, you'll
be asked to specify which printer port (LPT1-3) to print to.
If there is an error, PCS will inform you of the nature of the
problem and provide you with the opportunity of correcting it or
aborting the print operation.
Directory
This option allows you to change the current working direc-
tory. Enter a drive letter, directory, or complete path, as
appropriate, into the dialog box. Any open files will be closed
upon changing directories.
Operations Menu
========== ====
Pressing the Alt-O key combination activates the Operations
pull-down menu, which contains the following options:
Compile
Selecting this item invokes the Power C compile and compiles
the currently open source file(s). Any compile options speci-
fied through the PCS configuration file or environment variables
will eb in effect for the compilation.
The compile listing will appear on the screen and you will
have the opportunity to view it prior to return to PCS. To pre-
vent the listing from scrolling off the screen, include the
#pragma pagesize preprocessor directive in your program source.
Page 11
Link
The current project or source file will be linked, using the
options specified through the configuration file or environment
variable. The executable file produced will have the same name
as the first open file, with the extension .EXE.
Header
Selecting this option will invoke your editor and load the
project #include (*.H) file. Using such a file is an easy way
to declare external variables by using the #include file in
supplementary project source code modules.
View C.ERR
This option will invoke your viewer and allow you to see the
contents of the most recent compile listing (contained in the
C.ERR file generated by PC.EXE).
Trace
Selecting this menu item will invoke Power C Trace, a program
available separately from Mix Software. The PCT.EXE program
must be located in a directory on the DOS PATH, or in the cur-
rent directory. You should also have compiled your program with
the /T switch, and subsequently linked it, prior to running the
trace program.
DOS Shell
This option allows you to return momentarily to the DOS com-
mand line without exiting PCS 2.12. A reminder will appear in
your prompt informing you to type "exit" to return to PCS.
While you are in the DOS Shell, keep in mind that your total
free memory is reduced by approximately 135k.
Configuration Menu
============= ====
Pressing the Alt-C key combination will activate the Con-
figuration pull-down menu, which includes the following op-
tions:
Editor
Page 12
Selecting this option will allow you to enter the name of
your editor. In the first dialog box, enter the complete path
and file name of your editor program. In the second dialog box,
enter any command line parameters (switches) required by your
editor, if any. The editor name and switches will then appear
on the appropriate line in the status area at the bottom of the
screen.
Viewer
This option allows you to configure your viewer program.
Follow the steps above for the editor, this time typing the
path and switches for the viewer.
Compile Options
This option will allow you to select which switches are to be
used by the Power C compiler. The PC.EXE file's help screen
will be displayed and a small dialog box will appear at the bot-
tom of the screen. Enter your choice into the box.
Link Options
This menu choice will allow you to specify link options. A
small help screen explaining the available switches will be
presented. Enter your switch(es) in the dialog box.
Memory Allocations
With this option you can control the size of the stack, heap,
and far heap of your program. Enter values for each of these
items in the dialog box just as you would enter them on the com-
mand line. For example, if you want 16k of memory for the stack
enter "16k"; if you want 800 bytes allocated for the heap, enter
"800."
Object Library
Select this option to enter the name of an object file to be
linked as a library. This can be a library of your own creation
or a third-party library. Make use of the "?" wildcard to spec-
ify different library names for the three memory models. For
example, PCS is linked with the library CJSLIBM.MIX, a library
of functions developed by Tay-Jee Software. By entering the
name "CJSLIB?.MIX" as an object library, the files CJSLIBS.MIX,
CJSLIBM.MIX, or CJSLIBL.MIX will be linked depending upon which
memory model is in effect. (See the Power C README file for a
further discussion of libraries and wildcards.)
Page 13
Trace Options
This option allows you to specify command line arguments for
Power C Trace. A brief desctiption of the available switches is
shown in the dialog box; simply type the switch(es) you wish to
have included on the command line when you use Power C Trace.
Program Colors
Selecting this option activates the program color selection
process. Nine screen elements can have their screen attributes
individually configured. Enter the number of the screen color
you wish to modify, then position the flashing star character
over the appropriate color combination, then press <Enter>.
Once you are through selecting colors, enter "0" instead of a
color number. In the dialog box which appears, type N to put
your newly selected colors into effect, O to ignore the new
colors and use the colors in currently in effect, or D to
revert to the program's default color scheme. In the unreg-
istered version, while you can change the colors selected, you
cannot save these changes in the configuration file.
Quit
====
Select this option to leave Power C Shell and return to
DOS. Three options are available: "Yes" exits PCS immediately;
"Save" updates the PCSHELL.CFG file with the current settings,
then returns to DOS; and "No" returns you to PCS.
Page 14
HELP
Context-sensitive help is available from within the PCS
menu system (only). From the main PCS screen, or from within
any pull-down menu, pressing <F1> activates the help system.
A box will appear on the middle of the screen containing the
help information for the currently selected menu operation.
Use the cursor movement keys to scroll the help text up and
down through the box. Pressing <Esc> returns you to PCS.
A passive help system also exists for all menu items. Look
at the bottom line on the screen for a brief description of the
currently highlighted menu item.
A short help line appears for most dialog boxes in PCS. Most
"basic" editing functions, such as Insert/Delete and Backspace
work normally in dialog boxes. In addition, the <Tab> key can
be used to DELETE all information in a dialog box which lies to
the right of the cursor.
This document formatted with MARGARINE 3.1, a utility program
I created using Power C 2.2.0 and Power C Shell. Look for it
in IBM Systems/Utilities Forum (IBMSYS) on CompuServe (found
in the New Uploads or General Utilities Library as MARGAR.ZIP).
Page 15

View File

@ -0,0 +1,49 @@
Installation:
Copy the PCS2.EXE program to the disk or
directory which contains your Power C program files.
See the documentation for startup instructions.
Documentation:
To print the documentation, type the command:
copy PCSHELL.DOC lpt1:
Editor:
The public domain editor TDE is included with Power C
Shell. If you don't have a preferred editor, TDE is an ex-
cellent choice and best of all, it's FREE. The following
files comprise the TDE package:
TE.DOC
TE.EXE
TEG.HLP
TEMOD.EXE
TEREAD.1ST
Differences in registered version:
There are two differences between this evaluation version
and the registered version:
1) The registered version does not contain the "nag" screen
offering you the chance to print a registration form
2) The registered version allows you to save color configuration
to the configuration file (in this version, you can switch
colors, but they are lost upon exiting the program)
Source code availability:
Complete, documented source code for Power C Shell version 2.0
is available for $10. Use the REGISTER.FRM registration form file
to order. NOTE: You MUST have the GRAFIX Library Source (an option
with the C/Math Toolchest) from Mix Software to be able to compile
the source code provided. The GRAFIX Library Source is available
separately from Mix Software.

View File

@ -0,0 +1,50 @@
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º º
º REGISTRATION FORM º
º º
º º
º NAME: º
º ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ º
º º
º ADDRESS: º
º ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ º
º º
º ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ º
º º
º CITY: STATE: ZIP º
º ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄ º
º º
º º
º IMPORTANT! Product you are registering: Power C Shell v2.12B º
º ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ º
º Qty Total º
º Disk size desired: º
º Registration fee: $ 20.00 º
º _____ $______ 5-¬" (360K) º
º ÄÄÄÄÄÄÄ º
º Source code º
º (optional): $ 10.00 _____ $______ º
º 3-«" (720K) º
º VA residents _______ º
º 4.5% Sales tax: $______ º
º º
º International º
º Shipping: $ 5.00 N/A $______ º
º º
º º
º Grand Total: $______ º
º º
º PAYMENT: Check or money order payable in U.S. dollars (US$). º
º º
º Mail to: Tay-Jee Software º
º Post Office Box 835 º
º Lexington, VA 24450 º
º º
º º
º Comments/suggestions: º
º º
º º
º º
º º
º You should receive your program disk within 2 weeks. º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ

View File

@ -0,0 +1,19 @@
Tay-Jee Software now offers a new service to all of our customers:
Electronic Signature Conversion. We will electronically scan your
signature and convert it into an image that can be pasted into
virtually any wordprocessing or desktop publishing program. Just
send us your signature, name, and mailing address and tell us what
image format you need (.IMG, .PCX, .GIF, .PIX, or .WPG) or what
program you'd like to use your image in. Add style and uniqueness
to your documents while saving yourself time and energy!
Only $10 for the first signature and $5 for each additional signature
submitted on the same order. Shipping and handling is FREE! Send
your order to:
Tay-Jee Software
P.O. Box 835
Department RPM
Lexington, Virginia 24450

View File

@ -0,0 +1,594 @@
TEXT EDITOR 2.5 USER'S GUIDE
January 20, 1991
INTRODUCTION
Text Editor (TE) 2.5 is a public domain, full screen ASCII text
editor for the IBM PC and close compatibles which uses commands
similar to those used in WordStar and Sidekick. Features include:
o Display primary commands on pop-up help screen. Prompt
for subcommands.
o Insert, delete, split, join a line.
o Copy, delete, move, read, write, shift, hide, display
a marked block of partial or whole lines.
o Print a file/block to LPT1-LPT3.
o Enter any ASCII code.
o Find/replace a phrase.
o Temporary return to DOS.
o Set left/right margins and page length.
o Word wrap.
o Format (justify) a paragraph.
o Program size of 29,904 bytes.
Primary uses for TE are to create/edit batch files, generate
forms, edit files captured by telecommunications programs, write
E-mail and simulate a "smart" typewriter.
The file to be edited must be able to fit into available CPU
memory. The ASCII file must consist of lines of characters that
end with the CR character (ASCII 13). If the line contains more
than 255 characters or doesn't end with a CR, the first 255
characters are retrieved and another line is started. EOF
characters (ASCII 26) found before the true end of the file are
ignored.
INSTALLATION
TE consists of one file TE.EXE with a size of 29,904 bytes. To
load TE from any drive/directory, place TE.EXE in a directory that
is listed in the DOS PATH statement. TE.EXE display colors,
laptop display colors, cursor size, default margins, and default
page length can be changed with utility program TEMOD.EXE.
COMMAND SUMMARY
The symbols c-, s-, a- mean press the Ctrl, Shift or Alt key
simultaneously with the next key. Letters may be entered as upper
or lower case.
- 2 -
+----------------------------------------------------------------+
| TEXT EDITOR 2.5 COMMAND SUMMARY |
+-------------------------------+--------------------------------+
| TE [Path][FileName] | c- Ctrl s- Shft a- Alt |
+-------------------------------+--------------------------------+
| File |
+----------------------------------------------------------------+
| c-KD, c-KQ, F4 Save file and quit editor |
| c-KE, F2 Save and/or load another file |
+----------------------------------------------------------------+
| Cursor Movement |
+-------------------------------+--------------------------------+
| c-S, Left Char left | c-QS, Home Line begin |
| c-D, Rt Char right | c-QD, End Line end |
| c-A, c-Left Prev word | c-QE, c-Home Screen top |
| c-F, c-Rt Next word | c-QX, c-End Screen bottom |
| c-E, Up Prev line | c-QR, c-PgUp File start |
| c-X, Dn Next line | c-QC, c-PgDn File end |
| c-W Scroll up | c-QB To block start |
| c-Z Scroll down | c-QK To block end |
| c-R, PgUp Up 23 lines | Tab Next word, prev line |
| c-C, PgDn Dn 23 lines | s-Tab Prev word, prev line |
| c-Q4 To specified line | c-Kn Set line mark n=0-3 |
| c-QP Dn page len lines | c-Qn To line mark n=0-3 |
+-------------------------------+--------------------------------+
| Insert/Delete |
+-------------------------------+--------------------------------+
| c-V, Ins Insert/Replace | c-H, BkSp Delete left char |
| Entr Split/Insert line | c-G, Del Del char/join line |
| c-N, F9 Insert line | c-T Del next word |
| c-Y, F10 Delete line | c-QY Del to end line |
+-------------------------------+--------------------------------+
| Block |
+-------------------------------+--------------------------------+
| c-KB, F7 Mark block start | c-KC Copy block |
| c-KK, F8 Mark block end | c-KY Delete block |
| c-KH Hide/display block | c-KV Move block |
| c-KI Block right 1 char | c-KR Read block from disk |
| c-KU Block left 1 char | c-KW Write block to disk |
+-------------------------------+--------------------------------+
| Miscellaneous |
+----------------------------------------------------------------+
| F1 Display summary of Text Editor commands |
| c-QF Find phrase (1-31 chars) in file or block |
| c-QA Find/replace phrase (1-31 chars) in file or block |
| c-KP, F5 Print file or block to LPT1, LPT2, or LPT3 |
| a-Xa-Ya-Z ASCII code XYZ = 32-255 on keypad |
| c-P Then a-Xa-Y on keypad for ASCII XY = 1-31 |
| c-KS, F3 Temporary return to DOS. Back to TE: EXIT |
| c-QM Set left/right margins, page length |
| c-B Format paragraph to left/right margins |
+----------------------------------------------------------------+
- 3 -
TEXT EDITOR 2.5 USER'S GUIDE
STATUS LINE
The top screen line provides status information for the file being
edited.
o F1-Help. Where to find a pop-up screen of all TE commands.
o Line and column position of the cursor.
o Insert/Ovrwrite. If Insert mode, an entered character will
be added at the cursor by moving the character at the
cursor to the right. If Ovrwrite mode, an entered character
will replace the character at the cursor. Press the Ins key
to toggle between Insert and Ovrwrite.
o The drive, directory, and name of the file currently being
edited.
o An asterisk "*" if character(s)/line(s) have been added or
deleted.
The status line and the next line are temporarily used for
additional prompts required by some commands.
STARTING TE
TE is started by entering TE on the DOS command line. After TE is
loaded, TE asks "File to edit:". If only the Enter key is
pressed, TE will terminate and return to DOS. The drive/directory
must be included if the file is not located in the current
directory. The file name can be edited with the Home, End,
Left/Right arrow, Del and Bksp keys as it is entered. If the file
can't be found, TE asks "(file name) not found. New file (Y/N)?".
Enter Y or N (upper or lower case). Pressing Enter after Y or N
is not required. If Y, data may be entered into the new file. If
N, TE asks "Enter another file name (Y/N)?". If Y, enter the file
name. If N, TE will terminate.
TE can also be started by entering TE and including the file name
with optional drive/directory on the command line. For example:
TE C:\DOC\234.DOC will load the TE program and file 234.DOC from
drive/directory C:\DOC.
FILE/QUIT COMMANDS
Two primary file load, file save/no save , quit commands are
available. Each command provides prompts for various options.
c-KD or c-KQ or F4 Save File And Quit Editor
----------------------------------------------
c-KD means press the Ctrl and K (upper or lowercase) keys
together. Then press D (upper or lowercase). If no changes have
been made to the file, TE asks "File has NOT been modified. Quit
editor (Y/N)?". If Y, TE will terminate and return to DOS. If N,
TE can continue to be used with the current file.
- 4 -
TEXT EDITOR 2.5 USER'S GUIDE
If changes have been made to the file, TE asks "Save file as:
(file name) (Y/N)?". If N, TE asks "Quit editor (Y/N)?". If Y,
TE will terminate. If N, TE can continue to be used with the
current file. To save changes made to the file, TE asks "Save
file with current file name (Y/N)?". If Y, the file will be saved
with the current name and TE will terminate. If N, the current
drive/directory and file name may be changed with the Home, End,
Left/Right arrow, Del and Bksp keys. Press Enter to have TE save
the new file name and terminate.
Trailing spaces are stripped from the end of each line before the
file is saved. If the message "Drive not ready or can't save
file. Quit (Y/N)?" appears, it could mean the file is read-only.
It is not possible to save changes to a read only file until the
read-only attribute is removed by temporarily returning to DOS (F3
or c-KS command) and removing the read-only attribute with the DOS
ATTRIB command.
If a non-ASCII file (.COM, .EXE, .WK1, etc. ) or an ASCII file
that contains more than 255 characters per line is loaded into TE,
DON'T SAVE THE FILE!. TE will corrupt the saved file since TE
loads all characters to the CR (ASCII 13) or the first 255
characters of each line and then starts another line. When the
file is saved, trailing spaces (ASCII 20) are stripped and CR, LF
(ASCII 13,10) characters are inserted.
c-KE or F2 Save File And/Or Load Another File
-----------------------------------------------
The c-KE (F2) command adds to c-KD (c-KQ, F4) the question
"Continue editing same file (Y/N)?". If Y, the current file may
continue to be edited. If N, TE asks "File to edit:". Enter a
file name with optional drive/directory. If TE can't find the
file, TE asks "(file name) not found. New file (Y/N)?". If Y,
enter the new file name. If only the Enter key is pressed, TE
will terminate and return to DOS. If N, TE asks "Enter another
file name (Y/N)?". If Y, enter the file name. If N, TE will
terminate.
CURSOR MOVEMENT
Tab and s-Tab
-------------
Tab or s-Tab moves the cursor to a position which is equivalent to
the next or previous word on the previous line. Tab and s-Tab
commands do not insert tab characters (ASCII 9) into the file. If
the file contains tab characters, they will be displayed as an "o"
with the sides open. Tabs are not converted to spaces. Use the
the c-QA Find/Replace command to convert a Tab character to 8
(typically) spaces.
- 5 -
TEXT EDITOR 2.5 USER'S GUIDE
c-QP Down Page Length
-----------------------
The cursor is moved down page length lines. The standard default
value is 62 lines. It can be changed with the c-QM Set Left/Right
Margins and Page Length command. This command is used to add
headers, footers, page numbers, etc. at specified line intervals
in the file.
c-Qn To Line Mark n=0-3
-------------------------
Position cursor on the line previously set by c-Kn where n is
marker 0, 1, 2, 3. The default line marks are 20%, 40%, 60% and
80% of the max lines in the file. If the file contains less than
5 lines, the default mark is line 1.
c-Q4 To Specified Line
------------------------
Position the cursor at the line number entered when TE asks
"To line:".
The other cursor movement commands listed in the Command Summary
section are self explanatory.
INSERT/DELETE COMMANDS
Insert/delete commands always operate on the line with the cursor.
Ins or c-V Insert/Replace
---------------------------
Toggle between character Insert and Ovrwrite (Replace) modes.
Refer to the explanation in the Status Line section.
Entr Split/Insert Line
------------------------
Split the line at the cursor position and move all characters over
and to the right of the cursor to the next line. The cursor is
positioned to the left margin of the next line.
c-N or F9 Insert Line
-----------------------
Move the line with the cursor down and insert a blank line. The
cursor is moved to the left margin of the new line. If the
current line is the last line in the file, a new blank line is
added after the last line.
c-Y or F10 Delete Line
------------------------
Delete the line containing the cursor. The cursor is moved to the
left margin of the next line.
BkSp or c-H Delete Left Character
-----------------------------------
Delete the character to the left of the cursor.
- 6 -
TEXT EDITOR 2.5 USER'S GUIDE
Del or c-G Delete Character/Join Line
---------------------------------------
Delete the character over the cursor. If the cursor is beyond the
end of the line, the next line is joined to the current line at
the cursor position unless the current line is the last line in
the file.
c-T Delete Next Word
---------------------
Delete all characters from the cursor position to the next space
character. If the cursor position is at a space, all spaces will
be deleted up to the next non-space character. If the cursor is
beyond the end of the line, the next line is joined to the current
line.
c-QY Delete Characters To End Of Line
---------------------------------------
Delete all characters from the current cursor position to the end
of the line. If the cursor is at the beginning of the line, the
line is made blank and not deleted.
Word Wrap
---------
Word wrap occurs when characters entered beyond the right margin
or column 253 cause a word (all preceding characters up to the
next blank character) to be moved to the next line. Word wrap is
generated by the c-B Format Paragraph command (See Miscellaneous
Commands section). The left/right margins are set with the c-QM
command. The standard default left/right margins are columns
1/252 (See Miscellaneous Commands section).
BLOCK COMMANDS
Block commands mark, copy, move, delete, read, write, print,
indent and unindent one or more partial/whole lines.
c-KB or F7 Mark Block Start
-----------------------------
Mark (high lite) the block start line and column at the current
cursor position. The block will be default marked to the end of
the current line.
c-KK or F8 Mark Block Stop
----------------------------
Mark (high lite) all lines from the start block line and column,
marked with c-KB or F7, to the line and column containing the
current cursor position.
c-KH Hide/Display Block
-------------------------
Toggle between hide (remove high lite) or display (restore high
lite) a marked block. If a block is hidden, the block can't be
copied, moved, deleted, written, or printed.
- 7 -
TEXT EDITOR 2.5 USER'S GUIDE
c-KC Copy Block
-----------------
Copy the marked block to the current cursor position. The copied
block is high lited. If part or all of a single line is marked, TE
asks "Insert (Y) or Overwrite (N)?". If Y, the single line block
will be added to the line by moving the characters at the cursor
position to the right. If N, existing characters to the right of
the cursor will be replaced. Multiple line blocks are always
inserted at the cursor position. If a copy into a marked block is
attempted, the operation will be canceled. If a combined line
will contain more than 253 characters, the operation will be
canceled. Use c-B Format Paragraph to justify text to left/right
margins.
c-KV Move Block
-----------------
Move the marked block to the current cursor position. The moved
block is high lighted. Otherwise the operation is the same as
Copy Block.
c-KY Delete Block
-------------------
Delete the marked block. For multiple line blocks, the start
line will be deleted if the start column is at the left margin.
c-KR Read Block From Disk
---------------------------
Read a specified file (block) from disk and insert at the line
with the cursor. Text on the line with the cursor is moved after
the inserted file. If the file is not found, the command will be
canceled. The command remembers the last entered block read or
block write file name.
c-KW Write Block To Disk
--------------------------
Write a marked block to disk. If the specified file already
exists, it will be replaced with the contents of the marked block.
If the disk (drive) is not ready, the command will be canceled.
The command remembers the last entered block read or block write
file name.
c-KI and c-KU Move Block Right/Left One Character
--------------------------------------------------
Move all lines of the marked block right (c-KI) or left (c-KU) one
character position from the block start column. Characters will
be lost if they are moved right, beyond column 253 or left, beyond
column 1. The block end column is ignored.
- 8 -
TEXT EDITOR 2.5 USER'S GUIDE
MISCELLANEOUS COMMANDS
F1 Display Summary Of TE Commands
-----------------------------------
The TE commands, remaining CPU memory and version number are
listed. Press any key to return to the file being edited. This
command can't be issued in the middle of another command.
c-KP or F5 Print File Or Block To LPT1, LPT2, or LPT3
--------------------------------------------------------
TE asks "Print File (Y) or Block (N)?". If Y, the complete file
will be printed. If N, the marked block will be printed. Next,
TE asks "Printer LPT1, LPT2, LPT3 or Cancel (123C)?". Enter 1, 2,
or 3 for printer number or C to cancel the print operation. If
the printer is not ready (out of paper, off line, etc), TE asks
"Continue (Y/N)?". Find the cause for the printer not ready, then
answer Y. Otherwise, answer N to cancel the print operation.
a-Xa-Ya-Z Enter ASCII Code 32-255 On Keypad
----------------------------------------------
ASCII codes, 32-255, that are not on the keyboard (i.e. line
drawing characters) can be entered into the file by pressing the
Alt key while simultaneously entering the 2 or 3 digit code on the
keypad. The equivalent symbol will be displayed on the screen.
c-Pa-Xa-Y Enter ASCII Code 1-31 On KeyPad
--------------------------------------------
ASCII codes, 1-31, that can't be entered directly from the
keyboard (form feed, Esc) can be entered by pressing c-P. Then
press the Alt key simultaneously with a 2 digit code on the
keypad. The equivalent symbol will be displayed on the screen.
c-QF Find Phrase
------------------
When prompted with "Find:", enter a phrase of 1 to 31 characters.
To prevent finding an embedded phrase, enter a space before and
after the phrase. For example, enter <sp>the<sp> to prevent
finding the word "other". Cancel the operation by pressing the
Enter key only. TE asks for answers to the following options.
o "File (Y) or Block (N)?". If Y, the search begins at the
current cursor column, line. If N, the search begins at the
start column, line of the marked block.
o "Case sensitive (Y/N)?". If Y, the upper/lower case pattern
of the letters in the phrase will be matched. If N, case
sensitivity will be ignored. For example, the phrase "the"
will find "The" and "the" if N.
After each find, TE asks "Repeat (Y/N)?". If Y, the search
continues until another find or the end of the file or marked block
is reached. If N, the operation will be terminated.
- 9 -
TEXT EDITOR 2.5 USER'S GUIDE
c-QA Find And Replace Phrase
------------------------------
The find/replace phrase command is similar to find phrase (c-QF)
except a replace phrase of 1 to 31 characters must be entered in
addition to "Find:" when prompted with "Replace:". Cancel the
operation by pressing the Enter key only. In addition to the
"File (Y) or Block (N)?" and "Case sensitive (Y/N)?" options, TE
asks "Confirm replace (Y/N)?". If N, the replace phrase will be
substituted for the find phrase until the end of the file or block
is reached. If Y, the next two questions are asked each time the
find phrase is found.
o TE asks "Replace (Y/N)?". If Y, the replace phrase at the
cursor will be substituted for the find phrase. If N, the
find phrase will not be replaced.
o TE asks "Repeat (Y/N)?". If Y, the search will continue.
If N, the find and replace operation will be terminated.
c-QS or F3 Temporary Return To DOS
------------------------------------
Return to DOS without removing TE from CPU memory (RAM). Run the
DOS command or program that will fit in remaining memory. Type
EXIT on the DOS command line to return to TE. Exercise caution
when using this command. Other programs could corrupt RAM
currently allocated to TE or crash the computer causing a loss of
all data changes made to the file since it was last saved.
c-QM Set Right/Left Margins and Page Length
---------------------------------------------
TE prompts for answers to Left Margin, Right Margin, Page Length.
The current values are displayed. The current values may be
accepted by pressing Enter or the cursor keys may be used to
edit/change the values. The standard defaults are: Left/right
margin - Column 1/252, Page Length - 62 lines.
c-B Format Paragraph
----------------------
A paragraph is formated with one space between each word, two
spaces after each period and each line left justified to fit the
maximum number of whole words between the current left/right
margin columns until a blank line or end of file is reached. The
command is ignored if the right margin is the default value 252.
For example, the following paragraph will be processed as shown.
Now is the time for everyone to
come to the party. The time is now.
Now is the time for everyone to come to
the party. The time is now.
The Format Paragraph command doesn't work correctly if a whole
word is longer than the number of columns between the left and
right margins.
- 10 -
TEXT EDITOR 2.5 USER'S GUIDE
c-Kn Set Line Mark n=0-3
-------------------------
Set line mark n, where n is mark 0-3, to the line that currently
contains the cursor. Use c-Qn to position the cursor to the
specified mark n = 0-3.
TE CHANGES FROM VERSION 2.2 TO 2.3
Blocks can be marked with start/stop columns as well as start/stop
lines. The Block Right/Left Character commands (c-KI/c-KU) move
all lines of the marked block one character position from the
start block column instead of column 1. The following function
key assignments have been added: F3 - Temporary return to DOS
(c-KS), F5 - Print file or block (c-KP), F9 - Delete line (c-N).
TE CHANGES FROM VERSION 2.3 TO 2.4
The Mark Block Stop command now works correctly if the stop
location is before the Mark Block Start location. The Block Write
command now remembers the last Block Write file name as well as
the last Block Read file name. The status line cursor is placed
at the beginning of the default/last entry instead of at the end.
TE CHANGES FROM VERSION 2.4 TO 2.5
Added commands Delete Next Word (c-T) and To Specified Line
(c-Q4).
----------------end-of-author's-documentation---------------
Software Library Information:
This disk copy provided as a service of
Public (software) Library
We are not the authors of this program, nor are we associated
with the author in any way other than as a distributor of the
program in accordance with the author's terms of distribution.
Please direct shareware payments and specific questions about
this program to the author of the program, whose name appears
elsewhere in this documentation. If you have trouble getting
in touch with the author, we will do whatever we can to help
you with your questions. All programs have been tested and do
run. To report problems, please use the form that is in the
file PROBLEM.DOC on many of our disks or in other written for-
mat with screen printouts, if possible. PsL cannot debug pro-
programs over the telephone, though we can answer questions.
Disks in the PsL are updated monthly, so if you did not get
this disk directly from the PsL, you should be aware that the
files in this set may no longer be the current versions. Also,
if you got this disk from another vendor and are having prob-
lems, be aware that some files may have become corrupted or
lost by that vendor. Get a current, working disk from PsL.
For a copy of the latest monthly software library newsletter
and a list of the 3,000+ disks in the library, call or write
Public (software) Library
P.O.Box 35705 - F
Houston, TX 77235-5705
Orders only:
1-800-2424-PSL
MC/Visa/AmEx/Discover
Outside of U.S. or in Texas
or for general information,
Call 1-713-524-6394
PsL also has an outstanding
catalog for the Macintosh.


Binary file not shown.

View File

@ -0,0 +1,59 @@
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º TEXT EDITOR 2.5 COMMAND SUMMARY º
ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹
º TE [Path][FileName] º c- Ctrl s- Shft a- Alt º
ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹
º File º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º c-KD, c-KQ, F4 Save file and quit editor º
º c-KE, F2 Save and/or load another file º
ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹
º Cursor Movement º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º c-S, Left Char left ³ c-QS, Home Line begin º
º c-D, Rt Char right ³ c-QD, End Line end º
º c-A, c-Left Prev word ³ c-QE, c-Home Screen top º
º c-F, c-Rt Next word ³ c-QX, c-End Screen bottom º
º c-E, Up Prev line ³ c-QR, c-PgUp File start º
º c-X, Dn Next line ³ c-QC, c-PgDn File end º
º c-W Scroll up ³ c-QB To block start º
º c-Z Scroll down ³ c-QK To block end º
º c-R, PgUp Up 23 lines ³ Tab Next word, prev line º
º c-C, PgDn Dn 23 lines ³ s-Tab Prev word, prev line º
º c-Q4 To specified line ³ c-Kn Set line mark n=0-3 º
º c-QP Dn page len lines ³ c-Qn To line mark n=0-3 º
ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹
º Insert/Delete º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º c-V, Ins Insert/Replace ³ c-H, BkSp Delete left char º
º Entr Split/Insert line ³ c-G, Del Del char/join line º
º c-N, F9 Insert line ³ c-T Del next word º
º c-Y, F10 Delete line ³ c-QY Del to end line º
ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹
º Block º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º c-KB, F7 Mark block start ³ c-KC Copy block º
º c-KK, F8 Mark block end ³ c-KY Delete block º
º c-KH Hide/display block ³ c-KV Move block º
º c-KI Block right 1 char ³ c-KR Read block from disk º
º c-KU Block left 1 char ³ c-KW Write block to disk º
ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹
º Miscellaneous º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º F1 Display summary of Text Editor commands º
º c-QF Find phrase (1-31 chars) in file or block º
º c-QA Find/replace phrase (1-31 chars) in file or block º
º c-KP, F5 Print file or block to LPT1, LPT2, or LPT3 º
º a-Xa-Ya-Z ASCII code XYZ = 32-255 on keypad º
º c-P Then a-Xa-Y on keypad for ASCII XY = 1-31 º
º c-KS, F3 Temp return to DOS. Back to TE: EXIT º
º c-QM Set left/right margins, page length º
º c-B Format paragraph to left/right margins º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ


Binary file not shown.

View File

@ -0,0 +1,26 @@
TEXT EDITOR 2.5
Text Editor (TE) 2.5 is a public domain, full screen ASCII text editor for the
IBM PC and close compatibles which uses commands similar to those used in
WordStar and Sidekick. Primary uses for TE are to create/edit batch files,
generate forms, edit files captured by telecommunications programs, write
E-mail and simulate a "smart" typewriter.
Features include: 1) Program size of 29,904 bytes. 2) Edit file size as large
as available memory. 3) Display commands on pop-up help screen, prompt for
subcommands. 4) Insert, delete, split, join a line. 5) Copy, delete, move,
read, write, shift, hide, display a marked block. 6) Print a file/block to
LPT1-LPT3. 7) Enter any ASCII code. 8) Find/replace a phrase. 9) Temporary
return to DOS. 10) Set left/right margins and page length. 11) Word wrap.
12) Format (justify) a paragraph.
This archive contains the following files:
TEREAD.1ST This file.
TE.EXE The actual Text Editor program.
TE.DOC TE 2.5 User's Guide (10 pages).
TEMOD.EXE Utility to change TE.EXE colors, cursor size, margins, etc.
TEG.HLP TE 2.5 Command Summary (1 page).
Written by John Haluska, 310 W. Imperial Ave. #6, El Segundo, CA 90245.
CompuServe 74000,1106


View File

@ -0,0 +1,48 @@
Shareware Vendors may distribute the accompanying software package
under the following conditions:
1) The entire set, including documentation and demo files, must be
distributed TOGETHER. The following files MUST be a part of the
distribution package:
ASP-HUB.DOC
FILE_ID.DIZ
PCS2.EXE
PCSHELL.DOC
PCSREAD.ME
SIGNME.TXT
TE.DOC
TE.EXE
TEG.HLP
TEMOD.EXE
TEREAD.1ST
VENDOR.DOC
WHATS.NEW
COUPON.TXT
REGISTER.FRM
2) The program must be clearly identified as SHAREWARE. ANY VENDOR
who uses the term "Public Domain" as an integral part of its company
name or advertising MUST obtain prior written approval from Tay-Jee
Software before distributing this program in any way, shape, or form.
3) A fee of no more than $7 (not including shipping and handling) may
be charged for the disk on which the program(s) is(are) distributed.
4) Ordinarily, any vendor which is approved by the Association of
Shareware Professionals (ASP) will automatically meet these requirements
and is authorized to distribute the software.
For a catalog description, see the enclosed FILE_ID.DIZ text file.
Author contact info:
Tay-Jee Software
P. O. Box 835
Lexington, VA 24450

View File

@ -0,0 +1,40 @@
Version 2.12 -- 28 March 1992
1st "bundled" release with Power C compiler
Version 2.11 -- 22 December 1992
Adds support for Power C Trace through the Operations Menu
Version 2.02 -- 10 October 1992
Adds a real-time clock display to the menu bar
Version 2.01 -- 28 August 1992
Corrects a minor bug in the DOS Shell feature
Version 2.0 -- 10 August 1992
The program has been completely rewritten, with a new, user-friendly
interface featuring pull-down menus and dialog boxes.
Up to seven individual source files can now be open and worked on
at one time. Support is provided for automatically combining several
source files into a single project using Power C's integrated make
facility.
Users can change directories from within the program.
A "shell to DOS" feature has been added.
Support is provided for designating an external object library.
Supports project include file for multi-file projects.

View File

@ -0,0 +1,77 @@
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <string.h>
#include <graphics.h>
#include <malloc.h>
#define MODE CGA_320 /* set screen mode */
#define CHARSIZE 8 /* size of plotted characters */
main(int argc, char *argv[]) {
int oldmode;
int mode;
int sections;
int index;
struct vconfig screen_data;
struct fill_pattern *fill_data;
double *data;
char title[80];
int xtitle, ytitle;
extern int screen(int oldmode, int dfltmode);
extern struct fill_pattern *patterns(struct vconfig *screen_data,
int sections);
puts("This program displays a pie chart on the screen. You must");
puts("have graphics capability (CGA, EGA, MCGA or VGA) to run it.\n");
puts("Press <esc> to terminate, any other key to continue.\n");
if (getch() == '\x1b') return 0;
printf("Title: ");
gets(title);
printf("%s","Enter the number of sections in the pie: ");
scanf("%d",&sections);
data = calloc(sections,sizeof(double));
printf("\nEnter %d values: ",sections);
for (index = 0; index < sections; ++index)
scanf("%*c%lf",&data[index]);
oldmode = getvmode(); /* current screen mode */
if (argc > 1) mode = atoi(argv[1]); else mode = MODE;
if ((mode = screen(oldmode,mode)) == -1) {
puts("** Unable to set the screen to graphics mode **");
setvmode(oldmode);
return 1;
}
getvconfig(&screen_data); /* fetch the screen parameters */
fill_data = patterns(&screen_data,sections);
/* create the pie chart in the center of the screen */
clrscrn2(0);
pen_color(screen_data.colors-1);
move_to(screen_data.xpixels>>1, screen_data.ypixels>>1);
pie(screen_data.xpixels/4, data, sections, fill_data);
/* display the title in the center of the screen */
move_to((screen_data.xpixels - CHARSIZE*strlen(title))/2,0);
plots(title);
/* display the values */
for (index = 0; (index < 10) && (index < sections); ++index) {
/* calculate screen coordinates */
if (index >= 5) xtitle = screen_data.xpixels*4/5; else xtitle = 0;
ytitle = screen_data.ypixels-(CHARSIZE+2)*(5-index%5)-2;
move_to(xtitle,ytitle);
fill_style(fill_data->pattern,fill_data->width,fill_data->height);
++fill_data;
flood(CHARSIZE*2,CHARSIZE);
sprintf(title,"%g",data[index]);
move_to(xtitle+3*CHARSIZE,ytitle);
plots(title);
}
getch(); /* wait for a key */
setvmode(oldmode);
} /* end of main */

View File

@ -0,0 +1,3 @@
piechart
screen
patterns

488
Mix Power C v22/POWERC.DOC Normal file
View File

@ -0,0 +1,488 @@
**********************************************************
* Corrections to the Power C manual and New Features *
**********************************************************
Some instructions in the Getting Started section of the Power C manual
are now incorrect.
In the Arranging Files on a Hard Disk sub-section, you should ignore the
MD and COPY commands since the INSTALL program takes care of making the
directories and copying the files. However, you should execute the
MD MYFILES command on page 6 to create a directory for storing your own
programs, since the INSTALL program does not create the MYFILES directory.
In the Arranging Files on Floppies sub-section, if you have 5 1/4"
drives, you should substitute disk 3 of 4 where it mentions copying
the sample programs from disk 2 of 2 on page 7. The disk 2 of 2 is
correct if you are using 3 1/2" diskettes.
In the remaining sub-sections of the Getting Started section, if you
have 5 1/4" diskettes, disk 1 of 2 is now disk 1 of 4 and disk 2 of 2
is now disk 2 of 4. If you have 3 1/2" diskettes, you should substitute
disk 1 of 2 everywhere disk 2 of 2 appears since the INSTALL program
copies both the compiler and the linker onto the same diskette.
NEW FEATURES IN VERSION 2.0
Memory models:
Memory models are a reflection of the addressing modes of the
8086 family of processors. The 8086 family uses 64k segments.
Special techniques are required to exceed the 64k limits on code
and data. A simple (16 bit) address is confined to one 64k
segment. These are called "near" addresses. It is also
possible to use an address that occupies 32 bits. These "far"
addresses are normally stored as a segment number and a
corresponding offset.
In small memory model, the code resides in a single 64k or
smaller segment. Calls to functions use "near" addresses.
The data in small model is also located in a single 64k or
smaller segment. Data references also use "near" pointers.
The advantage of small memory model is that the code is
smaller than the other models since function calls use 3
bytes instead of 5 bytes.
In medium memory model, the code can occupy more than 64k of
memory. All function calls use "far" addresses. In Power C,
each function starts a new segment. This allows any function to
be up to 65520 bytes in length. The data in medium model is
located in a single 64k or smaller segment. Data references use
"near" pointers. Medium model is usually the best choice for
most programs. Code size is not limited and any large blocks of
data can be declared as far if 64k of data is not enough.
Large memory model uses unlimited code space like medium memory
model. Data in large memory model can occupy more than 64k of
memory. References to data in large model are with "far"
pointers. Large model is the least efficient of the memory
models. Each reference to a pointer takes more time and
generates more code. Large model is a good choice for programs
originally developed for larger computers that do not use
segmentation.
Large memory model
Large memory model is selected with the /ml compiler switch.
In large memory model, all pointers are far by default. You
can still use near pointers by including the "near" keyword.
Near pointers can only point to objects that are "near" or
auto.
Global variables may be near or far depending on their size.
Small variables (less than 256 bytes) are stored in near
memory by default. This allows them to be accessed more
quickly. Larger variables are stored in far memory. You
can always override the storage class with the "near" or
"far" keyword. Also, you can change the default size for
far variables with the /z compiler switch.
Addressing is done using near addresses whenever the variable
is auto or is in near memory. If a pointer or address is
passed to a function, it is automatically converted to a far
pointer.
Small memory model
Small memory model is selected with the /ms compiler switch.
In small memory model you are limited to 64k of code. Small
model is a good choice for programs that do not need more than
64k. The program will be smaller and slightly faster in small
model.
Far and huge data
Far and huge data is supported by Power C in all memory models.
You can declare a variable to be far or huge by including the
far or huge keyword in the declaration. To specify the storage
for a variable, the keyword should be immediately before the
variable name. Examples:
char far a[200]; /* far array of 200 characters */
char * far b[200]; /* far array of 200 pointers to char */
char far * far c[200]; /* far array of 200 far pointers */
char far *d[10]; /* near array of 10 far pointers */
int huge e[40000]; /* huge array of 40000 integers */
Huge arrays and structures can be as large as available memory will
allow. Huge variables can be larger than 64k bytes. Since
addressing a huge array or structure requires calculating both
a segment value and an offset, access to huge objects is slower
than access to far objects. You should use huge variables and
huge pointers only when you need the ablity to have an object
larger than 64k.
New pragma:
#pragma library "libname"
Allows you to specify a library to be searched when the
program is linked. The library name can contain '?' or
'*' to specify memory models. Any '?' character will be
replaced with the letter: 'S', 'M' or 'L' depending on
the memory model. A '*' character will be replaced by
'L' for large model 'S' for small model, and deleted for
medium model. This option is especially useful in headers.
For example, the header for a database library can include
the library name for linking.
#pragma library "\\c\\db\\isam*.lib"
#pragma library "\\c\\db\\cbt*.lib"
New warnings:
226 Array is too small to store terminating '\0' character
An array was declared with a specific size and then
initialized with a string literal. The size of the array
is equal to the size of the string without the '\0' terminator.
This array should not be used with string functions such as
strlen(). Example:
char a[3] = "abc";
227 Syntax error in #pragma
A pragma was specified but did not have the correct arguments.
For example, #pragma library requires the name of a library
as a string.
228 Function exit without a return value
The function returns a value (is not void) but does not
contain a return statement at the end.
229 Type conversion may cause overflow
An assignment or passing an argument to a function causes
a conversion of a larger type to a smaller one (such as
int to char). This conversion may lose information since
the smaller type cannot represent all possible values of
the larger. If you know that the conversion will not
overflow, you should use a type cast to perform it.
230 Item has the same name as a macro
231 Macro name already used for a variable or type
This warning indicates that a macro has the same name as a
variable or function. Although this is legal, it can be a
source of confusion.
232 Assignment of double to float may cause overflow
An expression of type double is assigned to a variable of
type float. This may result in an overflow or loss of
precision. This warning is only enabled if warning 229 is
also enabled. The /w switch (with no arguments) does not
turn on this warning. To enable it, you should use /w+232.
New compiler switches:
/ms, /ml specify small or large memory model
/z gives the threshold size for far variables in large
memory model. Global variables less than or equal to
this size are placed in near memory, and larger variables
are placed in far memory. The /z may be followed by a
size as a decimal number. A size of zero, makes all global
variables far unless they have a near keyword. /z is
equivalent to /z0. The default threshold size is 256 bytes.
/a Adjust variable addresses to word or double word boundaries.
/a or /aw places all 2 byte or larger variables at an even
address. /ad places all 4 byte or larger variables at an
address that is a multiple of 4, and all 2 byte variables
at an even address. This option will improve speed on
computers with a 16 bit or wider memory bus (such as the
IBM AT or other 80286 base machines).
Predefined macros
__POWERC - value is the version of power C. Versions less than 1.2
have the value "1". Version 1.2 is "120", 1.3.0 is "130"
and version 2.0.0 is "200".
M_I86SM - defined if small memory model
M_I86MM - defined if medium memory model
M_I86LM - defined if large memory model
__LINE__ - current compiler line number
__FILE__ - name of source file
__DATE__ - compile date
__TIME__ - compile time
__STDC__ - standard C, "1" if extended keywords are disabled,
"0" if extended keywords are enabled.
New library functions
void getimage(int left, int top, int right, int bottom,
void far *buffer);
Stores a bit image of a section of the graphics screen in a
buffer. The image can then be placed anywhere on the screen
using putimage(). The coordinates of the upper left (left,top)
and lower right (right,bottom) corners determine the area saved.
The size of buffer needed can be determined by calling imagesize().
void putimage(int left, int top, void far *buffer, int operation);
Copies a bit image to the screen. The image must have been
previously saved with getimage(). The image is placed on the
screen with its upper left corner at the coordinate given by
(left,top). The size of the image was stored as the first two
words of the buffer by getimage(). When the image is placed
on the screen, each pixel of the image can be combined with the
previous screen contents as specified by the operation. The
operations are:
COPY_PUT 0 copy the image over the previous contents
XOR_PUT 1 exclusive or with the previous contents
OR_PUT 2 inclusive or with the previous contents
AND_PUT 3 logical and with the previous contents
NOT_PUT 4 copy the inverse of each image pixel
long imagesize(int left, int top, int right, int bottom);
Returns the size of the buffer needed to store an image.
Setting the background color for plots and plotch:
The background of characters is controlled by the variable _v_bkgd.
It can be declared as:
extern int near _v_bkgd;
Setting _v_bkgd to a color sets the background color for characters.
Setting _v_bkgd to TRANSPARENT causes the background to be unchanged
and the previous contents of the screen to show in areas behind the
character.
Graphics using the bios:
For extended video modes and machines where the graphics do not match
the IBM PC memory mapping, you can force all graphics routines to use
the BIOS. To do this, set the variable _vusemem to 0. Example:
extern int near _vusemem;
_vusemem = 0;
Mix.exe
The conversion utility now has a switch to eliminate extra underscore
("_") characters from the beginning of external names. Some compilers
generate an extra leading underscore character on all external names.
If you are converting an assembly function originally written for
one of these compilers, you can use the "/_" switch to eliminate the
extra underscore.
New Features in version 1.3
Power C now supports pre-compiled headers. Much of the time in
compiling a C program is spent compiling the standard headers that the
program includes to declare standard functions. Power C will allow the
headers to be pre-compiled into a header library. The pre-compiled
headers are much faster than compiling the source for the headers.
By default, the compiler will search for a header library named
headers.hhh. A library by this name containing the standard headers
is supplied on your release disk. The header library can be found
in the default directory or any directory that would normally be
searched for headers. You can also specify a header library on the
command line by including the switch "/h" or "-h" followed by the
name of the library. An option of "/h" or "/h-" will disable the
header library feature.
Header libraries and pre-compiled header files are created and
maintained by the program "fasthdr.exe" supplied on your release
disk. This program can add, delete or replace headers in a library.
It can also create individual pre-compiled header files. The
default is to create a header library named "headers.hhh" in the
current default directory. The command line can contain a list of
headers (including wild cards). For example:
fasthdr a:*.h a:sys\*.h
If the disk in drive A contains the Power C release disk 1, the above
command will create a header library file named headers.hhh in the current
directory. The headers.hhh file will contain all of the standard
header files. If the header.hhh file already exists, the above command
would simply add the specified headers to the library and replace any
previously stored headers having the same name.
The /d switch is used to delete headers from the library. You can
give a list of headers to delete. Wild cards are not supported. For
example, the following command will delete time.h and math.h from the
library.
fasthdr /d time.h math.h
The /o switch allows you to specify a file or directory in which
the compiled headers will be stored. If the /o is followed by a file
name (with or without a directory prefix), then the headers are compiled
and stored in the specified library file. If the /o is followed by a
directory name only, then rather than create a single library file,
the fasthdr program creates a separate compiled header file for each
header file specified on the command-line and stores them in the specified
directory. In this case, the compiled header files will have the same
name as the original header files, so the directory specified for the
compiled header files should not be the same as the directory containing
the original header files.
The /f switch specifies that you want each header converted to
a separate file. The pre-compiled header will have the same name
as the original header and the original header will be renamed with
the extension ".hxt". Use /f switch rather than the /o switch if
you want the compiled header files to be stored in the same directory
with the original header files.
The /l switch gives a listing of the headers in a library.
--------
Power C (versions 1.2 and later) generate names up to 31 characters in
length for use by Power Ctrace version 1.2. Use of names longer than 8
characters requires version 1.2 or later of Power Ctrace. If you have an
earlier version of Power Ctrace, you must use the new /t8 compile option
rather than the /t option for debugging.
--------
Compiler error messages are now displayed differently than
described in the Power C manual. The example compile error described
on page 625 will now be displayed as follows. Notice that the
file name test.C precedes the line number rather than being displayed
on a separate line.
test.C(1):main() {printf("hello world\n")}
********* ^ 14
14: ';' expected
--------
Some warning messages have been added to the compiler. The warnings
are displayed to indicate that something is dangerous and possibly
incorrect but not strictly illegal. When warnings are issued, the
compiler generates the correct code for the source as written.
In many cases warnings can be disabled or ignored.
Warnings are disabled by default. Warning messages are enabled
with the "/w" or "-w" switch on the command line. Use /w to enable
all of the warnings or /w- to disable them. Individual
warnings can be turned on (or off) with /w+n (or /w-n) where n is
the warning number. For example "/w+221" causes the compiler to check
the types of pointers. In this case, a message will be diplayed if a
pointer to int is assigned to a pointer to char (unless a cast is present).
Warnings can also be controlled within the source file with
#pragma warning. Examples:
#pragma warning /* enable all warnings */
#pragma warning -224 /* don't report unused variables */
#pragma warning 221 /* check pointer types */
The warnings are:
220 - unknown pragma
221 - assignment or argument passing with pointers of different types
222 - assignment or argument passing with a pointer when a scalar
(int, unsigned ... etc) is expected, or use of a scaler when
a pointer is expected. (use a cast to override)
223 - A variable was defined but not used in the function
224 - Call to an undeclared function. The compiler assumes that
the function is of type int.
225 - #undef was used to undefine a symbol that is not a macro
--------
An additional preprocessor directive has been added:
#error message
causes the compiler to issue an error message
and stop the compilation
--------
Corrections to the manual:
Page 344: farmalloc does NOT initialize the allocated memory
to 0. Use farcalloc if you want the memory initialized.
Page 367: _fmalloc does NOT initialize the allocated memory to 0.
Note that _fmalloc allocates first from the far heap. If
the far heap is used up, _fmalloc will allocate from the
near heap. Because of this you must use _ffree to release
memory allocated with _fmalloc. Do NOT use farfree for
this purpose as it requires that the memory be from the
far heap.
--------
Additions to the manual:
=======================
The MERGE Program
_________________
The MERGE program is used to create a single library file from
several object files. It can also be used to add new functions to
an existing library or replace existing functions with new
versions.
Usage: merge libraryfile updatefile1 updatefile2 ...
or merge libraryfile @controlfile
MERGE accepts the name of a library followed by the names of one
or more update files. The names must be separated by commas or
blanks. The default extension for all file names is MIX. If the
library file (ie. first file name) does not exist, it will be
created. All of the functions in the list of update files are
added to the library. If any function already exists in the
library, it is replaced by the new copy.
If the list of update files is too long to specify on the
command-line, you may specify the name of a control file.
The name of the control file must be prefixed by the @ symbol.
The control file may contain one or more lines of update file
names separated by blanks or commas.
When an existing library file is updated with new functions,
the new functions will appear at the beginning of the
library file. This can cause the library file to be searched
more than once if other functions appearing later in the
library reference one or more of the new functions that appear
at the beginning of the library. To control the order of
functions in the standard libraries so that they can always
be searched in one pass, the batch files delete the old copy
of the library before creating a new one.
Note: When the MERGE program is executed, there must be
enough free disk space to temporarily store two
copies of the library file.
By default, the MERGE program creates a library in a compressed
format that is smaller than a standard object file as created
by the compiler. These compressed libraries can be searched
much faster than an object file. If you wish to create a library
that is compatable with versions of Power C earlier than 1.2,
you should use the -1 switch when you execute merge.
--------
The linker (PCL.EXE) recognizes an additional environment variable.
The variable LIBNAMES specifies a list of libraries that you want
searched in addition to the standard libraries. Multiple library
names must be separated by a semicolons. Libraries specified by
the LIBNAMES environment variable are searched after the libraries
specified on the command line and before the standard libraries. For
example, if you are linking a set of programs that need functions from
a windows library:
set libnames=windows
pcl program
is equivalent to:
pcl program;windows
The libraries specified by LIBNAMES may contain drive and/or
directory prefixes. A prefix is not required if the library
is in one of the directories specified by either the LIBRARY
or PATH environment variable.
The linker has an additional command line option. The /c option
causes the linker to ignore case in all function and variable
names. Use of this switch is discouraged, but it can be useful
when linking with functions written in assembly language. The
default in MASM is to convert all external names to upper case.
A better solution is to assemble with the /Ml MASM switch.
--- end of file ---

32
Mix Power C v22/PROCESS.H Normal file
View File

@ -0,0 +1,32 @@
/*$no list*//*$no trace <<< process.h >>> */
/* Copyright (c) Mix Software 1988 */
extern int _p_overlay;
#define P_WAIT 0
#define P_NOWAIT 1
#define P_OVERLAY _p_overlay
void abort(void);
int execl(char *filename, char *arg0, ...);
int execle(char *filename, char *arg0, ...);
int execlp(char *filename, char *arg0, ...);
int execlpe(char *filename, char *arg0, ...);
int execv(char *filename, char *argv[]);
int execve(char *filename, char *argv[], char *envp[]);
int execvp(char *filename, char *argv[]);
int execvpe(char *filename, char *argv[], char *envp[]);
void exit(int status);
void _exit(int status);
int getpid(void);
int spawnl(int mode, char *filename, char *arg0, ...);
int spawnle(int mode, char *filename, char *arg0, ...);
int spawnlp(int mode, char *filename, char *arg0, ...);
int spawnlpe(int mode, char *filename, char *arg0, ...);
int spawnv(int mode, char *filename, char *argv[]);
int spawnve(int mode, char *filename, char *argv[], char *envp[]);
int spawnvp(int mode, char *filename, char *argv[]);
int spawnvpe(int mode, char *filename, char *argv[], char *envp[]);
int system(char *cmdstring);
/*$list*//*$trace <<< process.h >>> */

105
Mix Power C v22/READ.ME Normal file
View File

@ -0,0 +1,105 @@
Power C - Version 2.2
-- Bonus --
The Power C disk(s) contain a copy of the Power C Shell from Tay-Jee
software. This is a shareware program that provides an integerated
environment for Power C programming. When you install Power C, a
sub-directory named pcshell will be created. This contains the
Power C shell, its documentation, and a small text editor. You can
learn more about the shell by reading the .doc files that are installed
with it. If you find the Power C Shell useful, please register it.
-----------
Power C is now supplied on one 3 1/2" or two 5 1/4" diskette(s).
Due to an increase in size, the Power C files are now stored in a
packed (ie. compressed) format. Rather than copy the files (as
described in the Getting Started section of the Power C manual), you
should now install the Power C files by simply executing the
INSTALL.EXE program on this diskette. Corrections to the Power C
manual and descriptions of new features are contained in the file:
Powerc.doc. This file will be unpacked when you install Power C.
Be sure to read powerc.doc to find out about the new features.
The INSTALL program unpacks the files to a directory on your hard
disk or to floppies. It does not alter the environment, CONFIG.SYS or
AUTOEXEC.BAT. If you are installing to 5 1/4" diskettes, you will need
4 formatted blank diskettes. If you are installing to 3 1/2" diskettes,
you will need 2 formatted blank diskettes. If you are installing to a
hard disk, you will need approximately 1 Meg (1000k) of disk space.
To run the INSTALL program, insert this diskette into one of your
floppy drives and type x:INSTALL, where x is the letter of the drive
containing this floppy diskette. If you have 5 1/4" release diskettes,
the INSTALL program will tell you when to insert release disk 2 of 2.
For example, type the following if this diskette is in drive A.
A:INSTALL
The INSTALL program will ask you a series of questions. At the end of
each question, the default answer is displayed inside square brackets (ie.
[default answer]). If the default answer is suitable, you may select it
by simply pressing the enter key. By default, it is assumed that you have
placed the master disk in drive [A], that you wish to install the files on
a hard disk [h], and that the directory to contain the files is [c:\powerc]
(note: the INSTALL program will create the directory if it does not already
exist).
If you install to 5 1/4" floppies rather than a hard drive, then the
following files will be copied to your four blank formatted diskettes.
Disk 1 of 4 Disk 2 of 4 Disk 3 of 4 Disk 4 of 4
Compiler Linker Examples Libraries
_______________________________________________________________________
HEADERS HHH PCL EXE READ ME PCLIBS MIX
PC EXE PCLIB MIX * H PCLIB2S MIX
PCO EXE PCLIB2 MIX SYS\* H PCLIBL MIX
PCAUTO MIX BARCHART C PCLIB2L MIX
PC87 MIX PIECHART C
PCIEEE MIX SCREEN C
PCDMY MIX PATTERNS C
FASTHDR EXE PIECHART PRJ
MERGE EXE
MIX EXE
PCMAC ASM
Disk 1 of 4 contains everything you need for compiling. Disk 2 of 4
contains everything you need for linking. Disk 3 of 4 contains the
individual .H header files and sample programs. Disk 4 of 4 contains
the small and large memory model libraries.
If you install to 3 1/2" floppies rather than a hard drive, then the
files listed above under Compiler and Linker are copied to the first
blank formatted diskette (Disk 1 of 2), and the files listed under
Examples and Libraries are copied to the second blank formatted
diskette (Disk 2 of 2).
The MIXC.MIX file that is listed in the Power C manual is no longer
distributed. The following new files are not listed in the Power C
manual:
HEADERS.HHH: This file contains all of the Power C header (.H) files
in a pre-tokenized format for faster compiling. This
file may be used in place of all the .H files. In other
words, the .H files are not needed if the HEADERS.HHH
file is present.
FASTHDR.EXE: This program is used to create pre-tokenized header
files such as the HEADERS.HHH file described above.
MERGE.EXE: This program is used for library management. It merges
multiple object files, creating a single object file
library.
PCLIBS.MIX: This is the small memory model version of PCLIB.MIX.
PCLIB2S.MIX: This is the small memory model version of PCLIB2.MIX.
PCLIBL.MIX : This is the large memory model version of PCLIB.MIX.
PCLIBL2.MIX: This is the large memory model version of PCLIB2.MIX.
**********************************************************************
* When install completes, please type the PowerC.doc file to see a *
**********************************************************************
* description of new features. *
**********************************************************************

32
Mix Power C v22/SCREEN.C Normal file
View File

@ -0,0 +1,32 @@
#include <graphics.h>
/* Set the screen to graphics mode. */
/* If the screen is set to monochrome, test whether it is a hercules */
/* graphics card. If 32k of screen memory exists, assume */
/* that the monochrome board is herules compatable. */
int screen(int oldmode, int dfltmode)
{
int mode = -1;
char far *memory, far *FP_SET();
char mem;
if (oldmode == MONOCHROME) {
/* check for hercules graphics card */
memory = FP_SET(0xb000,0x7ffe); /* check for extra screen memory */
mem = *memory; /* save current contents */
*memory = 0x55; /* store and check each bit as both 1 and 0 */
if (*memory == 0x55) {
*memory = 0xAA;
if (*memory == 0xAA) {
mode = HERCMODE;
setvmode(HERCMODE);
}
}
*memory = mem; /* restore original value */
}
else {
if ((mode = setvmode(dfltmode)) != dfltmode) mode = -1;
}
return mode;
}

17
Mix Power C v22/SEARCH.H Normal file
View File

@ -0,0 +1,17 @@
/*$no list*//*$no trace <<< search.h >>> */
/* Copyright (c) Mix Software 1988 */
#if !Defined(size_t)
typedef unsigned size_t;
#endif
void *bsearch(void *key, void *base, size_t number, size_t size,
int (*compare)(void *, void *));
char *lfind(void *key, void *base, unsigned *number, unsigned size,
int (*compare)(void *, void *));
char *lsearch(void *key, void *base, unsigned *number, unsigned size,
int (*compare)(void *, void *));
void qsort(void *base, size_t number, size_t size,
int (*compare)(void *, void *));
/*$list*//*$trace <<< search.h >>> */

11
Mix Power C v22/SETJMP.H Normal file
View File

@ -0,0 +1,11 @@
/*$no list*//*$no trace <<< setjmp.h >>> */
/* Copyright (c) Mix Software 1988 */
#if !Defined(jmp_buf)
typedef int jmp_buf[32];
#endif
void longjmp(jmp_buf env, int value);
int setjmp(jmp_buf env);
/*$list*//*$trace <<< setjmp.h >>> */

10
Mix Power C v22/SHARE.H Normal file
View File

@ -0,0 +1,10 @@
/*$no list*//*$no trace <<< share.h >>> */
/* Copyright (c) Mix Software 1988 */
#define SH_COMPAT 0x00
#define SH_DENYRW 0x10
#define SH_DENYWR 0x20
#define SH_DENYRD 0x30
#define SH_DENYNO 0x40
/*$list*//*$trace <<< share.h >>> */

35
Mix Power C v22/SIEVE.C Normal file
View File

@ -0,0 +1,35 @@
/* sieve.c */
/* Eratosthenes Sieve Prime Number Program in C from Byte Jan 1983
to compare the speed. */
#include <stdio.h>
#define TRUE 1
#define FALSE 0
#define SIZE 8190
typedef int bool;
char flags[SIZE+1];
int main()
{
int i,k;
int prime,count,iter;
for (iter = 1; iter <= 10; iter++) { /* do program 10 times */
count = 0; /* initialize prime counter */
for (i = 0; i <= SIZE; i++) /* set all flags TRUE */
flags[i] = TRUE;
for (i = 0; i <= SIZE; i++) {
if (flags[i]) { /* found a prime */
prime = i + i + 3; /* twice index + 3 */
for (k = i + prime; k <= SIZE; k += prime)
flags[k] = FALSE; /* kill all multiples */
count++; /* primes found */
}
}
}
printf("%d primes.\n",count); /*primes found in 10th pass */
return 0;
}

20
Mix Power C v22/SIGNAL.H Normal file
View File

@ -0,0 +1,20 @@
/*$no list*//*$no trace <<< signal.h >>> */
/* Copyright (c) Mix Software 1988 */
#if !Defined(sig_atomic_t)
typedef int sig_atomic_t;
#endif
#define SIG_DFL (void (*)(int))0
#define SIG_IGN (void (*)(int))1
#define SIG_ERR (void (*)(int))-1
#define SIGABRT 1
#define SIGINT 2
#define SIGILL 3
#define SIGSEGV 6
#define SIGTERM 7
#define SIGFPE 8
void (*signal(int sig, void (*sighandler)(int)))(int);
int raise(int sig);
/*$list*//*$trace <<< signal.h >>> */

12
Mix Power C v22/STDARG.H Normal file
View File

@ -0,0 +1,12 @@
/*$no list*//*$no trace <<< stdarg.h >>> */
/* Copyright (c) Mix Software 1988 */
#if !Defined(va_list)
typedef char *va_list;
#endif
#define va_start(argp, last) (void)(argp = (va_list) &last + sizeof(last))
#define va_arg(argptr, type) (*(((type*)argptr)++))
#define va_end(argptr) (void)(argptr = 0)
/*$list*//*$trace <<< stdarg.h >>> */

23
Mix Power C v22/STDDEF.H Normal file
View File

@ -0,0 +1,23 @@
/*$no list*//*$no trace <<< stddef.h >>> */
/* Copyright (c) Mix Software 1988 */
#if !defined(NULL)
#define NULL ((void *)0)
#endif
#if !defined(FARNULL)
#define FARNULL ((void far *)0)
#endif
#if !Defined(size_t)
typedef unsigned size_t;
#endif
#define offsetof(stype, member) (size_t)&(((stype *)0)->member)
#if !Defined(ptrdiff_t)
#if defined(M_I86LM)
typedef long ptrdiff_t;
#else
typedef int ptrdiff_t;
#endif
#endif
extern int errno;
/*$list*//*$trace <<< stddef.h >>> */

114
Mix Power C v22/STDIO.H Normal file
View File

@ -0,0 +1,114 @@
/*$no list*//*$no trace <<< stdio.h >>> */
/* Copyright (c) Mix Software 1988 */
#if !Defined(size_t)
typedef unsigned size_t;
#endif
#define _IOFBF 0
#define _IOLBF 0x40
#define _IONBF 0x04
#define BUFSIZ 512
#define EOF -1
#define L_tmpnam 13
#if !defined(NULL)
#define NULL ((void *)0)
#endif
#if !defined(FARNULL)
#define FARNULL ((void far *)0)
#endif
#define OPEN_MAX 64
#define FOPEN_MAX 64
#define FILENAME_MAX 63
#define SEEK_CUR 1
#define SEEK_END 2
#define SEEK_SET 0
#define stderr _iob[2]
#define stdin _iob[0]
#define stdout _iob[1]
#define TMP_MAX 32767
#if !Defined(fpos_t)
typedef long fpos_t;
#endif
#if !Defined(FILE)
typedef struct {
char file[32];
int fd;
} FILE;
extern FILE *_iob[OPEN_MAX];
#endif
#if !Defined(va_list)
typedef char *va_list;
#endif
#define getchar() getc(stdin)
#define fgetchar() getc(stdin)
#define putchar(c) putc(c,stdout)
void clearerr(FILE *fp);
int fclose(FILE *fp);
int feof(FILE *fp);
int ferror(FILE *fp);
int fflush(FILE *fp);
int fgetc(FILE *fp);
int fgetpos(FILE *fp, fpos_t *pos);
char *fgets(char *buffer, int n, FILE *fp);
FILE *fopen(char *filename, char *access);
int fprintf(FILE *fp, char *format, ...);
int fputc(int c, FILE *fp);
int fputs(char *string, FILE *fp);
size_t fread(void *buffer, size_t size, size_t number, FILE *fp);
FILE *freopen(char *filename, char *mode, FILE *fp);
int fscanf(FILE *fp, char *fs, ...);
int fseek(FILE *fp, long offset, int origin);
int fsetpos(FILE *fp, fpos_t *pos);
long ftell(FILE *fp);
size_t fwrite(void *buffer, size_t size, size_t number, FILE *fp);
int getc(FILE *fp);
char *gets(char *buffer);
void perror(char *string);
int printf(char *format, ...);
int putc(int c, FILE *fp);
int puts(char *string);
int remove(char *filename);
int rename(char *oldname, char *newname);
void rewind(FILE *fp);
int scanf(char *format, ...);
void setbuf(FILE *fp, char *bufptr);
int setvbuf(FILE *fp, char *bufptr, int buftype, size_t bufsize);
int sprintf(char *s, char *format, ...);
int sscanf(char *s, char *format, ...);
FILE *tmpfile(void);
char *tmpnam(char *buffer);
int ungetc(int c, FILE *fp);
int vfprintf(FILE *fp, char *format, va_list arglist);
int vprintf(char *format, va_list arglist);
int vsprintf(char *s, char *format, va_list arglist);
#if !defined(ANSI)
#define stdprn _iob[4]
#define stdaux _iob[3]
#define P_tmpdir "\\TMP"
#if !Defined(STRING)
typedef struct {
int length;
char string[80];
} STRING;
#endif
int fcloseall(void);
FILE *fdopen(int fd, char *mode);
int fileno(FILE *fp);
int flushall(void);
int fputchar(int c);
int getw(FILE *fp);
int putw(int word, FILE *fp);
int rmtmp(void);
char *tempnam(char *dir, char *prename);
int unlink(char *filename);
#endif /* ANSI */
/*$list*//*$trace <<< stdio.h >>> */

104
Mix Power C v22/STDLIB.H Normal file
View File

@ -0,0 +1,104 @@
/*$no list*//*$no trace <<< stdlib.h >>> */
/* Copyright (c) Mix Software 1988 */
#define ERANGE 34
extern double HUGE;
#define HUGE_VAL HUGE
#define RAND_MAX 32767
#if !defined(NULL)
#define NULL ((void *)0)
#endif
#define EXIT_FAILURE 0
#define EXIT_SUCCESS 1
#define max(a,b) (((a) > (b)) ? (a) : (b))
#define min(a,b) (((a) < (b)) ? (a) : (b))
#define MB_CUR_MAX _mb_cur_max
#if !Defined(_mb_cur_max)
extern int _mb_cur_max;
#endif
#if !Defined(size_t)
typedef unsigned size_t;
#endif
#if !Defined(wchar_t)
typedef unsigned wchar_t;
#endif
#if !Defined(div_t)
typedef struct {
int quot; /* quotient */
int rem; /* remainder */
} div_t;
#endif
#if !Defined(ldiv_t)
typedef struct {
long quot; /* quotient */
long rem; /* remainder */
} ldiv_t;
#endif
void abort(void);
int abs(int n);
int atexit(void (*funcptr)(void));
double atof(char *string);
int atoi(char *string);
long atol(char *string);
void *bsearch(void *key, void *base, size_t number, size_t size,
int (*compare)(void *, void *));
void *calloc(size_t number, size_t size);
div_t div(int numer, int denom);
void exit(int status);
void free(void *ptr);
char *getenv(char *name);
long labs(long n);
ldiv_t ldiv(long numer, long denom);
void *malloc(size_t size);
int mblen(char *s, size_t n);
size_t mbstowcs(wchar_t *pwcs, char *s, size_t n);
int mbtowc(wchar_t *pwc, char *s, size_t n);
void qsort(void *base, size_t number, size_t size,
int (*compare)(void *, void *));
int rand(void);
void *realloc(void *ptr, size_t size);
void srand(unsigned seed);
double strtod(char *str, char **scanstop);
long strtol(char *str, char **scanstop, int base);
unsigned long strtoul(char *str, char **scanstop, int base);
int system(char *cmdstring);
size_t wcstombs(char *s, wchar_t *pwcs, size_t n);
int wctomb(char *s, wchar_t wchar);
#if !defined(ANSI)
extern int _doserrno;
extern char **environ;
extern int errno;
extern int _fmode;
extern unsigned char _osmajor;
extern unsigned char _osminor;
extern unsigned _psp;
extern char *sys_errlist[];
extern int sys_nerr;
#if !Defined(onexit_t)
typedef int (*onexit_t)();
#endif
double drand(int n);
char *ecvt(double x, int digits, int *decimal, int *sign);
void _exit(int status);
char *fcvt(double x, int digits, int *decimal, int *sign);
void ftoa(double x, char *buffer, unsigned flag,
unsigned left, unsigned right);
char *gcvt(double x, int digits, char *buffer);
char *itoa(int value, char *digits, int base);
char *ltoa(long value, char *digits, int base);
onexit_t onexit(onexit_t funcptr);
char *putenv(char *string);
void swab(char *source, char *destination, int n);
char *ultoa(unsigned long value, char *digits, int base);
#endif /* ANSI */
/*$list*//*$trace <<< stdlib.h >>> */

59
Mix Power C v22/STRING.H Normal file
View File

@ -0,0 +1,59 @@
/*$no list*//*$no trace <<< string.h >>> */
/* Copyright (c) Mix Software 1988 */
#if !Defined(size_t)
typedef unsigned size_t;
#endif
#if !defined(NULL)
#define NULL ((void *)0)
#endif
#if !defined(FARNULL)
#define FARNULL ((void far *)0)
#endif
void *memchr(void *addr, int c, size_t n);
int memcmp(void *addr1, void *addr2, size_t n);
void *memcpy(void *destaddr, void *srcaddr, size_t n);
void *memmove(void *destaddr, void *srcaddr, size_t n);
void *memset(void *addr, int c, size_t n);
char *strcat(char *str1, char *str2);
char *strchr(char *str, int c);
int strcmp(char *str1, char *str2);
int strcoll(char *s1, char *s2);
char *strcpy(char *str1, char *str2);
size_t strcspn(char *str1, char *str2);
char *strerror(int errno);
int stricmp(char *str1, char *str2);
size_t strlen(char *str);
char *strncat(char *str1, char *str2, size_t n);
int strncmp(char *str1, char *str2, size_t n);
char *strncpy(char *str1, char *str2, size_t n);
char *strpbrk(char *str1, char *str2);
char *strrchr(char *str, int c);
char *strsave(char *str);
size_t strspn(char *str1, char *str2);
char *strstr(char *str1, char *str2);
char *strtok(char *str1, char *str2);
size_t strxfrm(char *s1, char *s2, size_t n);
#if !defined(ANSI)
void *memccpy(void *destaddr, void *srcaddr, int c, size_t n);
int memicmp(void *addr1, void *addr2, size_t n);
void movedata(int srcseg, int srcoff,
int destseg, int destoff, unsigned size);
void movmem(void *srcaddr, void *destaddr, size_t n);
void repmem(void *address, void *data, int size, int number);
char *stpcpy(char *str1, char *str2);
int strcmpi(char *str1, char *str2);
char *strdup(char *str);
char *stristr(char *str1, char *str2);
char *strlwr(char *str);
int strnicmp(char *str1, char *str2, size_t n);
char *strnset(char *str, int c, size_t n);
char *strrev(char *str);
char *strset(char *str, int c);
char *strupr(char *str);
#endif /* ANSI */
/*$list*//*$trace <<< string.h >>> */

View File

@ -0,0 +1,10 @@
/*$no list*//*$no trace <<< locking.h >>> */
/* Copyright (c) Mix Software 1988 */
#define LK_UNLCK 0 /* unlock the file region */
#define LK_LOCK 1 /* lock the file region (10 attempts) */
#define LK_NBLCK 2 /* lock the file region (1 attempt) */
#define LK_RLCK 3 /* same as LK_LOCK */
#define LK_NBRLCK 4 /* same as LK_NBLCK */
/*$list*//*$trace <<< locking.h >>> */

View File

@ -0,0 +1,37 @@
/*$no list*//*$no trace <<< stat.h >>> */
/* Copyright (c) Mix Software 1988 */
#define dev_t short
#define ino_t unsigned short
#define off_t long
#define time_t long
#define S_IFMT 0xf000 /* type mask */
#define S_IFDIR 0x4000
#define S_IFCHR 0x2000
#define S_IFREG 0x8000
#define S_IREAD 0x0100
#define S_IWRITE 0x0080
#define S_IEXEC 0x0040
#if !Defined(struct stat)
struct stat
{
dev_t st_dev;
ino_t st_ino;
unsigned short st_mode;
short st_nlink;
short st_uid;
short st_gid;
dev_t st_rdev;
off_t st_size;
time_t st_atime;
time_t st_mtime;
time_t st_ctime;
};
#endif
int fstat(int fd, struct stat *buffer);
int stat(char *pathname, struct stat *buffer);
/*$list*//*$trace <<< stat.h >>> */

View File

@ -0,0 +1,17 @@
/*$no list*//*$no trace <<< timeb.h >>> */
/* Copyright (c) Mix Software 1988 */
#define time_t long
#if !Defined(struct timeb)
struct timeb {
time_t time;
unsigned short millitm;
short timezone;
short dstflag;
};
#endif
void ftime(struct timeb *timeptr);
/*$list*//*$trace <<< timeb.h >>> */

View File

@ -0,0 +1,9 @@
/*$no list*//*$no trace <<< types.h >>> */
/* Copyright (c) Mix Software 1988 */
#define dev_t short
#define ino_t unsigned short
#define off_t long
#define time_t long
/*$list*//*$trace <<< types.h >>> */

View File

@ -0,0 +1,15 @@
/*$no list*//*$no trace <<< utime.h >>> */
/* Copyright (c) Mix Software 1988 */
#define time_t long
#if !Defined(struct utimbuf)
struct utimbuf {
time_t actime; /* access time */
time_t modtime; /* modification time */
};
#endif
int utime(char *filename, struct utimbuf *times);
/*$list*//*$trace <<< utime.h >>> */

80
Mix Power C v22/TIME.H Normal file
View File

@ -0,0 +1,80 @@
/*$no list*//*$no trace <<< time.h >>> */
/* Copyright (c) Mix Software 1988 */
#define CLK_TCK 100
#define time_t long
#define clock_t long
#if !defined(NULL)
#define NULL ((void *)0)
#endif
#if !Defined(size_t)
typedef unsigned size_t;
#endif
#if !Defined(struct tm)
struct tm {
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday;
int tm_yday;
int tm_isdst;
};
#endif
char *asctime(struct tm *timeptr);
clock_t clock(void);
char *ctime(time_t *timer);
double difftime(time_t time2, time_t time1);
struct tm *gmtime(time_t *timer);
struct tm *localtime(time_t *timer);
time_t mktime(struct tm *timeptr);
size_t strftime(char *buffer, size_t bufsize, char *format,
struct tm *timeptr);
time_t time(time_t *timer);
#if !defined(ANSI)
extern int daylight; /* non-zero if daylight savings time is used */
extern long timezone; /* difference in seconds between GMT and local time */
extern char *tzname[2]; /* standard/daylight savings time zone names */
#if !Defined(struct timeb)
struct timeb {
time_t time;
unsigned short millitm;
short timezone;
short dstflag;
};
#endif
#if !Defined(struct date)
struct date {
int da_year;
char da_day;
char da_mon;
};
#endif
#if !Defined(struct time)
struct time {
unsigned char ti_min;
unsigned char ti_hour;
unsigned char ti_hund;
unsigned char ti_sec;
};
#endif
void ftime(struct timeb *timeptr);
void getdate(struct date *datebuf);
void gettime(struct time *timebuf);
void setdate(struct date *datebuf);
void settime(struct time *timebuf);
int stime(time_t *timer);
void tzset(void);
#endif /* ANSI */
/*$list*//*$trace <<< time.h >>> */

169
Mix Power C v22/TM.C Normal file
View File

@ -0,0 +1,169 @@
#include <stdio.h>
#ifdef AZTEC86
#include <stdlib.h>
#endif
#ifdef HISOFTC
#include <stdlib.h>
#endif
#ifdef INTELC
#include <stdlib.h>
#endif
#ifdef WATCOM
#include <malloc.h>
#include <process.h>
#endif
#ifdef powerc
#define allocs 50
#else
#ifdef HISOFTC
#define allocs 66 /* not enough RAM with hisoft to go higher */
#else
/* most c runtimes work up to 69, but use 66 to have a consistent benchmark */
#define allocs 66
#endif
#endif
int logging = 1;
char * memset_x( p, v, c ) char * p; int v; int c;
{
unsigned char * pc = (unsigned char *) p;
unsigned char val = (unsigned char) ( v & 0xff );
int i;
if ( 0 == p )
{
printf( "request to memset a null pointer\n" );
exit( 1 );
}
if ( logging )
#ifdef CPMTIME
printf( " memset p %u, v %d, val %x, c %d\n", p, v, val, c );
#else
#ifdef HISOFTC
printf( " memset p %u, v %d, val %x, c %d\n", p, v, val, c );
#else
printf( " memset p %p, v %d, val %x, c %d\n", p, v, val, c );
#endif
#endif
for ( i = 0; i < c; i++ )
*pc++ = val;
return p;
}
void chkmem( p, v, c ) char * p; int v; int c;
{
unsigned char * pc = (unsigned char *) p;
unsigned char val = (unsigned char) ( v & 0xff );
int i;
if ( 0 == p )
{
printf( "request to chkmem a null pointer\n" );
exit( 1 );
}
for ( i = 0; i < c; i++ )
{
if ( *pc != val )
{
#ifdef CPMTIME
printf( "memory isn't as expected! p %u, v %d, c %d, *pc %d\n",p, v, c, *pc );
#else
printf( "memory isn't as expected! p %p, v %d, c %d, *pc %d\n",p, v, c, *pc );
#endif
exit( 1 );
}
pc++;
}
}
int main( argc, argv ) int argc; char * argv[];
{
int i, cb, c_cb, j;
char * pc;
char * ap[ allocs ];
logging = ( argc > 1 );
pc = argv[ 0 ]; /* evade compiler warning */
for ( j = 0; j < 10; j++ )
{
if ( logging )
printf( "in alloc mode\n" );
for ( i = 0; i < allocs; i++ )
{
cb = 8 + ( i * 10 );
c_cb = cb + 5;
if ( logging )
printf( " i, cb: %d %d\n", i, cb );
pc = (char *) calloc( c_cb, 1 );
chkmem( pc, 0, c_cb );
memset_x( pc, 0xcc, c_cb );
ap[ i ] = (char *) malloc( cb );
memset_x( ap[ i ], 0xaa, cb );
chkmem( pc, 0xcc, c_cb );
free( pc );
}
if ( logging )
printf( "in free mode, even first\n" );
for ( i = 0; i < allocs; i += 2 )
{
cb = 8 + ( i * 10 );
c_cb = cb + 3;
if ( logging )
printf( " i, cb: %d %d\n", i, cb );
pc = (char *) calloc( c_cb, 1 );
chkmem( pc, 0, c_cb );
memset_x( pc, 0xcc, c_cb );
chkmem( ap[ i ], 0xaa, cb );
memset_x( ap[ i ], 0xff, cb );
free( ap[ i ] );
chkmem( pc, 0xcc, c_cb );
free( pc );
}
if ( logging )
printf( "in free mode, now odd\n" );
for ( i = 1; i < allocs; i += 2 )
{
cb = 8 + ( i * 10 );
c_cb = cb + 7;
if ( logging )
printf( " i, cb: %d %d\n", i, cb );
pc = (char *) calloc( c_cb, 1 );
chkmem( pc, 0, c_cb );
memset_x( pc, 0xcc, c_cb );
chkmem( ap[ i ], 0xaa, cb );
memset_x( ap[ i ], 0xff, cb );
free( ap[ i ] );
chkmem( pc, 0xcc, c_cb );
free( pc );
}
}
printf( "success\n" );
return 0;
}

527
Mix Power C v22/TTT.C Normal file
View File

@ -0,0 +1,527 @@
/*
This version builds with old compilers including:
Aztec C 1.06 for 8080 & Z80 on CP/M.
Microsoft C Compiler V1.04 for 8086 on DOS. (This is Lattice C)
Microsoft C Compiler V2.03 for 8086 on DOS. (Still Lattice C)
Microsoft C Compiler V3.00 for 8086 on DOS.
QuickC 1.0
Turbo C 2.0
The syntax is old and reminds me of 7th grade summer vacation.
Much of this code is awkward to satisfy the lowest common denominator of many compilers.
unsigned long isn't supported in many older compilers, so long is used instead.
Early DOS and CP/M require register variabes to be int, not char or other types.
The perf improvement of using register-int instead of stack-char is worth it.
*/
#define LINT_ARGS
#include <stdio.h>
#ifdef DOSTIME
#include <time.h>
#include <dos.h>
#endif
#define true 1
#define false 0
/* Function Pointers are the fastest implementation for almost every compiler */
#define UseFunPointers 1
#define UseWinner2 2
#define UseLookForWinner 3
#define WinMethod UseFunPointers
#define ABPrune true /* alpha beta pruning */
#define WinLosePrune true /* stop early on win/lose */
#define ScoreWin 6
#define ScoreTie 5
#define ScoreLose 4
#define ScoreMax 9
#define ScoreMin 2
#define DefaultIterations 10
#define PieceX 1
#define PieceO 2
#define PieceBlank 0
typedef char ttype; /* 8-bit and 16-bit cpus do best with char aside from register in locals */
int g_Iterations = DefaultIterations;
ttype g_board[ 9 ];
#if WinMethod == UseFunPointers
ttype pos0func()
{
/* using "register int" instead of "ttype" for x is faster on 8086 and Z80 */
register int x = g_board[0];
if ( ( x == g_board[1] && x == g_board[2] ) ||
( x == g_board[3] && x == g_board[6] ) ||
( x == g_board[4] && x == g_board[8] ) )
return x;
return PieceBlank;
}
ttype pos1func()
{
register int x = g_board[1];
if ( ( x == g_board[0] && x == g_board[2] ) ||
( x == g_board[4] && x == g_board[7] ) )
return x;
return PieceBlank;
}
ttype pos2func()
{
register int x = g_board[2];
if ( ( x == g_board[0] && x == g_board[1] ) ||
( x == g_board[5] && x == g_board[8] ) ||
( x == g_board[4] && x == g_board[6] ) )
return x;
return PieceBlank;
}
ttype pos3func()
{
register int x = g_board[3];
if ( ( x == g_board[4] && x == g_board[5] ) ||
( x == g_board[0] && x == g_board[6] ) )
return x;
return PieceBlank;
}
ttype pos4func()
{
register int x = g_board[4];
if ( ( x == g_board[0] && x == g_board[8] ) ||
( x == g_board[2] && x == g_board[6] ) ||
( x == g_board[1] && x == g_board[7] ) ||
( x == g_board[3] && x == g_board[5] ) )
return x;
return PieceBlank;
}
ttype pos5func()
{
register int x = g_board[5];
if ( ( x == g_board[3] && x == g_board[4] ) ||
( x == g_board[2] && x == g_board[8] ) )
return x;
return PieceBlank;
}
ttype pos6func()
{
register int x = g_board[6];
if ( ( x == g_board[7] && x == g_board[8] ) ||
( x == g_board[0] && x == g_board[3] ) ||
( x == g_board[4] && x == g_board[2] ) )
return x;
return PieceBlank;
}
ttype pos7func()
{
register int x = g_board[7];
if ( ( x == g_board[6] && x == g_board[8] ) ||
( x == g_board[1] && x == g_board[4] ) )
return x;
return PieceBlank;
}
ttype pos8func()
{
register int x = g_board[8];
if ( ( x == g_board[6] && x == g_board[7] ) ||
( x == g_board[2] && x == g_board[5] ) ||
( x == g_board[0] && x == g_board[4] ) )
return x;
return PieceBlank;
}
typedef ttype pfunc_t();
pfunc_t * winner_functions[9] =
{
pos0func,
pos1func,
pos2func,
pos3func,
pos4func,
pos5func,
pos6func,
pos7func,
pos8func
};
#endif
#if WinMethod == UseWinner2
ttype winner2( move ) ttype move;
{
register int x; /* faster than ttype x on the stack */
switch( move ) /* msc v3 from 1985 generates a jump table! */
{
case 0:
{
x = g_board[ 0 ];
if ( ( ( x == g_board[1] ) && ( x == g_board[2] ) ) ||
( ( x == g_board[3] ) && ( x == g_board[6] ) ) ||
( ( x == g_board[4] ) && ( x == g_board[8] ) ) )
return x;
break;
}
case 1:
{
x = g_board[ 1 ];
if ( ( ( x == g_board[0] ) && ( x == g_board[2] ) ) ||
( ( x == g_board[4] ) && ( x == g_board[7] ) ) )
return x;
break;
}
case 2:
{
x = g_board[ 2 ];
if ( ( ( x == g_board[0] ) && ( x == g_board[1] ) ) ||
( ( x == g_board[5] ) && ( x == g_board[8] ) ) ||
( ( x == g_board[4] ) && ( x == g_board[6] ) ) )
return x;
break;
}
case 3:
{
x = g_board[ 3 ];
if ( ( ( x == g_board[4] ) && ( x == g_board[5] ) ) ||
( ( x == g_board[0] ) && ( x == g_board[6] ) ) )
return x;
break;
}
case 4:
{
x = g_board[ 4 ];
if ( ( ( x == g_board[0] ) && ( x == g_board[8] ) ) ||
( ( x == g_board[2] ) && ( x == g_board[6] ) ) ||
( ( x == g_board[1] ) && ( x == g_board[7] ) ) ||
( ( x == g_board[3] ) && ( x == g_board[5] ) ) )
return x;
break;
}
case 5:
{
x = g_board[ 5 ];
if ( ( ( x == g_board[3] ) && ( x == g_board[4] ) ) ||
( ( x == g_board[2] ) && ( x == g_board[8] ) ) )
return x;
break;
}
case 6:
{
x = g_board[ 6 ];
if ( ( ( x == g_board[7] ) && ( x == g_board[8] ) ) ||
( ( x == g_board[0] ) && ( x == g_board[3] ) ) ||
( ( x == g_board[4] ) && ( x == g_board[2] ) ) )
return x;
break;
}
case 7:
{
x = g_board[ 7 ];
if ( ( ( x == g_board[6] ) && ( x == g_board[8] ) ) ||
( ( x == g_board[1] ) && ( x == g_board[4] ) ) )
return x;
break;
}
case 8:
{
x = g_board[ 8 ];
if ( ( ( x == g_board[6] ) && ( x == g_board[7] ) ) ||
( ( x == g_board[2] ) && ( x == g_board[5] ) ) ||
( ( x == g_board[0] ) && ( x == g_board[4] ) ) )
return x;
break;
}
}
return PieceBlank;
} /*winner2*/
#endif
#if WinMethod == UseLookForWinner
ttype LookForWinner()
{
register int p = g_board[0]; /* faster as register int than ttype on 8086 and Z80 */
if ( PieceBlank != p )
{
if ( p == g_board[1] && p == g_board[2] )
return p;
if ( p == g_board[3] && p == g_board[6] )
return p;
}
p = g_board[3];
if ( PieceBlank != p && p == g_board[4] && p == g_board[5] )
return p;
p = g_board[6];
if ( PieceBlank != p && p == g_board[7] && p == g_board[8] )
return p;
p = g_board[1];
if ( PieceBlank != p && p == g_board[4] && p == g_board[7] )
return p;
p = g_board[2];
if ( PieceBlank != p && p == g_board[5] && p == g_board[8] )
return p;
p = g_board[4];
if ( PieceBlank != p )
{
if ( ( p == g_board[0] ) && ( p == g_board[8] ) )
return p;
if ( ( p == g_board[2] ) && ( p == g_board[6] ) )
return p;
}
return PieceBlank;
} /*LookForWinner*/
#endif
int g_IMoves = 0;
ttype MinMax( alpha, beta, depth, move ) ttype alpha; ttype beta; ttype depth; ttype move;
{
ttype pieceMove, score; /* better perf with char than int. out of registers so use stack */
register int p, value; /* better perf with these as an int on Z80, 8080, and 8086 */
g_IMoves++;
if ( depth >= 4 )
{
#if WinMethod == UseFunPointers
p = ( * winner_functions[ move ] )();
#endif
#if WinMethod == UseWinner2
p = winner2( move );
#endif
#if WinMethod == UseLookForWinner
p = LookForWinner();
#endif
if ( PieceBlank != p )
{
if ( PieceX == p )
return ScoreWin;
return ScoreLose;
}
if ( 8 == depth )
return ScoreTie;
}
if ( depth & 1 )
{
value = ScoreMin;
pieceMove = PieceX;
}
else
{
value = ScoreMax;
pieceMove = PieceO;
}
for ( p = 0; p < 9; p++ )
{
if ( PieceBlank == g_board[ p ] )
{
g_board[p] = pieceMove;
score = MinMax( alpha, beta, depth + 1, p );
g_board[p] = PieceBlank;
if ( depth & 1 )
{
#if WinLosePrune /* #if statements must be in first column for MS C 1.0 */
if ( ScoreWin == score )
return ScoreWin;
#endif
if ( score > value )
{
value = score;
#if ABPrune
if ( value >= beta )
return value;
if ( value > alpha )
alpha = value;
#endif
}
}
else
{
#if WinLosePrune
if ( ScoreLose == score )
return ScoreLose;
#endif
if ( score < value )
{
value = score;
#if ABPrune
if ( value <= alpha )
return value;
if ( value < beta )
beta = value;
#endif
}
}
}
}
return value;
} /*MinMax*/
long g_Moves = 0;
int FindSolution( position ) ttype position;
{
register int i;
for ( i = 0; i < 9; i++ )
g_board[ i ] = PieceBlank;
g_board[ position ] = PieceX;
for ( i = 0; i < g_Iterations; i++ )
{
g_IMoves = 0;
MinMax( ScoreMin, ScoreMax, 0, position );
g_Moves += g_IMoves; /* do the 4-byte long addition once per loop to save work */
}
return 0;
} /*FindSolution*/
#ifdef CPMTIME
struct CPMTimeValue
{
int h, m, s, l;
};
void print_time_now()
{
/* This CP/M BDOS call of 105 is only implemented in NTVCM -- it's not a standard CP/M 2.2 call */
struct CPMTimeValue t;
t.h = t.m = t.s = t.l = 0;
bdos( 105, &t );
printf( "current time: %02d:%02d:%02d.%02d\n", t.h, t.m, t.s, t.l );
} /*print_time_now*/
long get_ms()
{
/* This CP/M BDOS call of 105 is only implemented in NTVCM -- it's not a standard CP/M 2.2 call */
long h, m, s, l;
struct CPMTimeValue t;
t.h = t.m = t.s = t.l = 0;
bdos( 105, &t );
h = t.h;
m = t.m;
s = t.s;
l = t.l;
return h * 3600000 + m * 60000 + s * 1000 + l * 10;
} /*get_ms*/
#else /* no elif with old compilers */
#ifdef DOSTIME
void print_time_now()
{
/* Make a DOS interrupt call to get the time */
union REGS wrIn, wrOut;
wrIn.h.ah = 0x2c;
intdos( &wrIn, &wrOut );
printf( "current time: %02d:%02d:%02d.%02d\n", wrOut.h.ch, wrOut.h.cl, wrOut.h.dh, wrOut.h.dl );
fflush( stdout );
} /*print_time_now*/
long get_ms()
{
/* this function takes about 3 milliseconds on the original IBM PC */
long h, m, s, l;
union REGS wrIn, wrOut;
wrIn.h.ah = 0x2c;
intdos( &wrIn, &wrOut );
h = wrOut.h.ch;
m = wrOut.h.cl;
s = wrOut.h.dh;
l = wrOut.h.dl;
return h * 3600000 + m * 60000 + s * 1000 + l * 10;
} /*get_ms*/
#else
/* must do this on actual CP/M machines */
int print_time_now() { return 0; }
long get_ms() { return 0; }
#endif
#endif
int main( argc, argv ) int argc; char * argv[];
{
long start_time, end_time;
if ( 2 == argc )
sscanf( argv[ 1 ], "%d", &g_Iterations ); /* no atoi in MS C 1.0 */
start_time = get_ms();
FindSolution( 0 );
FindSolution( 1 );
FindSolution( 4 );
end_time = get_ms();
printf( "runtime in ms: %ld\n", end_time - start_time );
printf( "move count: %ld\n", g_Moves ); /* 6493 * g_Iterations */
printf( "iteration count: %d\n", g_Iterations );
printf( "method: %s\n",
( WinMethod == UseFunPointers ) ? "function pointers" :
( WinMethod == UseWinner2 ) ? "winner2" :
( WinMethod == UseLookForWinner ) ? "look for winner" :
"invalid method" );
return 0;
} /*main*/

View File

@ -0,0 +1,5 @@
powerc v2 loads pco.exe to optimize object files after compilation. Before doing so it frees
RAM to make room. But it doesn't relocate the stack, which is sitting in freed RAM that gets
reused by pco.exe. When pco is done there is a crash because the return address is in trashed
stack. This somehow works in vanilla DOS. ntvdm has a workaround for pc.exe

7
Mix Power C v22/m.bat Normal file
View File

@ -0,0 +1,7 @@
ntvdm -r:. pc -f /c /ms /dpowerc /dDOSTIME /j /fi /q %1.c 1>nul 2>nul
ntvdm -r:. pcl %1
del %1.mix 1>nul 2>nul