NNNNNNp NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNN7O  @! #@%`')+-/1 O5`9;=?A C@E`GKMOQ S@U`WY[]_a cegmoq su`y{} @ @ ` @ ` @ ` @ ` ǀ ɠ @ ` ׀  o o!a  !a!!#A%a)+/1!3A5a9;=?A!CAEaGIMOQ!SAO  @! #@%`')+-/1 O5`9;=?A C@E`GKMOQ S@U`WY[]_a cegmoq su`y{} @ @ ` @ ` @ ` @ ` ǀ ɠ @ ` ׀  o o!a  !a!!#A%a)+/1!3A5a9;=?A!CAEaGIMOQ!SACNLIB 0823D a ARTWORK a ARXX $a CC Fa HCLOCK Ua hFRACTAL aa wLI ia PALETTE a PRINT a QIX a STARTUP a TTOOL2 a ,QIO C a K $.  a..  a3D C a  3D PRGa  extern float sin(),cos(),exp(); int contrl[12], intin[256], ptsin[256], intout[256], ptsout[256]; float x, y, dfy, py, f; float pi,SIN_THETA,COS_THETA; int width,xcount,ycount; int top[1000],bottom[1000]; int handle,height,i,dummy; int oldx,oldy; int NUM_LINES; int pxy[4]; #define TRUE 1 #define FALSE 0 float func() { return(cos((x*x+y*y)*5.)*exp(-x*x-y*y)); } float scalex() { float temp; temp=width/2.; return((xcount-temp)/width*pi); } float scaley() { float temp; temp=NUM_LINES/2.; return((temp-ycount)/NUM_LINES*pi); } unscaley() { return((dfy+2.)/4.*height); } main() { register visible, dy; /* The following is the setup to use the VDI and AES */ /* Set the system up to do GEM calls*/ appl_init(); /* Get the handle of the desktop */ handle=graf_handle(&width,&height,&dummy,&dummy); /* Open the workstation. */ for (i=1; i<10; ++i) intin[i] = i; intin[10] = 2; v_opnvwk(intin, &handle, intout); graf_mouse(256,pxy); width=intout[0]; height=intout[1]; vswr_mode(handle,2); v_clrwk(handle); oldx=0; oldy=0; NUM_LINES=64; SIN_THETA=.5; COS_THETA=0.866; pi=3.14159; for (ycount=0; ycountdy) bottom[xcount]=dy; else visible=FALSE; } if (visible==TRUE) { vsl_color(handle,1); pxy[0]=oldx; pxy[1]=oldy; pxy[2]=xcount; pxy[3]=dy; v_pline(handle,2,pxy); } oldx=xcount; oldy=dy; } } evnt_keybd(); } `\*O.|*m - ЭЭм// ??<JNA N>/<NA"/0<NBNuNV/9l/9lN 6P//9d/9dN VX/N 6P/N rP.N//<C/9l/9lN 6P//9d/9dN 6P/NP/N 6P/NX/N 6PN^NuNV/<B09-zH/NX/NP-@/9-r09-zH/NX//.09 H/NX/N rP/NP/N 6PN^NuNV/<B09DH/NX/NP-@/9-r09DH/NX/09 H/NX//.N rP/NP/N 6PN^NuNV09pH/NX//<C/<B/9NP/NP/N 6P/NXN^NuNVHN.B/<B/<p/<-zNB 3@3>`0y> 0>Ry> y >m3./<@/< NDP.?<NT3-z3p>?9@NT>@NByhByj3@D#@:#ݲ,@2#B-rBy `|a&#l/9:/9lN 6P#6By `6a|#da#./92/9.N 6P//96N rP#a6<Jy fBG`zJy f$0y 00y %0~`L~0y ҼPo0y 0`&0y %Pl0y %0`BG|fN>?9@NT3h3j3 3.?<?9@NX3 h3jRy 09-zR@y nRy 09 yDmxN0JLN^NuNV3  3 By33N<09N^NuNV3ByBy3NB@09N^NuNV#r#F#z#"#&#-v*#> aF3pN^NuNV>a*pN^NuNV>NRN^NuNV>MNR n0 n 0 n0 n0B@09N^NuNV3z# >NNRN^NuNVH..,. N . LN^NuNVH..,. N $ LN^NuNVH..N LN^NuNVH..N LN^NuNVHJl| .D-@`BFJfB`^~` .-@R .f` .-@S. g .-@޼@ JFg .JLN^NuNVH .м<JgJFlB`V .:|oJEg <` <`0..μ|`RFJFm`SFJFnJEg D. JLN^NuNVH..,. N LN^NuNVH..N  LN^NuNVH..,. N  LN^Nu?<`$?<`?<`<bTJNuBgJk<8cH~$<cP<c <L~TNu,<>.N <<XDxB묈<΄,<CN ,.N $(< .BJk<FD<c~䯾o$`<D<c~DDl`z,k^g>k^g2k8<d,&B<ރeNuRid~S<Nu.NuJNu:ڼ.gNu<Jj~`~<L~Nu.<AOJNuH~?g<$,<;AN i<`D<o< l", #define NUMLINES 343 #define NUM_FUNCTIONS 13 extern double cos (), sin (); int func[13][NUMLINES]; int contrl[12], intin[256], ptsin[256], intout[256], ptsout[256]; int dummy,handle; int xwidth,ywidth,height,width; int pxy[4],t1,t2,t3,t4; int i,j,k,l,m; int mx; long Randx=1; main() { appl_init(); handle=graf_handle(&height,&width,&dummy,&dummy); for(i=1; i<10; ++i) intin[i] = 1; intin[10] = 2; v_opnvwk(intin, &handle, intout); pxy[0]=0; pxy[1]=0; pxy[2]=intout[0]; pxy[3]=intout[1]; xwidth=pxy[2]; ywidth=pxy[3]; graf_mouse(0,i); v_clrwk(handle); v_gtext(handle,0,height*2,"Precomputing coefficients ... please wait"); init(); Srand((long) Gettime()); while(!Bconstat(2)){ v_clrwk(handle); i=Rand()%NUM_FUNCTIONS; while((j = Rand()%NUM_FUNCTIONS)==i); k=Rand()%NUM_FUNCTIONS; while((l = Rand()%NUM_FUNCTIONS)==k); for(m=0;mBgN ~T>@N v.09D@?Bg?9@N \a>N.a`|>@N vaH H@3aH H@3ygaH H@3@aH H@3@ܰy@gByB`0929BAHЁм @30929BAHЁ @"|00(H@309@29BAHЁм @309@29BAHЁ @"|00(H@3>?9?9?9ap\RyB yWBm&By`By`Ry ymRy ym>?<N TJgr>@N N *N^NuNV-|B0<WH/NX-@0<WH/NX//.pH/NX/N0P/N P-@09E\HH/NX-@Bn`r0.H/NX-@/./.pH/NX//.N P//.NlP/pH/NX/N0P/N0P/N P/NX?0n00nJPl 0n"|00D@2n20n"|00|@2n20<@H/NX//././.N0P/N X/N0P/N P/NX?0n1_0<@H/NX//././.N0P/N X/NPX/N0P/N P/NX?0n1_\0<@H/NX//././.N0P/N X/N0P/N P/NX?0n1_ 0<@H/NX//././.N0P/N X/NPX/N0P/N P/NX?0n1_ 0<@H/NX//././.pH/NX/N0P/N0P/N X/N0P/N P/NX?0n1_ f0<@H/NX//././.pH/NX/N0P/N0P/N X/NPX/N0P/N P/N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!T3~SUU???xBJg.jD<¼bHF<܆[Jj ܼdRNumc68343 floating point firmware (c) copyright 1981 by motorola inc.#NN/9Nu#NM/9Nu#NA/9Nu Precomputing coefficients ... please wait.                        "     f &   : b$ fBL. % a.. % aARCHIVE H &a ARDEL C (a 0AREXTR C +a ARL BAT-a <ARLIST C /a  ARREPL C 1a $ARUTIL C 4a *ARWRTMODC 7a ,ARXX C 9a .ARXX DOC<a 3I ARXX INPAa 7[ARXX PRGCa 8=/* archive.h * * headerfile for arxx * * Author: Ton van Overbeek * TPC862@ESTEC.BITNET * 1986-10-05 */ #define WORD int /* 16bit = int for ALCYON */ #ifdef LATTICE #define WORD short /* 16bit = short for LATTICE */ #endif struct objfhead { /* object file header */ WORD objtyp; long textsize; long datasize; long bsssize; long symtsize; long reserv1; long reserv2; WORD reserv3; }; struct armodhead { /* library module header */ char fname[12]; long res1[2]; WORD flags; long fsize; WORD res2; }; struct symbtab { /* symboltable */ char symname[8]; WORD symtype; long symvalue; }; #define OBJTYP 0x601a /* first word in .o file */ #define ARCHTYP 0xff65 /* first word in library */ #define LIST 1 /* arxx operations */ #define REPLACE 2 #define DELETE 4 #define EXTRACT 8 #define WRITE 16 #define AFTER 1 /* flagvalues for aftbef */ #define BEFORE 2 #define NOCOPY 4 /* * ardel.c * * delete command for arxx * * Author: Ton van Overbeek * TPC862@ESTEC.BITNET * 1986-10-05 */ #include #include #include "archive.h" long eFread(); long eFwrite(); static WORD buff[512]; /* buffer for copying modules */ static struct armodhead modhead; /* library module header */ int delmod(flib, libname, ftmp, tmpname, modnames, modcount, verbose) WORD flib, ftmp; int modcount, verbose; char *libname, *tmpname, **modnames; { WORD flag; /* library flag, should be 0xff65 */ WORD fobj; /* handle for object file */ int eolib = FALSE; /* end-of-library flag */ /* * read and check library magic word */ if (eFread(flib, libname, 2L, &flag) != 2L) return -1; if (flag != ARCHTYP) { errmsg("arxx: %s not in library format", libname); return -1; } buff[0] = ARCHTYP; if (eFwrite(ftmp, tmpname, 2L, buff) != 2L) return -1; while (modcount > 0) { eolib = search(flib, libname, ftmp, tmpname, *modnames, eolib, 0, verbose); if (eolib < 0) return -1; if (eolib) { errmsg("arxx: module %s not found", *modnames); return -1; } if (verbose) printf("d %s\n", *modnames); modcount--; modnames++; } /* * copy remainder of library by searching for empty modulename */ if (search(flib, libname, ftmp, tmpname, "", eolib,0, verbose) < 0) { return -1; } /* * everything ok: * write end-of-lib (0 word), * rename temp file and delete original library */ buff[0] = 0; if (eFwrite(ftmp, tmpname, 2L, buff) != 2L) return -1; Fclose(flib); Fclose(ftmp); Fdelete(libname); Frename(0, tmpname, libname); return 0; } /* * arextr.c * * extract command for arxx * * Author: Ton van Overbeek * TPC862@ESTEC.BITNET * 1986-10-05 */ #include #include #include "archive.h" extern struct armodhead modhead; /* library module header */ long eFread(); int extrmod(flib, libname, modnames, modcount, verbose) WORD flib; int modcount, verbose; char *libname, **modnames; { WORD flag; /* library flag, should be 0xff65 */ WORD fobj; /* handle for object file */ int eolib = FALSE; /* end-of-library flag */ /* * read and check library magic word */ if (eFread(flib, libname, 2L, &flag) != 2L) return -1; if (flag != ARCHTYP) { errmsg("arxx: %s not in archive format", libname); return -1; } while (modcount > 0) { eolib = search(flib, libname, 0, NULL, *modnames, eolib, NOCOPY, verbose); if (eolib < 0) return -1; if (eolib) { errmsg("arxx: module %s not found", *modnames); return -1; } if ((fobj = Fcreate(*modnames, 0)) < 0) { errmsg("arxx: cannot create %s", *modnames); return -1; } if (copymodule(flib, libname, fobj, *modnames, modhead.fsize)) { return -1; } Fclose(fobj); if (verbose) printf("x %s\n", *modnames); modcount--; modnames++; } Fclose(flib); return 0; } rm arxx.prg link68 [co[arxx.inp relmod arxx rm arxx.68k /* * arlist.c * * list command for arxx * * Author: Ton van Overbeek * TPC862@ESTEC.BITNET * 1986-10-05 */ #include #include #include "archive.h" long eFread(); long eFseek(); listlib(flib, libname, verbose) /* list contents of library */ int flib; /* file handle */ char *libname; /* library filename */ int verbose; /* TRUE if -v specified */ { WORD flag; /* library flag, should be 0xff65 */ struct armodhead modhead; /* library module header */ long count; /* * read and check library flag */ if (eFread(flib, libname, 2L, &flag) != 2L) { return -1; } if (flag != ARCHTYP) { errmsg("arxx: %s not in archive format", libname); return -1; } /* * list module names and sizes */ while (TRUE) { /* read module header and check if not end of library */ if ((count = Fread(flib, (long) sizeof(modhead), &modhead)) != (long) sizeof(modhead)) { if ((count > 0) && (modhead.fname[0] == (char)0)) { break; /* end of library */ } errmsg("arxx: read error on %s", libname); return -1; } if (modhead.fname[0] == (char) 0 ) break; /* end of library */ /* print module name and size */ printf("%-12s %6ld", modhead.fname, modhead.fsize); /* if not verbose skip object file */ if (!verbose) { if (eFseek(modhead.fsize, flib, libname) < 0) { return -1; } } else { /* list global symbols */ struct objfhead objecth; struct symbtab symbolt; int nsym; /* nr of symbols printed for this module */ if (eFread(flib, libname, (long) sizeof(objecth), &objecth) != (long) sizeof(objecth)) { return -1; } if (eFseek(objecth.textsize + objecth.datasize, flib, libname) < 0) { return -1; } count = objecth.symtsize; nsym = 0; while (count > 0) { if (eFread(flib, libname, (long) sizeof(symbolt), &symbolt) != (long) sizeof(symbolt)) { return -1; } if ((symbolt.symtype & 0x2600) >= 0x2200 || (symbolt.symtype == 0xA800 && symbolt.symvalue)) { if (nsym && ((nsym % 6) == 0)) printf("\n%19s", ""); if (symbolt.symtype & 0x0200) { /* text segment */ printf(" "); } else if (symbolt.symtype & 0x400) { /* data segment */ printf(" *"); } else if (symbolt.symtype == 0xA800) { /* common */ printf(" %%"); } symbolt.symtype = 0; /* force terminated string */ printf("%-8s", symbolt.symname); nsym++; } count -= sizeof(symbolt); } /* skip relocation info */ count = modhead.fsize - sizeof(objecth) - objecth.textsize - objecth. datasize - objecth.symtsize; if (eFseek(count, flib, libname) < 0) { return -1; } } printf("\n"); } return 0; } /* * arrepl.c * * replace command for arxx * * Author: Ton van Overbeek * TPC862@ESTEC.BITNET * 1986-10-05 */ #include #include #include "archive.h" long eFread(); long eFwrite(); long eFseek(); static WORD buff[512]; /* buffer for copying modules */ struct armodhead modhead; /* library module header */ replmod(flib, libname, ftmp, tmpname, modnames, modcount, aftbef, opmod, verbose) WORD flib, ftmp; int modcount, aftbef, verbose; char *libname, *tmpname, **modnames, *opmod; { WORD flag; /* library flag, should be 0xff65 */ WORD fobj; /* handle for object file */ int retval; /* return value from insert/replace */ /* * read and check library flag */ if (eFread(flib, libname, 2L, &flag) != 2L) return -1; if (flag != ARCHTYP) { errmsg("arxx: %s not in archive format", libname); return -1; } buff[0] = ARCHTYP; if (eFwrite(ftmp, tmpname, 2L, buff) != 2L) return -1; /* * if -a or -b option is not specified replace modules in the order * specified in modnames, otherwise insert the modnames modules after * or before opmod. */ if (aftbef == 0) { retval = replace(flib, libname, ftmp, tmpname, modnames, modcount, verbose); } else { retval = insert(flib, libname, ftmp, tmpname, modnames, modcount, opmod, aftbef, verbose); } if (retval) return -1; /* * Everything ok up till now. * Write end-of-lib (0 word), * rename temp file and delete original library */ buff[0] = 0; if (eFwrite(ftmp, tmpname, 2L, buff) != 2L) return -1; Fclose(flib); Fclose(ftmp); Fdelete(libname); Frename(0, tmpname, libname); return 0; } static int replace(flib, libname, ftmp, tmpname, modnames, modcount, verbose) WORD flib, ftmp; int modcount, verbose; char *libname, *tmpname, **modnames; { WORD fobj; /* handle for object file */ int eolib = FALSE; /* end-of-library flag */ long count; /* nr of bytes read/written */ long getfsize(); /* get filesize from directory */ int i; while (modcount > 0) { if((fobj = Fopen(*modnames, 0)) < 0) { errmsg("arxx: cannot open %s", *modnames); return -1; } count = getfsize(*modnames); /* check if really an object file */ if (checkobj(fobj, *modnames, count)) { errmsg("arxx: %s not an object file", *modnames); Fclose(fobj); return -1; } eolib = search(flib, libname, ftmp, tmpname, *modnames, eolib, 0, verbose); if (eolib < 0) return -1; /* write new module header */ if (eolib) { strcpy(modhead.fname, *modnames); for (i = strlen(modhead.fname) + 1; i < 12; i++) { modhead.fname[i] = 0; } modhead.flags = 0666; /* unix style rw permission, not used */ } modhead.fsize = count; if (eFwrite(ftmp, tmpname, (long) sizeof(modhead), &modhead) != (long) sizeof(modhead)) { return -1; } if (copymodule(fobj, *modnames, ftmp, tmpname, count)) { return -1; } if (verbose) printf("r %s\n", modhead.fname); modcount--; modnames++; } /* * copy remainder of library by searching for a non existing * module */ if (search(flib, libname, ftmp, tmpname, "", eolib, 0, verbose) < 0) { return -1; } return 0; } static int insert(flib, libname, ftmp, tmpname, modnames, modcount, opmod, aftbef, verbose) WORD flib, ftmp; int modcount, aftbef, verbose; char *libname, *tmpname, **modnames, *opmod; { WORD fobj; /* handle for object file */ int eolib = FALSE; /* end-of-library flag */ long count; /* nr of bytes read/written */ long getfsize(); /* get filesize from directory */ int i; eolib = search(flib, libname, ftmp, tmpname, opmod, eolib, aftbef, verbose); if (eolib < 0) return -1; while (modcount > 0) { if((fobj = Fopen(*modnames, 0)) < 0) { errmsg("arxx: cannot open %s", *modnames); return -1; } count = getfsize(*modnames); /* check if really an object file */ if (checkobj(fobj, *modnames, count)) { errmsg("arxx: %s not an object file", *modnames); Fclose(fobj); return -1; } /* write new module header */ strcpy(modhead.fname, *modnames); for (i = strlen(modhead.fname) + 1; i < 12; i++) { modhead.fname[i] = 0; } modhead.fsize = count; modhead.flags = 0666; /* unix style rw permission, not used */ if (eFwrite(ftmp, tmpname, (long) sizeof(modhead), &modhead) != (long) sizeof(modhead)) return -1; if (copymodule(fobj, *modnames, ftmp, tmpname, count)) { return -1; } if (verbose) printf((aftbef == AFTER ? "a %s\n" : "b %s\n"), modhead.fname); modcount--; modnames++; } /* * copy remainder of library by searching for a non existing * module */ if (search(flib, libname, ftmp, tmpname, "", eolib, 0, verbose) < 0) { return -1; } return 0; } int search(flib, libname, ftmp, tmpname, modname, eolib, aftbef, verbose) WORD flib, ftmp; char *libname, *tmpname, *modname; int eolib, aftbef, verbose; { long count; int found; if (eolib) return eolib; found = FALSE; while (TRUE) { if ((count = eFread(flib, libname, (long) sizeof(modhead), &modhead)) != (long) sizeof(modhead)) { if (count > 0 && modhead.fname[0] == (char)0) {/* end-of-library */ return TRUE; } return -1; } if (strcmp(modname, modhead.fname) == 0) { /* found module */ found = TRUE; if (aftbef == NOCOPY) { return FALSE; } else if (aftbef == 0) { /* seek past module */ if (eFseek(modhead.fsize, flib, libname) < 0) { return -1; } return FALSE; } else if (aftbef == BEFORE) { /* seek back to beginning of module header */ if (eFseek(-((long) sizeof(modhead)), flib, libname) < 0) { return -1; } return FALSE; } /* else if (aftbef == AFTER) fall through to copy module */ } /* * module not found, copy to temp file if NOCOPY flag not set */ if (aftbef != NOCOPY) { if (eFwrite(ftmp, tmpname, (long) sizeof(modhead), &modhead) != (long) sizeof(modhead)) { return -1; } if (copymodule(flib, libname, ftmp, tmpname, modhead.fsize)) { return -1; } if (verbose) printf("c %s\n", modhead.fname); } else { /* aftbef == NOCOPY, seek past module */ if (eFseek(modhead.fsize, flib, libname) < 0) { return -1; } } if (found) return FALSE; } } int checkobj(fobj, fname, fsize) /* returns TRUE if fname is */ WORD fobj; /* an object file */ char *fname; long fsize; /* filesize from directory */ { struct objfhead objhead; long csize; if (eFread(fobj, fname, (long) sizeof(objhead), &objhead) != (long) sizeof(objhead)) { return -1; } if (objhead.objtyp != OBJTYP) return -1; /* Compute expected filesize from objectfile header. * Expected size = size of header + * size of text segment + * size of data segment + * size of symboltable + * size of relocation information. * * There is one byte of relocation info for each byte in the text * and data segments. */ csize = (long) sizeof(objhead) + 2 * (objhead.textsize + objhead.datasize) + objhead.symtsize; if (fsize != csize) { errmsg("arxx: size error on %s, expected %ld, actual %ld", fname, csize, fsize); return -1; } if (eFseek(-((long) sizeof(objhead)), fobj, fname) < 0) { return -1; } return 0; } long getfsize(fname) /* get filesize from directory */ char *fname; { struct { /* directory structure */ WORD junk[10]; char attrib; WORD date; WORD time; long size; char namext[14]; } dirinfo; long savdta; savdta = Fgetdta(); Fsetdta(&dirinfo); if (Fsfirst(fname, 0) != 0L) { errmsg("arxx: error looking for size of %s", fname); return 0L; } Fsetdta(savdta); return dirinfo.size; } int copymodule(fin, inname, fout, outname, size) /* copy size bytes */ WORD fin, fout; /* from fin to fout */ char *inname, *outname; long size; { register long count; register long n; for (count = size; count > 0; count -= (long)1024) { n = min((long)1024, count); if (eFread(fin, inname, n, buff) != n) { return -1; } if (eFwrite(fout, outname, n, buff) != n) { return -1; } } return 0; } /* * arutil.c * * support routines for arxx * * Author: Ton van Overbeek * TPC862@ESTEC.BITNET * 1986-10-05 */ #include #include "archive.h" #define TRUE 1 #define FALSE 0 int fredir(handle) /* returns TRUE if handle belongs to a diskfile */ WORD handle; { register long position; /* First we write 2 characters (space + backspace). * If output is to console a following Fseek will return 0L. * If Fseek returns a positive position, we put the pointer * back where we started and return TRUE. */ if (Fwrite(handle, 2L, " \010") != 2L) { return FALSE; } if ((position = Fseek(0L, handle, 1)) > 0L) { Fseek(-2L, handle, 1); return TRUE; } return FALSE; } errmsg(plist, arg1, arg2, arg3) /* print an errormessage on the */ char *plist, *arg1, *arg2, *arg3; /* screen */ { char buff[81]; sprintf(buff, plist, arg1, arg2, arg3); Fwrite(-1, (long) strlen(buff), buff); Fwrite(-1, 2L, "\r\n"); } /* * File routines with error check */ long eFread(handle, fname, count, buff) WORD handle; char *fname; long count; char *buff; { register long n; n = Fread(handle, count, buff); if (n < 0L) { errmsg("arxx: read error on %s", fname); } return n; } long eFwrite(handle, fname, count, buff) WORD handle; char *fname; long count; char *buff; { register long n; n = Fwrite(handle, count, buff); if (n != count) { errmsg("arxx: write error on %s", fname); } return n; } long eFseek(count, handle, fname) WORD handle; char *fname; long count; { register long n; n = Fseek(count, handle, 1); if (n < 0L) { errmsg("arxx: seek error on %s", fname); } return n; } /* * arwrtmod.c * * write command for arxx * * Author: Ton van Overbeek * TPC862@ESTEC.BITNET * 1986-10-05 */ #include #include #include "archive.h" #define STDOUT 1 extern struct armodhead modhead; /* library module header */ long eFread(); int wrtmod(flib, libname, modnames, modcount, verbose) WORD flib; int modcount, verbose; char *libname, **modnames; { WORD flag; /* library flag, should be 0xff65 */ WORD fobj; /* handle for object file */ int eolib = FALSE; /* end-of-library flag */ /* * check if only one module asked and STDOUT redirected */ if (modcount != 1) { errmsg("arxx: only 1 module allowed in arxx -w"); return -1; } if (!fredir(STDOUT)) { errmsg("arxx: output must be redirected for arxx -w"); return -1; } /* * read and check library magic word */ if (eFread(flib, libname, 2L, &flag) != 2L) return -1; if (flag != ARCHTYP) { errmsg("arxx: %s not in archive format", libname); return -1; } eolib = search(flib, libname, 0, NULL, *modnames, eolib, NOCOPY, verbose); if (eolib < 0) return -1; if (eolib) { errmsg("arxx: module %s not found", *modnames); return -1; } if (copymodule(flib, libname, STDOUT, NULL, modhead.fsize)) { return -1; } if (verbose) errmsg("w %s", *modnames); Fclose(flib); return 0; } /* * arxx.c * * library utility, replacement of ar68 * * Author: Ton van Overbeek * TPC862@ESTEC.BITNET * 1986-10-05 * */ #include #include #include "archive.h" main (argc, argv) int argc; char **argv; { register char *p; /* pointer for argument processing */ char *libname; /* library filename */ char *opmod; /* library module to insert after or */ /* before with -ra or -rb option */ char **modnames; /* array of module names to insert, */ /* extract, delete, ... */ char *tmpname = "arxx.tmp"; /* temporary workfile */ int oper; /* selected operation */ WORD flib; /* handle for library */ WORD ftmp; /* handle for workfile */ WORD ibuf[2]; /* buffer for creating empty library */ int verbose; /* TRUE if -v option specified */ int aftbef; /* after/before flag for -ra/-rb option */ int retval; /* return value from action routines */ argc--; argv++; oper = 0; aftbef = 0; while ((argc > 0) && (**argv == '-')) { argc--; p = *argv++; while (*++p != '\0') { switch(*p) { case 'T': /* list library */ case 't': oper |= LIST; break; case 'R': /* replace/insert modules */ case 'r': oper |= REPLACE; break; case 'D': /* delete modules */ case 'd': oper |= DELETE; break; case 'X': /* extract modules */ case 'x': oper |= EXTRACT; break; case 'W': /* write module to stdout */ case 'w': oper |= WRITE; break; case 'V': /* verbose flag */ case 'v': verbose = TRUE; break; case 'A': /* specify after opmodule */ case 'a': aftbef |= AFTER; if (*(p+1) != '\0') usage();/* must be followed by module name */ if (--argc == 0) usage(); /* and library name + .... */ opmod = *argv; argv++; break; case 'B': /* specify before opmodule */ case 'b': aftbef |= BEFORE; if (*(p+1) != '\0') usage();/* must be followed by module name */ if (--argc == 0) usage(); /* and library name + .... */ opmod = *argv; argv++; break; } } } if (aftbef == (AFTER|BEFORE)) usage(); if (aftbef && (oper != REPLACE)) usage(); if (argc == 0) usage(); libname = *argv; argc--; argv++; if (argc == 0) { if (oper != LIST) usage(); } modnames = argv; /* * Open library for reading, * If error and operation is replace create an empty library * and open it for reading */ if ((flib = Fopen(libname, 0)) < 0) { if (oper != REPLACE) { errmsg("arxx: cannot open library: %s", libname); exit(1); } else { if ((flib = Fcreate(libname, 0)) < 0) { errmsg("arxx: cannot create library: %s", libname); exit(1); } ibuf[0] = ARCHTYP; ibuf[1] = 0; if (Fwrite(flib, 4L, ibuf) < 0) { errmsg("arxx: write error on %s", libname); exit(1); } Fclose(flib); flib = Fopen(libname, 0); } } if ((oper == REPLACE) || (oper == DELETE)) { /* open temp file */ if ((ftmp = Fcreate(tmpname, 0)) < 0) { errmsg("arxx: cannot create %s", tmpname); exit(1); } } switch (oper) { case LIST: retval = listlib(flib, libname, verbose); break; case REPLACE: retval = replmod(flib, libname, ftmp, tmpname, modnames, argc, aftbef, opmod, verbose); break; case DELETE: retval = delmod(flib, libname, ftmp, tmpname, modnames, argc, verbose); break; case EXTRACT: retval = extrmod(flib, libname, modnames, argc, verbose); break; case WRITE: retval = wrtmod(flib, libname, modnames, argc, verbose); break; default: Fclose(flib); usage(); break; } if (retval) { Fclose(flib); Fdelete(tmpname); } exit(retval); } usage() { errmsg("usage: arxx -trdxw[v] [-ab opmod] lib mod1 mod2 .... [> file]"); exit(1); } NAME arxx - an object library maintainer, replacement for ar68 SYNOPSIS arxx -trdwx[v] [-ab opmod] lib mod1 mod2 .... [>file] DESCRIPTION With arxx you can create and maintain object libraries to be used with LINK68. It has been written as a replacement for ar68, which did not function satisfactorily. In the command specify only one of the trdwx options. With the r option only one of the ab options may be specified. For details see below. 1. Listing the contents of the library: arxx -t[v] lib [>listfile] The t option will give you a list of the names and sizes of the object modules in the library on the standard output. When the v option is specified the global symbols for each module are also listed. Global symbols in the data segment are preceded by an '*'and external global symbols (common data, C external variables) are preceded by a '%'. 2. Replacing modules in the library: arxx -r[v] lib mod1 mod2 .... modn [>listfile] The library is scanned once and the modules are replaced in the order specified on the command line. When a module is not found in the library it is added at the end. It is possible to get the same module more than once in the library by specifying the wrong order. This is also the command to create a new library. With the v option the modules copied and replaced are listed on the standard output. 3. Inserting modules in the library: arxx -r[v] -ab opmod lib mod1 mod2 .... modn [>listfile] When you want to insert modules in the library use the a (after) or b (before) option (Only one allowed). This option has to be followed by the name of the library module after or before which the new modules have to be inserted. 3. Deleting modules from the library. arxx -d[v] lib mod1 mod2 ... modn [>listfile] Deletes the modules from the library. The modules have to be specified in library order because the library is only scanned once. 4. Extracting modules from the library. arxx -x[v] lib mod1 mod2 ... modn [>listfile] The library is searched only once to extract the modules specified on the command line. The object files are created in the default directory with the same names as in the library. If you want an other name and/or directory use the w option. 5. Writing modules from the library to an other directory/file. arxx -w[v] lib mod >newfile This works the same as the x option, but only one module may be extracted. This module is written to the standard output which has to be redirected to the diskfile of your choice. REMARKS Output redirection (necessary for -w, optional for the others)) has to be performed by the command interpreter. When using arxx as a TTP application from the desktop you are out of luck. When no v option is specified arxx performs it work silently (except for the t option). With the v option all actions (copying, adding, extracting, writing, deleting modules) are listed on the standard output. [s,u] arxx.68k=gemstart,arxx,arlist,arrepl,arextr,ardel,arwrtmod, arutil, osbind,gemlib `2+*O*m#: - ЭЭм"ҍ¼.A// Bg?<JNA y:"h#:E?/ NN"/0<NBNu o AdpNu#:BNuNV0/"/ NB:d0< A3r"NB0<NBN^Nu o2/0/ HSoQBNu o0/JfBNuf SNuNVH-|4^SnX BnBn`Sn n *PX `H`n`n`n`n`~n`t=|`jnJ-ga.Snfa$ n -PX `@nJ-gaSnfa n -PX ``H |3rW h@NR MJfLJno n P -g& nfaJng ngaJnfa n -PSnX Jnf ngan-n BW/.?<=N\=@l ng ./<4gNX>N `BW/.?<N =|eBn./<?.?<@NPJl./<4NX>N >?<>NTBW/.?<=N\=@ ng nf4BW/.?<N 0.`>/.?.N\=@`>/.?.?././.?./.?.N\=@`>?././.?./.?.N=@`z>?././.?.N =@`R>?././.?.N =@`,>?<>NTaT``S@|b@0@4 PNJng >?<>NT.?<ANT>N JL N^NuNV.4N>N N^NuNV.U/</. ?.N gp`\ neg. /<5NXp`<`2./<?.?<?NP-@ްg,JoB@H.f`. /<51NXp`B@H.g.//<5HNjPJnf". ?./.N\Jlp``./</. ?.N gp`d. ?. .Ю/N\Jlp`@-nBn`./</. ?.N gp`0.|&|"l nfJgJng$0.HH@J@f.5Y/<5SNjX.g.5ZNj`*.g.5]Nj` nf .5`NjBn./<5dNjXRnJn .м䐮ĐȐ-@. ?./.N\Jlp`.5iNj`B@N^NuNV.U/</. ?.N gp`B neg. /<5lNXp`"3e:.:/</.?.NL gp`Jnf,> ?././.?./. ?.a=@`2> ?./.?././.?./. ?.ap=@Jngp`|By:.:/</.?.NL gp`H>?<>NT>?<>NT. ?<ANT. /.Bg?<VNPB@N^NuNVBn`BW n/?<=N\=@l n./<5NXp` n.a-@. n/?.a\J@g* n./<5NX>?<>NTp`H>Bg?. n//.?./. ?.a =@Jnlp`JngJ n./<CN/X.CN/R@=@` |C2nBRn n m3C#C.C/</.?.NL gp`./.?. n/?.a J@gp`^Jng.C/<5NjXSnXJnnl>Bg?./<5/.?./. ?.aJ@lp`B@N^NuNVBn> ?.?././.?./. ?.a=@Jnlp``bBW n/?<=N\=@l n./<5NXp`h n.a-@. n/?.a\J@g* n./<5NX>?<>NTp` n./<CN/X.CN/R@=@` |C2nBRn n m#C3C.C/</.?.NL gp`./.?. n/?.a. J@gp`nJn g$.C nf/<5`/<5NjXSnXJnn> Bg?./<6/.?./. ?.aJ@lp`B@N^NuNVJng0.`Bn`z.C/</. ?.N -@gJoB@H9Cfp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nGVfJL8N^NuNVN$>NN^NuNVHBG`0м8.NVRG|mJLN^NuNVH*n0-|g*.N>-g .N'>B@H+@+@Bm m>NJL N^NuNVH>.>N,@*@ f3 93:9p`NBF0|f>?<>N1T<l|>N+>N+JFf0``393:9pJL N^NuNVN^NuNVH*n0-| |f, -<o >/-?N*\>Gg mp`J-gJg-g;| `;| `>0- D@H/?N \Bm +mB@JL N^NuNVHN+J>|fp`>N+08*@C$Jn fUJnfU.3/.N0XJ@fU;n 0``.3/.N0XJ@fU0`h> ?</.?N.,PJ@g>N+393:9p`0U>B-H?N \BWB-H?N \0JL N^NuNVBW?. /.a\N^NuNVBW?. /.a\N^NuNV>?. /.a\N^NuNVH>N,@*@ f3 93:9p`$>?-/. ?<BN1P+@U -JL N^NuNV>B?.a\N^NuNVHK;| .+@+@;|:./. / NP>.BgN#T0JL N^NuNVH*nBnJ gh``BE-n `RRE nJg n %fJEo.?/. N#0\-n n n %@R DfBn n H|-@R Df n R Rn| <0fG n R =|<*f-M n=PT n R `8`*JnlBnH2. A|=@ n R <0m<9o|<.f BF n R <*f-M n<T n R `*`H2 A<| n R <0m<9oBn<lg<LfRn n R A-HH` RnJng <)>` <)#C.C?<?< // N( Jngp`pH`RnJng <)>` <)#C.CBg?< // N( Jngp`pH`zRnJng <)>` <)#C.CBg?<// N( Jngp`pH`&RnJng <)>` <)#C.CBg?<// N( Jngp`pH`-M n-PX`-M n0|@B.T`H>?// N" X|`~H>?// N"v X|`XH>?// N" X|`4.H?N#TRn``|C|5b@0@8 PN.N/:ElJFm:0.E=@JnfX .0f* n -f SE. nH?N#TRRn`..H?N#TRn0.SnJ@n.?/.N#0\n`..H?N#TRn0.SnJ@n`0.JL N^NuNVJnlp`0.=@ n -@>/. /.NPN^NuNVJnlp`0.=@ n -@>/. /.NPN^NuNV>/. /.a~P-@. N/2.^AAo>/. /.aP-@ .N^NuNVH *n>. (n,g$Bl >/ ?N*\Gg lp`*B@`&`.H?N#T|fp` 0SGJ@fB@JL0N^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n(n >.B@=@=@``Rnnc L2n  fB@0.ncf>?.B@0.W B2.Ё//-/ N1v=@B0.ѭJnf393:9p`^=n`8Rn>?</<9/-/ N1v=@B0.ѭnb4 -o+mB@0.JL0N^NuNVH*n>?./. /-/ N1v=@Jnf393:9p` B0.ѭ -o+mB@0.JL N^NuNVH*n 0.8мC$-@~0.`BW/ ?<o n1GBG`BW/ ?<NN1\JfB@`0<>`h>ON1JfB@`0<>`N>/ ?<=N1\>o n1GBG`,.?<AN1T>``||b@0@9 PN0JL8N^NuNVH *n (n`RJff .JL0N^NuNVH *n(n `op`lp`JgJfHHAJL0N^NuNVH *n (n`RR0.SnJ@ofRn`B0.SnJ@f .JL0N^NuNVH *n (nf .JL0N^NuNVH *n(M`RJf HJL0N^NuNVN^NuNVH *n(n `$H>a0H>a&op`lp` JfJfB@JL0N^NuNVH>.|am |zn|0JLN^Nu _B0Z"y:CCbNC NNVH..,. Jf#:v <`Hc #:vB`:fzB`(xe 〼b`BJge`#:v JLN^NuJg .NuNV n=h.0n/0n/N1P/?.?<?N1PN^NuNV n=h.0n/0n/N1P/?.?<@N1PN^Nu#CNA/9CNuNVBBJlDRBJ lD RB0. -@0.2. An=@ .gDN^Nu Stack Overflow$C runtimeCON:LST:ABDRTVWXabdrtvwxtLB8j`VtLB8j`VzJJJJJJJJJJJ$arxx.tmparxx: cannot open library: %sarxx: cannot create library: %sarxx: write error on %sarxx: cannot create %susage: arxx -trdxw[v] [-ab opmod] lib mod1 mod2 .... [> file]arxx: %s not in archive formatarxx: read error on %s%-12s %6ld %19s * %%%-8s arxx: %s not in archive formatarxx: cannot open %sarxx: %s not an object filer %s arxx: cannot open %sarxx: %s not an object filea %s b %s c %s arxx: size error on %s, expected %ld, actual %ldarxx: error looking for size of %sarxx: %s not in archive formatarxx: module %s not foundarxx: cannot create %sx %s arxx: %s not in library formatarxx: module %s not foundd %s arxx: only 1 module allowed in arxx -warxx: output must be redirected for arxx -warxx: %s not in archive formatarxx: module %s not foundw %s  arxx: read error on %sarxx: write error on %sarxx: seek error on %s"': unmatched quote: No match\:Stack Overflow $    !!.!R!v!v!v!v!v!v!v 2!v!v!v !v!v!v !v!v!v!v!v!v!v!v!v!v !!.!R!v!v!v!v!v!v!v 6!v!v!v !v!v!v 99 ...v.....T!!!!"CP/M-68K(tm), Version 1.2, Copyright (c) 1983, Digital Research XXXX-0000-6543216$ Rƌ  & & 40(&  &(,&,,6PB&& &:TH":J"F" 20".("  &,(  "4$00  "  D$:(    & : 0HN&  "jj`^***`&$ D"R$ZF \@(B4.J".86 Jp $""@2&"fH" (<@* " . G aH.. G aCC C Ha ISCC DOCLa ^^GETOPT C Oa dSYSERR C Ra f/* * cc - Compile C programs * * cc [options] ... file ... * * Cc runs the various passes of the C compiler, followed by the assembler * and the linker and relmod to produce an executable image. * * Cc accepts various types of `file' arguements. Files with a `.c' * extension are compiled and assembled to produce object files with the * `.o' extension. Files with `.s' extensions are assembled to produce * object files with `.o' extensions. File with `.o' extensions are * included in the list of files to be linked, in the position in which * they occur in the list of files. File names with no extension, or * extensions other than `.c', `.s' or `.o' are treated like files with * `.o' extensions. Then all the files are linked with the default * startup file START and the default libraries LIBS. The result is run * thru relmod to produce the executable image. The default name of the * executable image is NAME. * * The default actions of Cc may be modified by specifying one or more of * the following options that are interpreted by Cc. * * -c Compile the file only. Don't run linker or relmod. * If the file name has a `.s' extension, then run the * assembler only. If the file name has a `.c' extension * then run the C compiler and assembler. If the file * name has any other extension, or no extension, ignore it. * * -w Supress warnings from C compiler. * * -e Run the macro preprocessor only, sending the result to stdout. * * -p If present, specifies that the file and line number information * that is normally included in the preprocessed output is to * be omitted. * * -dname=def * -dname Define the name to the macro preprocessor, as if by * `#define'. If no defintion is given, the name is defined * as `1'. *Warning* the preprocessor converts `name' and * `def' to uppercase. * * -i d: Allows using a different drive for the files in a * `#include ' statement. *Warning* Files in an * include statement within double quotes are unaffected by * this option. * * -s Compile the `.c' files and leave the output assembler * files in corresponding files with `.s' suffixes. File * names with extensions other than `.s' are ignored. The * assembly, linker and relmod stages not run. * * -f d: Specifies the drive the assembler is to use for temporary * files. * * -llib Use the library `lib' in addition to the default libraries * LIBS. Multiple -l options may be used. * * -o name Name the output file name instead of the default NAME. * If name has no file name extention is specified, * `.prg' is used. * * -n Show what actions will be performed if Cc were to be * run. No execution is performed (Like "make -n" ). * * * NOTES: * * All the options that take an additional arguement, allow an optional * blank to be specified between the option and the arguement. * * DEFAULTS: * * The following are defaults compiled into Cc. One or more of the * defaults may be changed, by editing and re-compiling cc.c. * * Symbol Value Meaning * SILENT Defined Echo command to console before executing. * Undefined Work Silently. * * DEBUG Defined Echo command to console, but do not * execute command (like -n option). * * WAIT Defined Wait for RETURN to be hit at the console * before exiting Cc. Typically used when Cc * is run from the desktop. * Undefined Do not wait before exiting Cc. * * LINKW Defined Wait for disk change between compile and * link. Typically defined when using single * sided drives where the C compiler and * assemblet are on one disk, and the linker * and relmod are on a separate disk. * Undefined Do not wait between compile or assembly * and linking statges. * * DEF_DRIVE "a:" Default drive on which the Ccompiler, * Assembler, linker, relmod and the * libraries reside. * * * PRE_PROC "cp68.prg" Name of the Macro Preprocessor. * * PRE_FLAGS "" Default Preprocessor flags. String must * end in a blank if it is not NULL. * * PASS1 "c068.prg" Name of Pass 1 of the C compiler. * * PASS1_FLAGS " -f" Default flags to Pass 1. Note the blank * before -f. * * PASS2 "c168.prg" Name of Pass 2 of the C compiler. * * PASS2_FLAGS "" Defalt flags to Oass 2. Must begin with * blank if not NULL. * * ASM "as68.prg" Name of the assembler. * * ASM_FLAGS "-l -u -s a: " Default flags to the assembler. Must end * in an blank. * * LINK "link68.prg" Name of the Linker. * * LINK_FLAGS "u" Default flags to the Linker. The list of * flags is comma separated. * * RELMOD "relmod.prg" Name of the Relocater. * * RELMOD_FLAGS "" Default flags to the relocator. * * START "gemstart" Default startup file. * * LIBS "gemlib" List of libraries linked by default * (comma separated). * * NAME "a.prg" Name of output if '-o name' is not specified. * * KNAME "a" NAME without the extension. * * NAME_EXT ".prg" The extension to use if a '-o name' was * specified but `name' did not have * an extension. * * COMPILING CC * * Sources required: cc.c, getopt.c and syserr.c. * Include files: osbind.h * * Cc may be linked as follows (assuming compiler etc on drive a:) * a:link68.prg [u] cc.68k=a:gemstart,cc.o,getopt.o,syserr.o,a:osbind.o,a:gemlib * * or Cc could be used as follows (assuming compiler etc on drive a:) * cc -o cc -i a: -f d: cc.c getopt.c syserr.c a:osbind.o * * A word about gemstart: * Gemstart as supplied by Atari does not have enough stack and * heap space for anything other than trivial programs. Edit gemstart.s * the constant $500, to a value such as $4000 that will give Cc about * 16K of stack+heap space. Then reassemble gemstart before linking Cc. * Note that Cc will not run if linked with gems.o. * */ #include /* general definitions */ #define EOF ((int) -1) #define TRUE ('\001') #define FALSE ('\0') #define NULL (0) #define VOID /* */ #define CRLF "\015\012" /* #define SILENT 1 */ /* Show command before executing if defined */ /* #define DEBUG 1 */ /* While Debugging */ /* #define WAIT 1 */ /* define if wait for ret at end of cc */ /* Typically for use from Desktop */ #define LINKW 1 /* define if wait for disk change between */ /* compile and link */ #define DEF_DRIVE "a:" /* Default drive on which the Ccompiler is found*/ /* drive on which the assembler is found */ /* drive on which the linker is found */ /* drive on which Relmod is found */ /* drive on which the libraries are found */ /* default passes and flags */ #define PRE_PROC "cp68.prg" #define PRE_FLAGS "" /* Must end with a blank if any flags */ #define PASS1 "c068.prg" #define PASS1_FLAGS " -f" /* Note the blank before -f */ #define PASS2 "c168.prg" #define PASS2_FLAGS "" /* Must begin with blank if any flags */ #define ASM "as68.prg" #define ASM_FLAGS "-l -u -s a: " /* Must end in an blank */ #define LINK "link68.prg" #define LINK_FLAGS "u" #define RELMOD "relmod.prg" #define RELMOD_FLAGS "" /* default names and libraries */ #define START "gemstart" #define LIBS "gemlib" #define KNAME "a" #define NAME "a.prg" #define NAME_EXT ".prg" typedef char BOOLEAN; /* Flags */ BOOLEAN c_flag = FALSE; BOOLEAN s_flag = FALSE; BOOLEAN e_flag = FALSE; BOOLEAN p_flag = FALSE; #ifdef DEBUG BOOLEAN n_flag = TRUE; BOOLEAN do_flag = FALSE; #else #ifndef SILENT BOOLEAN n_flag = TRUE; #else BOOLEAN n_flag = FALSE; #endif BOOLEAN do_flag = TRUE; #endif /* globals */ long status = 0L; /* Status accumulator */ char *pre_flags = (char *)NULL; /* List of flags to the preprocessor */ char *pass1_flags = (char *)NULL; /* List of flags to the pass1 C comp */ char *asm_flags = (char *)NULL; /* List of flags to the assembler */ char *output = (char *)NULL; /* Name of executable output */ char *k_output = (char *)NULL; /* Name of .68K intermed. file */ char *link_files = (char *)NULL; /* List of .o files to be linked */ char *libes = (char *)NULL; /* List of libraries to use */ char cmd[258]; /* cmd[0] = len of command tail cmd[1..] = command tail max len 256. + a byte for NULL */ char *cmd_ptr = &cmd[1]; char *ret_msg = "Hit RETURN to continue ......"; /* General Message */ /* external functions */ extern VOID sys_error(); /* * Initialize everything */ VOID init() { extern char *expand(); pre_flags = expand(pre_flags,PRE_FLAGS); pass1_flags = expand(pass1_flags,PASS1_FLAGS); asm_flags = expand(asm_flags,ASM_FLAGS); output = expand(output,NAME); k_output = expand(k_output,KNAME); libes = expand(libes,DEF_DRIVE); libes = expand(libes,LIBS); } /* * Add to string `string' the additional string `add', reallocating storage. * Returns pointer to resultant string. Exits after message on error. */ char *expand(string,add) register char *string; register char *add; { extern char *malloc(), *realloc(), *strcpy(), *strcat(); extern int strlen(); if(add == (char *)NULL) /* We have nothing to do */ return(string); if(string == (char *)NULL) { /* just alloc storage, copy and return */ if((string = malloc(strlen(add)+1)) == (char *)NULL) /* out of mem */ #ifdef DEBUG error(0,"expand"); #else error(0); #endif strcpy(string,add); return(string); } else { register int tlen; tlen = strlen(string) + strlen(add) + 1; if(tlen > 256) /* we can't do it */ #ifdef DEBUG error(1,"expand"); #else error(1); #endif if((string = realloc(string,tlen)) == (char *)NULL) /* out of mem */ #ifdef DEBUG error(0,"expand"); #else error(0); #endif strcat(string,add); return(string); } } #define DOT_C 0 #define DOT_O 1 #define DOT_S 2 #define DOT_X 3 /* Dont care, treat as .o */ /* * Ext_type - the extention type of a file name */ int ext_type(filename) char *filename; { extern char *rindex(); extern int strlen(); register char *p; if((p = rindex(filename,'.')) == (char *)NULL) /* no extention */ return(DOT_X); p++; if(strlen(p) > 1) /* something more than .X */ return(DOT_X); switch(*p) { case 'c': case 'C': return(DOT_C); case 's': case 'S': return(DOT_S); case 'o': case 'O': return(DOT_O); default: return(DOT_X); } } char *basename(file) /* Return the base name of a file name ie. everything but the .ext */ char *file; { register char *b, *end; register int len; extern char *malloc(), *rindex(), *strncpy(); extern int strlen(); if((end = rindex(file,'.')) == (char *)NULL) len = strlen(file); else len = (int) ( (long)end - (long)file ); if((b = malloc(len+1)) == (char *)NULL) /* out of memory */ #ifdef DEBUG error(0,"basename"); #else error(0); #endif strncpy(b,file,len); b[len] = '\0'; return(b); } VOID usage() { Cconws("Usage: cc [-c][-e][-w][-p][-s][-i d:][-dsymbol[=name]][-f d:]\r\n"); Cconws(" [-l library][-o name[.ext]] files .....\r\n"); #ifdef WAIT wait_msg(ret_msg); #endif exit(1); } main(argc, argv) int argc; char *argv[]; { register int c; register char *file, *base; extern int optind, getopt(), ext_type(); extern char *optarg, *expand(), *rindex(), *basename(); if(argc < 2) /* nothing to do */ exit(0); init(); while ((c = getopt(argc,argv, "CEPSWNcepswnD:I:F:L:O:d:i:f:l:o:")) != EOF) switch (c) { case 'n': case 'N': do_flag = FALSE; n_flag = TRUE; break; case 'C': case 'c': /* compile only (compile and assemble) */ c_flag = TRUE; break; case 'e': case 'E': /* pre processor only, sending output to stdout */ if(e_flag == TRUE) break; /* Already Specified */ e_flag = TRUE; pre_flags = expand(pre_flags, "-e "); break; case 's': case 'S': /* produce .s file (compiler only) */ s_flag = TRUE; break; case 'p': case 'P': /* dont include file names and line #'s */ if(p_flag == TRUE) break; /* Already specified */ p_flag = TRUE; pre_flags = expand(pre_flags, "-p "); break; case 'd': case 'D': pre_flags = expand(pre_flags, "-d"); pre_flags = expand(pre_flags, optarg); pre_flags = expand(pre_flags, " "); break; case 'w': case 'W': pass1_flags = expand(pass1_flags, " -w"); break; case 'i': case 'I': pre_flags = expand(pre_flags, "-i "); pre_flags = expand(pre_flags, optarg); if(rindex(optarg, ':') == (char *)NULL) /* Ok he forgot, we will add it for him */ pre_flags = expand(pre_flags, ":"); pre_flags = expand(pre_flags, " "); break; case 'l': case 'L': libes = expand(libes, ","); libes = expand(libes, optarg); break; case 'f': case 'F': asm_flags = expand(asm_flags, "-f "); asm_flags = expand(asm_flags, optarg); if(rindex(optarg, ':') == (char *)NULL) /* Ok he forgot, we will add it for him */ asm_flags = expand(asm_flags, ":"); asm_flags = expand(asm_flags, " "); break; case 'o': case 'O': { register char *p; /* name of output file */ free(k_output); free(output); k_output = (char *)NULL; output = (char *)NULL; p = basename(optarg); k_output = expand(k_output,p); free(p); output = expand(output,optarg); if(rindex(optarg,'.') == (char *)NULL) /* No extention */ output = expand(output,NAME_EXT); } break; case '?': default: usage(); break; } /* Switch and While */ if((e_flag == FALSE) && (s_flag == FALSE) && (c_flag == FALSE)) { link_files = expand(link_files,DEF_DRIVE); link_files = expand(link_files,START); } if(optind >= argc) { /* Nothing to do */ #ifdef WAIT wait_msg(ret_msg); #endif exit(0); } for (; optind < argc; optind++) { file = argv[optind]; base = basename(file); switch(ext_type(file)) { case DOT_C: /* A .c file */ if(e_flag == TRUE) pre_process(file,base); else { c_compile(file,base); if(s_flag == FALSE) /* assemble and remove .s file */ assemble(base, TRUE); } break; case DOT_S: if(s_flag == TRUE) break; /* assemble, do not remove .s file */ assemble(base,FALSE); break; case DOT_X: if(e_flag == TRUE) pre_process(file,base); break; case DOT_O: default: break; } /* switch */ if((s_flag == FALSE) && (e_flag == FALSE) && (c_flag == FALSE)) { link_files = expand(link_files,","); link_files = expand(link_files,base); link_files = expand(link_files,".o"); } free(base); } /* for */ /* Free up memory not needed */ if(pre_flags != (char *)NULL) free(pre_flags); if(asm_flags != (char *)NULL) free(asm_flags); if((s_flag == FALSE) && (e_flag == FALSE) && (c_flag == FALSE)) { link_files = expand(link_files,","); link_files = expand(link_files,libes); if(libes != (char *)NULL) free(libes); #ifdef LINKW wait_msg("Insert Linker Disk and hit RETURN ....."); #endif rel_link(); } #ifdef WAIT wait_msg(ret_msg); #endif exit((status == 0L)? 0 : 1); /* Cumulative status for all we have (not)done */ } VOID pre_process(file,base) /* Run the C preprocessor */ char *file; char *base; { extern long do_exec(); extern char *expand(), *strcpy(), *strcat(); register char *command; command = expand((char *)NULL,DEF_DRIVE); command = expand(command,PRE_PROC); strcpy(cmd_ptr,(pre_flags != (char *)NULL)? pre_flags : ""); strcat(cmd_ptr,file); strcat(cmd_ptr," "); strcat(cmd_ptr,base); strcat(cmd_ptr,".i"); if((status = do_exec(command,cmd)) != 0L) { rm_if_exist(base,".i"); sys_error(status); #ifdef WAIT wait_msg(ret_msg); #endif exit(1); } if(e_flag == TRUE) rm_if_exist(base,".i"); free(command); } VOID c_compile(file,base) /* Run the C Compiler */ char *file; char *base; { extern long do_exec(); extern char *expand(), *strcpy(), *strcat(); register char *command; pre_process(file,base); command = expand((char *)NULL,DEF_DRIVE); command = expand(command,PASS1); strcpy(cmd_ptr,base); strcat(cmd_ptr,".i "); strcat(cmd_ptr,base); strcat(cmd_ptr,".1 "); strcat(cmd_ptr,base); strcat(cmd_ptr,".2 "); strcat(cmd_ptr,base); strcat(cmd_ptr,".3"); strcat(cmd_ptr,pass1_flags); if((status = do_exec(command,cmd)) != 0L) { rm_if_exist(base,".i"); rm_if_exist(base,".1"); rm_if_exist(base,".2"); rm_if_exist(base,".3"); sys_error(status); #ifdef WAIT wait_msg(ret_msg); #endif exit(1); } rm_if_exist(base,".i"); free(command); command = expand((char *)NULL,DEF_DRIVE); command = expand(command,PASS2); strcpy(cmd_ptr,base); strcat(cmd_ptr,".1 "); strcat(cmd_ptr,base); strcat(cmd_ptr,".2 "); strcat(cmd_ptr,base); strcat(cmd_ptr,".s"); strcat(cmd_ptr,PASS2_FLAGS); status = do_exec(command,cmd); rm_if_exist(base,".1"); rm_if_exist(base,".2"); if(status != 0L) { rm_if_exist(base,".s"); sys_error(status); #ifdef WAIT wait_msg(ret_msg); #endif exit(1); } free(command); } VOID rel_link() /* Run the linker and relmod */ { extern long do_exec(); extern char *expand(), *strcpy(), *strcat(); register char *command; command = expand((char *)NULL,DEF_DRIVE); command = expand(command,LINK); strcpy(cmd_ptr,"["); strcat(cmd_ptr,LINK_FLAGS); strcat(cmd_ptr,"] "); strcat(cmd_ptr,k_output); strcat(cmd_ptr,".68k"); strcat(cmd_ptr,"="); strcat(cmd_ptr,link_files); free(link_files); if((status = do_exec(command,cmd)) != 0L) { rm_if_exist(k_output,".68k"); sys_error(status); #ifdef WAIT wait_msg(ret_msg); #endif exit(1); } free(command); command = expand((char *)NULL,DEF_DRIVE); command = expand(command,RELMOD); strcpy(cmd_ptr,RELMOD_FLAGS); strcat(cmd_ptr,k_output); status = do_exec(command,cmd); rm_if_exist(k_output,".68k"); if(status != 0L) { rm_if_exist(output,""); sys_error(status); #ifdef WAIT wait_msg(ret_msg); #endif exit(1); } free(command); } VOID assemble(base,del_s) /* Assemble a file, delete .s if del_s TRUE */ char *base; BOOLEAN del_s; { extern long do_exec(); extern char *expand(), *strcpy(), *strcat(); register char *command; command = expand((char *)NULL,DEF_DRIVE); command = expand(command,ASM); strcpy(cmd_ptr,asm_flags); strcat(cmd_ptr,base); strcat(cmd_ptr,".s"); status = do_exec(command,cmd); if(del_s == TRUE) rm_if_exist(base,".s"); if(status != 0L) { sys_error(status); #ifdef WAIT wait_msg(ret_msg); #endif exit(1); } free(command); } VOID rm_if_exist(file,ext) /* remove a file is it exists */ char *file; char *ext; { register char *name; extern char *malloc(), *strcpy(), *strcat(); extern int strlen(); if((name = malloc(strlen(name) + strlen(ext) + 1)) == (char *)NULL) { /* Out of mem */ #ifdef DEBUG error(0,"rm_if_exist"); #else error(0); #endif } strcpy(name,file); strcat(name,ext); if(n_flag == TRUE) { Cconws("Deleting "); Cconws(name); Cconws(CRLF); } #ifndef DEBUG Fdelete(name); /* disregard error */ #endif free(name); } static char *my_err[] = { "Out of Memory", "Cannot handle strings longer than 256 internally" }; #ifdef DEBUG VOID error(n,func) int n; char *func; #else VOID error(n) int n; #endif { Cconws("CC: "); Cconws(my_err[n]); #ifdef DEBUG Cconws(" in Function "); Cconws(func); #endif Cconws(CRLF); #ifdef WAIT wait_msg(ret_msg); #endif exit(1); } long do_exec(command,tail) /* execute a command */ char *command; char *tail; { register unsigned int len; register char *p; extern int strlen(); /* the format of the command tail is * tail[0] = len of tail. * tail[1..len] = * tail[len+1] = '\0' */ p = tail + (long)sizeof(char); if((len = strlen(p)) > 255) { #ifdef DEBUG error(1,"do_exec"); #else error(1); #endif } *tail = (char)len; if(n_flag == TRUE) { Cconws(command); Cconws(" "); Cconws(p); Cconws(CRLF); } if(do_flag == TRUE) return(Pexec(0,command,tail,(char *)NULL)); else return(0L); } VOID wait_msg(msg) /* Wait for RETURN after displaying message */ char *msg; { register int c; Cconws(msg); while((c = Cnecin()) != '\r' && (c != '\n')); Cconws(CRLF); /* Echo CRLF */ } cc - Compile C programs cc [options] ... file ... Cc runs the various passes of the C compiler, followed by the assembler and the linker and relmod to produce an executable image. Cc accepts various types of `file' arguements. Files with a `.c' extension are compiled and assembled to produce object files with the `.o' extension. Files with `.s' extensions are assembled to produce object files with `.o' extensions. File with `.o' extensions are included in the list of files to be linked, in the position in which they occur in the list of files. File names with no extension, or extensions other than `.c', `.s' or `.o' are treated like files with `.o' extensions. Then all the files are linked with the default startup file START and the default libraries LIBS. The result is run thru relmod to produce the executable image. The default name of the executable image is NAME. The default actions of Cc may be modified by specifying one or more of the following options that are interpreted by Cc. -c Compile the file only. Don't run linker or relmod. If the file name has a `.s' extension, then run the assembler only. If the file name has a `.c' extension then run the C compiler and assembler. If the file name has any other extension, or no extension, ignore it. -w Supress warnings from C compiler. -e Run the macro preprocessor only, sending the result to stdout. -p If present, specifies that the file and line number information that is normally included in the preprocessed output is to be omitted. -dname=def -dname Define the name to the macro preprocessor, as if by `#define'. If no defintion is given, the name is defined as `1'. *Warning* the preprocessor converts `name' and `def' to uppercase. -i d: Allows using a different drive for the files in a `#include ' statement. *Warning* Files in an include statement within double quotes are unaffected by this option. -s Compile the `.c' files and leave the output assembler files in corresponding files with `.s' suffixes. File names with extensions other than `.s' are ignored. The assembly, linker and relmod stages are not run. -f d: Specifies the drive the assembler is to use for temporary files. -llib Use the library `lib' in addition to the default libraries LIBS. Multiple -l options may be used. -o name Name the output file name instead of the default NAME. If name has no file name extention specified, `.prg' is used. -n Show what actions will be performed if Cc were to be run. No execution is performed (Like "make -n" ). NOTES: All the options that take an additional arguement, allow an optional blank to be specified between the option and the arguement. DEFAULTS: The following are defaults compiled into Cc. One or more of the defaults may be changed, by editing and re-compiling cc.c. Symbol Value Meaning SILENT Defined Echo command to console before executing. Undefined Work Silently. DEBUG Defined Echo command to console, but do not execute command (like -n option). WAIT Defined Wait for RETURN to be hit at the console before exiting Cc. Typically used when Cc is run from the desktop. Undefined Do not wait before exiting Cc. LINKW Defined Wait for disk change between compile and link. Typically defined when using single sided drives where the C compiler and assembler are on one disk, and the linker and relmod are on a separate disk. Undefined Do not wait between compile or assembly and linking statges. DEF_DRIVE "a:" Default drive on which the Ccompiler, Assembler, linker, relmod and the libraries reside. PRE_PROC "cp68.prg" Name of the Macro Preprocessor. PRE_FLAGS "" Default Preprocessor flags. String must end in a blank if it is not NULL. PASS1 "c068.prg" Name of Pass 1 of the C compiler. PASS1_FLAGS " -f" Default flags to Pass 1. Note the blank before -f. PASS2 "c168.prg" Name of Pass 2 of the C compiler. PASS2_FLAGS "" Default flags to Oass 2. Must begin with blank if not NULL. ASM "as68.prg" Name of the assembler. ASM_FLAGS "-l -u -s a: " Default flags to the assembler. Must end in an blank. LINK "link68.prg" Name of the Linker. LINK_FLAGS "u" Default flags to the Linker. The list of flags is comma separated. RELMOD "relmod.prg" Name of the Relocater. RELMOD_FLAGS "" Default flags to the relocator. START "gemstart" Default startup file. LIBS "gemlib" List of libraries linked by default (comma separated). NAME "a.prg" Name of output if '-o name' is not specified. KNAME "a" NAME without the extension. NAME_EXT ".prg" The extension to use if a '-o name' was specified but `name' did not have an extension. COMPILING CC Sources required: cc.c, getopt.c and syserr.c. Include files: osbind.h Cc may be linked as follows (assuming compiler etc on drive a:) a:link68.prg [u] cc.68k=a:gemstart,cc.o,getopt.o,syserr.o,a:osbind.o,a:gemlib or Cc could be used as follows (assuming compiler etc on drive a:) cc -o cc -i a: -f d: cc.c getopt.c syserr.c a:osbind.o A word about gemstart: Gemstart as supplied by Atari does not have enough stack and heap space for anything other than trivial programs. Edit gemstart.s and change the constant $500, to a value such as $4000, that will give Cc about 16K of stack+heap space. Then reassemble gemstart before linking Cc. Cc will not work if linked with gems.o. /* got this off net.sources */ /* see getopt.doc for origonal author */ /* Ported to the 520ST - bammi@case */ #include #define CRLF "\015\012" #define EOF ((int)-1) #define NULL (0) /* * get option letter from argument vector */ int opterr = 1, /* useless, never set or used */ optind = 1, /* index into parent argv vector */ optopt; /* character checked for validity */ char *optarg; /* argument associated with option */ #define BADCH (int)'?' #define EMSG "" #define tell(s) Cconws((char *)*nargv);Cconws((char *)s); \ Cconout((int)optopt);Cconws(CRLF);return(BADCH); int getopt(nargc,nargv,ostr) int nargc; char **nargv, *ostr; { static char *place = EMSG; /* option letter processing */ register char *oli; /* option letter list index */ extern char *index(); if(!*place) { /* update scanning pointer */ if(optind >= nargc || *(place = nargv[optind]) != '-' || !*++place) return(EOF); if (*place == '-') { /* found "--" */ ++optind; return(EOF); } } /* option letter okay? */ if ((optopt = (int)*place++) == (int)':' || !(oli = index(ostr,optopt))) { if(!*place) ++optind; tell(": illegal option -- "); } if (*++oli != ':') { /* don't need argument */ optarg = (char *)NULL; if (!*place) ++optind; } else { /* need an argument */ if (*place) optarg = place; /* no white space */ else if (nargc <= ++optind) { /* no arg */ place = EMSG; tell(": option requires an argument -- "); } else optarg = nargv[optind]; /* white space */ place = EMSG; ++optind; } return(optopt); /* dump back option letter */ } #include #define CRLF "\015\012" #define VOID /* */ #define NULL (0) static char *sy_err_list[] = { /* 0L */ "OK, no error", /* -1L */ "basic, fundamental error", /* -2L */ "drive not ready", /* -3L */ "unknown command", /* -4L */ "CRC error", /* -5L */ "bad request", /* -6L */ "seek error", /* -7L */ "unknown media", /* -8L */ "sector not found", /* -9L */ "no paper", /* -10L */ "write fault", /* -11L */ "read fault", /* -12L */ "general error", /* -13L */ "write protect", /* -14L */ "media change", /* -15L */ "unknown device", /* -16L */ "bad sectors on format", /* -17L */ "insert other disk", /* BDOS level errors */ /* -32L */ "invalid function number", /* -33L */ "file not found", /* -34L */ "path not found", /* -35L */ "too many open files (no handles left)", /* -36L */ "access denied", /* -37L */ "invalid handle", /* -39L */ "insufficient memory", /* -40L */ "invalid memory block address", /* -46L */ "invalid drive was specified", /* -49L */ "no more files", /* Atari's own inventions */ /* -64L */ "range error", /* -65L */ "internal error", /* -66L */ "invalid program load format", /* -67L */ "setblock failure due to growth restrictions" }; static char *unknown = "Unknown System Error"; VOID sys_error(n) long n; { register char *p; if(n > 0) p = unknown; else { n = -n; if((n >= 0) && (n < 18)) p = sy_err_list[n]; /* 0 <= n < 18 */ else if((n >=18) && (n < 32)) p = unknown; else if((n >= 32) && (n < 50)) p = sy_err_list[n - 14]; /* 32 <= n < 50 */ else if((n > 49) && (n < 64)) p = unknown; else if((n >= 64) && (n < 68)) p = sy_err_list[n - 36]; /* 64 <= n < 68 */ else p = unknown; } /* Phew ! */ Cconws("System Error: "); Cconws(p); Cconws(CRLF); } . U ah.. U aCLOCK C Va i=DEMO C Ya k!STCLOCK DOC]a t FINAL STATUS = Transfer successful. ACTION> (Next, Down, Xm, List) n Name: DEGAS ROBOT PIC (LOST IN SPACE) Type: DATA Date: 30-JAN-1986 20:00 by ANALOG2 Size: 28937 This SQueezed DEGAS low-res picture of the ROBOT from LOST-IN-SPACE was drawn by Tom Hudson for ANALOG Computing magazine. Unsqueeze this file with STUSQ to generate the entire 32K file ROBOT.PI1. Keywords: OTHER, DEGAS, LOW-RES, SQUEEZED ACTION> (Next, Down, Xm, List) n Name: 1ST WORD STAR SG-10 Type: TEXT Date: 27-JAN-1986 02:55 by RESORTER These are files to set up the Star SG-10 printer to get proper screen dumps and function with 1st Word. Keywords: HINTS, 1ST WORD SG-10, PRINTER DRIVER Contents: 1 1ST SG-10 (Size: 3107) 2 1STSG-10.HEX (Size: 6225) ACTION> (Next, Down, Xm, List) n Name: SIEVE.PRG Type: PROGRAM Date: 20-JAN-1986 00:59 by DCHIQUELIN Size: 18225 This is the Sieve of Eratosthenes written in OSS Personal Pascal and compiled. It uses GEM, and will do a user selectable number of iterations. Time is 6 seconds for 10 iterations. Keywords: OTHER, SIEVE OF ERATOSTHENES, BENCHMARK, PASCAL, COMPILED ACTION> (Next, Down, Xm, List) n Name: RAMDISK DESK ACCESSORY Type: PROGRAM Date: 12-JAN-1986 16:40 by RANDYH Size: 1755 This program implements a 360K ramdisk for owners of systems with one megabyte of RAM. To create the RAMDISK, open up either A or B floppy and use the INSTALL DISK DRIVE command and use D for device letter and call the device name RAMDISK. After creating, SAVE YOUR DESKTOP and reboot. During the boot the RAMDISK copies all of a: up to D:, freeing A: up for use. Keywords: OTHER, RAMDISK, ONE MEGABYTE, UTILITY ACTION> (Next, Down, Xm, List) ^Z ST series Menu: Directory Search /*********************************************************************/ /* CLOCK ACCESSORY */ /* by: R. Ritter September 1985 */ /*********************************************************************/ /*********************************************************************/ /* INCLUDE FILES */ /*********************************************************************/ #include "obdefs.h" #include "define.h" #include "gemdefs.h" #include "osbind.h" /*********************************************************************/ /* DEFINES */ /*********************************************************************/ #define WI_KIND (MOVER|CLOSER|NAME) #define NO_WINDOW (-1) /*********************************************************************/ /* EXTERNALS */ /*********************************************************************/ extern int gl_apid; extern float sin(), cos(); extern long trap14(); extern unsigned trap1(); /*********************************************************************/ /* GLOBAL VARIABLES */ /*********************************************************************/ int gl_hchar; int gl_wchar; int gl_wbox; int gl_hbox; /* system sizes */ int analog_id ; /* our menu id for analog clock */ int phys_handle; /* physical workstation handle */ int handle1; /* virtual workstation handle for analog clock*/ int handle2; /* virtual workstation handle for digital clock*/ int ana_handle; /* analog clock window handle */ int xdesk,ydesk,hdesk,wdesk; int xold,yold,hold,wold; int xanalog,yanalog,hanalog,wanalog; /* desktop and work areas */ int msgbuff[8]; /* event message buffer */ int ret; /* dummy return variable */ int contrl[12]; int intin[128]; int ptsin[128]; int intout[128]; int ptsout[128]; /* storage wasted for idiotic bindings */ int work_in[11]; /* Input to GSX parameter array */ int work_out[57]; /* Output from GSX parameter array */ int hrs, mins, secs; unsigned bottom; long date_time; int showings; /****************************************************************/ /* open virtual workstations */ /****************************************************************/ open_analog() { int i; for(i=0;i<10;work_in[i++]=1); work_in[10]=2; handle1=phys_handle; v_opnvwk(work_in,&handle1,work_out); /* open window */ ana_handle=wind_create(WI_KIND,xdesk,ydesk,wdesk,hdesk); wind_set(ana_handle, WF_NAME,"TIME",0,0); wind_open(ana_handle,xdesk,ydesk+(hdesk/4),hdesk/4,hdesk/4); wind_get(ana_handle,WF_WORKXYWH,&xanalog,&yanalog,&wanalog,&hanalog); } /****************************************************************/ /* Accessory Init. Until First Event_Multi */ /****************************************************************/ main() { appl_init(); phys_handle=graf_handle(&gl_wchar,&gl_hchar,&gl_wbox,&gl_hbox); analog_id=menu_register(gl_apid," Analog Clock"); wind_get(0, WF_WORKXYWH, &xdesk, &ydesk, &wdesk, &hdesk); ana_handle=NO_WINDOW; showings = 0; multi(); } /****************************************************************/ /* dispatches all accessory tasks */ /****************************************************************/ multi() { int event; while (TRUE) { event = evnt_multi(MU_TIMER | MU_MESAG, 1,1,0, 0,0,0,0,0, 0,0,0,0,0, msgbuff,4000,0,&ret,&ret,&ret,&ret,&ret,&ret); wind_update(TRUE); if (event & MU_MESAG) switch (msgbuff[0]) { case WM_NEWTOP: case WM_TOPPED: if (msgbuff[3] == ana_handle) wind_set(msgbuff[3],WF_TOP,0,0,0,0); break; case AC_CLOSE: /* system has requested */ if((msgbuff[3] == analog_id)&&(ana_handle != NO_WINDOW)){ v_clsvwk(handle1); ana_handle = NO_WINDOW; } break; case WM_CLOSED: /* user has requested */ if (msgbuff[3] == ana_handle){ wind_close(msgbuff[3]); graf_shrinkbox(xanalog+wanalog/2,yanalog+hanalog/2,gl_wbox,gl_hbox,xanalog,yanalog,wanalog,hanalog); wind_delete(msgbuff[3]); v_clsvwk(handle1); ana_handle = NO_WINDOW; } else break; case WM_MOVED: if (msgbuff[3] == ana_handle){ wind_set(msgbuff[3],WF_CURRXYWH,msgbuff[4],msgbuff[5],msgbuff[6],msgbuff[7]); wind_get(msgbuff[3],WF_WORKXYWH,&xanalog,&yanalog,&wanalog,&hanalog); } break; case AC_OPEN: if (msgbuff[4] == analog_id){ if (ana_handle == NO_WINDOW) open_analog(); else /* if already opened, for user convenience */ wind_set(ana_handle,WF_TOP,0,0,0,0); } break; } /* switch (msgbuff[0]) */ if((event & MU_TIMER) && (ana_handle != NO_WINDOW)){ showings++; if (showings < 25){ date_time = trap14(23); /* This statement will most likely result */ /* in an unresolved LINKER reference. */ /* This can be resolved by first */ /* patching the ASSEMBLER file; */ /* changing the line: */ /*** jsr _trap14 ***/ /* */ /* - to be instead: */ /*** trap #14 ***/ bottom = date_time & 0xFFFF; hrs = bottom >> 11 & 0x1F; mins = bottom >> 5 & 0x3F; secs = (bottom & 0x1F) << 1; draw_analog(); } else advertise(); } wind_update(FALSE); } /* while (TRUE) */ } /****************************************************************/ /* Draw the clocks */ /****************************************************************/ draw_analog() { int temp[4]; float degrees; float radians = 0.01745329; /* number of radians in 1 degree sexagesimal */ vsf_interior(handle1,0); vsf_style(handle1,8); vsf_color(handle1,0); temp[0]=xanalog; temp[1]=yanalog; temp[2]=xanalog+wanalog-1; temp[3]=yanalog+hanalog-1; v_bar(handle1,temp); /* blank the interior */ vsf_color(handle1,1); vsl_color(handle1,1); vsl_ends(handle1,0,1); vsl_type(handle1,1); vsl_width(handle1,3); temp[0] = xanalog+wanalog/2; temp[1] = yanalog+hanalog/2; /* draw the clock face */ v_ellipse(handle1,xanalog+wanalog/2,yanalog+hanalog/2,hanalog/2,hanalog/2); vsf_color(handle1,0); v_ellipse(handle1,xanalog+wanalog/2,yanalog+hanalog/2,hanalog/2-3,hanalog/2-3); vsf_color(handle1,1); /* draw the hour hand */ if (hrs > 11) hrs = hrs - 12; /* change to 12 hour time */ degrees = hrs*30 + mins/2; temp[2] = temp[0] + (hanalog/2-13)*sin(radians*degrees); temp[3] = temp[1] - (hanalog/2-13)*cos(radians*degrees); v_pline(handle1,2,temp); /* draw the minute hand */ degrees = mins*6; temp[2] = temp[0] + (hanalog/2-2)*sin(radians*degrees); temp[3] = temp[1] - (hanalog/2-2)*cos(radians*degrees); v_pline(handle1,2,temp); /* draw the second hand */ vsl_ends(handle1,0,0); vsl_width(handle1,1); degrees = secs*6; temp[2] = temp[0] + (hanalog/2-2)*sin(radians*degrees); temp[3] = temp[1] - (hanalog/2-2)*cos(radians*degrees); v_pline(handle1,2,temp); } advertise() { int temp[4]; int i; wind_set(ana_handle,WF_CURRXYWH,xdesk,ydesk,wdesk,hdesk); wind_set(ana_handle,WF_NAME,"to order TIME tools...",0,0); wind_get(ana_handle,WF_WORKXYWH,&xanalog,&yanalog,&wanalog,&hanalog); vsf_interior(handle1,0); vsf_style(handle1,8); vsf_color(handle1,0); temp[0]=xanalog; temp[1]=yanalog; temp[2]=xanalog+wanalog-1; temp[3]=yanalog+hanalog-1; v_bar(handle1,temp); /* blank the interior */ i=60; v_gtext(ana_handle,5,i,"Thank-you for trying this sample desk accessory."); i = i + 15; v_gtext(ana_handle,5,i,"Please feel free to distribute this program to whom-ever you please."); i = i + 15; v_gtext(ana_handle,5,i,"You may order a production version of this 'TIME' desk accessory,"); i = i + 15; v_gtext(ana_handle,5,i,"including a Digital AND Analog clock as well as an automatic boot program"); i = i + 15; v_gtext(ana_handle,5,i,"that sets the correct date and time; - by sending $10.00 to:"); i = i + 15; v_gtext(ana_handle,5,i," "); i = i + 15; v_gtext(ana_handle,5,i," R. F. Ritter,"); i = i + 15; v_gtext(ana_handle,5,i," (RE: Time Tools)"); i = i + 15; v_gtext(ana_handle,5,i," 10 Blueberry Drive,"); i = i + 15; v_gtext(ana_handle,5,i," Agincourt, Ontario"); i = i + 15; v_gtext(ana_handle,5,i," CANADA M1S 3E9"); i = i + 15; v_gtext(ana_handle,5,i," "); i = i + 15; v_gtext(ana_handle,5,i,"(Be sure to include return address so that micro diskette can"); i = i + 15; v_gtext(ana_handle,5,i,"promptly be mailed to you....)"); } [74615,323] STCLOC 04-Sep-85 2260 155 Keywords: HARDWARE MODIFICATION CLOCK UNINTERRUPTED POWER A circuit modification to the intelligent keyboard power supply that allows the time of day clock to have uninterrupted power. This circuit will provide uninterrupted power for the clock in the ST. ***** WARNING THIS CIRCUIT MAY VOID YOUR WARRANTY ***** AND I MAKE NO CLAIMS AS TO ITS RELIABILITY Current operating system 7/85 has bug that loads a predetermined time and date into the clock at power on and reset. ( I have been told that this will be corrected in a later version. ) power input choke ( Located at power input plug ) | | | | gnd -12 +12 +5 + Power at these | points on all L___I---I time. I 5 I ( Limits current to max of 75ma. ) ______I v I Cost aprox $1.50 | IregI 75ohm< __I---I > | | | # < 2.2ohm gnd > L--I>---+battery ( 4 AA Ni-Cad in series - to ground ) diode Charge current 50ma. The keyboard draws 20ma batterys provide 500mah ------------------- I Intelligent I I Keyboard I I Clock I I time day date yrI I I ------------------- | ( continuation of wire from pin 13 mother board ) | | diode diode +------+ | From From pin 13 plug battery from mother board +5v to key board. 5v supply to keyboard cut wire and add diode in series with wire as shown above. The above circuit has been in my ST for the last 4 weeks with no problems. The ST may be turned off for an unlimited time and the clock will still be powered but you only have 24 hours if ST unplugged from wall ( ac supply ). Total cost of materials $12.50 . b aw.. b aFRACTAL C ca xFRACTAL PRGfa ~ #include extern double sqrt(); int contrl[12], intin[256], ptsin[256], intout[256], ptsout[256]; int x_boundary; int y_boundary; double x_realpart; double y_imagpart; double x_plus_y_squared; double window_size; double temp_x,temp_y,temp1,temp2,temp3; double x,y,tempr; int i,plot_x,plot_y,count,num_random; int dummy,handle,pxy[4],kbak; int mx,my,width,height; int rgb_in[3]; char decimal[80]; main() { x=0.50001; y=0.; /* The following is the setup to use the VDI and AES */ /* Set the system up to do GEM calls*/ appl_init(); /* Get the handle of the desktop */ handle=graf_handle(&width,&height,&dummy,&dummy); /* Open the workstation. */ for (i=1; i<10; ++i) intin[i] = i; intin[10] = 2; v_opnvwk(intin, &handle, intout); pxy[0]=0; pxy[1]=0; pxy[2]=intout[0]; pxy[3]=intout[1]; x_boundary=pxy[2]/2; y_boundary=pxy[3]/2; vs_clip(handle,1,pxy); /*turn on clipping*/ graf_mouse(3,&dummy); /* The setup is now complete */ restart: rgb_in[0]=1000; rgb_in[1]=1000; rgb_in[2]=1000; vs_color(handle,0,rgb_in); v_hide_cursor(handle); v_clrwk(handle); v_gtext(handle,0,height*10,"Fractal drawing program by"); v_gtext(handle,0,height*11,"Alex Leavens and Leonard Tramiel"); v_gtext(handle,0,height*13,"Please enter x,y and window size, using"); v_gtext(handle,0,height*14,"the mouse and the bar. Left edge is 0,"); v_gtext(handle,0,height*15,"right edge of bar is 4."); v_gtext(handle,0,height*17,"To input new starting values,"); v_gtext(handle,0,height*18,"press any key while program is"); v_gtext(handle,0,height*19,"drawing. To exit, press F1."); v_gtext(handle,0,height*21,"Note: This program DOES take a while"); v_gtext(handle,0,height*22,"to run, especially in the monochrome"); v_gtext(handle,0,height*23,"mode. Just hang in there!"); /* Set color of polyline used to draw points */ vsl_color(handle,2); v_show_cursor(handle,0); initial(); for(count=0;count<10;++count) { function(); } /*Now clear the screen*/ v_clrwk(handle); rgb_in[0]=0; rgb_in[1]=0; rgb_in[2]=0; vs_color(handle,0,rgb_in); /* Now plot points */ while((evnt_multi(0x0021, 0,0,0, 0,0,0,0,0, 0,0,0,0,0, &dummy, 0,0, &dummy,&dummy,&dummy, &dummy,&kbak,&dummy))==0x0020) { plotpoint(); function(); } if (kbak!=0x3b00) goto restart; rgb_in[0]=1000; rgb_in[1]=1000; rgb_in[2]=1000; vs_color(handle,0,rgb_in); v_clsvwk(handle); } /*-----------------End of main()---------------------*/ function() { temp_x=x; temp_y=y; x=temp_x * x_realpart - temp_y * y_imagpart; y=temp_x * y_imagpart + temp_y * x_realpart; x=1.-x; temp1=y; x_plus_y_squared=(x * x) + (y * y); x_plus_y_squared=sqrt(x_plus_y_squared); temp3=(x_plus_y_squared - x) / 2.; if(temp3<0.) temp3=temp3 * (-1.); y=sqrt(temp3); temp3=(-x) + x_plus_y_squared; if(temp3<0.) y=y * (-1.); temp3=(x + x_plus_y_squared) / 2.; if(temp3<0.) temp3=temp3 * (-1.); x=sqrt(temp3); temp3=x + x_plus_y_squared; if(temp3<0.) x=x * (-1.); if(temp1<0.) x=x * (-1.); num_random=rand(); if(num_random<16000) { x=x * (-1.); y=y * (-1.); } x=1.-x; x=x/2.; y=y/2.; } /*-----------------End of Doroot()----------------------*/ plotpoint() { temp1=window_size * (x - .5) + x_boundary; temp2=y_boundary - window_size * y; plot_x=temp1; plot_y=temp2; Plot(plot_x,plot_y); } /*---------------END plotpoint()---------------------*/ initial() { /* Scale the values, depending upon what monitor is in use... */ temp3=x_boundary * 2.; temp3=temp3 / 4.; /* Get the x value of the equation... */ v_hide_cursor(handle); v_gtext(handle,0,height,"what is x-->"); pxy[0]=0;pxy[1]=2*height;pxy[2]=2*x_boundary;pxy[3]=3*height; v_bar(handle,pxy); v_show_cursor(handle,0); evnt_button(1,1,1,&mx,&my,&dummy,&dummy); evnt_button(1,1,0,&dummy,&dummy,&dummy,&dummy); v_hide_cursor(handle); x_realpart=mx; x_realpart=x_realpart / temp3; /*scale 0-200 to real # 0-4 */ ftoa(x_realpart,decimal,6); decimal[79]=0; v_gtext(handle,width,4*height,decimal); /* Get the y value of the equation */ v_gtext(handle,0,height,"what is y-->"); pxy[0]=0;pxy[1]=2*height;pxy[2]=2*x_boundary;pxy[3]=3*height; v_bar(handle,pxy); v_show_cursor(handle,0); evnt_button(1,1,1,&mx,&my,&dummy,&dummy); evnt_button(1,1,0,&dummy,&dummy,&dummy,&dummy); v_hide_cursor(handle); y_imagpart=mx; y_imagpart=y_imagpart / temp3; /*scale 0-200 to real # 0-4 */ ftoa(y_imagpart,decimal,6); decimal[79]=0; v_gtext(handle,width,4*height,decimal); /* calculate values for the program */ x_plus_y_squared=(x_realpart * x_realpart) + (y_imagpart * y_imagpart); x_realpart=4 * x_realpart/x_plus_y_squared; y_imagpart=(-4) * y_imagpart/x_plus_y_squared; /* Get the window size ... */ v_gtext(handle,0,height,"what's the window size-->"); pxy[0]=0;pxy[1]=2*height;pxy[2]=2*x_boundary;pxy[3]=3*height; v_bar(handle,pxy); v_show_cursor(handle,0); evnt_button(1,1,1,&mx,&my,&dummy,&dummy); evnt_button(1,1,0,&dummy,&dummy,&dummy,&dummy); window_size=mx; window_size=window_size / temp3; /* scale to 0-4 real */ tempr=2.; tempr=tempr * x_boundary; window_size=tempr/ window_size; ftoa(window_size,decimal,6); v_hide_cursor(handle); decimal[79]=0; v_gtext(handle,width,4*height,decimal); } /*------------------rand()-----------------*/ /*This function will return a 16 bit random number*/ rand() { return(Random()&0xffff); } /*__________End of rand_________________*/ /*------------Plot(x,y)------------------*/ Plot(x,y) { int pxy[4]; pxy[0]=x; pxy[1]=y; pxy[2]=x; pxy[3]=y; v_pline(handle,2, pxy); } /*------------------End of Plot (x,y)---------------*/ `z \*O.|!n*m - ЭЭм// ??<JNA NJ/<NA"/0<NBNuNV#@)#*N0.%/<%/<*/<*N 3%3%`0y%!0%Ry% y %m3!.#/<%/<!NPBy#By#3##3##09#H3)09#H3).#?<?9%NX.%?<NT3)3)3).)Bg?9%NX>%N>%N .09* ?Bg?9%NH\.09* ?Bg?9%NH\.09* ?Bg?9%NH\.:09*?Bg?9%NH\.b09*?Bg?9%NH\.z09*?Bg?9%NH\.09*?Bg?9%NH\.09*?Bg?9%NH\.09*?Bg?9%NH\.09*?Bg?9%N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NuNVH..N LN^NuNVH..,. N LN^Nu<a<NugPk dR< HC6<(*,A4.< ` (؄*[ZcR FHCNu@ @ <NuJg NugR kjklf`>k^g>k^g2k8<d,&B<ރeNuRid~S<Nu.NuJNu:ڼ.gNugRghEDvi^E]HE:BB8HD&HC؃HF&؃BDHDHGHFHEބj ޼gNuSiex@ބއdRgNu~NujJ<Numc68343 floating point firmware (c) copyright 1981 by motorola inc.#!NN/9!Nu#!NM/9!Nu#!NA/9!Nu Fractal drawing program byAlex Leavens and Leonard TramielPlease enter x,y and window size, usingthe mouse and the bar. Left edge is 0,right edge of bar is 4.To input new starting values,press any key while program isdrawing. To exit, press F1.Note: This program DOES take a whileto run, especially in the monochromemode. Just hang in there!what is x-->what is y-->what's the window size-->."           $                                                      .     $    >T0: : 4. j a.. j aLI BATka jLI C ma &LI DOCpa LI HLPsa )LI LNKva LI MAPxa zqLI PRF}a ULI PRGa pSORT C a YTMLIB C a z!REM REM LI.BAT - COMMAND FILE TO COMPILE AND LINK LI REM REM EXPECT FOLLOWING LATTICE PROGRAMS: REM LC.PRG, LC1.TTP, LC2.TTP, LINK.PRG REM EXPECT FOLLOWING EXTRACTED C MODULES FROM LI.C D/L'd REM LI.C, LI.LNK, SORT.C, TMLIB.C LC LI LC SORT LC TMLIB LINK -WITH LI.LNK REM REM IT SHOULD NOW BE COMPILED AND LINKED AS LI.PRG REM /* LI.C V2.1 List files, size, date and time V1.3 upgrades: SORT filenames, correct exiting after no files found V1.4 upgrades: correct reporting of filetype, use library modules for date/time/numeric conversions V2.0 upgrades: output now defaults to screen instead of printer, parse command switch "/OUTPUT" to direct output to screen, parse "/SORT" and "/NOSORT" switches to list files by when added to directory by DOS V2.1 : correct date processing (in TMLIB module), allow a comma "," in output spec to print to both devices, reduce maximum files due to GEM bug (no more than 64 files?), add help switch to list switches, don't echo filespec to screen when run with command line (c) COPYRIGHT 1986 BY THOMAS J. MYNAR THIS SOFTWARE MAY BE COPIED AND DISTRIBUTED FREELY WITH THE INCLUSION OF THIS NOTICE. NO WARRANTY AND/OR USEABILITY IS IMPLIED. */ #include #include #include #define DAPRT 0 #define MAXFILE 0x0090 #define MAXLEN 54 #define PRT 1 #define CON 2 #define TRUE 1 #define FALSE 0 int maxlen, srtlen; char am_pm_str[6] = { " xm" }, COPYRIGHT[] = { "\15\12Copyright \275 1986 Tom Mynar\277\15\12\ Directory program V" }, cr_lfs[] = { "\12\12\15" }, e_fmt1[] = { "\12\12\15Total of " }, e_fmt2[] = { " files, in " }, e_fmt3[] = { " bytes, matching " }, e_maxfil[]= {"\12\15Maximum files found, sorry, missing: " }, errntf[] = { "\12\15File not found" }, help_1[] = { "\12\15Enter in the form:\ \12\15 device:\134 [folder [.folder\134] \134] FILE\ NAME.TYPE [/switch [/switch2] ]" }, help_2[] = { "\12\15\12FILENAME and TYPE can contain * and ?\ \12\15\12Switches are:\12\15" }, help_3[] = { "\ \12\15 /h print help text\12\15\ \12\15 /n [osort] don't sort\12\15\ \12\15 /o=p output to printer\ \12\15 /o=c output to screen (default)" }, help_4[] = { "\ \12\15 /o=, or\ \12\15 /o=c,p output to both\12\12\15" }, hdr[] = { "\12\15 FILENAME SIZE DATE TIME \ FLAGS\12\15" }, prsank[] = { ", press any key" }, r_w_flag[8] = { " R/x\12\15" }, srnend[] = { "\12\15Done" }, tos[] = { "\12\15Enter Filespec: " }, VERSION[] = { "2.1 " }; char dta[44], dirspec[64], out_buff[132], dirlst[MAXLEN*MAXFILE], fmt_num[10], fmt_nam[14], fmtdat[12], fmttim[12], cmnd[255], cmnval[255]; char *filename, *at_buff, *at_fmt, *at_nam, *at_srch, *at_bu2, *datstr, *timstr; long error, filesize, tot_siz, tot_fil, F_SUBDIR = 0x1F; int waitans, done, sizsrch, noopt, noval, outdev, wntsrt, swpos, nextsw, com_pos; short int readonly = 0x01, subdir = 0x10, allfile = 0x00; vollab = 0x08; short int attribute, drive_no, lincnt; unsigned short int date, time, index; /* put one char to printer */ static void putlst(c) char c; { Bconout(DAPRT, c); } /* Put a null terminated string to the printer */ static void prtstr(s) char *s; { if ( (outdev & CON) != 0 ) { Cconws( s ); } if ( (outdev & PRT) != 0 ) { while (*s) putlst(*s++); } } /* function to decode the DTA into file specifications of name size, date, time and attribute */ dec_file() { char one_char[2]; long int PS_date, PS_time; at_bu2 = &fmt_num[0]; filesize = *(long*) (&dta[26]); lngstr( at_bu2, filesize ); strfil( at_bu2, at_bu2, 0x09, " " ); filename = &dta[30]; one_char[1] = dta[21]; one_char[0] = '\0'; attribute = *(short int *) (&one_char[0]); date = *(short int *) (&dta[24]); time = *(short int *) (&dta[22]); datstr = &fmtdat[0]; timstr = &fmttim[0]; PS_date = date; cnvdate( datstr, PS_date, 0x00 ); PS_time = time; cnvtime( timstr, PS_time, 0x00 ); } /* save filename, get next filename */ static void loop() { done = 0; /* until end of file searches matching */ while (done == 0) { dec_file(); for (index=MAXLEN-10;index<=130;index++) out_buff[index]='\0'; for (index=0;index<=MAXLEN-10;index++) out_buff[index]=' '; /* determine if sub directory or not (affects filename printing) */ if ( (attribute & subdir) == subdir ) { at_buff=&out_buff[1]; strcpy( at_buff, filename ); at_bu2=&out_buff[15]; strcpy( at_bu2, ""); /* put the filename at char pos 1 put the text "DIR" where size goes */ } else { if ( (attribute & vollab) == vollab ) { at_buff=&out_buff[0]; strcpy( at_buff, filename ); at_bu2=&out_buff[15]; strcpy( at_bu2, "