AS memory is used, it is possible tO test for remain- ing memory and take appropriate steps as it is de- pleted, without having tO worry about destruction Of the assembly routine. は has been suggested that asys- tem monitor be used tO place the routine in proper high memory. The most practical method for modest length routines is tO 'poke' it intO the proper memory slOt, as ー did here.ln bOth examples, the data is placed in 'data' statements and 'read' (and poked) intO memory. Don't be confused by the &H that precedes each number. This simply designates that the following number is hexadecimal. Short routines can be included with the main program. Longer routines should be located in separate programs, chained from the main program, and executed tO memory. Then the main program can continue. The primary thing tO note about the subrou- tine is the 'ret' mnemonic. This must be included in bOth 'usr' and 'call' methods in order tO return tO the maln program. 200 DATA & H54 ′ & HOD ′ & HOA ′ & H24 ′ & H54. & H68 ′ & H69 ′ & H73 ′ & H20 ′ & H69 ′ & H73 ′ & H20 10 20 30 40 50 60 70 80 9 0 100 115 120 130 135 140 150 160 170 180 190 200 210 220 PRINT CHR$(27);CHR$(43) : Ræ CLEAR SCREEN THIS IS A TEST OF THE CALL FUNCTION" PRINT PRINT:PRINT:PRINT PRINT "THE PRCERN'I CALL WILL BE SUMMONNED" PRINT I = & H8100 READ A IF A=&HFF THEN 120 : R ひ 1 ls the message delimiter found? 10 20 30 40 50 60 70 80 90 100 115 130 135 140 150 170 180 190 210 PRINT CHR$ ( 27 C 日 R$ ( 4 3 ) : REM CLEAR SCREEN PRINT 物 THIS IS A TEST OF THE tÆR FUNCTION" PRINT: PRINT: PRINT PRINT "THE PRCGRAH USR3 WILL BE SUMMONNED" PR INT I = & H8100 : Ræ STARTING ADCRESS OF SUBROUTINE READ A IF A=&HFF THEN 120 I ,A: REM BYTES INTO MNORY I=I + 1 110 GOTO 70 R EM 120 DEF USR3 = & H8100 X=USR3(1) R24 PR INT PR INT "THE USR3 SUBROtnINE IS DATA & HC9 ′ & H54. & H68. & H69 ′ & 日 73 を & H20 ′ & H69 ー & H73 ′ & H20 ′ & H61 ′ & H20 ′ & 日 50 160 DATA & H11 ′ & H11 ′ & H81 ′ & HOE ′ & H09 ′ & HCD ′ 05 ′ 00 ′ & H11 ′ & H24 ′ & H81 ′ & HOE H09 X)NE" DATA & HCD ′ 05.00 DATA & H52 ′ & H4F ′ & H4D ′ & H50 DATA & H4D ′ & H45 ′ & H53 ′ & H53 220 DATA & H31 ′ & H20 ′ & HOD ′ & HOA ′ & H24 ′ & 日 FF Figure 2. KE I ′ A I=I 十 1 110 GOTO 70 ADR=&H8100 CALL ADR REM PR INT PRINT "THE SUBROLTINE IS DATA & H11 ′ & H11 ′ & H81 ′ & 日 OE ′ & H09 ′ & HCD ′ 05 ′ 00 DATA & H11 ′ & H24 ′ & H81 ′ & HOE ′ & H09 ー & HCD ′ 05 ′ 00 DATA & ーに 9 ′ & H54 ′ & 日 68 ′ & H69 ′ & 日 73 ー & 日 20 ′ & H69 ′ & H73 DATA & 日 20 ー & H61 ′ & H20 ′ & H50 ′ & 日 52 ′ & H4F ′ & H4D. & H50 DATA & H54 ー & HOD ′ & 日 OA ′ & 日 24 ′ & H54. & H68 ′ & H69 ′ & H73 DATA & H20 ′ & H69 ′ & H73 ー & H20 ′ & H4D ′ & H45 ′ & H53 ′ & H53 DATA & H31 ′ & H20 ′ & HOD ′ & HOA ′ & 日 24 ′ & HFF Figure 3. The 'call' command is implemented. contiguous block in memory. or more are pointed tO by the [B,C] registers and form a registers, the second tO the [D,E] registers, and three depending on theiramount, are passed first tO the [H,L] the address 0f subroutine (line 1 20 ). The arguments, name>[ (argument list) ] '. The variable name contains passed via the ℃ a Ⅲ . The format is ℃ a <variable language) will suffice. But a large amount Of datacan be there is no argument so a simple ℃ a 『 ()s in assembly Simply define an address and ℃ a 『 it.ln this example, mand appears tO be somewhat easier tO implement. ure 3 for lines 120 and 130 of figure 2. The 'call' com- does not support it. Substitute lines 120 and 130 Of fig- require version 5.0 Of Basic-80 (MBasic); version 1 .4 TO use the ℃ a 『 command, refer tO figure 3. This will Subroutine access Via the command. figure 2 , the program first puts the 、 data' state- OCTOBER 1980 turned from the subroutine tO continue the main program. another sentence and demonstrates that we have re- cessing can continue from this point. Line 150 prints Again, we dO not care what was returned; further pro- was passed. Here X contains the value tO be returned. line 130 , returning data is usually Of the same type as pointers, data can be passed and retrieved at will. From cisely designated. Using the [H,L] register pair as locations in relation tO the [H,L] register pair are pre- Depending on which type is used, various memory number, and double precision floating point number. 2-byte integer, string, single precision floating point ever, several types Of arguments may be used, i. e. quire an argument, SO ー gave it a simple number. HOW- passed tO the subroutine. This example does not re- number 3. The argument is the means by which data is [<digit>] (argument)'. The digit is the subroutine subroutine, refer tO line 130. The format used is 、 usr subroutine number 3 is at 8100H (hex). TO summon the example, the starting address Of assembly language number Of 'def usr' statements may be used. 旧 this ever, by simply redefining a subroutine's address, any different routines may be defined at any time. How- the starting address Of the subroutine is specified. Ten ments intO memory at the chosen location.ln line 1 20 ;A SUBROUTINE TO PRINT A SIMPLE STATEMENT 8100 8100 810 3 8105 8107 810A 810B 810D 810E 8113 C9 8114 812F 8110 C 20 381 FEOO 23 D301 7E C20381 E680 DBOO 211481 START 415353454DMESSAGE ORG L XI IN AN I JN Z MOV 0 [ INX CPI JN 2 RET END 810 OH ・ ;ASSÜ•IBLE HERE ;RETURN TO BASIC : I F NOT IT AGA IN ;IS IT THE END? ー MO 、 UP MæORY LADDER ;OtnPUT CH.ARACTER TO SCREEN ;GET A BYTE OF MESSAGE ;JUMP TO START IF NOT READY ;MASK READY BIT ;CHECK CRT READY STATUS ;POINT REG. 日 TO MESSAGE START 00 0 IH START 8 OH 00H H,MESSAGE LANGUAGE IS EASY!' ′ 00H 8100H DT VERS 1.4 D8100 8100 21 14 8110 C 2 03 8120 47 5 5 8130 00 00 8140 00 41 81 81 DB C9 47 00 00 41 4 5 00 E6 53 20 00 00 53 49 80 C 2 03 45 53 00 4D 20 00 81 4 2 4 5 00 7E 4C 41 00 D3 59 53 00 01 2 0 59 00 2 3 4C 21 00 FE 41 00 00 00 4E 00 00 GUAGE IS EASY! . . ASSEMBLY LAN Figure 4. An assembly language routine and hex dump using more 00 れ entiona ロ / 0. げ you dO not have any subroutine in mind but want tO implement the 'usr' or ℃ a 『 commands now, fig- ure 4 uses more common coding and can be used for experimentation. Using an assembly language routine takes a fair amount Of work and bother; it better be worth it.ln our example, it certainly is not, but the example demon- strates the technique and should pique interest in test- ing this feature. ロ INTERFACE AGE 709
ECT 0 0 1 2 3 4 5 9 9 9 9 C) 5 6 BuiIding 引 ocks fO 「 Microcomputer Systems, Dedicated Cont 「 0 and Test Equipment RM-IO S -100 RACK MOUNT CARD CAGE ECT's 日 M -10 is a rack mount 10 slot Card Cage with Power Supply, consisting 0f an ECT-IOO rack mount Card Cage ( 19 " W x 12.25 " H x 8"D), the MB-IO M0ther Board (with ground plane and termination) 10 connectors and guides and the PS-15A Power Supply ( 15A @ 8V, 1 .5A @ 士 16V ). $ 295.00 (underline) Guess my 厄 e 「 lt's play time now. HOW about a game Of Guess My Letter? this game, the computerwill"think" Of a IetterfromA to 乙 You try tO guess whatletter the computer is "thinking" of. 100 REM* *GUESS MY LETTER GAME 1 1 0 CLEAR 200 120 A$ = "YOU GUESSED MY LETTER!!!" B$ = 、、 T 日 Y CLOSER TO THE BEGINNING OF THE 130 ALPHABET" 140 C$ = "TRY CLOSER TOTHE ENDOFTHEALPHABET" 200 日 EM**EXPLAIN GAME TO PLAYER 210 C LS PRINT 、 'I'M THINKING OF A LETTER FROM A TO Z" 220 230 PRINT "GUESS MY LETTER!!!" 300 REM**X=ASCII CODE FO 日 SECRET LETTER 310 X = RND ( 26 ) + 64 REM**GET GUESS (G$).IS げ A LETTER? 400 PRINT :INPUT 、・ YOU 日 GUESS (A TO Z)" ; G$ 410 旧 ASC(G$)<65 PRINT 、、 GUESS A LETTER!" : GOTO 410 420 lFASC(G$)>90 PRINT 、 'GUESS A LETTER!" : GOTO 410 430 REM**COMPARE GUESS WITH SECRET LETTER 500 旧 ASC(G$) =X THEN PRINT A$ : GOTO 610 510 旧 ASC(G$)<X THEN PRINT C$ : GOTO 410 520 旧 ASC(G$)>X THEN PRINT B$ : GOTO 410 530 600 REM**WINNER. ASK FO 日 REPLAY PRINT A$ 610 620 PRINT : PRINT ・・ TO PLAYAGAIN, PRESSSPACE BAR' KEY$ =INKEY$ :IF KEY$ = 630 ' ' THEN 620 ELSE 640 『 KEY$ = 640 ' ' THEN 210 ELSE 630 END 999 Copyright 1980 by JOhn WiIey and Sons,Inc. ThiS iS a continuing series fO 「 parents and teachers WhO WiSh tO help kids learn how tO use, program and enjoy the RadiO Shack TRS-80 computer. The series began in the Aug-Sep 1979 issue 0 ロ A. Parts 1 through 3 are available free as an 8-page booklet from Sharon ROSS, Radi0 Shack Circulation Dept. 3 , 1300 One Tandy Center, Forth Worth, TX 76102. ロ ◆◇ ec ね伽加 0 加 0 襯 / icrocom 〃 e ′〃 a 翩影 a 賠 ECT 加面 $ ・石 a ″側・ Sma 〃 Business ・ Personal CaM Cages, PO S 〃 , 解 a 加 m , CPU'S, 解 emo , 〃 0 , 0 石′ね加 s INQUIRY NO. 14 良 TR ① NIC CONTROL 蘢新間加 763 Ramsey A 冊 . , HiIIside, NJ 07205 ( 201 ) 686-8080 TM CP 86 "Operating System of the 80 ' s fo 「 the Processor ofthe 80 ・ s. MMT. lnc. announces a sophisticated interactive operating system for the lntel 8088 / 8086 processor. CP86 includes dynamic file management. an 8086 assembler with t com ・ patible mnemonics. a ne 「引 purpose text editor and an ad ・ vanced program debugger. File structure. command syntax and system calls are almost entirely compatible with CP/M 2.2. . S300 CP86. AvaiIabIe only through your local dealer. beginning Dec. 20 *CP/M is a registered trademark of Digital Research. 0 0 0 0 ELECTRONIC MAIL ON 0 0 0 0 0 0 0 0 0 川 川な川なルーで , カ P_O. 日 OX 29411. 日日 00K し Y 、 CENTER. MINNESOTA 5 四給 1 560 る 530 CIRCLE INQUIRY NO. 42 OCTOBER 7 980 INTERFACE AGE 33
Features include: microprocessor controlled and programmable with 32 system-level soft- ware commands, graphics dOt plotting mode, 96 Ascii characters with upper and lower case. A 0 , print with nine software form whenever a paper-motion command causes text tO fall outside the programmed text. The RAM-based 16-channeI vertical an all-metal cabinet. Optional interfaces in- clude an RS -232 current loop, IEEE 488 and a custom AppIe interface. は is available with either friction 0 「 tractor-type paper feed. Price with the standard friction-feed head is $ 710. Epson America,Inc. , 23844 Hawthorne Blvd. , Torrance, CA 90505. CIRCLE INQUIRY NO. 134 format control corresponds to the selected textlength. Program-seIectable print pitches available are: 12.5 characters per inch, 8.33 cpi, expanded 8.33 cpi, 6.25 cpi, and 4.16 cpi. The printers continue to offer 1 0 cpi fo 「 normal printing, and 167 cpi, making it possible tO print 132 columns on paper 81 ん inches wide, 0 「 227 columns on 1 47/8-inch ( 387 (m) paper. Price of HP 2631 B is $ 3 , 600 and $ 3 , 950 fo 「 HP 2635B. Hewlett- Packard CO. , 1507 Page Mill Rd. , Palo A は 0 , CA 94304 , ( 415 ) 857-1501. CIRCLE INQUIRY NO. 133 selectable sizes from 5 x 7 tO 1 0 x 1 4 character fonts, reverse font printing capability, standard parallel and serialinte 「 - face, 1 1 0 tO 9 , 600 baud and adjustable trac- tO 「 width fO 「 paper size slection. Prices for kits are $ 295 fO 「 the 40 column and $ 455 for the 80 column. Assembled and tested printers run $ 325 for 40 column and $ 485 fo 「 the 80 column. C00S0 い nc. , P. 0. Box 743 , Anaheim, CA 92805 , ( 714 ) 545-2216. CIRCLE INQUIRY NO. 132 Dig printers, designed fO 「 truck weighing scales, 0 ⅱ metering and medical test equip- ment, are offered in tape 0 「 ticket printing versions. Four tape printer models Offer a choice of 6- 0 「 12-column formats with the mechanical unit, and optional BCD interface electronics. Four ticket printers Offer 5- or 1 1 -column formats with 0 「 without the BCD interface electronics. AII models include drive electronics. Standard open frame Dot•matrix serial printers offer refine- ments in paper- and forms-handling, five print pitches for greater flexibility, optional higher-density print matrices and RS-232-C interface. The HP 2631 B printer and HP 2635B printing terminal allows paper tO automatically advance tO the next top-of- 80- co 他 m れ dOt matrix printer, the TX-80, designed tO interface with personal com- puters, is capable Of printing a full 96 Ascii and 64 graphic characters at the rate of 1 25 cps. The printer uses a 5 x 7 matrix that allows the printing Of descenders, and is controlled by an internal microprocessor in units are supplied with taps fO 「 1 2 v dc, 1 1 7 v ac or 220 v ac power inputs. Smith & Wesson, 2100 RooseveIt Ave. , SpringfieId, MA 01 101 . CIRCLE INQUIRY NO. 135 Graphics interface, SDI, designed fO 「 Cromemco computers, displays COlor or black-and-white images with up tO 756- by 484-point resolution. Features are color map selection, dual page windowing function, automatic area fill mode and NTSC broad- cast compatibility. Consisting Of tWO circuit boards which plug directly intO a S-100 bus, the interface uses direct memory access tO display the contents Of a display memory. Each pixel may be mapped from one nybble or one bit Of the display memory. Bit-mapped OCTOBER 1980 TALK YOUR 釦砒印ね YO / 餞 Ⅳカ a mo speech rec- 0 / ″ 0 〃 is a/S0 avai/able 期 the HeuristicsTM 208 P FOR S- 100 computers, ゆ 0 speech 肥 CO / ″ 0 〃 a / 側 can Heuristics 20S and 50 加 a S. 加 / e The 20m also makes a Ⅳ S25 recognize 64 S orphrases practical s ね system 可 chOice multiples the Heuristics 50m e 肥助 . 硼 command any a 叩″ ca ″ 0 〃 . and 7000 industrial/commercial speech The advanced Heuristics 2000 ⅵ micro- 肥 CO / 加〃 . Prices 「 these modu/es phone 加 c ルグ brings a 勀 0 / e 〃 e ル hands- s ねな $ 20 硼 0 ″ approach ね e 〃 and program SO the nexttimeyou カ a 由ね e 厩 contro/—for a surprising/y / 0 ル $ 259 〃 ル 0 S toprocess ormenus se/ect, 血〃 7 ル 0 水 optiona/ カ田グ - s 加 ge 「 s e 加 . HEURISTICS 2 側 0 microphone (shown 佐川叩 / e above)isa/soavai/able. The ね佐可 the com.硼ね「加血 s " HeuristiGS 加 c. , 7285 mme 解 0 Avenue, Sunnyvale, CA 94086 ・ 4 田 / / 34-8532 CIRCLE INQUIRY NO. 21 育 2 INTERFACE AGE
My TRS-80 Likes Me When ー Teach Kids H0w to Use by B0b AIbrecht Ascii Land Wandering Star is on vacation. This time we will talk more about those numeric codes that stand for characters. Remember: Wandering Star ( ☆ ) is 42. Cosmic dust (. ) is 46. Empty space に ' ' ) is 32. Every keyboard character has its own numeric code, called an Ascii. Ascii means American Standard COde fO 「 lnformation lnterchange. LOts Of computers use it. The TRS-80 uses it. SO, we will use it. The Ascii code fo 「 A is 65. The Ascii code fo 「 B is 66. The Ascii code fo 「 C is 67. Guess the Ascii code for D. Guess the Ascii code for 乙 Yes, the Ascii code fo 「 D is 68 and the Ascii code for Z is 90. The Ascii codes fo 「 A through Z are the whole numbers from 65 to 90. Basic provides a built-in function called ASC which gives the Ascii code for any character. Clear the screen and try these. You type: PRINT ASC("A") は prints: 65 You type: PRINT ASC("B") は prints: 66 You type: PRINT ASC("Z") は prints: 90 You type. PRINT ASC(" は prints: 42 You type: PRINT ASC(" ' ' ) は prints: 32 Experiment! Use the following program to find the Ascii codes for keyboard characters. REM* *ASCII CODES FO 日 KEYBOARD CHARACTERS 100 1 1 0 CLS PRINT : INPUT "KEYBOARD CHARACTER" ; KEY$ 120 130 CODE = ASC(KEY$) 140 PRINT "THE ASCII CODE 旧 ' ' CODE 150 GOTO 1 20 Here is what happened when we ran the program. KEYBOARD CHARACTER? THE ASCII CODE 旧 65 KEYBOARD CHARACTER? ☆ THE ASCII CODE 旧 42 KEYBOARD CHARACTER? 1 THEASCII CODE 旧 49 KEYBOARD CHARACTER? THEASCII CODE 旧 32 Try some keys yourself. FO 「 most keys, the program will work. げ your exploration is quite thorough, you may run into OCTOBER 7 980 S-100 MULTI-FUNCTION I/O BOARD Has tWO serial Sync/Async ports ( RS -232 , current loop 0 「 TTL) with individual Xtal controlled programmable baudrate genera- tO 「 S. Four 8-bit Parallel ports; one latched input port and other three can be programmed in combinations of input, output 0 「 bidirectional. A 0 , has three 1 6-bit Programmable Timers and an 8- 厄 v Programmable lnterrupt Controller w/Auto restart (8080 / Z80). Other features include; on-board clock divisor fo 「 timers, completely socketed, wire wrap posts f0 「 easy port configuration plus lOre. A & T w ん ser's Manual. . (P/N 52748-100 ) $ 375.00 善 S -100 "SMART" PROTOTY 円 NG BOARD Provides flexibility with ou 「 Bus. 、 い第応 Bar matrixed power distribution. い気濠ミ煢 Ou 「 "SMART" Prototyping Board allows building your circuit(s) with ease and saves you hours Of power busing layout time. ldeal fO 「 Memory, CPIJ, レ 0 ′ A/D, D/A. Disk Controiler, etc. Accepts all standard .300' and .600" 「 ow spacing l/Cs 0 「 sockets. Top row on .100 " center spac- ing allows mounting Of standard Header Connectors. Kit—includes two Bus Bars with power supply ( + 5V , 当 2V ) com- ponents ()s shown on phOto) (P/N 52748400 ) $ 4935 . (P/N 52748-4XX ) $ 2935 Board only . ・ Calif. Residents Add 6 % Sales Tax. u. S. Domestic price. price Subject TO Change Without Notice. I/O TECHNOLOGY FOR MORE INFORMATION P. 0. Bo x 21 1 9 Canyon Country. CA 91351 CALLOR WRITE; Phone ( 805 ) 252-7666 CIRCLE INQUIRY NO. 22 30 INTERFACE AGE
co kee が取 g problems? CCA Data Management System solves them easily. And it also gives you greater data handling flexibility. cus- Having information at your fingertips can make your j0b a tomize DMS, write add-on BASIC programs that read or write whole lot easier. And that's what the CCA Data Management DMS files and perform any kind of processing you want. System is all about. You can so 社 and print your data ⅲ nearly any form 0f With this Personal Software ' " package and an Apple Ⅱ ' " report and mailing label you want. SO data by up to 10 fields or TRS-80 " disk system, it will be far easier to keep inven- tories, customer lists, accounts receivable and payable records, for zip code, balance due, geographic location or whatever. And print reports with subtotals and totals automatically patient histories and many more items. ln 信 you can use the CCA DMS for all of your data calculated. Apple DMS has two additional features. lts ISAM management needs, rather than buying (expensive) or writing search method helps you find any item on a diskette within (time consuming) separate programs for each applica- 10 seconds. And it's Data lnterchange Format Program tion. That's because DMS lets you create your own allows you t0 move DMS files into our Apple VisiCalcT" filing systems, adapting itself to the types of records program—the "electronic worksheet"—for powerfu し you keep. You specify the number and names of flexible calculating. each data field—without any programming ・ Ask your Personal Software dealer to show you how With DMS keeping all of your records, you only have tO learn how use one system. That's easy computenzed record keeping is. TO locate the nearest dealer, contact Personal Software lnc. , easier, t00. lt's menu driven, with plenty Of 叩 8 / 745-784 お 30 Bordeaux Drive, Sunnyvale, prompts t0 help you create files and add, update, scan, lnspect, delete, SO 鴆 con- CA 940 跖 . dense and print data. Our compre- h000 ⅳ 0 0- page step-by-step イ : 冫。 instruction manual even provides complete ' OW tO" inventory and mailing list applications so you can start processing mmediately. DMS is a very powerful sys- tem, with more 61e and record storage capacity than other data base programs on the market. *Apple is a trademark Apple Computer, (. : TRS-80 is a trademark the Radio Shack Diu ofTandy Co 「 p. 0 を 0 CIRCLE INQUIRY NO. 48 らづり ー第興デば一・ 1 第ーリ取 訂川Ⅲ埠川
comes in. Suppose you had two $ 50 checks and one $ 1 OO check outstanding, and the bank says it paid $ 100 on your account. Not even your super-whiz home computer is psychic. SO the tie breaker in this go - rithm is the order in which the checks appear on the list.lf at least one of the $ 50 checks appeared on the list before the $ 100 one, the solution given would be that the two $ 50 checks had cleared. The degenerate case for the algorithm is if the on ツ check cleared was the last one on the list, and itS amount was more than the sum of 訓 the others that precede it. The program will then try every possible branch 訓 the way tO the bottom before it finds the answer. You can speed up the solution by sort- ing the checks intO decreasing amount order before running the tree. But this will change the tie breaker—the $ 1 OO check will always be earlier on the list. ー order my data in check number sequence, SO my tie breaker is first in, first out. Sometimes ー have special knowledge, SO ー cheat and adjust the input 「 eco 「 d. は is always easier tO use the program tO find out if there is more than one possible solution, but you need special knowledge tO know which solution is right. P 「 09 mm 9 i れ fO 「 ma 00 The program shown is written in Microsoft's Basic -80, version 5. Since mine is the compilable one (Bascom 5. OI ) , ー have been lavish with remarks and lengthy mnemonic variable names in the listing—neither Of which are carried over intO the machine-language run-time version. げ you are using an interpretive BasiC and are tight fO 「 space, you will find that pruning the variable names down to their first two characters will not introduce any ambiguities.lt will so prevent the REM in remainder from causing difficulties in versions Of Basic that don't 訓 ow buried reserved words in variable names. げ you are not familiar with Basic-80, version 5 , there are some Other changes from earlier versions you should be aware of before you read the program listing. One is the elimination Of the need for semicolons as concatenating separators in variable liStS in ・ print' or 'lprint' statements—spaces are acceptable substitutes (). g. , line 1060 ). 'WhiIe … wend' has been added to satisfy the anti - goto' structured programming bigots. げ you don't have ・ while … wend,' you can substitute an 'if … goto' for the ・ while' (reversing the sense of the logic statement) and a ・ goto ' fO 「 the ・ wend. ' FO 「 example, line 1 120 would become ・ if eof(l ) goto 1 170 , ' and line 1 160 would be ・ goto 1 120. ' Another substantive change in version 5 : Microsoft has belatedly recognized that ・ fo 「 ... to ' loops should always be tested at the ・ for... tO ' line, not at the ・ next' line. This means that if the index already exceeds the ・ tO ' value on entry, there will not be an unwanted first pass.lf your Basic is deficient in this respect, you will have tO fix it with a detouring ・ if... goto ' line before entering the IOOP that starts on line 5030. Such a de- tour is not needed before line 4180, because the cir- cumstances can never arise at that point. Line 4220 is put in because ー hate to stare at a blank display screen wondering if anything is going on inside the machine. The pruned check numbers will be displayed on each pass. UnIess you scroll Off by spending t00 much time climbing t00 many bran- ches, the complete path will remain on the face of the screen when the program finishes—pro- viding you sent the out- put tO the printer as shown. The full-blown Ascii listing shown (written with Microsoft Edit-80) is stored on 8K of disk. The final operational machine-language program lives on 19K Of disk, but that includes all the system functions it needs that otherwise would be provided by the Basic interpreter. ー don't know the minimum memory size in which this program would 「 un in interpretive mode. ー am certain that a properly transliterated version would fit easily in a system that has the Basic interpreter in 日 OM and 16K of RAM. は might even run in 8K. Since the file us- ed is sequential, it could be on a cassette tape instead of on disk as shown. Carrying along the ・ payee' in the records is Of marginal utility—the added information is barely worth the effort in keying it in. On the Other hand, if you are inserting the algorithm intO an already existent check register program, you can embellish it by adding another array variable tO carry the check date. A bug creeps ー used this program in this form almost daily for over two months, and it hasn't blown yet. That is not to say that it is bug free.ln fact, a subtle bug has shown up. は is in Microsoft's release 5. OI of their Bascom. The penny function FNA(W), defined in line 560 , will produce single-precision results, in spite Of the fact that the く name> Of the function, A, has been defined as a double-precision variable. This bug has allegedly been fixed in release 5.1 . Test your version Of Basic, and, if necessary, insert a ・ defdblf' in the program tO fix this implementation bug. ー have used a variety Of programming styles, as an exercise and would suggest that you study the listing until you understand the concepts, and then reprogram the application tO fit your own environment. ロ CC- ー 0C0 ー 00 ( —-----eeece の 0 ー 0000 ー e 00 ー . 一 eccce 00 ・よ CC 00
CHOOSE... Choose an AppIe Desk に u 前ユ luu ーこ道 uu れ what you want, then color is what you enough wires and cables tO thrill an get. For "under $ 400 , " it is offering a electrician, the strange-looking expan- 4K RAM, 8K ROM unit with a 53-key sion interface, and the accompanying giggles from the rest Of the computer typewriter-type keyboard, 1 , 500 baud industry. That scenario has not been cassette interface and RS -232 serialin- repeated. The model Ⅲ has gotten rid terface. The color computer provides a Of that cheap, plastic IOOk, shows some screen format Of 16 lines, 32 characters- excellent styling, and doesn't have a per-line and graphics arrays from 32 by visible cable—except tO peripherals. 64 tO 196 by 256. The machine uses plug-in color program pack, and the initial fact, the unit resembles the offering includes: personal finance, AppIe Ⅲ in many respects. CertainIy, A bi-level desk ideal fo 「 an AppIe math, bingo, chess, checkers, music, bOth feature themselves as integrated computersystem. This 42 ” x 31 % ” desk cor 第 with a shelf to ho two AppIe disk drives. The football, pinball and quasar commander. units with keyboard, memory, and top shelf fO 「 your TV 0 「 monitor and manuals The program packs sell f0 「 $ 29.95 tO diskette storage capabilities in one. can a 0 have an optional paper 引 Ot tO accom- $ 39.95. Joystick controls with push- This RadiO Shack offering has a hand- Odate a printer. button triggering are $ 24.95. A 16K some sculpted keyboard, a variety Of Choose a Micro Desk RAM unit is available as an expansion memory sizes ranging from 4K tO 48K option fO 「 $ 218 0 「 as a complete unit, and up tO tWO onboard diskettes with a upping the system price tag tO $ 599. A configuration limit Of four. matching 1 3-inch color TV receiver is The model Ⅲ is available in three ver- available fO 「 $ 399. sions. The levell system with 4K Of Looking very much like the color RAM prices at $ 699. は will reportedly computer, but bearing a different key- run with 訓 modell,levell software pro- board, is the Videotex terminalthat will grams as it uses the levell Basic. A second version with 16K Of RAM sell for $ 399 and be available in and model Ⅲ Basic will sellfor $ 999 and Get your micro computer off the desk top and November. は includes a direct-connect intO the micro shelf under ou 「 Designer Series features upper and lower case. telephone modem and 4K 0f memory, desks. SuitabIe fo 「 the North Star, Dynabyte, The third version, dubbed the desk- and can be used for accessing net- Vector Graph ics, and Altos computers The top business computer, has 32K Of works such as Micronet. deskS come in a variety Of sizes and CO ー 0 「 S. RAM, two double-density 40-track disk RadiO Shack is quick tO point out that Choose a Mini Rack drives, an 日 S -232 serialinterface and the Videotex terminalis just that... a ter- sells for $ 2 , 495. は can be expanded tO minal, and despite its resemblance tO the full 48K and four disk drives. One Of the color computer, is not a computer. its high points is the ability tO read exist- The daisy wheel printer is just that, a ing modell disks, which immediately daisy wheel printer, with some unique makes 訓 Of that software out there application Of plastics and a price tag Of available fO 「 immediate use. The model $ 1 960 ー we below the average. Ⅲ Basic is "compatible with most The printer plotter, at $ 1 460 , is T 日 S -80 modell programs," according to bound tO become quite popular. は the company. lnterestingly enough, the features multidirectional printing and company still denies that production on has an average print speed Of CPS on the modell has been stopped. 7.5-inch lines. The Lineprinter Ⅵ , a wide bed 100 CO 「 s , at last CPS printer featuring bidirectional 9 by The long-awaited color unit seemed 7-dOt print head, can use between dwarfed in this announcement by the 4-inch and 1 5-inch paper, has a built in previous tWO products, but if color is character self-test and limited graphics capability. Made overseas, the unit car- ries a $ 1 , 160 price tag, is being made exclusively f0 「 Radi0 Shack and uses a Centronics-type interface. lncidentally, one Of the chief criticisms against RadiO Shack has been the way it refuses t0 acknowledge any- one else in the industry. lts marketing policies in company-owned stores high- light this view, since it doesn't even 訓 OW non-Radio Shack publications tO be SO 旧 . That wall may be about tO crack. Along with the Videotex announce- 物 ment, RadiO Shack a 0 advised us that it will be selling a videotex software package f0 「 Apple that will retail for $ 29.95 , and are seriously considering an offering Of the package fo 「 other popular microcomputers. OCTOBER 1980 Mini racks and mini ーれ iC 「 0 racks have standard venting, cable cut outs and adjustable RETMA rails. Choo a stand alone bay 0 「 a 48 " , 60' 72 ” desk modelin a variety of co 「 s and wood tones. A custom rack is available for the C 「 0 ー第 e ー第 CO. Choose a Printer Stand The UniversaI printer stand fits the: Centronics 700 ′ s DiabIo 1600 ′ s & 2300 ′ s Dec LA 34 T ヨ : 810 & 820 NEC Spinwriter Okidata Slimline Lear SiegIer 300 ・ s Anadex 9500 ' s Delivery in days on over 200 styles and co 「 s in StOCk. Dealer inquiries invited. ELECTNONIC 5 5 〒 EM 与 FURNITUNE COMe リ 17129 S. Kingsveiw Avenue Carson, CaIifornia 90746 Telephone: 213 / 538-9601 CIRCLE INQUIRY NO. 16 第 8 INTERFACE AGE
A ル MO PERFEC. TM The MAGfC WAND 。 We've been saying it for a few months IIOW, and the reviewers seem tO agree. UntiI I saw the Magic Wand, if I were allowed to own one and only one editor, Word Star* would have been it. . My personal preference is for Pencil or Magic Wand for text creation. Jerry Pournelle On Computing, Summer 1980 The basic functions of the Magic Wand editor are as easy to learn as those Of Electric Pencil*. Of print formatting. Magic Wand dominates in the area Larry Press On Computing, Summer 1980 Of all the word processors I have used (and that includes a dozen or more), the Magic Wand is the most versatile. The Wand has almost all Of the features Of Other processors, plus many new ones Of itS own. lt measures up tO even the word-processing software running on the largest mainframe computers.' Rod Hallen Microcomputing, June 1980 The Magic Wand is one of the most flexible word processing packages available, and should be considered by any potential word processing purchaser. Glenn A. Hart Creative Computing, August 1980 AvailabIe for b0th the CP/M@ and OASIS operating systems 3220 Louisiana ・ Suite 205 ・ Houston, Texas 77006 ・ 713 ー 528 ー 5158 CP/M is a registered trademark 研 l)igital Research Corp WordStar is a trademark of Micro Pro lnternatlonal. lnc. EIectric Pencil is a trademark 研 Michael Shra 、 'er S0ftware,Inc OCTOBER 1980 CIRCLE INQUIRY NO. 93 INTERFACE AGE 105
0 い Ob ・「 1980 lssue Void after December 31 , 1980 円・ ase type 0 「 print ANSWER THE FOLLOWING BY CHECK- ING ONLY ONE BOX PER QUESTION : 謝旧 C れ一しこ当 C Name lCompany Address Ph (A/C) に Home い Business State ー 76 77 78 79 80 81 82 83 84 85 86 87 51 52 53 54 55 56 57 58 59 60 61 62 26 27 28 29 30 31 32 33 34 35 36 37 1 2 3 4 5 6 7 8 9 10 11 12 lPlease send information on items circled below: 13 38 63 88 14 39 64 89 15 40 65 90 16 41 66 91 17 42 67 92 18 19 20 43 44 45 68 69 70 93 94 95 Country 21 46 71 96 22 47 72 97 23 48 73 98 24 25 49 50 74 75 99 100 h01 102103 104 105106 107108109 110111 112113114 115 116 11711811 120 121 122123124 125 h26 127 128 129 130131 132133134 135136137138139140141 142143144145146147148149150 h51 152 153154 155156 157 158159160161 162 163164165166167168169170171 172173174175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199200 卩 01 202 203 204 205 206207 208 209 210211 212 213214 215216 217 218219220221 222223224225 PIease use the following numbers tO answer the survey on page 144. 76 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 卩 26 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 に 51 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 国 01 402403404 405 406407408409410411 412 413414 415416417418419420421 422 423424425 レ 26 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 READER SERVICE CARD2 A. 8. C. D. E. F. G. A. 8. C. D. E. F. G. A. B. C. D. E. 8. C. E. F. G. A. 8. C. D. A. 8. C. D. E. G. A. C. D. E. F. G. 応 C. D. E. ロ「 0 他 ssion 引 ( 6 朝 c 引 . Accountin . Law. E に . ) ロ Eng ⅲ ee 「 (Mechanicai, Electrical. tc. ) C)Business ( 日 a ⅱ . WhO s 謝剱日 c. ) lZEducational ( pro ー 6350 「 . Teacher, A33i3 愴猷 . E に . ) CjGovernment (Armed S ・Ⅳに 63 , State. Federal, Etc.) ロ Consumer (HObbyist, 日 c. ) ロ 0 ー he 「 cÆwner/President ロ Executive Officer ロ Division/Department Manager CJSupervisor ロ General Staff CJConsultant ロ 0 物 0 「 ロー mme 朝 a urchase C.1Purchase ・ 60 days CCompariSOns CJLiterature Library ロ Oth 町 GBusiness and Pe 「 son ロ Pe on 引 On ツ C)I nstructional ロ Research and t)eveiopment CDOEM ロ 0 物 6 「 CJHardware ÜFirmware [ 」 Sottware ロ 0 ⅲ ÜACC0untin System ロⅢ 0 80nk6 system ロ Process ContrOl System 〔」 Medic Research ロ Ed ucational System ロ 0 Ⅲ師 OGames ロ Home Econom ics OComputer Art and GraphiCS ロ Personal lnvestments ロ Ch i 馗 Educational D ・引 opm ・ n ー C)Sports ロ 0 ・「 ロ 0 ・ $ 1 .9 「 ] $ 2 , 刈・ $ 4 的 ロ $ 5 工 0 ) ・ $ 9 , 9 的 「」 $ 100R ・ $ 20 , ロ Ov $ 加 ANSWER THE FOLLOWING BY CHECK- ING ONLY ONE BOX PER QUESTION ー旧 C れ一 L こ当 C Name Title lCompany ー lAddress City Oc b 部 1980 lssue Void a 町 December 31 , 1980 円 eas ・ type 0 「 print Ph (A/C) に Home Country い Busir,ess State lPlease send information on items circled below: 10 35 60 85 101 102 103 104 105 106 107 108 109 1 10 1 1 1 1 12 1 13 1 14 1 15 1 16 1 1 7 1 18 1 19 1 2 3 4 26 27 28 29 51 52 53 54 76 77 78 79 5 6 30 31 55 56 80 81 7 8 9 32 33 34 57 58 59 82 83 84 1 1 12 36 37 61 62 86 87 13 38 63 88 14 39 64 89 15 40 65 90 16 41 66 91 1 7 42 67 92 18 19 43 44 68 69 93 94 20 45 70 95 2 21 46 71 96 22 47 72 97 23 48 73 98 24 49 74 99 25 50 75 100 1 21 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199200 国 26 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 レ 01 402403 404 405 406 407 408409410411 412413 414 415416 417418 419420421 422423424 425 卩 76 377 378 379 0 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 3 397 398 399 48 地 51 352 353 354 355 356 357 358 359 360 361 362 363 4 365 366 367 368 369 370 371 372 373 374 375 卩 26 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 厄 01 302 303 304 305 3 307 308309 310 311 312 313314315 316317318319320321 322323 324 325 卩 76 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 PIease use the following numbers ー 0 answer the survey on page 144. P01 202203 204 205206207 208209210 211 212213 214 215216217 218 219220221 222223224225 A. C. D. E. F. G. 3 C. D. E. F. G. A. C. D. E. A. C. D. E. F. G. B. C. D. A. 8- C. D. G. 8. C. 0. E. F. G. 8. C. D. E. ロ「 0 他 ssion (MedicaI. Accountin Law, 日 0. ) ロ E09 ⅲ e ・「 (Mechanicai, E 畑 ctr に創 . に ) ロ Bu 引 n633 (Retail. WhO 他、引 E . ) CEducational ( P 「 0 330 れ Teacher, Assi 引 a ⅲ . E . ) ロ Government(Armed S ・Ⅳに・ 5. a 怕 . Federal. 日 c. ) tZConsumer (Hobbyist. 日 c. ) ロ 0 ・「 「 j gwner/President ロし一ⅳ・ 0 ic ・「 DDivision/Department Manager ロ Sup ・Ⅳ i30 「 ロ General S ね ロ Consultant い Other Ælmmediate purchase ロ Purchase ・ 60 days CComparisons ロ L ・「 a ー u Library ロ 0 ー he 「 朝 usiness On ツ ロ Bu 引 n ・ 55 and P ・「 30n 引 ロ P 部 30n 謝 On ツ こ」 nstructional に Research and Development ロ OEM ロ 0 ・「 ロ Firmware ロ Software ロ 0 物・「 GACCOuntin System ロ旧 entO Ⅳ ontrol System ロ P 「 oc ・ 53 Control System OMedlcal Research ロ Educational Syst ・ m ロ 01 her 「第 Hom ・ Economics ロ Comp い・「 Art and G ph に 3 ロ P ・「 30n 創・引 m ・ n ーー い Child Educational Developm ・ nt ロ SPO パ 3 ロ 05 二 $ 5 刈・ $ 9 報 冂 $ 10 刈・ $ 加 , 网 Ov 町 $ 20 ド
tions until it encounters a question with a zero value in 、 yes(l). The program has run out Of questions. は is time to guess. Lines 310 tO 340 make the guess and lines 380 to 400 handle a correct response. The 「 emainder Of the program handles an incorrect guess. The variable 'empty' points to the next open slot in the 'ask$' array. Here we place the correct answer from ou 「 teacher. Next, we take the incorrect guess and remove it from 'ask$(l)' and place it in the next open slot in ・ ask$. ' The program will use the new question put in ・ ask$(l)' to choose between the guesses in 'ask$(empty)' and 'ask$(empty + 1 ). ' げ the correct answer for the new guess is 'Y' then line 520 sets up the yes and no arrays. Otherwise line 530 does the WO 「 k. NOW the program is ready and able to try again. The eager young teacher will shortly have a well-educated student. But don't stop there; this program is easily modified. HOW about teaching the computer about the states or animals, English novelists, or BibIe characters. Almost any subject can be taught tO the AppIe. WhO knows... you might end up with the best educated computer (and child) in the neighborhood. ロ PROGRAM LISTING BfiKER'S 6 日 E 第じロ日 E 日 Computers AS Teacher's Pets Kids are natural teachers whO love tO show how smart they are. Listen tO them. They're always explaining things t0 each 0ther and their parents. What a child needs is a good, patient student. Kids SO love guessing games and SO does an Apple com- puter. The AppIe doesn't know much, but it learns fast and is never bored. . . it's a natural student. GOOd teacher and good student—put them together and you have education. The Apple is learning from its young teacher and bOth are having fun. But isn't it the young boy or girl whO is supposed to be learning? け you think this is a problem, you've never taught. NO one ever learns more than the teacher. The best way tO get someone, even a child, tO learn, is tO force him tO teach. Those students whO surpass their teachers dO SO 0 可 y be- cause they have found a better teacher—themselves. They have learned the secret oflearning. That's why children are naturalteachers before they are taught tO be students. The Presidents The basic concept behind this program has been around fO 「 years. Apple Computer has a similar program called Animals on its DOS 3.2 program disk. The concept is simple, and the program is easy tO under- stand. The child thinks up the name Of a President Of the United States. The computer tries tO guess whO it is. げ the computer is wrong, the child tells the computer what addi- tional question it should have asked. The young teacher has taught its electronic student a lesson in American history. Three notable features about the process are: the com- puter doesn't have tO be filled with a lOt Of facts, the child has tO learn about the subject in 0 「 de 「 tO teach his student and the computer uses guessing games that are fun tO play. Besides an Apple computer with AppIesoft, you need a bOOk on the Presidents. After 訓 , a good teacher should know about his subject. Take a guess The program starts with one question and tWO guesses. These are set up in lines 130 through 150 コ f the answer is yes, then the computer will guess George Washington.If the teacher replies with a no, the computer guesses Jimmy Carter. That is the total extent of the program's knowledge of the American Presidents. Each question and possible guess are kept in the list of strings 'ask$. ' Suppose we are asking question l. は is in 'ask$(l). ' 'Yes(I)' will point tO the next question tO ask if the answer is Ⅳ ' and 、 n00 ) ' will point tO the next question tO ask if the answer is 、 N. コ f 'yes(l)' doesn't point anywhere, then 'ask$(l)' doesn't contain a question. は contains a guess. Lines 220 through 270 ask the questions. The program always starts with question zero. は continues asking ques- 18 INTERFACE AGE 物ま - 丁 L ト . 一 リ : 4 毒 OCTOBER 1980