~Acftines Vol
Total Page:16
File Type:pdf, Size:1020Kb
~acftines Vol. I, Issue 3, April 1991 Price: $2.75 76. 68n. /llCbiD" js published and copyright (C) 1991 by Catham Rouse Company, RDI! BOI 371, Wyolling DR 19934. Ph. \302) 492-8~11. The edito~ is Jall~s H. DeStafeno. One year USA subscription is $12.\0. Canada aDd Mexico $14.2~. All otbers \surface $17.25. All "ajor credit cards ",cepted. Our low prices reflect a 10% casb discount. Please add 1 % to credit card orders. AnT site display ad,ertislng is accepted. The half page rate is $IO/issue. Write for other size/duratlon rates. Readers are encouraged to contribute letters, articles, programlling inforllation and other material related to cOllp"ters witb the 68n x) processors; excepting Macs and Amigas. Please send lIaterial to the above address. Thank you for your support. The This Issue: Editor's Tho~ghts By Jim DeStafeno Editor's thoughts 1 Ref1ections In 'c' 3 Bob van der Poel finishes his 3 part C programming Well. .. Due to Ron Anderson's series. treat, its even a tighter squeeze this month, but its well worth it. REX.R, S1t*DOS and We have had lots of questions OS-~/68000 . 5 about REXSDOS and 8K*D08; what are Ron Anderson discusses they, what are they I ike, where and compares the three can they be gotten, etc. Ron has operating systems. done a yoemans job discussing Advertiser's Index 1 them. He even tossed in 08-9/68000 for good measure. Guess Ron is one C1assified Ads 2 of four or five people that have written this article, He has long term in depth first hand experi ence with the three operatingsys Advertiser's Index tems. This makes him uniquely qua'" lified to undertake the task. I count us luck to have such a man Granite Computer Systems 3 on staff. And speaking of "good guys", The 68xxx Machines 4 van der Poel finishes his three part series this month. I'm not a Bob van der Poe1 Software 4 "e" programmer, yet I've been able to enjoy his ef forts. I hope l' ve delmar company 8, 9 convinced him to share wi th us more of the ways he has used to Palm Beach Software 11 solve vexing programming problems. still havn't heard from IM8 on Peripheral Technology 13 the MM/l or Frank Hogg Lab. s on their machine(s). April 1991 68xxx Machines Page 1 Microware has just announced a translater program that converts Se:1_ect:::i_<>ns In C source code of their 09/68K BASIC Part 3 of 3 to their 'c' compiler source code. That not only means a Basic pro By Bob van nor Poel gram can be compiled to M/L, but when written on one computer it will run on all the computers the Microware 'c' language runs on. I Last issue, in Part 2 of this feel this is a major pargramming series, we created an array of advancement. pointers to functions which let us Lastly, if you've written a create a cursor with different short program, have a new piece of video attributes. This month we software you'd like to evaluate or will take this concept one step have other information our readers further and set up an array which might be interested in, let us contains not only function point know. We are always interested in ers, but also a set of unique val printing articles from new writ ues paired to each function. This ers. And, as always, your comments type of table is very useful in and criticisms are welcome. the main input parser of a prog So, kick back and let Ron and ram. Bob take you for a ride; which My text editor VEO has a main would be hard if not impossibl e, loop which simply waits for a key to get anywhere else. press and then branches to an ap propriate routine: if the keypress is a character then we go to the edit() routine, if it is a control we execute the appropriate func Classified Ads tion. This could be done with a massive SWITCH .. CASE, but the met hod presented in the following - WANTED 55-50 equipnent. swr CPU fragments is much easier. First card, also Gimix PIO #28 (30 pin) FOG. off, a structure is needed which Alen E. Gordon, 11) / 160 NW 176 st / will hold both the keyvalues and Miami, FL 33169/ (305) 653-8000. the corresponding functions: - SALE Complete, ready to plug in; all struct jumpent{ hardware, software, manua 1s and ca char key; b 1es ; super fast 20MB hard disk and int ("fn)O; 35/40 track, double sided floppy disk } ; drive; both in one case, for CoCo I, II or II I. Works with both BASIC and Next, let's have a look at the 05-9. HD is partitioned. Used sparing idle loop: ly; $525. Jim DeStafeno / Rd 1, Box 315 / Wyoming, DE 19934 / (302) mainloop() 492-8511. { - SALE Tandy/TRS-80 Model 100 laptop 1* let the compiler know which C011luter. Bui It in 300 baud modem. routi nes we'] 1 be usi ng * I BASIC, text editor, communications software bui It in Ra1. Has 32K RAM. extern i nt addmacro(). append(), Includes modem and printer cables and £indO, all manuals. Good condition. $115 block(), delete(); including shipping. Phone Randy Krippner: (414) 853-1044. register int k; 000 static struct jumpent cmdsl]={ 'a'-Ox60, addmacro, Turn that old computer equipment into 'g'-Ox60, append, cash with a 68xxx classified ad. For 'f'-Ox60, find, Sale ads are $5.00 per 50 character 'b'-Ox60, block line. Wanted ads are just $2.50 per 50 'd'-Ox60, delete, character line. 0,0; for{; ;)( Page 2 68:u:x Machines April 1991 k=curkey(x,y,*curpos,O); if(k>=' , edit(k); e he if (do jump( k ,cmds » return -1: doerror{ "Unknown function"); } This function receives the key to look f or the base address of Of course, VEDs list of func the tabl e. I t loops through the tions is much longer. The main table until a match or the end of jump table has over 60 entries. the table is found. If the charac Both the structure and the loop ter 'c' is found in the table the are more complex, but this example corresponding function is called will suffice for our needs here. and a 0 is returned. If a match is What we have done is to set up not found a -1 is returned so that an array with entries matching the caller can alert the user that each possible keypress and the an unknown or illegal option was corresponding function. In this selected. example, if CTRL-A is pressed we The idea of jump table selec want to call the function tion can be expanded for your own addmacro(), for CTRL-D we want needs. For example, there is no delete(), etc. All we need now is reason for the match characters to a function, dojump(), which will remain type char. With a simple examine each entry in the array modification they could easily be looking for a match and, if one is changed to integers, floats, or found, call the corresponding fun even strings. It is also possible ction. to change things so that parame ters are passed to the functions, dojump(c,tbl) and with some trickery the func char c; tions could even return values. struct jumpent tbl[]; By using pointers to functions, we can create compact, fast C pro { grams. Due to space limitations, for( ; tbl->key; tbl++){ there is onl y space to show code if( tbl->key==c){ fragments and simple examples, but (*tbl->fn)(); with this base you should be able return 0; to expand this technique and adapt April 1991 68xxx Machines Page 3 the concept to your own programs. If you have any comments on this series or suggestions for future Grea~ 05-9 50f~ware articles please drop me a note here at the "The 68xxx Machines" or directly to me at PO Box 355, VBD: OS-9 Text Editor . $24.96 Porthill, 10, 83853. The best editor for OS-9 just got better. Version 2.0 of this best se ller now includes 36 definable mac ros, case-switcher, and even more speed. See the review in Mar/Apr Cli pboard. Works with 128 or 512K. Up I ......~ ~ .... grades to version 2.0 with new 28 pg. Coo I I 'C 1Il manual are $12.00 with proof of pur III III I "'QCc, -.f..o I chase. 'C~ .... ~ I .. 0- ........ I OIl"'" C C I "'N VPRINT: OS-9 Text Formatter. $29.95 1<1<'" .... I "'00 Qj Qj -~'-'.... An unbelievably powerful formatter. ~~ U Features include complete proportion 01 01 '" 'C'C ~' al font support, multiple columns, 01 01 c; c; footnotes, indexing, table of conte 01 0:1 I nts and more. Comes with 120 pg. man uu I I III ual, demo files and extensive macro 0000 I I ~ ..,. file. 512K RAM recommended. ;;J;;J I .... :e= 0- Cc I IIlC I I C ~"'~ ..; ! I ... ~ Ultra Label Maker 9 . $19.95 ... ,.II: ::s .. .... ~ •• .:J I I .... a~Q ........ .. .. COl> Turns your printer into a printing ~ ~ .c.... ao=.s ~~ 5 ~ ..~ IC..;E press for labels. WYSIWYG previewing. .. 'C .... N Supports ALL printers. Useful and ='!:!::S = .. QC lots of fun. One of Rush Caley's Top Ztf..lUtf..l fI.l.. ~~~ 10. Requires 512K Coco 3. Coco 2/3 version $14.95 Magazine Index System 9 ..