@L}5 _$% l0$)$$Hȱ$ UhL" `e$$%`$%`  R@W!( L(1   Y I`  d  Ld M * @  $ % CC$$)%1 Udߥ$9%: !0 S$% DD˙`  }J)Lr d M * @  $ % CC$$)%1 Udߥ$9%: !0 S$%} DD˙`  }J)Lr J  ((  p L ()   J}L= ( L 0q A    IB JC;? D W } LL  ` W )LA!  ߰")-݆ p" } $G@LL 08`Q")<2Q0 -G$Ș݆ UL# ; p8(()(0ʥ)NQ` }$GȘ݆LU )L ݆ L GȘ ݆LL )W>Z   HH)H }p h  hyhy D L> L JJ    ! LA*` BF }7'8  M HN H` 8 Z  \LdJJ!"! GFE@F (!L }EE !E^ ^ E E7EȩEdE/EȩE  D } .L }  ;F d  ;?F7F? ( .   Z D LL d } . D  L    p  E` , d)  D L) 0BM݊L݉} ML  N݆ L NLML [ TEqEHȱEqEh 0Gȹ G} HLL GɛL  LFREE SECTORS G) *Gȩ GȽG GȌ*jj >G} C8jJ3j2CD( C202C ԠBX` N 1? l LlD:RAMDISK}.COMLu L1 L ;LHL  T`  `8  ɐ     `TU  } L ? .  t`GBJ ~DEHI B V0dV!}QDEHI VF9 ,0 ,0 s0hhL  L` H hDHEh"}DEL8HI4 0 HI,0 0  9 .G VLO#},0 L4*IJ`llD1:AUTORUN.SYSNEED MEM.SAV TO LOAD THIS FILE.D8:MEM.SAV J y08 B|DEHI$} V0 0`B;DEL`?<0LV`@ʆ v s? F0Ξ05: [ BDEHI%} VY8 B V  @  /DE `E:D8:DUP.SYSERROR-SAVING USER MEMORY ON DISKTYPE Y TO &}STILL RUN DOS B;DE J  (` 9 V⪍ ઍ  -'}LLu ÝDEHILV 9 .l 9 .l  `` s$B BH(}I|DE V BLV nB,DE JLV B V BLVDEIʩ BꭝLu }05  15 2 2151^116115ύ011$r2ԭ5 3)5)5ԭx G*}@@L00)+& 2 L0=ɛ -L!1LV1L1 /3 3ȹ441L-4 v3 25 2H 2h͔5+}L3L3 2 k3U hh`DOC`QL3P1Lk0S1H /3h0B k3@ VL0LU!#$53 1181118,}1111Ε5 1Lk0552 1Ȍ1i111i11115Lk0pppB4f5&&&&&&&&^6f^6&&&&&-}&&A1@BJ D2ELVK@BHILV^Щ6 2BD2EJ VBD5EHI0 V0%5.}5 2iХiL[2 25 25`D:*.*` i@`8 ``@i `8@`0 BLV525<4/}5`HH i ԍΗ552 ԍhh@ Lح1Э1Ѣ 24.4 240}4`D4E` 2BJ k3LVRH` 2BD4EhK)I JLV333}MENU and use: ENTER"Dn:Filename.Ext" -Programs may be one of the following file types: BAS > BASIC languag?}e OBJ > MACHINE language DOC > DOCumentation PIC|MIC|FNT|MVM > Graphics AMS|MUS|MBD > Music LST@} > BASIC LISTing -Some MACHINE language programs can only be run by booting the disk MENU "without" BASIC! -For sA}ome programs, XL/XE models may require a "TRANSLATOR" program to be booted first! [Also available from BELLCOM] -B}Most programs are relatively self-explanatory; however, some have separate DOCumentation files available. Some BASICC} programs may contain instructions in their program listings. -To use this great MENU program on your own disks, D}simply copy the file "AUTORUN.SYS" onto your disk. * MENU written by DAVID CASTELL * program on your own disks, ^ **** * * THE ACE "C" COMPILER * -------------------- * ****THE COMPILER AND LINKER REQUIRE 4 F}8K.REMOVE ALL CARTRIDGES BEFORE USING,i.e. BOOT "WITHOUT" BASIC.NOTE: EXCEPT FOR THE DOCUMENTATION==== (.DOC) FILES, TH G}E PROGRAM FILES ON THIS DISK CANNOT BE LOADED USING THE DISK MENU. CONTINUE READING FOR LOADING INSTR H}UCTIONS. The ACE C compiler is a newerversion of the DEEP BLUE C compilerfrom APX by John Palevich. ACE C,like DEE I}P BLUE C, is a subset ofstandard C, drawn primarily from RonCain's public domain C-compiler. Most programs written using A J}CE Ccan be run on any computersupporting standard C withoutalteration. If you already haveDEEP BLUE C, be sure to read t K}hefile BLUE.DOC before using ACE C. Programs written with BLUE C willnot necessarily run on ACE C. This text will no L}t teach youhow to program in C! If you are notfamiliar with C (and even if youare), I would advise you to obtainthe book M}"The C ProgrammingLanguage", by Brain W. Kernighan andDennis M. Ritchie. It can be toughreading, but it will define the C N}language. If you have questionsabout ACE C, you may send them witha self-addressed, stamped envelopeto: Ralph E O}. Walden 1821 Jefferson Eugene, Oregon 97402 HOW TO RUN THE PROGRAMS ----------------------- P} All the programs on this diskuse the normalize function inACECIO.C when requesting filenames. When entering a filena Q}me, if you donot include a drive (Dn:) then itwill be assumed you want D1:. Inall cases, you do not need toinclude the e R}xtension. To run the programs on thisdisk first boot DOS (without BASIC)from your work disk (this disk does not conta S}in a complete DOS). Now insertthis disk and use the (L)Load optionin DOS and type in the fullfilename of the program desir T}ed.All programs with the extension".COM" will run automatically whenthey are loaded. If you are usingOS/A DOS, you can r U}un the program bydirectly typing its primary name(the ".COM" will be supplied foryou). The programs may be loadedfrom an V}y drive, but the file"ENGINE.OBJ" MUST be on D1:. Included on this disk is alibrary of standard functions(ACECIO.CCC W}), and a librarycontaining several graphicsfunctions (GRAPHICS.CCC). For theirdescriptions, see the files of thesame name X} with the extension ".C". ACE C SUPPORTS THE FOLLOWING ----------------------------1) The declarations char, int, Y}andpointers (also extern). A charpointer may be used as an unsignedint for anything exceptmultiplication and division. Z}2) Single dimension arrays. (Nopointer arrays - they won't generatean error, but won't work likestandard C.) Note: float [}ing pointfunctions are provided, but you mustdefine a floating point number as:char name[6];. It will act as achar array \} except in floating pointfunctions. (See FLOAT.DOC.)3) Unary operators:+,-,*,&,++,--,!,$- (tilde).4) Binary operators: ]}+,-,*,/,%,|,^,&,==,!=,<<,>>,(op)=,&&,||,?:,(comma),(op)= (example: var += 3(var=var+3).)5) Statements: asm, break, case, ^}continue, default, do, else, for,if, return, switch, while.6) #define and #include.7) Constants: decimal, hexadecimal, _}octal, backslash. UNSUPPORTED FEATURES OF C ------------------------- (these are NOT in ACE C)1) Structu `}res, unions.2) Multidimensional arrays.3) Full floating pointimplementation (See FLOAT.DOC).4) Functions returning any a}thing butint.5) Unary operator: sizeof.6) Binary operator: type casting. DIFFERENCES FROM STANDARD C -------- b}-------------------1) The last clause of a "switch"statement, either "case" or"default" must be terminated with a"break" c}, "continue", or "return".2) Characters are unsigned, andrange from 0-255.3) Standard C allows lines tocontinue onto th d}e next line. ACE Cis much more particular. ACE Callows code to begin with linenumbers, therefore, unnumbered linesMUST e}begin with a non-number (Spaceor character) or it will be deleted. Strings and comments may NOTcontinue onto the next line f}.4) C source code lines can be amaximum of 199 characters long afterany expansion from #define's.5) Functions may have g}a maximum of126 arguments.6) When ACE C encounters a /*, itconsiders that the end of the line. Therefore, comments may n h}ot beimbedded within a line, and they maynot cross over to a new line.7) ACE C will do constant evaluationat compile tim i}e provided there isnothing (Space, parenthesis, etc.)between the numbers and operators: num=5*6; will be num=30; at runti j}me. num=5*(6); will remain thesame. Evaluation is strictly rightto left, and there is no order ofprecedence: num=5*6+1; k} is num=35. Use a space or parenthesis tooverride constant evaluation.8) A tab character is not "whitespace", i.e. the c l}ompiler will tryto compile it. (See CFORMAT.DOC forconverting tabs into spaces.)9) ACE C has an assembly languageinterf m}ace. Read the file ASM.DOCfor a description of its use. BLUEC users: asm on ACE C is VERYdifferent; be sure to read ASM. n}DOC!10) Braces in standard C arereplaced with $( and $). The tildeis replaced with $-.11) Variables may not be defined o}within a statement.BACKSLASH: Use of the backslashwithin a single or double quote willgenerate the following codes:\ p}b - backspace delete\d - cursor down\e - escape\f - clear screen\g - bell\l - cursor left\m - control M (can be used as q} aRETURN on IDS printers)\n - return\r - cursor right\t - tab\u - cursor upAdditionly, a back space followed bya numb r}er will convert the number toits actual value. "\65\66" wouldgenerate the string "AB". NOTE: youcannot put a control comm s}a (graphicsheart) within a string since this isthe end of the string character; youmust use \0. USING ACE C t} -----------Here's a brief summary of how toget a C program running. A moreextensive description follows.1) u} Enter the program using the texteditor of your choice and save it todisk with the extension ".C", withor without line num v}bers.2) Load ACEC and compile theprogram.3) Load LINK and link the program.4) Load the program (which willautomatical w}ly run).1) EDITING: You may use any texteditor that creates ASCHII files,with or without line numbers, toenter the sou x}rce program. Note:CFORMAT.COM will do a lot of theformatting of a C program for you(See CFORMAT.DOC). You must savethe y}file with the extension ".C".2) COMPILING: The compiler andlinker require 48k so you mustremove any cartridges before ru z}nningthem. You run the compiler fromAtari DOS using the 'L' option. Thecompiler filename is ACEC.COM. FromOS/A+ DOS, j {}ust type ACEC, and pressRETURN. The compiler will ask forthe filename, which it willnormalize with the extension ".C". T |}he compiler will then create a filewith the extension ".CCC" for use bythe linker. When you press RETURNafter the filenam }}e, the screen willbe turned off while the program iscompiled. If any error isencountered all compilation willstop, the s ~}creen will be turned on,and the line with an error messagewill be displayed. Take note of theerror and press a key, which } willreturn you to DOS. If compilationis done without errors, the screenwill be turned back on, and a listof all the fun }ctions in the programwill be displayed. Press RETURN togo back to DOS, or type in anotherfilename to compile. Note: the }largest ".CCC" file you can have isabout 9K. It's safer to createseveral small files and link themtogether then to have o }ne largefile. Compiler directives in thesource file: #define - whenever the compilerencounters the first string ( }allcharacters until the next space) itwill replace it with the secondstring (everything to the end of theline or comment) }. Example: #defineEOL 155; putchar(EOL); - this willbe changed to putchar(155). Note:constant evaluation will be done on }the second string. #include filename - this willinclude the filename specified. Thefilename will be normalized with th }eextension ".H" The included fileis usually used as a header filecontaining extern declarations.3) LINKING: The lin }ker joinstogether all files that are to bepart of the same program. You mustfirst create a file with theextension ".LNK" } which contains alist of the programs to linktogether. The only file typesallowed are ".CCC" and ".OBJ"(object). All fi }lenames arenormalized with the extension".CCC", so the extension is neededonly for ".OBJ" files. (Assemblylanguage files } should have theextension ".OBJ".) The last filemust be either "ENGINE.OBJ" or"ENGLOAD.OBJ". "ENGLOAD.OBJ" willresult i }n "ENGINE.OBJ" being loadedfrom D1: whenever the program isrun. "ENGINE.OBJ" is about 4000bytes long, whereas ENGLOAD.OBJ } isonly about 130 bytes. Load the linker in the samemanner as the compiler (the filenameis LINK.COM). The linker wi }llrequest the name of the link file,which will be normalized with theextension ".LNK". The linker willthen create a file } with theextension ".COM" which is ready torun. ACE C is actually a P-codeinterpreter and the code to run it,plus numero }us IO functions describedin ACECIO.C, is in the fileENGINE.OBJ. To access the IOroutines in ENGINE.OBJ you must alsoincl }ude the file ACECIO in your LNKfile. NOTE: both ACEC.COM andLINK.COM require ENGINE.OBJ to be ondrive #1, as they use ENG }LOAD.OBJ. If the linker does not find a LNKfile, it will create the followingfile: filename.CCC ACECIO.CCC ENGLOAD }.OBJ4) RUNNING: Run your program thesame way you run the linker andcompiler. The extension will alwaysbe ".COM", which } need not beincluded if you are using OS/A+ DOS. When your program is runningcorrectly, you can use FASTC.COM onthe ".CCC }" files which will speed upyour program by 20-30%. (SeeFASTC.DOC.)-----------------------------------BE SURE TO READ A }LL THE .DOC FILES,AND LOOK AT THE .C FILES FOREXAMPLES.FASTC.DOC.)-----------------------------------BE SURE TO READ A : ACE C / FLOATING POINT ---------------------- ACE C has a limited support offloating point by using thef}unctions defined in ACECIO.C. Todefine a floating point number, use:char name[6];. Floating point willbe the same as Bas}ic only instead ofusing operators like + and -, etc.,you must use one of the followingfunctions: (for the examples, a,b,c}are presumed to have been previouslydefined as: char a[6],b[6],c[6];)atof(a,str) - convert the string toa floating point }and put it in a. Examples:atof(a,"3.14276") - same as BASIC A=3.14276clog(a,b) same as Basic B=CLOG(A)exp(a,b,c) same }as Basic C=A^Bfadd(a,b,c) same as Basic C=A+Bfdiv(a,b,c) same as Basic C=A/Bfmul(a,b,c) same as Basic C=A*Bfsub(a,b,c) sa}me as Basic C=A-Bftoi(a) this will return the integervalue of a. This is NOT the same asBasic INT(A). Basic simply remov}esthe decimal portion, whereas ftoi(a)will round the number either up ordown. Example: atof(a,"1.9"); x=ftoi(a); - sets}x=2. BASIC: A=1.9: X=INT(A) setsX=1.itof(i,a) converts the integer i tofloating point and puts it in a(opposite of ftoi})log(a,b) same as Basic B=LOG(A)NOTE: any var may be used in thefunctions. Example: fadd(a,a,a) isthe same as Basic A=}A+A. To dosomething like A=B, usemove(b,a,6);.may be used in thefunctions. Example: fadd(a,a,a) isthe same as Basic A=2 DEEP BLUE C vs. ACE C ---------------------- There are several differencesbetween BLUE C and ACE C. }The ACE Ccompiler runs 10 to 15 times faster,especially when using #define's. The Linker runs 4 to 5 times fasterand the }execution time of programsis about twice as fast. To maximizespeed ACE C eliminates the followingchecks:1) Eliminates c}heck for differentversions. If you link an ACE C".CCC" file with DEEP BLUE C'sDBC.OBJ your computer will crash.2) Elimi}nates check for the stackoverwritting into the screen.3) Eliminates check for division byzero.Plus, here are the more }noticeabledifferences between the twocompilers:1) ACE C does not allow imbeddedcomments or comments to continue tothe n}ext line.2) ACE C does not allow the tabcharacter to be used as a space.3) ACE C does accept programs withline numbers.}4) ACE C does do constant evaluationat compile time.5) ACE C asm is VERY different thanBLUE C. Don't use an assemblyp}rogram for BLUE C with ACE C. (SeeASM.TXT)6) The fprintf function from BLUE Cwill work as a printf function inACE C. (}printf checks to see if aniocb was included). The printffunction is part of ENGINE.OBJ.7) Most BLUE C functions have bee}nrewritten in assembly language andare part of ENGINE.OBJ. They runfaster, and take up less space.8) BLUE C loads at $3}000; ACE Cloads at $2C00.9) The psuedo code has been extendedby 27 instructions. These newinstructions are used when FA}STC.COMhas been used on a ".CCC" file. There is no check for a bad codecaused by a messed up file.10) The usr(addr,arg1,}arg2,...) actsjust like the asm function. (SeeASM.TXT)a bad codecaused by a messed up file.10) The usr(addr,arg1,? ASM STATEMENT ------------- Assembly language runs about 10times faster than ACE C and takes u}pabout a third of the space. ACE Cprovides the ability to define afunction as an assembly languageroutine via the asm st}atement. Todefine the function use: func() $( asm address-of-function; Note that asm acts like aclosing brace, }signaling the end ofthe function. You need not includeany arguments in func(). Anyarguments between the parenthesiswill} be placed on a stack in theorder that they occur. When yourroutine gets control, the pointer tothe stack will be at $C6,} and thenumber of arguments passed will bein $BF. To get the low byte of anarguement use: LDY #argumentnumber*2 LDA} ($C6),YTo get the high byte, use LDY#arguementnumber*2+1. If you want to return aninteger, load A with the low byte},and X with the high byte. To returna character, load A with thecharacter, and X with a zero. Endyour code with an RTS.} The page zero locations whichare free are $80 through $B5, and$C8 through $CF. ACE C uses theOperating System's fl}oating pointregisters, so though you may usethem, don't leave a value in themexpecting it to be there the nexttime your r}outine is called. Twoadditional locations that may be ofvalue to you are $B7 - color fromcolor(c), and $B6 the graphics i}n559 before fast() was used. ENGINE.OBJ starts at $2C00, soyou may use memory from LOMEM (value in $2E7) up to that.} Also$400-$57F, and $600-$6FF is free. ($400-47F is tie cassette buffer). LINK will tell you where the stackstarts, so y}ou could figure out asafe place well above that. Assemble your program with theextension ".OBJ". Be sure toinclude }it in the ".LNK" file withthe extension ".OBJ". The order itappears is not relevant. Note thatboth ENGINE.OBJ and ENGLOA}D.OBJ usethe load/run address at $2E0.BJ". The order itappears is not relevant. Note thatboth ENGINE.OBJ and ENGLOA, FASTC.COM --------- FASTC.COM will optimize ".CCC"files, lowering execution time20-30%. }A ".CCC" file is composedof "psuedo" instructions to beexecuted by ENGINE.OBJ. FASTC looksfor certain sequences ofinstru}ctions, and replaces them witha faster single instruction. RunFASTC by using the "L" option fromDOS. When it requests a }filename,specify a file already compiled byACE C. FASTC will automatically addthe extension ".CCC". The screenwill be tu}rned off while FASTCchanges the file. When it is done,the number of new instructions willbe displayed.reenwill be tun printf ------ The printf function enables youto print information to the screenor an }y device. It takes a variablenumber of arguments. If the firstargument is less than 255, it isassumed to be an iocb #, a }ndeverything is sent to that iocb. Otherwise the output is sent to thescreen (iocb #0). The next argumentis the format s }tring, followed byany additional arguments. Everything in the format string willbe sent out until a % isencountered. The } character(s)following the % determine how theargument is to be printed. Thefirst % is for the first argumentafter the f }ormat string, the secondfor the second argument, and so on. Too few arguments will cause garbageto be printed. The follow }ingcharacters may be used after the %:c - print a characterd - print an integerf - print a floating point numbers - pri }nt a stringx - print a hexadecimal number% - print a percent signNote: A character, integer, orhexadecimal value may be } obtainedfrom any variable defined as eitherchar or int. A floating pointnumber is assumed to have beendefined as a 6 el }ement char array. A number between the % and thecharacter defines the field width. If there aren't enough characters }ornumbers in the argument, it will befilled out with spaces. A '-'before the number will left justifythe field. A decim }al point and anumber will determine the decimalpart printed in a floating pointnumber, padded with up to 2 zeros ifthere }aren't enough. Here are some examples:printf(">abcd<"); produces >abcd%s<","abcd"); produces >abcd }%10s<","abcd"); produces > abcd%-10s<","abcd"); produces >abcd abcd%-10s<","abcd"); produces >abcd , 1ERin H:kRin H&Hk1(}E> 1E1E2Rin Ri$j KE&jkl~ WE1TU~3T`UE, 1E&k1E"J&kh`WE,1E $wkhWE, h4lFAhr(}"A KEfk6l~ } missing closing bracketextern char int char int #include#defineCan't nest include filesHOpe(}n failure on include file(sU~&gl( |nzls~sz7E( (|H|ls~||z&ln (}l|zn l|zn  $l|1{ ||z6s|OA:sU~m,n :  (},,< ?E. ?E`z&Ko( sU~^os~$en( 3TUE,&uoEE&|o $psU~&owp$ps~&ow(}p$ps~&oq$ps~os~&obUE*q SE$ps~os~& pbUEwq SE$ps~&$pdq SE(}$ps~6ps~&IpbUEt SE$ps~&dp:rp SE$ps~vpt~&pbUESrp SE$p t~&prp(} SE$pt~pt~&pbUE v SE$pt~&p$pp SESE  tU~p"t~ ^AE4tU~&qEE&q7t~(}$#qeo$qbAE (|Xi|=E|z|reor/ =E XiItU~uqr( |z|ܛreor/ =E(} Xir( ( |Xi|=E|z||z|||rwqreo$reoNtU~ rTt~rpr(}ܛr Xir/ =E|( `zGr/ (||gr( n/nܛ( (B'EH&re(}t~|'E .BZ&rn&r$r .$rjBrvt~n&rnܛ$rnܛ( ]must be cons(}tant]illegal function or declaration%s(missing open paren)illegal argument name),expected commacharint wrong nu)}mber argsasmNeeded address*[,expected commachar int $(if(if while(while do switch(switch returnbreak;break)} continuefor(for ;;missing semicolon$)missing final endelsewhiledo with no whileNo active whilesNo active whiles)}(||| |Xi|=E|z|||GyzIyzKyzNyU~ tVyU~&t\y~|z|)}&u|$9u|n%u|&/uyy~rryU~Luy~yU~ cuyU~&iu$u|z|rܛr)}eoyU~ uyU~ uyU~&u$unܛru&u$t&urܛnr Xir)}/ =E|( ( |Xi|=E|z||z||z||z|||yzyU~`vpryU~vp)}rrܛryU~vyzrܛreorܛr Xir/ =E|( yU~vy~ (()}( (&w&w`z&w( yU~&-w$2w|H|Bwyz||z&wn ewJ&vwn  $)}wwzyU~&w|Sl&w$w|rrrr1{ $w$wyU~w( $v( ((&x&x`z) }&w( yU~& x$xhH| xyzhz&1xhzyU~&mx|Sl&exbx|>$jx$x) }~xJ&x$xhr=En{ =E~/ =E$x$wyU~x( $w( (T RiRiViT&CyRin ) }yRin y| $ y| $+yRin $y| $+y| Ri[Rin Ri$x( ()$(defaultcase 'case' or 'd) }efault' expectedconstant needed:Missing colondefaultcase defaultcase $)(;;)):Missing colon*[,*[,() }q~y`}~;z`z& z$;z|zu`n}U~8z$;z$y}z&Uzrr$\zr( q)}~}~xz3TUE, }~ }rOA}~ rU~z}~ }~ (TViJ&zrr~&z( n)}$z( (T,0,nXiJ&*{rr~&{( n$z( rz Ri&B{Ri ViT,0,Z&\{}~)}Vi RiVir~Rin  Rin  Rin  Rin  Ri ,,< Vin ViRi rz Ri&{Ri XiT,)}.Z&{~~Xi RiXir~Rin  Rin  Rin  Rin  Ri ,,< Xin XiRi q~3TUE,)} Ab| 3TUE,~~ ^9E 0R9N: 'EB, .H&|-~~ 1E1Ef|'EDD 'EFF`1E*,$|)} |&|'E . 'E 'EB|D~~$}'E . 3TUE, 3T, UE 3TUE,>}EE&3} C}~$}~ &}GEX)}} EE KE 3Ei}GE 3E3T3E~f}3EAKE&} KE$} GE$} $C} ),);illegal symbol name%s already defined)}see abovemissing bracketnot definedGLOBAL symbol table overflowlocal symbol table overflowtoo many active whilesno act)}ive whiles~i~C}~$U~r~ ~~C}~ *N*p*****+f+++?3TOA 1E1EUE~$~^1E$~ )}RA$~CrOA@ hdA UE WE3TUE,~|&^UE$~~3TUE,Ti&Ti 8h`WE,Ti ~~$Ti"h`)}WE,~ 3TUE,"3TUE,nJ~3TUE,\h`WE,~ h`WE,~ $Mh`WE,~ $Ti'h`WE,~ 3T)}UE,'3TUE,X~3TUE,\h`W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#J;L( $J: M( 1}gJn#-KgJn""K=L( $-K< M( NKgJn NKgJn H&K)M)M,BMHgJn1} gJ^PJlJ( KgJn KgJn H&KHH@aIH( 3LgJnkJkJL1}LkJ HLkJH&3LH>aIH( HLgJn H&LgJnkJkJffLkJJ{LkJhzLkJ1}L&LH9aIH( LHAaILHFaIH( 1}HaIH HaIH gJ~gJ~n>, gJ~ gJ~n< ,, , ,1},,,,,,!,$,',*,-,0,3,6,9,<,?,B,E,H,K,N,Q,T,W,Z,],`,c,f,i,l,o,r,u,x,{,~,,,,,1},,,,,,,,,,,,,(f5N$+Nt$NrM$%N( (rNfNrrM|rM1}fNNrMrN$HN( NMrMnNMMM can't open %sfilename (or RETURN to exit)?1} g?NNrMrN$HN( NMrMnNMMM can't open %sfilename (or RETURN to exit)?0K?.JLg?Can't find D1:ENGINE.OBJ @ VYD?EBJ V"ND?E BI Vl IHEDB V5}0­D?E?8HI V B VL,ace @/J(|b|.F*I+G*I&FHH n5}H lH tH vH6IzHIlG*IHNIyn@-IHZIHzHEIzHGI&@HHKI.H pH&@HpH, 5}HGIGzHH*I$@GzH*IzHrH lHf@GzH*I$,@rlHH rHlHHrHZ&6AGrH2*I$,@5}&AHwH xHhiArHxHHxHH$AGH*IHQIYA$,@prH HHn zHwH lHfA5HzH*I$,5}@ HrHH pHR&AHppH $AH A^H$AHHT&F$B^H$AHHdP& BHJ&/B`HF$BH5} =BHH\ HB$gB FH ^B^H$OBbH$F$OB\boB$BHDHI&BvH&BnH. nH vH tH$BtH&BnH. nH t5}HHF$F$B\cB$BHKHI&B tHnHn nHHF$F$B\dB$"CHQHI&C^vHnHn nHHF$F$C\0*C$~CH5}FHnNIxxCHnFHn HHF&uC`HQIF$XCbH$F$xC\$C$CHnHH.HH(CH 5}J&CHJ&CH.J&C FnHn nHHFH)CnH. nH$F$C\& D\| D$zDH.HHHH&?DH5}FHn A r'A3 9;'9M'AM' ;'99}-'A7B <' <'"' .can't open %sfilename (or RETURN to exit)? 'abs'alpha'ato9}f'bgets'bputs'cgetc'cgets'ciov'clear'clog'close'color'copen'cputc'cputs'dpeek 'dpoke9}!'drawto"'exit#'exp$'fadd%'fast&'fdiv''find('fmul)'fsub*'ftoi+'getchar,'getkey-'gets.'graphics/9}'gtime0'itof1'locate2'log3'match4'move5'normaliz6'open7'peek8'plot9'poke:'position;'printf<'putchar9}='rnd>'sfind?'slow@'soundA'stickB'strcatC'strcmpD'strcpyE'strigF'strlenG'tolowerH'toupperI'usrJ'v9}alK'closeallL'getreadM'getnamestickB'strcatC'strcmpD'strcpyE'strigF'strlenG'tolowerH'toupperI'usrJ'v8%' j'  '  j'  ' j'  ' j j'  ' ' =}' ' ' '  '' '   ' j j'7 ' ''=}A /AB > . '  'AB  '' '' AB=}  '@ A3  : A '   / "'  =}'@A3: A ' A ' '  '' F=} F  F '' F F ''A3 A ' A A ' =} 'A3 A ' A A '   '' F ' '=} '!'F 8' A '"'F 7 A '#'9F 8' '$'A7 '=} F ' F A ' F F '%'' F '&' A F  F  ''' F=} ' U9(' TF '       )'*' pF  '+' |F  =}','F -' . .   .'F -'=} . ! "!."#"  $#%$ &%$&''''playbase=}'charbase'playsize'pminit'peek'poke'graphics'pmgraphi'move'pmflush'clear'hitclear'pmcolor=}'pmwidth'hitpf'hitpl 'pmclear!'chget"'chaget#'chput$'plmove%'pladdr&'setcolor''fill('dpoke)'ciov*=}'paddle+'ptrig,'vstick-'stick.'hstick"'chaget#'chput$'plmove%'pladdr&'setcolor''fill('dpoke)'ciov*<.,(?L:6L,2L5LU4Lt5Li5L-L3L+-L6L!5L2L1L3L-L1LW.La.L1L6L4L4LO5L4L.L4L4L45L,L,L3L]1L5L4L1L4L5L-L2LA}3L/.L1L=.L1L/L-L3LD2L_5L5L3L.L.L-L3L{2L2L2L2L{.2lȱňı88必ƥDZ…ȱ…ťi ,ԆL!A}8 , 46`* 76`L, `ƅˈƅʈƅɈƅ` -ƝB EƝD IƝH ƝJ A}K VIi`` -L,BHI V0ڢ`ȱ G-FȌ- tLw- -ձʑ `ƙȥA}̱ȑ`ƙȄͦʥ``ƅɈƅȢ`ƅȱƅ̠ƅȱȪ̑Ȋ` /.HȱȪh` -ȅȱA}ͥˑȥʈȦͥ`ƅƅ إԅ) ٥0Ԧ`IIi` -L- - 80`` -V/F\/A}G]/\/]/ƅȱƅL*/҅Ɉƅȭ]/\/\/]/V/Ȅʩ΅ϩ %$ U/L0/`( 46 zA}-ԆբL!8ȱ% 2-Lp/.Lp/AL/ȱ: 0蝀懲詛 ٥ ԅΤLp/ԅϤLp/A}DL0ȱIՈIiL0Ոƅ إ'0ȄΥΐ U/ R0L0 R0Υ U/LD0 - U/A}Π0. U/Le0)LU/溤`XL0ȄƅՈƅԥH)JJJJi0:i U/h)i0:i U/ A}L0L0/C ʱ U/L0SL4ʱƅȱƅť K1L0ΰ U/ K1LH1 K1ΰ U/L0 U/A}``BP B VBD1EƝK)IJLt-S:ƅ`ƅVȱƅTƅU` 1 0`Lz- 1`BLt- 1 A} - BIƅɝEƝDȠˆ 2󩛑Lt- - BLt-ƍ+2ƍ*2ƿƿiƐLt0`8Hƪh` -̄ͱʅαA}ͥ``ȱܱƅɈƅȢ`{a `A[i L2 -Π 2Ȉȱ :* A}D1:șȈ..Ȅ̤αʤ̑`@i`ƝDȱƝEBȱƆ 2A}ARWUD`   J V0JJJJ`Lz-ƨx`ƨТ`ȭ Ȑ Ң`ƝEƝDBA}I V0 ($`Lz- -L3 -B0ƝKƝDȱƝELv3FL0ʱƪȱƨ ؠ0.)ȩ.ȩ0ȩA}L0ȱ)LA4ƅƅ ؠƅȱƅL4ƙșʙ`̈` u4 L4 u4 (L4 u4 fL4 u4 `L4 -A}ș ޠʈ`ƅȱƅȱƅȱƅ L4ƪȱƨ ޠƪȱƨ ݠƅȱƅL4 -ș L4ƅɈƅȠA} ٦ԥ`//B`/B` 5 BLt- 5B VHI`` -ƝIƝHƝEƝD` - A}``_A [ a{``ҩ҈) ƝҠ) Ƞ)` - ȈȈ`LLA}i56i66i1i1i1i1$i86%i96/©6í@@L7@"66l iàLA}7…ȱ…ťiÈԑL7…ȱ…ťiåՑĈԑL7ȱňĥԑĥ8êc;%7d;&7Lt…ȱ…ťiA}ÈąԄL7…ȱ…ťiñąՈąL7eȱeL6ȱňĥԑĥȑĈL7ԅԄL7ԪȱԈՆL7i‘A}ȱ‘L6…ȱ…L6iԑȑL7ԱԊȦձՊL7iȱª¨„ iiȑÈL7ȱA}Í;88L7±ŠȦñÊL7ªȱ…ƈL7 L\8L6 ȥLB=L,=q…q…L6&L7A}eԅȱeՅՈL78ԅȱՅՈL7ԅՅȱ :ԥL7 9L8 9ԥL7ȱդL:ԅȱՅՈL7EA}ȱEՅՈL7%ԅȱ%ՅՈL7ȱJfՈL7ȱL7ȱ*ՈL7ԱL78ԅԩՅL7A}EԅԩEՅL7L7L78Ԫȱ`ȱL7ȱԄL7 90 90 90ʊ 90A}ȱՐɱԐȱՐзԐЭȱՐЎԐL9ȱՐ԰L9&&& L: A}`ɀE ɀf8ਊ s:$ 8$P 8`E0 IIL; 8A}Ff eeFfff$ 8`,'7E7e7666v777777j877!8E8\8u88888888A}9%969G9o99999999:::%:7:K:`:~8;+0>L>h>>>><<<<>??…ȱ…ťiÈią ȱA}iąՈL7ȱĈL7…ȱ…ťiñąՈąiȱiĈL7…ȱ…ťi8ą԰ ȱąՈL7ȱąՈL7…A}ȱ…ťiñąՈą8ĐL7ȱĈL7tmL(=P]L(=…ȱ…8ԈĪCL(=…ȱ…8ԈĪA}0)L<=8ªԥiàL7Ԅՠªȱ…Æ L78ª0ƊL<=˥ԈL<=ФԈLA}(=q…ԥq…L6…ȱ…ťiåqąԥqąՈL7eȱeťiåiđđL7eȱeťiB}L <eȱeťiL?<eȱeťiLn<eȱeťiL<eȱeťiőB}L6eȱeňeԅȱeՅL6eȱeťiñ‘ąՈ‘ąL6eȱeűąՈąL6eȱeňąԄB}L6 ԄL7L7L?:6ȱeťiñ‘ąՈ‘ąL6eȱeűąՈąL6eȱeňąԄ@*S??Lo?Can't find D1:ENGINE.OBJ @ VaD?EBJ VVD?E BI Vl IHEDB V0ʭDF}?E?8HI V B VL,o? VVD?E BI Vl IHEDB V0ʭDD} request the filename from the user */char s[];$( printf("filename (or RETURN to exit)? "); gets(s); if(!s[0]) $( N?} putchar(''); putchar(''); exit(); $)$) printf("filename (or RETURN to exit)? "); gets(s); if(!s[0]) $( L5/* graphics and game i/o *//* */#define RAMTOP 0x6A#define PMCOLOR 0x2C0#define SDMCTL 0x22F#define GRACTL 0xD01D#definRA}e CHBASE 0x2F4#define PMBASE 0xD407#define PLSIZE 0xD008#define HPOSPL 0xD000#define PLTOPF 0xD004#define PLTOPL 0xD00CRB}#define HITCLR 0xD01E#define OLDCHSET 0xE000#define GRAF 0xD00Dchar *playbase,*charbase,playsize;/* *//* initialize playRC}ers *//* */pminit() /* this must be called before any use of the following PM functions */$( int i; charbase=(peek(RAMRD}TOP)-12)<<8; poke(PMBASE,peek(RAMTOP)-8); playbase=(peek(RAMTOP)-8)<<8; poke(RAMTOP,peek(RAMTOP)-16); graphics(0); RE}pmgraphics(0); move(OLDCHSET,charbase,1024); poke(CHBASE,charbase>>8);$)pmflush() /* call this before returning to DOS RF}to turn off PM graphics */$( pmgraphics(0); poke(CHBASE,OLDCHSET>>8); poke(RAMTOP,peek(RAMTOP)+16); graphics(0);$)RG}/* Set up PM graphics *//* i=0 > inhibits PM graphics *//* i=1 > single line resolution *//* i=2 > double line resolution RH}*/pmgraphics(i)int i;$( int j; if(i) $( poke(SDMCTL,i==1 ? 0x3E : 0x2E); /* enable DMA */ poke(GRACTL,3); RI}playsize= (i==1) ? 8 : 7; clear(playbase,2048); playbase += (i==1) ? 1024 : 512; for(j=0;j<4;++j) poke(HPOSPL+j,0RJ}); $) else $( poke(SDMCTL,0x22); poke(GRACTL,0); for(j=0;j<4;++j) $( poke(HPOSPL+j,0); poke(GRAF+RK}j,0); $) $)$)hitclear() /* clears the collision registers */$( poke(HITCLR,0);$)pmcolor(n,hue,intensity) /* workRL}s like setcolor(), defines color of player n */char n,hue,intensity;$( poke(PMCOLOR+n,(hue<<4)+intensity);$)/* define pRM}layer width *//* width=0 > normal width *//* width=1 > double normal width *//* width=3 > four times normal width */pmwidRN}th(n,width)char n,width;$( poke(PLSIZE+n,width);$)/* *//* hitpf() and hitpl() return a 1 if who collided with hitwho, RO}otherwise it will return 0. *//* if hitwho is minus, a collision with any hitwho will return a 1 *//* */hitpf(who,hitwho) RP}/* player-playfield collisions */int who,hitwho;$( if(hitwho<0) return peek(PLTOPF+who); /* if hitwho is minus, check forRQ} any collision */ return (1<200) $( dx[n]=-1; continue; $) if(y[n]223) $( dy[n]=-1; continue; $)/* if wVp}e were looking for who we collided with, we would use hitpl(who,hitwho) */ if(hitpl(n,-1)) $( /* did it hit anyone? */Vq} dx[n]=rnd(3)-1; while(!(dx[n]=rnd(3)-1)); while(!(dy[n]=rnd(3)-1)); y[n]+=dy[n]; plmoVr}ve(n,x[n],y[n],shape[n]); pmclear(n); chget(rnd(127)+1,shape[n]+2); /* new shape drawn from character base */Vs} hitclear(); $) $) $)$) chget(rnd(127)+1,shape[n]+2); /* new shape drawn from character base */T-/* This program formats C files *//* See CFORMAT.TXT for a detailed explanation of what if does *//* */#define PAD 2 /* nuZu}mber of spaces to indent after a "$(" */#define SPACE 32#define TAB 127#define EOL 155int iocb,count,i,length,csflag,dflaZv}g,iocb2;char s[20],c,lastchar,nextchar,*bufptr,*endptr,bak[20];main() $( int backup; char *maxsize,*address; /* addressZw} MUST be the last variable defined!!! */ address=&address+100; /* This is the address for the text */ maxsize=0xBC00-addrZx}ess; /* Maximum text length */ printf("\f\t The ACE C Formatter\n\t by Ralph Walden\n\n"); printf("^M will insert a rZy}eturn\n^N will delete through the next return\n\n"); while(1) $( /* loop until user indicates no more files via getname() fZz}unction */ dflag=csflag=iocb=count=lastchar=c=backup=0; slow(); getname(s); printf("Do you want a back-up? (YZ{}/N)"); if(tolower(getkey())=='y') backup=1; putchar('\n'); fast(); closeall(); strcpy(bak,s); normaliZ|}ze(s,"C"); if(backup) $( if(i=find(bak,strlen(bak),'.')) *(bak+i)=0; /* erase the period */ normalize(bak,"BAZ}}K"); printf("\u%s <<< %s\n\n",s,bak); $) else printf("\u%s (no back-up)\n\n",s); if((iocb=copen(s,'r'))=maxsize) $( printf("Text exceeds %dK\nZ}You wouldn't be able to link\nit either!\n",length/1024); continue; $) if(backup) $( if((iocb2=copen(bak,Z}'w'))>0) $( bputs(address,length,iocb2); /* write all of the text to a backup */ close(iocb2); $) Z} else $( printf("I can't open %s\nShall I continue without a back-up?\n(Y/N)",bak); if(toupper(getkey())!='Y'Z}) continue; $) $) endptr=address+length; /* get the length of the text */ *(endptr+1)=EOL; /* to avoid someZ} checks for end of buffer */ if((iocb=copen(s,'w'))<0) $( printf("Can't open %s\n",s); continue; $) bZ}ufptr=address; while((i=find(address,length,TAB))>=0) *(bufptr+i)=SPACE; /* convert tabs to spaces */ while(*bufptr==Z}SPACE) ++bufptr; /* remove any starting spaces */ for(;bufptr'd') && (c != EOL)) out(*bufptr++); if(c==13) c=EOL; /* convert control M to a RETURN */ switch(c) $( Z} case SPACE: /* remove all but one space */ out(SPACE); while(*bufptr==SPACE) ++bufptr; --bufptZ}r; /* in order to read next character */ break; case 'b': /* handles "break" statements */ if(matZ}ch(bufptr,"break;")) $( if(dflag) $( /* break after a default */ count-=PAD; csflag=dZ}flag=0; $) else if(csflag) $( /* break after a case */ count-=PAD; csflagZ}=0; $) $) out(c); break; case 'c': /* handles "case" statement */ Z} if(match(bufptr,"case ")) $( csflag=1; /* indicate we are dealing with a case */ count+=PAD; /* incrZ}ease the indentation */ $) out(c); break; case 'd': /* handles "default" statement */ Z} if(match(bufptr,"default")) $( ++dflag; /* indicate that we have a default */ count+=PAD; Z} $) out(c); break; case '0': /* convert all hex to upper case */ out(c); Z} if(tolower(*(bufptr+1))=='x') $( out(*(bufptr+1)); bufptr+=2; while(hex(*bufptr)) out(Z}toupper(*bufptr++)); --bufptr; /* so we will read it at top of loop */ $) break; caseZ} '$': /* this handles $( and $) */ nextchar= *(bufptr+1); lastchar= *(bufptr-1); if(nextchar=='Z}(') $( if((lastchar != SPACE) && (lastchar != EOL) && (*(bufptr-2) != EOL)) out(SPACE); /* add a space */ Z} count+=PAD; $) out(c); if(nextchar==')') count-=PAD; break; case '&': /*Z} separate || and && with spaces */ case '|': lastchar= *(bufptr-1); if(lastchar==c) $( Z} out(c); if(*(bufptr+1)!=SPACE) out(SPACE); $) else if((*(bufptr+1)==c) && (lastchar!=SPACE)Z}) $( out(SPACE); out(c); $) else out(c); break; case '/': /* thZ}is handles comments */ if(*(bufptr+1)=='*') $( out(*bufptr++); /* '/' */ out(*bufptr++); /*Z} '*' */ while(1) $( /* find the end of the comment */ while((*bufptr != EOL) && (*bufptr != '*')) $Z}( out(*bufptr++); $) out(*bufptr); if(*bufptr == EOL) $( /* if the Z}comment continues to the next line, we must add a '/*' */ i=1; while(*(bufptr+i)==SPACE) ++i;Z} if(*(bufptr+i) != '/') $( out('/'); /* start the new line with a comment it it isn't alreaZ}dy there */ out('*'); out(SPACE); $) $) else Z}if(*(bufptr+1)=='/') break; /* end of comment */ ++bufptr; /* not the end of the comment, so we continue the loZ}op */ $) $) else out(c); break; case EOL: /* this handles all returns */ Z} out(c); if((bufptr+2)='0' && c<='9') || Z}(tolower(c)>='a' && tolower(c)<='f')) return 1; else return 0;$)haracter or not */char c;$( if((c>='0' && c<='9') || XD/* Sieve of Eratosthenes *//* See BYTE , January 1983, for comparision with other computers *//* Takes about 5 minutes to r^}un, with the screen off */#define TRUE 1#define FALSE 0#define SIZE 8190char flags[SIZE+1];main() $( int i,prime,k,cou^}nt,iter; printf("10 iterations\n"); fast(); dpoke(19,0); for(iter=1;iter <= 10;++iter) $( count=0; for(i=0;i ^}<= SIZE;++i) flags[i]=TRUE; for(i=0;i <= SIZE;++i) $( if(flags[i]) $( prime=i+i+3; for(k=i+prime;k<^}=SIZE;k += prime) flags[k]=FALSE; ++count; $) $) $) k=gtime()/60; slow(); printf("%d primes (1899)\^}n",count); printf("%d seconds\n",k);$)++count; $) $) $) k=gtime()/60; slow(); printf("%d primes (1899)\\*/* File compacter. This will compact files with multiple load segments. *//* It is useful for .COM files produced by C, andb} assembly language object files. *//* Binary file must not exceed 6K! (about 49 sectors) */char *buf,*begin,*end,*place,*enb}dbuf,name[20];main() $(int iocb,tmp; iocb=getread(name,"COM"); buf=0x5000; endbuf=bgets(buf,0x6000,iocb)+buf; if(geb}tint(buf) != 0xFFFF) $( printf("Not a binary file!\n"); getkey(); exit(); $) buf+=2; /* get past the header *b}/ place=buf; while(1) $( if((begin=getint(place))<0) break; /* end of file? */ end=getint(place+2); /* end of firb}st module */ printf("\n%x - %x",begin,end); tmp=(end-begin)+5+place; if(tmp>=endbuf) break; /* end of file */ b} if(getint(tmp)==(end+1)) $( /* compact it */ printf(" Compacted"); *(place+2)=*(tmp+2); *(place+3)=*(tmpb}+3); move(tmp+4,tmp,endbuf-tmp); endbuf-=4; $) else place=tmp; $) close(iocb); copen(name,'w'); bb}uf-=2; /* this is to get the header we discarde at the beginning */ iocb=bputs(buf,endbuf-buf,iocb); close(iocb); putchb}ar(155); slow();$)getint(where)char *where;$( if(where>endbuf) return -1; /* end of the file */ return *where+(*(whb}ere+1)<<8);$)();$)getint(where)char *where;$( if(where>endbuf) return -1; /* end of the file */ return *where+(*(wh`/* File compare *//* This program will compare two files and tell you if they are the same */int n1,n2,count,c,c2,a1,a2,a3;f}char name1[20],name2[20];main() $( printf("Filename #1? "); gets(name1); printf("Filename #2? "); gets(name2); nof}rmalize(name1," "); normalize(name2," "); if((n1=copen(name1,'r'))<0) $( printf("can't open %s\n",name1); getkey(f}); exit(); $) if((n2=copen(name2,'r'))<0) $( printf("can't open %s\n",name2); getkey(); exit(); $) a1f}=a2=a3=count=0; fast(); while((c=cgetc(n1))>=0) $( if(c!=(c2=cgetc(n2))) $( slow(); printf("f} %d\n%s != %s\n%d != %d $%x != $%x",count,name1,name2,c,c2,c,c2); printf(" '%c' != '%c'\n",c,c2); f}printf("$%x $%x $%x >%x< $%x $%x $%x\n",a1,a2,a3,c,cgetc(n1),cgetc(n1),cgetc(n1)); exit(); $) ++count; a1=af}2; a2=a3; a3=c; $) if((cgetc(n2)>0)) $( slow(); printf("%s %s\n",name2,name1); exit();f} $) slow(); printf("%s == %s\n",name1,name2); exit();$) printf("%s %s\n",name2,name1); exit();dA