<<

dr. dobb's journal of $1.so COMPUTER Calisthenics & Orthodontia Running Light Without Overbyte June/July, 1976 Box 310, Menlo Park CA 94025 Volume 1, Number 6

A REFERENCE JOURNAL FOR USERS OF HOME COMPUTERS .CONSUMER COMMENTS ·fraUie for Pittman's 6800 [letter & reply] 4 Denver's Digital Group Kit Draws Praise [letter] 5 Good Reports & Plaudits for MOS Technology[letter/note] 5 Accentuate the ; Eliminate the Games [letter/reply] 6 Short on Length, hut Long on Quality [letter] 6 A Novice Constructs an IMSAL S. A. Cochran, Jr. 7 Don't Underestimate BASIC fletter] 40 an attorney builds his first computer BASIC Complaint & Macro Message [letter & reply] 40 FCC Petition on ANSCII Transmission by Hams 42 reply points out BASIC limitations SOFTWARE A Bootstrap for the 8080, Lichen Wang 8 Byte-Saving Programming Tricks for the 8080, Tom Pittman 9 An Exercise for Novice Translator Implementors, Bill Thompson 11 A Classy 8080 Text Editor, similar to a PDP-9 Editor, F. J. Greeb 13 includes general comments, user documentation & extensively annotated source code Tiny Trek for Mueller's MINOL, Erik Mueller 37 Button, Button Game in 8080 Machine Code, Ron Santore 38 CORRECTIONS & IMPROVEMENTS Errors in & Improvements for Texas Tiny BASIC (TBX), Charles Skeldon 3'4 Errata & Additions to Wang's Palo Alto Tiny BAS1C, Lichen Wang 35 MinErrata for MINOL, plus Tiny Trek, Erik Mueller 36 VIDEO OUTPUT 48 Lines of 64 Characters on a TV for $499. 95, Video· Terminal Technology 27 512-Character Video RAM from Canada, Matrox Electronic Systems 27 Variable Character Spacing in Video Displays, Jim Day 28 TVT-11 Mods to Get 64 Characters per Line, David Valliere . 29 Homebrew TV Display System with Graphics, Glendon Smith 30 complete design & implementation details, including complete schematics $98.50 Graphics Terminal Kit, Southwest Texas Products Corporation 33 MISCELLANEOUS HARDWARE 4K Static RAM Board (Unpopulated) for $18.75 4 Adaptor Makes LSI-11 's and ll/03's into Real PDP-11 's 36 $450 Dot-Matrix Printer for 6800's and 8080's 36 Western Data's 6502-hased Data Handler Kit for $169.95 43 RCA COSMAS & µScope [letter], Jim Day 43 LED Replacements for Burn-Outahle PDP-8/E Lamps 43 RANDOM DATA POINTS Do You .•• , a request for your assistance 3 16-hit, 3-MegaHertz Micro? [rumor] 5 Going to Submit a Program to S9meplace? .[letter & reply]6 New club: TRACE in Ontario 15 Table of Contents for First Six Issues of Dr. Dobb 's Journal Pointers to Other Good Stuff 26 + propaganda, subscription form & questionaire centerfold 6800 BASIC, Editor, Blackjack; Tiny BASIC Star Trek; etc. Sonoma County Computers Hold Meetings 27 Central Oklahoma Computer Group 29 1980 Census: Have Any Suggestions? 34 Club: ICE-NINE in Illinois 36 Computers & Education ffour brief notes] 40 Tiny Time Sharing? Lee Felsenstein 41 lversons Initiate APL Newsletter, Jean Iverson 41 Software Exchange for 6800's [letter & reply] 41 IMS Associates, Inc., Moves 41 A Club Survey for a Club Club · 42 TV Dazzler Contest back cover SUBMITTING 00::KEEP IT A SECRET! I ITEMS FOR ~ PUBLICATION ' let us know what exciting new soft~re and ~ystems you are ' working on. We'll tell everyone else (1f you wish). Maybe someone is also working on the same thing. You can work together and get results twice as fast. Or, may be someone t t else has already done it; no reason for everyone to reinvent the wheel.

DR COBB'S JOURNAL OF' ~'~]--:" ?; COMPUTER CAUSTHENICS & ORTHODONTIA t l I \ ,I~~~ ,, - Volume 1, Number 6; June/July, 1976 t DATE'M-Please include your name, address, and date on all tidbits you send to us. Box 310, Menlo Park CA 94025 t TYPE'M-If at all possible, items should be typewritten, Copyright © 1976 by People's Computer Company double-spaced, on standard, 816 x 11 inch, white paper. If we t can't read it; we can't publish it. Remember that we will be retyping all natural language (as opposed to computer languages) Publisher t communications that we publish. People's Computer Company PROGRAM LISTINGS-We will accept hand-written 1010 Doyle, Menlo Park, Californio. t Editor (415) 323-3111 programs only as a very last resort. Too often, they tend to say Jim . Warren, Jr. t something that the computer would find indigestible. On the Contributing Editors other hand, if the computer typed it, the computer would probably accept it-particularly if it is a listing pass from an F. J. Greeb t Lichen Wang assembler or other translator. t It is significantly helpful for program listings to be on continuous paper; either white, or very light blue, roll paper, or t fan-folded paper. Since we reduce the copy in size, submitting it Dennis Allison on individual pages forces us to do a significant amount of extra t cutting and pasting. For the same reason, we prefer that you exclude pagination or page headings from any listings. Circulation & Subscriptions t Please, please, please put a new ribbon on your printer Mary Jo McPhee t before you run off a listing for publication. Bulk Sales In any natural language documentation accompanying a program listing, please refer to portions of code by their address t or or label, rather than by page number. Printer t DRAWINGS & SCHEMATICS-Please draw them signifi­ Nowels Publications, Menlo Park 94025 cantly larger than the size you expect them to be when they are published. Take your time and make them as neat as possible. We POSTMASTER: Please send Form 3579 to: Box 310, Menlo Park t CA 94025. Return postage guaranteed. Application to mail at do not have the staff to retouch or re-draw illustrations. Use a second-class postage rates is pending at Menlo Park CA. t black-ink pen on white paper. Published 10 times per year; monthly, encl!Mling July & December. LEITERS FOR PUBLICATION-We are always interested t in hearing your praise, complaints, opinions, daydreams, etc. In U.S. subscriptions: Foreign subscriptions: t letters of opinion for publication, however, please back up any (Subscription blank is on centerfold.) Add $4 per year to U.S. opinions that you present with as much factual information as $1.50 for a single ~. rates for surface mail. t possible. $3 for the first three issues. Add 112 per year to U.S. We are quite interested in publishing well-founded, 110 per year. rates for air mail. t responsible evaluations and critiques of anything concerning hobbyist hardware or software, home computers, or computers Discounts available for bulk orders. t and people. Disclaimer We may withhold your name from a published letter if you We serve as a communication medium for the exchange of t so request. We will not publish correspondence, however, which information. We do not guarantee the validity of that information. is sent to us anonymously. t We reserve the right to edit letters fm purpo:res of clarity Reprint pri11il11111es and brevity. Articles herein that are copyrighted by individual authors or t ADVERTISING-Advertising from manufacturers and otherwise explicitly marked as having restricted reproduction rights vendors may be accepted by us. However, we reserve the right to may not be reprinted or copied without permission from People's t refuse any advertising from companies which we feel fall short of Computer Company, O'I' the authors. All other articw may be our rather picky standards for ethical behavior and responsiveness reprinted for any non-ooml"m!rcial purpose, provided a credit-line is to consumers. Also, any such commercial advertiser is herewith included. The credit-line should indicate that the material was informed that we will not hesitate to publish harsh criticisms of · reprinted from Dr. Dobb'i; Journal of Computer Calisthenics & t their products or services, if we feel such criticisms are valid. Orthodontia, Box 310. Mmllo Park CA 94025. ' Dr. Dobi:l's Journal of Computer Calisthenics 8i Orthodontia, Soi:t 31 OI, Menlo Park CA 94025 June/July, 1976 YOU LIKE WHAT WE ARE DOING? * Publishing significant systems software, every month * Reprinting materials from club newsletters * Proposing & detailing "realizable fantasies" ... exciting projects, feasible for home computers * Actively pursuing a role of consumer advocate * Publishing useful references ... indices to periodicals, bibliographies, lists, etc. * "All Meat" pages; we are not accepting commercial advertising * And more-

KNOW THAT MUCH MORE MATERIAL IS BEING SUBMITTED THAN WE ARE FINANCIALLY ABLE TO PRINT? * Many more programs than we have room to print * Much more very useful material from many club newsletters * A number of projects that are practical & appropriate for users * More consumer evaulations of products & services * Many, many more reference lists, indices, tables, etc. * Much more

KNOW THAT YOU CAN HELP US TO BE ABLE TO PUBLISH ALL THE GOOD THINGS WE ARE RECEIVING? * Since we ... -are supported entirely. by subscriptions & sales through stores - want to keep it that way ("keeps us honest" when we indulge in consumer advocacy) -are serving you; not serving commercial advertisers * Then ... - the only way we can get more income to pay our printers to print more pages, is to have more people and companies subscribe to and purchase the Journal -you have already helped by purchasing this issue

WISH TO HELP US HELP YOU? * Tear out the center-fold (not very sexy, but we hope it's attractive) - pass it along to a friend or professional associate - post it on the bulletin board at school or at work - give it to a manager of microprocessor software or design - reprint it in your club newsletter * Stand up and tell your next computer club meeting about the Journal

[and ... if you really like what we are doing:] * Send tax-deductible contributions to People's Computer Company - do so as a company or an individual [Oh ... didn't you know? PCC, the publisher of Dr. Dobb's Journal is a legitimate, state and federally chartered, non-profit, educational organization. Contributions to it are tax-deductible.] ()()

June/July, Hl76 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Sox 310, Menlo Park CA 94025 Page 3 PRAISE FOR PITTMAN 1S 6800 TINY BASIC 4K STATIC RAM BOARD and (UNPOPULATED) FOR $18.75 A Minor Complaint ... With Tom's Response Dear Friend, May 10, 1976 Dear Bob, May 17, 1976 I would appreciate your disseminating the spec sheet I bought Torn Pittman's 6800 TINY BASIC and enclosed to your friends and club members. A discount of 5% think it's the best $5 I've spent in a long time. I haven't will be given to clubs with an order of 50, and 10% on 100. tested it exhaustively, but it seems to work admirably, though slowly. The user's manual that came with it was simple and Several months ago I received several inputs on making an unpopulated 4K RAM board, hence I am producing the comprehensive, and gave enough info to make the program board for the hobbyist that does not want to get ripped off. run on anyone's system with a minimum of fuss. Mine worked The board has been fully tested and is in use by many almost as soon as I got the paper tape read in. Tom Pittman people here in Dallas. I might add that it is in use on 8080, is to be applauded not only for producing a good TINY 6502, and 6800 CPU's. BASIC that uses less than 2K, but for doing such a good job Sincerely yours, of explaining how to use it. If all hobbyist vendors con­ Jim Garrett Box 2161 formed to Tom's standards, there would be far fewer Micro Applications Garland TX 75041 complaints. 4K STATIC MEMORY BOARD (unpopulated) My only complaint about Tom is that he staunchly FEATURES refuses to release the source listing of his program. I need to 2102 and 91 L02 compatible make some modifications to the program, for use with my User selectable options cassette 0/S, and I would like to be able to expand it. It is Protect/Un protect switch Battery backup very frustrating to be kept so ignorant about his program, Selection of address by dip switch particularly since it seems to work so well. He seems con­ Fully compatible with MiTS/ALTAIR and IMSAI 8080 cerned about his ability to retain control over the integrity of Can be used with other micro/homebrew computers Full buffering of address and data lines the program, and perhaps about the investment in time and Bipass capacitors on all ICs for improved noise immunity potential ·money he .expects to receive from it. I can't see how SPECIFICATIONS , he'll ever make enough money (at $5 a copy) to keep himself Double-sided Ml L-spec board in business. But the price may serve to discourage people from 100-pin (50x50) on 0.125-inch centers Standard dimensions circulating clandestine copies of the program. Anyone who Plated through holes uses Tom's program without paying Tom for the privilege, Gold plated edge contacts should be tarred and feathered. GENERAL DESCRIPTION Sincerely, This is an unpopulated 4,096 word (byte) Random Access Memory. The cost to populated is less than any kit available (based on David M. Allen 1317 Central Ave. advertised prices). Full instructions, schematics "nd parts list are Kansas City KS 66102 included. PLUSES 100% tested Instruction package Dear Jim: 11 June '76 Plated through holes and gold-plated edge contacts I have to agree with David's complaint-! would be very Uses 2102's or 91 L02's unhappy to find the tv I just bought did not have a sche­ PRICES matic, but then a $5 transistor radio is something else. 1-3@ $18.75each Though he does not seem to realize it, David has actually 4 or more @ $16.25 each touched on the reason why I have not made source listings $1 for instruction package (one is included with each order) Texas residents add 5% tax available. When I first started this venture, I too was not sure i DELIVERY 3-4 weeks could make enough money to stay in business; it was in fact a sort of experiment in economics. Therefore, as a hedge Coming Soon: "The Extender." against possible losses, I sold copies of the source and main­ tenance documentation to a company for a lot more money We are interested in receiving consumers' compliments than any hobbyist would be willing to pay, though it was and complaints concerning Micro Applicatior;s, and all other still considerably less than I usually sell custom programs of large and small marketeers to the hobbyist community. --JCW comparable size for. While the sale was non-exclusive, I do not think it fair to devalue this company's investment when (yes, I know it's slow), bu!. already I am fo1e-sharing my to some extent they helped make Tiny possible. efforts between tllis, new software, and those expensive cus­ Aside from that one large sale, Tiny BASIC 6800 has tom programs that keep the rent paid; th~ projects with non­ not yet paid for itself, but the promise is there, so I expect zero financial return seem to get higher throughput. to go ahead with other software for the hobbyist in the same price range, and I hope to make source listings available for Tom Pittman Box 23189 the new packages. As for Tiny BASIC, i am presently pre­ San Jose CA 95153 paring a comprehensive description of the i l (which is sub­ P.S. Your readers may appreciate being made aware of the stantially the same as that originally published in PCC) in­ fact that Tiny BASIC does run on a Sphere configuration, but cluding instructions for modifying it to add fu~tional capa­ they should mention which computer they have, since the 1 bility or change syntax, to be published in DDJ ' {if you will code is slightly different for the different operating systems have it). I had hoped to include an assembler Wl>'ftten in Tiny (e.g., Sphere vs. SWTP, etc.).

Page 4 Dr. Dobb's Journal of ,Computer Caiisthenics & Orthodontia, Bo% :no, Menlo Park CA 94025 June/July, 1976 DENVER'S DIGITAL GROUP KIT DRAWS PRAISE I've been spending most of my time figuring out what makes the Monitor work. The DC documentation is not much Dear Bob: April 26, 1976 help. I've also found out that machine language is a far cry I finally broke down and bought myself a system. I from Fortran. took out a bank loan, added some cash of my own and I will echo what some othe_rs have said about the DG mailed my cashier's check to the Digital Group for their system; Three-board system. It does what they say it will do. Three days later I read in PCC that caution was needed It worked the first time I turned it on, which says a in dealing with DG. I also read some mixed reports in Micro-8 lot considering how complex it is. It's definitely not a News. I was really nervous, had bad dreams, and didn't sleep beginner's kit. for nights. More documentation: flow charts for the Monitor (I'm working on a set), clearer instructions, spec Order placed with DG: 3-board system kit plus 2/10/76 sheets for the IC's and a better description of how it power supply. They promised 3-week delivery. works would be nice. But that would mean more Order placed with Herbach & Rademan: Clare/ money and maybe in that case the documentation is Pender Keyboard. OK. 2/21 The three boards arrived, missing 74121 and 22uF capacitor. Last week I got info about DG's Tiny BASIC. I plan to 2/25 Keyboard arrived. order that and another 81< of RAM from them. 2/26 Power supply arived. Materials I'm finding helpful: The Bugbook III. 3/3 Mother board arrived. Hopefully my Intel 8080A Users' Manual will get here soon. Total time: 3 weeks, one day. The missing parts took 4 I want to get: 8080A System's Manual, weeks and two letters. 8/Mod 80 Microcomputer Development System Ref­ All parts are of good quality. erence Manual, SCELSI software manuals. TV-Cassette and Mother boards are slightly warped. 5V 6A supply by Eentak Inc.; looks impressive. Keep up the good work. Documentation fair; assumes a lot. Several minor errors. Yours, Chassis, switches and connectors need to be ordered Ed C. Epp Freeman Junior College from other distributors at present. Freeman SD 57029 Time Spent 2.5 hours 1/0 card GOOD REPORTS ABOUT MOS TECHNOLOGY 4.75 CPU card 3. 25 TV-Cass. card We hear that MOS Technology has sold aboJt 1000 Ki M's. 2.5 - 5, ± 12V power supply We also hear that they are very responsive to customer queries. If .5 Mother board you have needs or interests, the "good guy" name we have been 6.5 TV modifications given is Don Mclaughlin, Product Manager for KIM, 17.5 Planning, cutting, mounting, wiring chassis (215) 666-7950. 4.5 Checking things out PLAUDITS FOR MOS TECHNOLOGY 41.5 hours Total time Dear Jim, May 11, 1976 I took my time and spread it over about 40 days. I Just received my third issue of Dr. Dobb's Journal and must say I savored every minute of it. I thought I'd drop you a note of thanks for putting in an I had trouble with the TV characters being out of focus. article on a MOS 6502. From the lack of MOS Technology It finally dawned on me, after scratching my head for several articles, I got the feeling that "Intel Valley" was banning MOS days, that the TV interface was overdriving the T". video. I Technology products in California. solved the problem by turning the contrast and brightness to last week I called Intel, to get a software manual, and zero. later I plan to add a pot on the interface output. received the biggest runaround I have ever gotten. Unlike When I had gone through their checks, I turned the sys­ Intel, I have found MOS Technology will answer any and all tem on and sure enough there was a message on the TV questions on their products and it only takes o~e call t<;> them screen: "Read 8080 Initialize Cassette." to produce results. Many times I have called Will Mathis and After dancing around the room, I proceeded to read in Don Mclaughlin of MOS Technology with what I, today, the cassette. Numbers flashed across the screen. First 1's, then would consider to be stupid questions and received the time 2's, and finally 7's, then a bunch of dots. The dots weren't and help of their technical staff in getting m~ on the straight suppose to happen. More scratching of the head and several and narrow. · days later I decided it must be the cassette recorder. MOS gets a number one in my book and should be I borrowed a recorder from the school to replace my El given more space in your Journal. Cheapo and everything happened just like it was supposed to. Very truly yours, However it still misses a few bits now and then. The 1100 Gerald D. Severson baud rat~ is too fast for my El Cheapo. It looks like it would be possible to set the cassette read and write constant RUMOR: 16-BIT, 3-MEGAHERTZ MICRO? at a lower baud rate, re-record the Operation Monitor, and then every time the system is turned on key in the new con­ We hear that MOS Technology is planning to exhibit a stant from the front panel, and then read in the cassette on an El Cheapo. However, the DG system does not come with a 3-megahertz, 16-bit microprocessor at this Fall's Wesco.~ con­ vention in San Francisco. They also expect to have a rotate front panel, just plf!ns for one. right" instruction in their 6502 by the time this issue reaches your hands.

June/July, 1976 Dr. Dobb's Journal of Computer Calisthe~ics & Orthodontia, Box 310, Menlo Park CA 94025 Page 5 ACCENTUATE THE SYSTEMS SOFTWARE; GOING TO SUBMIT A PROGRAM ELIMINATE THE GAMES TO A MANUFACTURER'S SOFTWARE LIBRARY? Dear Editor, WHY NOT SUBMIT A COPY You can eliminate 90% of the games. Almost all other hobby publications specialize in them. Emphasize your unique­ TO YOUR LIBRARY (THE JOURNAL)? ness: a repository for systems software. It's a great idea, so far well executed; so don't drop the ball by trying to cover Dear Editor, May 12, 1976 too many other things. I strongly recommend that you push I've got a gripe. I ordered my Altair back when Pop APL as you did TBASIC Tronics first published the article (took four months to get it, though). Anyway, they automatically gave me a 1 year's sub­ Robert C. Minnick Box 306 scription to their Computer Notes. With each copy they in­ Ouray CO 81427 clude at least one page of new programs available in their software library. These are programs that they keep asking To a large extent, we will leave the games for publication people to send in, for which they receive a couple of pro­ in People's Computer Company. We will reprint games from grams in turn from the library. We are told these programs time to time, particularly when they are "games' systems," or are all free simply for a small handing and copying fee. These are games written in assembly-level code. This might be con­ "small fees" are almost all $2 minimum-or more for the sidered to be, so to speak, systems software for home computer longer programs. The current offering consists of 29 programs users. Dr. Dobb's Journal will definitely not be emphasizing totaling $61 in fees if one ordered all 29 (28 are $2 each, games, however. and 1 is $5). We would be delighted to "push" APL as we did Tiny What I don't understand is why they don't publish them BASIC. All we need is for someone to provide design criteria in their Computer Notes. As it stands, Computer Notes con­ and details appropriate for hobbyist consumption. We are sists of 16 pages of virtually nothing but_ their own advertising. alwsys on the lookout for competent individuals interested in They say a subscription to non-Altair owners is $30. Personally, providing the leadership for such projects. Incidentally, as soon I wouldn't give 30 cents for a year's subscription. I bet after as he can find the time, the Editor of Dr. Dobb's Journal is the 12th issue goes out and they start selling subscriptions planning on initiating a SMALL PASCAL project, to be pur­ they are going to be in for a big surprise. Who will pay even sued in much the same manner as Dinnis Allison's Tiny $10 for their advertising sheet? They also issue software with BASIC project. This will be based on Niklaus Wirth's PASCAL, a $500 price tag to the hobbyist and then lament the swap­ a cfoanly designed, excellent, block structured, high-level lang­ ping, passing around, trading, of it. What do they expect? uage similar to ALGOL, ,but with much more powerful data But that's another story. description and manipulation facilities, and structured for The point is-why can't you publish these (or similar)? single-pass compilation. Just glancing at the latest list I see programs listed as being One final note: PCC is not a program repository. We 60 lines, 83 bytes, 73 bytes, 21 lines, 46 lines, 121 bytes, publish all available information about interesting software, 28/33 bytes, 56 bytes, 12 lines, 250 lines, 15 bytes, etc. You including information as to how it may be obtained. However, could get all eleven programs I listed on 3 or 4 pages, and we do not distribute such software in machine-readable form that represents $22 of handling and copying fees. Publishing (e.g., paper tapes, cassettes, etc.). --JCW some would save us a bundle. This is what I hope Dr. Dobb's Journal is all about. SHORT ON LENGTH Actually, a lot of people just aren't going to get many of the BUT LONG ON QUALITY programs unless there is a lot of the lamented swapping, trad­ ing, and exchanging-or, unless you become the "library" for Dear Jim, all of us. Having just read your February issue (Vol. 1, No. 2), I So far, you are doing fine. Keep up the good work. was sufficiently impressed to part with the money for a sub­ Durward Landers 2509 Lakeside Dr. scription. What your publication lacked in length was more Garland TX 75042 than adequately offset by quality and subject matter. Your questionnaire scares me somewhat as you apparently are look­ We will publish as many programs as we can, if people ing for some new directions: Additional coverage of other will send them to us. Spread the word: Whenever someone topics is fine and may tend to broaden your base of appeal. decides to submit a program to a manufacturer's software However, I for one, bought your publication for what it cur­ library or users' group, encourage them to .also submit it to rently is-"a medium concerning the design, development and the Journal. If it's systems software or assembler-level, we will distribution of free and low-cost software." Should your en· probably publish it. If it's a program coded in BASIC or some terprise maintain its stated goal of presenting "detailed infor­ other Hll (High Level language), it will probably be pub­ mation concerning low-cost systems software," I will have lished in PCC Newspaper. spent the subscription fee well. I remain, We see nothing wrong with offering programs to manu­ Dan Artman 1445 Adams Rd facturers' libraries. But at the same time, why not offer them Cincinnati OH 45231 to your library: Dr. Dobb 's Journal? As far as reproduction and postage costs are concerned: is doing little more than breaking even. Unfortunately, there is there is a problem. The Community Computer Center (CCC) a lower limit on the cost of maintaining paper-tape equip­ is maintaining a Program Repository and Duplication Facility ment + purchasing supplies + paying a paltry pittance to a (see the Journal, March, 1976, issue) for all programs sub­ .slave to operate the equipment arid verify tapes that are mitted to it. We think their charges are reasonable: $1 /ounce punched and ... etc. (Note: People's Computer Company is for tapes plus 50 cents (orders under $5) or $1 (orders ex­ a publishing operation. We provide programs in human-readable ceeding $5) for postage and handling. Note that these are form. We do not provide programs in machine-readable form, quite comparable to MITS' charges ... and we know CCC e.g., paper-tapes.)

Page 6 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Bern 310, Menlo Park CA 94025 June/July, 1976 A novice constructs an IMSAI An attorney builds his first computer by S.A. Cochran, Jr. while waiting for this unit to arrive. I had a little confusion about the proper procedure for I am a little out of my field messing about with computers­ completing the povyer supply and collecting it. I had ·docu­ far more than some school teachers are whose .interest is in mentation for connection of the IMSAI power supply using propagating math instruction, etc. But even my life was not un­ two alternative transformers and they had shipped a third touched by some of the manifestations of the computerized version of the main power supply. This was corrected quickly society-about four years ago, I made use of the I BM Mag-card enough, and a minor problem with the 1 K memory board Selectric typewriter during a period of heavy work. Ever since, I was quickly corrected when someone pointed out that I had had been struck with the convenience-and high cost-of interchanged a .01 mfd capacitor and a 33 mfd one. Testing mechanized typing. of the front panel board and the cpu board had to wait for More recently, I heard that John Arnold and Dick Whipple arrival and assembly of the mother board and additional were assembling a computer for what appeared to be peanuts, mernqry. compared to the charge gaily levied by IBM for its typing units, When the additional units arrived, everything tested out much less its Mag-card units, and still less than its computers. satisfactorily, except that there wa§ a single. bad LED on the Based on this information, I could hope to install a powerful front panel. I recall that there was an embarrassing pause typing system with greater capabilities than anything that I after this LED was replaced-we thought that the entire could expect to purchase from IBM with available resources, equipment had gone berserk. However, I found that a piece of and at less cost. wire had worked its way behind the front panel, and was Having decided to get into the microcomputing stream, shorting th.e deposit switches. I have had no further problems with the help of John Arnold, I decided to get an IMSAI with the computer, or with any of the parts supplied by rather than Altair because the IMSAI unit with memory was IMSAl-except for the problems involved in learning to speak the same price as the MITS unith without memory. Also, machine language like a native. (Apparently I don't do that MITS' prices for memory were substantially above those yet.) charged by IMSAI. My remaining difficulties in getting the initial system I placed my order for the IMSAI unit on into operation have revolved around input and output devices. · January· 22nd. They received this order on the 25th, and the I joined John Arnold and Dick Whipple in the acquisition of unit was actually shipped on February 2nd. I learned more three Burroughs Model 9350-2 communicating typewriters about the units actually available from IMSAI on January 25th, from Herbach & Rademan of Philadelphia. These units were and sent in an additional order on that date. It was not filled correctly advertised as receiving and transmitting a form of until March 1st, when some of the parts were shipped. The ASCII. They appear to be based on the Friden Model 2300 1/0 ports that were included in the second order did not typewriter, a modernized version of the Flexowriter. They are arrive until about March 25th. not. readily convertible to use as a computer input because The serial 1/0 board was delayed by a considerable there is a direct mechanical linkage between the keyboard and re-design of the board, which must have started in January, the keybars of this typewriter. Another thing that I found very and must have concluded at the very end of February. The hard to get used to was that this "typewriter" didn't have a documentation received with the original equipment showed backspace key! There was some additional major maintenance the manner of assembling the SIO 2-2 board, Rev. 1. I re­ to be done on this equipment. Although it could be induced ceived at least one set of errata with the documentation, and to type, thus far I have been unable to get the typewriter one after I had already got the equipment. Ultimately, IMSAI hooked up to the computer! sent me their SIO 2-2 Rev. 3 board, with all of the changes After making the decision to use a separate keyboard, I built into the board. bought one of the keyboards originally built for RCA that I would like to point out that IMSAI was very prompt have been advertised by Sargeant's in Los Angeles. This key­ in providing the kit buyers with errata when they discovered board was advertised to be fully ASCII encoded, and it was, something that needed to be fixed. In addition, on certain so far as it went. Unfortunately, this unit had provision for rather complicated modifications, they offered to make the upper and lower case letters, numbers, and punctuation marks, modifications themselves if the kit-builder did not trust him­ but it did not have any provision for the non-printing control self to fix the unit satisfactorily. They have also been quite · characters so common to computer work. In addition, upon helpful with software for units of the equipment. For in­ applying power to the keyboard, we discovered that this key­ stance, with the CRI board .they supp.lied paper tape software board carried a strobe that was valid as long as the key was and a listing. pressed, and used negative logic. That is, the strobe output, In the revised order, I had requested the EXP-22 and all the other outputs supposed to be made true when a mother board. I recall that I could not proceed beyond the key was pressed, went at that point from a voltage of 5.0 to · assembly of the several independent boards during February 0.4 volts. It appeared that it would be necessary to add a

~un_e/July, 1976 Dr. Dobb's Journal of Computer Calisthenics a Orthodontia, Box 310, Menlo Park CA 94025 Page 7 tair number of !C's to the interface between the keyboard and the computer in addition to installing an additional key Bootstrap for 8080 on the keyboard for use as a control key. With all these matters before me I decided to keep the keyboard for future by Lichen Wang modification, and get another for my present use. But I did get a pretty keyboard enclosure from Sargeant! (reprinted with permission from [ Later] ... I am now in the process of putting that Newsletter) pretty keyboard enclosure and keyboard to good use. It's going to take a certain amount of skill and understanding but one If your 8080 microprocessor system is not equipped with of my purposes in getting into this hobby was to acquire that non-volatile memory, you probably have to reload the memory sort of skill. Thanks to Sargeant's, any way, for providing me from time to time. To read the Intel hex-format paper tape, with an occasion for that sort of acquisition-even if it wasn't you need to key in a loader of some eighty-odd bytes long. This what I exactly expected. is rather tedious and often leads to error. Altair BASIC has a I feel that I should mention the question of IMSAi soft­ bootstrap loader of twenty or twenty-one bytes long. In princi­ ware before closing. In the advertisements that they began to ple, you can use this bootstrap to load in your own loader which distribute just after I ordered my I MSAi unit, they stated will then load in your program. I coded one myself, and what that they would ship an assembler, loader, and monitor with comes out is a bootstrap sixteen bytes long. This is still too every unit, together with BASIC and other languages there­ long-maybe our professional experts can make it shorter. For after. This assembler, etc., turned out to be a re-write of the the time being, you are welcome to copy mine. assembler originally distributed by Processor Technology Corp. The part that you have to key in looks like this: It uses all of a 4K memory, and needs an additional 2K of 0000 DBOO READ IN 0 ;READ AND RAM, if not more. A complete source listing and paper tape 0002 E620 ANI 20H ;MASK THE STATUS BIT of this assembler were enclosed with the unit. IMSAI also 0004 CAOOOO JZ READ ;NOT READY YET provided a listing and paper tape of software for their Cas­ 0007 DBOl IN 1 ;READY, READ IN A sette Recorder Interface board. On March 20th, IMSAI wrote FRAME all of their customers, stating that they were now ready to 0009 010900 HERE LXI B,HERE ;LATER BECOMES INX B, deliver their 4K BASiC, and expected to be ready to deliver STAX B, CPI the 8K and 12K BASIC languages on April 15, and May 15, oooc 02 STAXB ;LATER BECOMES FF respectively. The 4K BASIC was shipped at the end of March. OOOD C30000 JMP READ ;LATER BECOMES JNZ I was ultimately charged $4.00 for their cost of duplicc.tion of READ the paper tape, and an additional $10.00 for a 70-page source And the paper tape should have the binary equivalent of the code listing of the IMSAI BASIC. IMSAi had apparently hex numbers shown below: enclosed it 'by mistake.' IMSAl's price for its 4K BASIC thus amounts to $14. 01 01 ... 01 03 02 FE FF C2 00 00 XX XX ..... XX XX FF In addition, IMSAI will sell the 8K and 12K for $1 <·leader -> <-bootstrapping -> <-your loader ->marker per kilobyte of memory required. The source code listing for Where your loader is punched in binary format on the paper these two extended BASICs will again be $2.50 per kilobyte. tape between the 00 and the FF is denoted by XX XX ..... Compared to the longwinded philosophical discussions that one XX XX. Your loader cannot have any byte with the value FF. hears from MITS from time to time, this is probably a great The marker FF tells the bootstrap to start your loader, starting bargain, notwithstanding thct the IMSAI BASIC may not be at lOH. After the FF, the paper tape is read by your loader. Use quite as powerful ~s the MITS 4K BASIC. whatever format you want. After acknowledging the assistance of my friends in If your loader cannot be loaded at lOH, then you will have checking out the IMSAI 8080, I conclude that this equipment to write another loader which can be loaded at 1OH. Use it to is a well-designed, sturdy unit easily capable of expansion to load in your first loader to load in your program. This sounds the full limits of addressable. memory. IMSAI has acted in a very confusing, but that is how bootstrap works. Have you very businesslike fashion, and has tried to be genuinely helpful ever tried to get yourself off the ground by pulling your within the limits that are proper to a business organization. bootstrap? , IMSAI recently raised the price of the basic equipment, with­ Incidentally, the I/O ports at locations 1 and 8, the status out memory, to $599. Certain persons of my acquaintance bit mask at 3, and the jump condition at 4 may have to be griped very strongly at IMSAl's action. I consider that in view changed for different I/O interface board. Your loader should of the high quality of the merchandise, the IMSAI equipment copy them from the bootstrap rather than setting them up on is worth this premium price to the individual who has never their own. (Or, you can code your loader to change location 9 attempted to build an electronics kit before. Anyone who to RET, and use READ as your input routine.) This way the considers the IMSAI not worth the price, should consider same paper tape can be used on different machines. To carry whether he or she could duplicate the system with available this one step further, your program should, in turn, copy them resources. If he could match the high quality provided by from your loader, so that it too can work on different IMSAI, could he deliver the goods to others, at the price? If machines. so, why isn't he in there competing? Yours very truly, HIGH SCHOOL CLUB IN CHICAGO S.A. Cochran, Jr. Box 607 The University of Chicago Laboratory High School (1362 Attorney at Law Tyler TX 75701 E. 59 St., Chicago IL 60637) has started a computer club.

Dr. Dobb's Jmnnal of Computer Calisthenics & Orthodontia:, Box 310, Menlo Park CA 94025 June/Juijy, 1976 BYTE SAVING PROGRAMMING TRICKS FOR THE 8080

by Tom Pittman stitutions): (reprinted with permission from Hom'ebrew Computer Qub Newsletter) ADI OFFH C=O if and only if A=OO SUI 1 C=1 if and only if A=OO These are some programming tricks I have accumu­ lated over the years which can often save a byte or two It is easy to get the sign of A into the Carry (any in 8080 programs. Because of the peculiarities in the left shift will do); to get the complement of the sign is a little trickier. This instruction leaves the contents of A instruction sets, only a few of these also apply ~o 6800 programs and are so noted. Many of these tricks are unchanged, and also works for the 8080: widespread lore; some I have never seen elsewhere. I hope they can help you as well. CPIBOH Complement bit 7 to Carry For 2's complement signed arithmetic, it is some­ Finally, how do you pack a byte with some bits times necessary to add a signed 1-byte number to a from A and some bits from B? The Univac 1108 has a larger format. There are also other reasons for s~read­ special instruction called Masked Load Upper which ing a single bit (in the Carry FF) to a whole byte (1n A). does this. The 8080 (and also the 6800-but only when I found this one in the Scelbi book: the second byte is in memory) can do this in three in­ structions! Assume that the data in A and B (or any SBBA Copy carry to all bits in A other register or memory location) are already in ~he correct bit positions. The mask represents a byte with The 8080 does not have a proper shift instruction the ones where the data in A is to be substituted; the which fills the vacated bits with zeroes. Normally, a non-data bits of A and B may contain garbage, as they CLC must precede the RAR instruction. However, for are ignored: left shifts: XRAB XOR B to A data bits ADD Shift with zero insert AN/ Mask Delete A garbage XRAB Insert B data To insert a single bit (in the Carry) into the left or right end of the A without altering the other seven bits: The theory behind this trick lies in the fact that RAL Remove old left bit the XOR operation may be considered a "selective RRC Insert new from Carry complement" instruction. In other words, where there are ones in B the bits in A are complemented, and where there are ones in B the bits in A are unchanged. The right-end version is symmetrical. To divide a The AND operation, on the other hand, may be thought signed (2's complement) number in half, it is necessary of as selectively setting bits to zero in A, where the to keep the sign bit (bit 7) unchanged while shifting A zeroes in the mask set bits in A to zero and ones in the right. The 8080 does not have an instruction for this, mask leave the bits in A unchanged. Assume for the but the RAR may be used if the Carry can bet set up moment that the mask is al I ones; the other two instruc­ to match the sign bit: tions exactly cancel each other, leaving A unchang~d, since the ones in B complemented the corresponding RLC Copy bit 7 to Carry bits in A the first time and recomplemented the same RRC Restore A bits (back to their original states) the second time. Thus ones in the mask retain the original bits in A. Now con­ The 6800 has a single instruction for signed right sider zeroes in the mask: here the corresponding bits of shifts, but no circular rotate. To copy a sign into the A are cleared to zero by the AND operation so that the Carry: first XOR has no effect; the second XOR simply com­ plements those zeroes in A whi~h corre~pond t<;> ones ASRA (6800) Duplicate bit 7 in B, which is to say that it copies the bits of B into A ROLA Restore A with bit 7 in Carry (remember A was cleared to zeroes by the AND opera­ tion). Thus zeroes in the mask copy in bits from B. Some of these other tricks with the Carry become Since each bit operates independently, there is no re­ more useful if the Carry can be set on the basis of the quirement that the selected bits o! A or B be conti~­ other conditions. A zero in A may be converted into uous. Note also that no other registers or memory 1s either a one or a zero in the Carry (so that non-zero is required for this procedure, and that B is unchanged. I the reverse) by one of the following instructions (this realize this operation looks suspicious, so I have includ­ also works in the 6800 with appropriate opcode sub- ed the following truth table:

June/July, ~976 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box 310, Menlo Park CA 94025 Page 9 a: a: FIGURE 1 ~ 0 Cl) 0 c <( a:i <( >< 2 >< Byte Packing Truth Table .... <( "'C ~ c ..."' N 0 0 0 0 0 0 =B 0 0 1 0 0 0 =A DO THE OPCODE• OPPERAND• AND COMMENT 0 1 0 1 0 1 =B MULT.IPl:.E BLANKS BECOME SINGLE BLANKS 0 1 1 1 1 0 =A 0061- liF POC1 MOV C.A 0062 CD0938 CALL co 1 0 0 1 0 0 =B 006S CDBIOO POCl: CALL CRCHK 1 0 1 1 1 1 =A 0068 FE20 CPI 006A CA6SOO JZ POCI 1 1 0 0 0 1 =B 006D FE3B CPI .• J. 006F CA4400 JZ FCI 1 1 1 0 0 1 =A 0072 4F POC2: MOV C.A 0073. CD0938 ·CALL co 0076 CDBIOO P'F!OCESSOR TECHNOLOGY REFORMATOR CALL C'F!CHK 0079 FE20 CPI 007B C27200 JNZ POC2 THIS PROGRAM TAKES BOBO ASSEMBLY 007E C36100 JMP SOIJRCE PROGRAMS WRITTEN ON INTEL'S POC lNTELLEC 6 !JHICH HAVE COLONS AFTE'F! LABELS, CONTROL-I'S FOR TABS, AND SEMICOLONS TO DENOTE COMMENTS. J READ A CHA'F!ACTER, MASK OFF PARITY. J IF ITS .A CARRIAGE RETURN, THEN J DO THE END OF LINE. THING· CONVERT CONT'F!OL-l'S TO BLANKS. IT CONVERTS THEM TO PROCESSOR REPRODUCE LEADE'F!. . TECHNOLOGY'S FO'F!MAT WITH LINE NUMBERS, '*' TO DENOTE COMMENTS, 0081 CD0638 CRCHK• AND NO SEMICOLONS AFTER LABELS· CALL RI JGET THE CHARACTER 0084 E67F ANI 7FH JMASK PARITY 0086 FEDD CPI CR 0088 CA9500 JZ CRCI J ITS THE END THE READER MUST BE UNDER PROGRAM CONTROL. 008B B7 THAT IS IT MUST BE STOPPED AFTER EACH ORA A CHARACTER IS, READ IN. 008C CA9900 JZ CRC2 JREPRODUCE.LEADERll 008F FE09 CPI 09H JCONTROL-1 IS A TAB 0091 co RNZ JNOT CONTROL-I THIS RUNS ON THE INTELEC/8 0092 3E20 !fV I A.' . IT STARTS AT LOCATION !OH 0094 C9 RET JREPLACE WITH ' . AND USES THE INTEL MONITOR 0095 El CRCI: POP H IFORGET RETURN FOR 110 0096 C3AAOO JMP NL I NE JGO TO END OF LINE 0099 4F' CRC21 HOV C.A 0000 CR EQU OOH 009A CD0938 CALL co JOU'!"PUT LEADE'F! OOOA LF EQU OAH 009D C38100 JMP 'CltCHK 3B06 RI EQU 3B06H JREADE'l .INPUT 3B09 co EQU 3B09H JCONSOLE OUTPUT PRINT OUT CCH.L>> AS AN ASCII DECIMAL DIGIT• 0000 ORG IOH OOAO 23 DPRT: INX H OOAI 4E HOV C.M 0010 310001 START: LXI SP. 01 oo·H OOA2 CD0938 CALL co ; INITILIZE STACK OOA5 C9 RET 0013 CDBIOO CALL CRCHK J INPUT A CHARACTER J OOA6 30303030 DNUM: DB '0000' PRI~T OUT 4 ASCII DECIMAL DIGITS ; 0016 FS MDEC: PUSH PSW 0017 21A900 J TERMINATE A LINE WITH A LXI H,DNUM+3 J OOIA 7E MDI: MOU A,M CARRIAGE-RETURN, LINE-FEED OOIB 3C J AND GO PRINT THE NEXT LINE NUMBER· IN'! A J OOIC FE3A CPI '9'+1 JTOO BIG? OOAA OEOD OOIE C22700 NLINE1 MV'I c.cR JNZ MD2 OOAC CD0938 CALL 0021 3630 MUI co M,, '0' OOAF OEOA MUI C.LF 0023 28 DCX H JOO THE NEXT DIGIT OOBI CD0938 0024 C31AOO JMP CALL co MDI 0084 CDBIOO NL21 CALL C'F!CHK 0027 77 MD2: MOU M,A 0087 FEOA 0028 21ASOO CPI LF LXI H.DNUM-1 OOB9 CAB400 JZ 0028 CDAOOO CALL NL2 DPRT ·ooBc C31600 JMP MDEC 002E CDAOOO CALL DPRT 0031 CDAOOO CALL DPRT 0034 CDAOOO CALL DPRT 0000 END 0037 OE20 MVI c,• 0039 CD0938 CALL. co P• FlR5T COLUMN, CHECK FOR A LABEL 003C Fl FFCHK: POP PSW 003D FE3B CPI 'J' JCOMMENT? 003F C24EOO JNZ LBCHK 0042 OE2A MVI c., '*' 0044 CD0938 FCI: CALL co JPROCESS A COMMENT 0047 CD8100 CALL CRCHK 004A 4F HOV C.A 0048 C34400 JMP FCI LISTING PRODUCED COURTESY OF COMMUNITY COMPUTER CENTER. . 1919 Menalto., MENLO PARK· (41.5) 326-4444

CHECK FOR A LABE.IJ\ THEY. HAVE COMPUTER GAME~ FOR KIDS• BIRTHDAY PARTIES. TIME ON A PDP II AND PSP 004E FE20 LBCHK1 CPI 0050 CA6100 JZ POC JNO 1-AB.EL 0053 4F LBCl1 MOV. C,A TIME ON A PDP/II AND PDP/8, AND WILL REPRODUCE PAPER OOS4 CD0938 CALL CO TAPES••••• 0057 CD8100 CALL CRCHK OOSA FE3A CPI '1' JDELETE '<' 005C C25300 JNZ LBC I JLOOP TO Pl'tlNT 005F 3E20 MVI A,' '· J' ' SEPARTES LABEL AND OP-C(lnE Page 10 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box 310, Menlo Park CA 94025 June/July, 1976 AN EXERCISE FOR NOVICE a transition table to evaluate an arithmetic expression. There TRANSLATOR IMPLEMENTORS are 2 stacks: a transition stack, T, and an execution stack, E (arrays "T" and "E"). The program reads the expression once An Arithmetic Expression Evaluator, Coded in BASIC from left to right and takes various actions as directed by reference to the Transition Table (array "D"). As the expres­ by Bill Thompson sion is read, if the new symbol is an identifier (name of a variable, its value is pushed on stack E. If the new symbol is Greetings: April, 26, 1976 an operator: 16 ( + - * I ) then the program goes to the I have been studying , interpreters and the like, transition table for instructions. It does this by comparing the and thought that some of the methods that I have used to current symbol with the top one on the translator stack (T). gain a proper acquiantance with such a complicated subject might aid other uninitiated persons. INSTRUCTIONS: As such, having access to an HP9830 (programmable 1. Push the current operator on translator stack T, and calculator-programs in BASIC) I have constructed in BASIC, continue reading. an expression evaluator-sort of an . Since it is in 2. Perform an operation, push the current symbol on T, BASIC, instead of assembly, the flow is a bit more obvious. continue. Thanks and take care, 3. Pop Stack T, continue (deletes parenthesis). Bill Thompson 614 - 35 St 4. Perform an operation. Pop T, then repeat the table Evans CO 80620 look-up with the current symbol and the new top of T. 5. Error: missing right parenthesis. Following is a program and sample run of a simple 6. Error: missing left parenthesis. 7. End-evaluation complete. expression evaluator, written in BASIC. The program uses a transition table to "crunch" an expression. I have restrained Notes: myself from numerous embellishments which have occurred to A "stack" is a last-in-first-out data vector. me as I worked on the program-had I started on that route All operations are performed on the top two members of the expression Stack, E. I would soon have succeeded in writing a BASIC interpreter All operations performed use the top of the T stack. in BASIC! Nevertheless, I do suggest that the beginner who All expressions must be followed by a blank. wishes to learn enough to write a or an interpreter A blank is denoted in the table by "Vl'. will find it particularly helpful to write this routine in Values are assigned by expressions of the form: assembler code. If you have access to a version of BASIC with 'LET E=5'. strings, add some of those embellishments I left out, such as Reference: Translation of Computer Languages by Wein­ program storage, exponential functions, and assigning an garten, 1973, Holden-Day, Inc., ISBN 0-8162-9423-2. (Warn­ expression to a variable. All of these will get you into the ing: the reference though good, contains errors in diagrams, program, and hopefully into your own language. etc.)

A TRANSITION TABLE EVALUATOR 10 DI~ AS[80J,BS[10l,CS[26J,C[26l,TfBOJ,E[BOJ,D(6,71 FOR ARITHMETIC EXPRESSIONS (IN BASIC) 20 HEM This program illustrated the use of stack techniques and 30 HE.I\ SET UP THE TRANSITION TABLE 40 HE1~ 50 FOH I=I TO 6 60 ~OH J=I TO 7 Current Symbol 70 HEAD D[I,JJ 80 NEXT J 16 + * I 90 NEXT I (blank) 100 DATA 7,1,1,1,1,1,? 110 OATA 5,1,1 ,1,1,1,3 120 DATA 4, 1,2,2, I, 1,4 I 30 DATA 4, I , 2, 2, I , I , 4 t .,i 7 6 140 DATA 4,1,4,4,1,1,4 0 I 50 DATA 4, 1 , 4, 4, 1 , 1 , 4 p 5 3 160 Frrn I=l TO 26 170 C [I J=O 180 :°"EXT I 0 + 4 2 2 4 190 FOR I=I TO 80 f 200TrIJ=I 4 2 2 4 210 E[IJ=O 220 NEXT I s 230 BS=" ( +-*/) '' t * 4 4 4 4 240 CS="Al:3CDEFGHIJKLMNOPQHSTUVWXYZ 11 a 250 DISP "INPUT EXPRESSION"; 260 INPUT AS c I 4 4 4 4 270 IF AS [I ,31# 11 LET" THEN 300 k 280 GOSUB 380 290 GOTO 250 300 K=I T 310 L=POS

June/July, 1976 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box 310, Menlo Park CA 94025 Page 1.1 350 GOSUB 530 11 '.50 iffTUHN 360 K=K+l 1160 E[ll=E[2l*E[IJ 370 GOTO 31 0 11 10 c;oSlJfl 1270 380 A=POSCCS,AS[5,5ll 1180 ,~ ETlJf?tJ 390 N=POSCAS,"=") 11\10 E[ll=E[2l/E[IJ 400 C[MJ=VALCASUJ+l l> 12'.)0 GOSUB 1270 410 PRINT"* 11 1CS[1A,t0!"=1'1C[MJ; 11 *" I 2 I 0 fl ETll fl~! 420 RETUflN 1220 f-IE'A T!IIS flll!ITINE POPS STACK T 4 30 ~= POS CC S , As [ K, K l ) 1230 FOfl l=l TO 79 440 IF M=O THEN 500 1240 T[!l=TfI+l J 450 FOH . I=80 TO 2 STEP - I 1250 NEXT I 460 EC I J=EC I-1 J 1260 i-lETUHN 4 70 NEXT I 1270 flE,v\ TllIS f.IOUTINE SHIFTS STACK E 480 EC I l=CC Ml 1280 Fm~ !=2 TO 79 490 rlETIJilN 1290 E[ Il=EC 1+1 l 500 GOSUB 1320 I 300 ~~EXT I 510 PHINT "INVALID SYMBOL" 131 0 RETUi-li~ 520 GOTO 190 I .120 1-'1? INT As 530 GOTO DCTCIJ,LJ OF 540,590,650,7!0,770,B30,B90 1330 1-'H!NT TABCK-l)1••~;o 540 REM I .340 r'fl INT 550 r1E.<1 rnsrnucT ION I 350 ii!:OTU fl!J 560 rlEM 570 GOSUd 990 RUN 580 RETURN INPUT EXPRESSION?LET A=5 590 i1E1'A 600 rlEM INSTRUCTION TI * A= 5 610 ilEll INPUT EXPRESSION?LET Z=6 620 GOSUl:l I 050 630 GOSUB 990 * Z= 6 640 rlETURN INPUT EXPRESSION?LET D=4 650 rlE1A * D= 4 660 rlElvl INSTRUCTION I II 670 rlEM INPUT EXPRESSION?LET X=3.25 680 GOSUB I 220 * X= ·3.25 690 i?ETUHN 700 rlE.11 INPUT EXPRESSION?LET P=3.14159 710 REii INSTrlUCTION IV * P= 3.14159 720 REI~ 130 GOSUB 1050 7 40 GOSUB I 220 INPUT EXPRESSION? A *A 750 GoSUB 530 A*A = 760 rlETUf.IN 770 f.IEiA * 25 * ·mo tlEM INSTRUCTION v 190 REM 800 GOSUB 1320 * STOP * dlO PHINT "MISSING HIGHT PAHENTHESIS" INPUT EXPRESSION?A/Z*P 820 GOTO I 90 NZ*P d30 rlEl'A 840 rlEM INSTRUCTION VI t 850 rlE'A 860 GOSUB 1320 870 PHINT "MISSING LEFT PARENTHESIS" INVALID SYMBOL (missing ~. that is, missing terminating blank) 880 GOTO I 90 INPUT EXPRESSION? A/Z*P 890 RE.vi 900 REM INSTRUCT roq VII A/Z*P = 910 RE\l * 0.265258463 * 920 PRINT AS!" =" 9 30 p fl I NT II* .. IE [ I 11 " *" 940 PR INT * STOP * 950 PRINT "* STOP *" INPUT EXPRESSION?(A *Z)+ D*X 960 ECIJ=O Y70 GOTO 250 (A*Z)+D*X = 980 END * 43 * 990 RE\I THIS ROUTINE A!lDS A SYMB:JL TO STACK T I 000 t'"OR 1=80 To 2 STEP - I I 0 I 0 TC I J =TC I- I J * STOP * I 020 ;JEXT I INPUT EXPRESSION?( (A-Z)/(X*Z)+P 1030 TC 1 l=L I 040 flETUi

Page 12 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box 310, 11/lenlo Park CA 94025 June/July, 1976, A Classy 8080 Text ·Editor by F. J. Greeb Discs and controllers. A 16-bit system. High speed printer and 1915 S. Cape Way, Denver CO 80227 controller. And on and on and on • . . (303) .986-6651 PLANNED APPLICATIONS-Indefinite. I designed and May 6, 1976 [received at PCC June 21st] built the system to learn more about the hardware. That pur­ pose was accomplished: I did learn a lot. As for what I do Hello People, May 12, 1976 Enclosed is a description and source listing of my test editor with it, only time will tell. program, along with some comments on conversion of the p~ogram -to other 8080 systems. This material is being submitted approxunately THE EDITOR simultaneously to both the Denver Amateur Computer Society News­ letter and to Dr. Dobb's Journal for publication as either (or both} The text editor program is a strong/line oriented pro­ orga,;ization sees fit. As far as I know, all the bugs have been re­ gram written in 8080 . The program is de­ moved from the program. I have been using an earlier version, which is .signed for use in the development of source programs to be essentially the same except for the variable storage locations and tele- processed by an assembler or compiler, or for general p~rpose type routines, for several months. . I am also including a current description of my system, which ASCII file generation. 29 separate commands are recognized by will probably be out of date by the time you receive this, since I the program - keep changing it, and ~ome other general comments. The editor does not require line numbers to be present Keep up the good work. in the ASCII file. It has the capability to search for and lo­ Fred J. Greeb .cate any string of valid ASCII characters in the file, irrespec­ tive of their location within a line. Lines can be added, de­ GENERAL COMMENTS 5-12-76 leted, replaced, modified, or printed with simple input co!1'­ TEXT EDITOR SOURCE LISTING-The listing is not mands. Once initialized, the program contains self protection generated directly by the 8080 assembler. It is the result of features so that it cannot overwrite itself. playing the source tape generated by the assembler into a HARDWARE REQUIREMENTS-The program occupies system which has a high speed printer. The. playback timing is approximately 2.5K words of memory, plus memory space for not perfect and some errors do occur. All known errors have the file being edited. An additional 128 words of memory are been corr:ected, but consider this factor as a potential source used for the 8080 stack. Peripherals supported are a TV-Type­ of errors when implementing the program on another system. writer, Baudot teletype (output only), and a . TEXT EDITOR PROGRAM-The program has not been Several of the driver routines for the peripherals are contained optimized for either memory utilization or speed. The original in the system monitor ROM, and must be supplied externally design goal was to use less than 4K, for compatability with for conversion to other 8080 systems. the assembler. The first version used about 2K, and therefore COMMAND FORMAT AND DESCRIPTION-All com­ no size reduction was attempted. . mands to the editor are input as ASCII data terminated by a Most commands execute with no noticeable delay. A carriage return. The only non-printing ASCII characters recog­ long string search or deletion · of many lines will cause a few nized by the program are carriage return (C/R, 15), end seconds' ause. of file (EOF, octal 1), and Tab (Control T, octal 24). The DESIRABLE .HIGH LEVEL LANGUAGE FEATURES program outputs a greater-than symbol, >, as a prompt indi­ (personal preference)-Efficient utilization of memory, possibly cating that it is waiting for a command to be input. by converting source code to opcode (binary) .equivalents, The commands recognized may be classified into three rather than storing source code directly. This conversion general categories: Initialization, Edit, and Utility. All com­ could be accomplished at load time, or by a separate pro­ mands must be followed by a space and/or terminated by a gram (a C?ompiler?). C/R. Additional parameters associated with a command (nu­ User definable 1/0 handling, including multiple 1/0 ports. merical or string data) must be separated from the command by Considering the price of PROM's, I suspect most 1/0 routines one or more spaces. will end up in PROM sooner or later, with everyone using Initialization Commands-The initialization commands different techniques and addresses. set the file start address and define the end of file. All ini­ External subroutine call capability, including variable tialization commands request the file starting address, which transfer capability. must be input from the keyboard. User definable integer and floating point variable The initialization commands and their results are: capability. NEWF Defines a new file location starting at the input ad­ Several others I can't think of off the top of my head, dress, and enters the input mode. and will undoubtedly remember after I mail this. EDIT Edit an existing file at the input address. Outputs the SUPPLIERS-Excellent: James Electronics, Bill Godbout first line or page of the file, as specified by the out­ (2 week service on custom-programmed PROM's). rillajor sup­ plier gripe: refund credit slips rather than cash refund on out­ put mode. of·stock items. These have a habit of getting lost when re­ LOAD Loads a file from tape, beginning at the starting ad­ dress. Loading begins wieh a C/R is input following turned for a cash refund. I don't know how the two men­ tioned suppliers handle this problem. Out of numerous orders the address input to_ allow time for manual tape setup. for a variety of merchandise, they have never been out-of­ Edit Commands-The edit commands are used to display stock on any item. Poor suppliers: why bother to mention-. and/or edit lines within the file. All edit commands operate them-most have already received an abundance of criticism. on, or with resp~ct to, the current line. In most cases, the WANT LIST-High level language. Floating point arith· current line is defined as the last line displayed on the TVT rnetic and 1/0 routines. Floating point arithmetic hardware screen. The program utilizes a line pointer which always con­ and/or schematics. Scope driver software using D/A converters. tains the starting address of the current line. This address Games. Cheap paper tape reader. changes as different lines within the file are accessed. DREAM LIST-Cassette tape controllers, hardware and In the following descriptions, a string is defined as any ~ software. High speed CRT terminal, 72 column line minimum. sequence, of any length, of valid ASCII characters. Parameters

June/July, 1976 Dr. Oobb's Journal of Computer Calisthenics & Orthodontia, Box 310, Menlo Park CA 94025 Page 13 contained within parentheses are optional parameters which line in the file (or move M lines) and dis­ may be included in the command line. Only the parameters, play the new current line. M may be pos­ and not the parentheses, are included if the optional itive or negative (max. range = ± 255). parameters are used. p (M) Print the current line (or M lines). The last line printed becomes the new current A String Append the string to the end of the current lines. line and display the result. PAGE List one page ( 15 lines), beginning with BOTM Set the current line pointer to the end of the current line. The current line is un­ file. changed. C %string1%string2 Find the first occurence of string1 in the R string Replace the current line with the input current line and change it to string2. The string and display the result. two string lengths need not be equal, and T Set the current line pointer to the top of the second string can be null (i.e., a C/R the file and display the first line or page following the second delimiter). The de­ of the file. limiters (%) may be any printing ASCII character. Utility Commands-The utility commands allow display­ D (M) Delete the current line (or M lines begin­ ing of the various pointers used by the program; specifying ning with the current line) from the file. parameters to the program; and outputting files to tape. All The file is moved in memory so that no addresses output by these commands are displayed in split empty space exists in the file. M is input octal, low order address first, followed by the high order ad­ as a decimal number, maximum value dress. The utility commands interface with the TVT only, and = 255. do not putput to the TTY. F string Find and display the first line in the file The utility commands recognized, and the functions they which begins with the string. The search perform, are: begins with the line following the current CLRS Clear TVT screen line and continues until a match is found DISP Displays current line pointer. This command is or the EOF is reached. The found line useful for the INSM command to determine the becomes the current line. starting address of the lines to be inserted. I string 1.nsert the string as a new line following DEOF Display end of file address. the current line. The file is moved up in DISM Display current setting of maximum memory memory to make space for the new line. size. If no string is included, or if only a C/R SETM Set maximum meory address. This value is pre­ is input as a command, the editor enters set to 7.5K for use in an 8K system, leaving the continuous input mode. In this mode, .5K free for later additions to a large file. This multiple lines may be entered in the file command requests an address input. by typing in each line followed by a C/R. MODEL Sets the output to the line (L) or page (P) Exit from the continuous input mode is p mode. In the line mode, only the current line is accomplished by inputting a null line (C/R displayed following a command. In the page only). When the continuous input mode is moade, 15 lines are displayed. The first line entered, the message INPUT will be dis­ displayed is the current line. played. Upon exiting this mode, the mes­ OUTM S Sets the output device to the TVT (S) or tele­ sage EDIT will be displayed. No prompt is T(C) type (T). The T parameter initializes the TTY issued between multiple input lines, which only (set to Baudot letters mode), and the TC indicates that the editor is in the input parameter also outputs a carriage return/line mode. feed. INSM M Insert M lines from memory following the RUBO X Sets the rubout character to X. X (initialized current line (M = 1 to 255). The file is to ") may be any printing ASCII character. The moved in memory to accomodate the new rubout character erases the previous input char­ lines. The location (starting address) of the acter in a command line. Multiple rubouts may new lines will be requested and must be be used to erase (back up) multiple characters. input from the keyboard. This command Kill X Sets the kill character to X. X (initialized to ?) is designed for merging together of two may be any printing ASCII character. The kill files, but may also be used to move lines character deletes the entire input line. If the within the same file if the destination is at kill and rubout are set to the same character, a higher memory address than the source. the kill function will take precedence. If this is not the case, only one line at a Q Quit. Exit to monitor. time may be moved correctly within the TAPE Transmitts the entire file to cassette tape. Two file. subcommands are associated with this command LIST List the entire file on the output device and require responses to queries displayed on (TVT or TTY). the TVT. The first TVT output is "REMOVE L string Locate and display the first line in the file TABS?". An input of Y (yes) will cause tabs to which contains the string anywhere within be converted to spaces prior to transmission to the line. The search begins with the line the tape recorder. if N (no) is input, the file following the current line and continues will be taped unmodified. The next output mes­ until a match is found or the EOF is sage is "FULL OR PARTIAL Fl LE?". If an F reached. The located line becomes the cur- (full) is input, the file is terminated by a double rent line. end of file on the tape. If P (partial) is input, N (M) Move the current line pointer to the next the file is terminated by a single end of file

Page 14 Dr. Dobb's Journal of Computer Calistheni

June/July, 1976 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box 310, Menlo Park CA 94025 Page 115 000 265 325 PUSH [:o TO STACK ~ E:X:ECUTE Ci"lMD rg 000 266 35i PCHL €U30 267 105 104 iii i24 EDMS DI~ ·'ED IT·" ED IT MESSAGE 001a 273 215 DE: 8DH MSE: SET ON LAST CHAR en... 000 274 * 8080 TE>ff Er:oITOR ** 000 274 * TAPE OUTPUT COMMAND ROUTINE £100 i00 * TE>ff ED I TOF.: PF.:OGF.:AM 000 274 * 001'1 i00 * l·lF.:ITTEt{ IN 8€H:l0 ASSEME:L'T' LANGUAGE 001a 274 04i 075 001 TPCF~ L:X:I H, TRMS OUTPUT TAE: 000 i00 * "lERS I ot·l 4. APF~ IL 16, 1.976 000 277 3i5 :1.02 002 CALL OUTF.: MESSAGE c 000 i00 * TVT OF~ E:AUDOT TT'T' OUTPUT 000 302 3:1.5 045 004 CALL C•TIN INPUT f;:ESPONSE :"' 000 i00 * USES ROM Mot~ I TOR F.:OUT INES 000 305 053 DC:x: H SET TO CHAF~ ADDFi: ·c 000 i00 0(10 306 1.76 MOV A.M GET RESPONSE 0 * SET INITIAL CONDITIONS 000 307 376 :13:1. CPI ... ,T•··· TEST IF '.'ES CT 000 i00 * 000 311 3:12 322 000 JZ $+6 JUMP IF 'r'ES ~ 000 i00 * 000 i00 06i 200 :,47 ua SF', STAK SET STACK 000 3i4 376 1i6 CPI ·"W TEST IF NO 5' 000 i03 076 077 MVI A, '?·' SET KILL 000 3i6 J:02 020 1302 JNZ l·lHAT EF:ROR IF NOT 'T"ES OF.: NO !:; 000 i05 062 043 0ii STA KI LL CHAF.:ACTER 000 32i 257 :><:RA A CLEAR A REG :::J !!!. 0•30 ii0 076 042 MVI A, ... " ·' SET RUE:OUT 000 322 062 045 01i STA TEMi SET TAE: FLAG 0 000 ii2 062 04 7 (111 STA F.:UE:O CHAF.:ACTER 000 325 04i 01i 010 UH H, EFEF.: OUTPUT FULL OR ..... 000 ii5 257 :":F.:A A . CLEAR A REGISTER 000 330 3i5 i02 002 CALL OUTR PAF.:TIAL MESSAGE C'l 0(1(1 ii6 062 050 011 STA MODE SET TO LINE MODE 000 333 3:1.5 045 004 CALL DTIN INPUT RESPONSE ~ 000 i2i 041 377 03:5 Un H. EDMS OUTPUT ErHT 000 344 3:12 355 000 .JZ STCC• .JUMP IF FULL &' 000 135 3i5 i02 01a2 CALL OUTR MESSAGE 000 347 J:76 12(1 CPI ·'P·' TEST IF PAF.:TI AL S' •300 i4(1 076 076 CMRT W~I A, '>' 000 3~.51 3(12 020 002 JNZ !~HAT EF<:l':OF.: IF t·lOT F OF.: P ~ 01;m i42 315 07i 003 CALL TVTO OUTPUT PF.:OMPT 0013 354 257 ;x:RA A CLEAi': A =· 000 i45 315 045 004 CALL DTIN INPUT COMMAND 000 355 062 067 0ii STCD STA TEMP SET F OR P MODE £l (100 i50 315 i45 006 CALL SCNE: SCAt~ OFF E:LAWO:.S 000 J:60 052 057 0:1:1 L.HLD TOPL GET START ADDF.: Ill' 000 i53 * 000 J:6J: 3:15 207 34:1.. CALL TMDL TI ME DELA'T' TO TAPE 0 ~)00 i53 * INPUT MODE IF COMMAND = C/R 000 366 026 00:1. M'./I D.. i SET TAE: COUNTER ;:i 01a0 153 * 000 37(1 072 045 011 N~';TP LDA TEMi GET TAE: FLAG s 1-:::100 :153 332 074 003 JC INMD JUMP TO INPUT MODE €1€10 3:73 267 Ol':A A SET 81;::18(1 FLAGS g. 000 :156 3:05 SCRH PUSH E: SA'•/E E:.~~C REG ,e:1e:10 J:74 :176 MOV A.M GET DATA FOR OUTPUT a 1zn30 157 €12:1. :1. 7:1 €107 LXI D,CTE:4 COMMAND TAE:LE ADDF.: 000 375 043 IN:x: H I NCF.:EMENT AC•DF~ESS ..fii' 000 162 052 055 0:11 LHLD IPNT COMMAND ADDF.: IN I E:UF (10•3 ::76 J:12 0::::2 001 .JZ TE:OK ,TUMP IF TAE:S STA'T' tu '"100 165 ~:::1..:i.2 €153 J.31.1. SHLD ADDS FOR SEARCH ROUTINE •301 (101 376 024 CPI TAB TEST IF TAE: ~ 00•3 17•3 076 004 mr ~4 4 CHAR COMMANDS 0€11 0£G 3(J2 032 (10:1. .JN:<: TE:OK .JUMP IF NOT TAE: •300 172 062 044 011 STA NCHR FOF.: SEARCH ROUT HlE 0'7J1 006 ~ 000 :175 (106 021 MVI E:.N4CS # OF 4 CHAR CMMDS 00i 006 * CONVERT TAE:S TO SPACES .o * fH30 1.77 3i5 2(14 006 CALL CTSH CALL SEARCH F.:OUTINE 0e:11 •306 * s: 1a01"1 202 * 0•31 0136 :172 MCl\•1 A .• D GET COLUMN COUNTER ~ 0(10 202 * ZERO IF MATCH ..:;:11-31 0€17 326 1306 SUI 6 SUE:TRACT 6 F:EPEATEDL 'T' 0 '"100 202 * 01:31 01i 322 01217 i.zu:::1:t ,TNC :l;:-5 UNTIL OVEF.:FLOW OCCUF.:S .,, 000 2(12 312 222 000 .JZ MTCH .JUMP IF MATCH 001 014 137 MO'./ E .. A #(-) OF SPACES TO E REG !!l 00(1 2(15 076 001 M'./I A, i 1 CHAF: CMr·ms R- / .,,. 001 015 076 04(1 MVI -· SPACE 000 207 062 044 01i STA NCHF.: FOR SEARCH ROUTINE 001 017 3i5 151 34:1. CALL TAPO TO TAPE C'l 01711'.'1 2i2 006 014 MVI E:, N1CS # OF 1 CHAF.: CMl"lDS 001 022 024 INR D INCREMENT COLUMN COUNT :I:> 0130 2i4 3i5 204 006 CALL CTSH SEARCH TAE:LE 001 023 034 It·lR E INCREMENT SPACE COUNT "' 000 217 302 020 002 .mz ~lHAT EF.:ROF.:, NO MATCH 001 024 J:(12 017 001 .mz $:-8 LOOP UNTii,.. SPACES DONE ~ 00€1 222 042 067 0i1 MTCH SHLD TEMP SA'•..1E ADDF.:ESS 0(11 027 J:03 J:70 00(1 JMP N:x:TP GET NEXT CHAFi: 0'1 000 225 072 044 0i1 LDA NCHF.: # OF CHAR IN CMMD 00i 032 315 151 J:4i TE:OK CALL TAPO OUTPUT TO TAPE 000 230 1i7 MO'./ C,A TO C REG 001 035 024 INF.: D I NCF:EMENT COLUMN COUNT ~'100 231 •306 000 MVI E: .. 0 ADD E:C TO HL TO 00i 0::6 376 001 CPI 1 TEST IF EOF 000 233 052 055 011 LHLC> IPNT GET ADDR OF CHAF.: !::10i 040 312 05J: 001 JZ TDON JUMP IF EOF 000 236 0i1 C•AD E: AFTER CMt•JCo 00i 043 3:76 0:15 CPI 13 TEST IF C/R 000 237 042 055 011 SHLD IPNT SET IE:UF PO INTER c... 00i 045 302 J:70 !::1(10 JNZ NXTP NE:X:T CHAR IF NOT C/I': c 000 242 1.76 MO'·i A, M GET NE:X:T CHAF.: 001 050 303 366 ~300 JMP N:X:TP-2 F:ESET COLUMN COUNT ... '+i i 000 243 376 04i CPI TEST IF C.-"R OF.: E:LANK 001 053 006 001 TDON MVI E:, 1 SET FOR EOF OUTPUT !: 000 245 322 020 002 .JNC ~lHAT EF.:F.:OR IF NOT 001 055 072 067 01:1. LC•A TEMP GET F.-"P FLAG ~ 000 250 3i5 i45 006 MTGO CALL SCNE: SCAN OFF E:LANKS 00i 060 267 ORA A SET 8080 FLAGS ... 000 253 042 055 011 SHLD IPNT SET IE:UF PO INTER 001 06i 31,32 066 001 JNZ TPLC JUMP IF FULL FILE 000 256 052 067 01i LHLD TEMP RECALL MATCH ADDF.: 001 064 004 INR E: INCREMENT 8 TO en""' 000 26i 30i POP E: RESTORE E:.S,C 001 065 004 INR E: EOR 000 262 02i i40 000 E:>(CT L:X:I D.CMRT SET RETUl':N ADDRESS 00i 066 i70 TPLC MOil A, E: EOF OF~ EOF.: TO A .:::.._1._1.-,c:-c:· 1-:::u:::11. 1.3 6 7 :3:i5 i5i J:4i CALL TA~J AND TO TAPE 00i 042 06i Oii SHLD PNTF: SET LINE POINTER 2- (10:1 1-:::172 ]:~:::1:: 21-:::13 1-:;:1(:12 JMP DEOF DISPLAY END ADDRESS 00:1 260 303 243 001 JMP NXUP LOOP UNTIL DONE ::l 001. 263 .+; ;:::"' OOi 075 122 11-:::15 :115 1.1. ~~· TF~S DW 'REMOVE TABS? c: OOi iOi i26 i05 041;.~ i24 OOi 263 * EXIT TO PRINT ROUTINE ~ OOi 1J::15 11-:::11 1.t-32 123: l;'.f("? 001 26? * OOi iii 240 [:oE: ··+::mH 001 26? 072 050 0:1:1 NOON LOA MODE MODE FLAG TO A § f10i i12 * 001 266 052 06:1 0.1:1 LHLD PNTF: LOAD LINE POINTEF: en OOi ii2 * NEXT COMMAND ROUTINE 001 27i 267 OF:A A SET 8080 FLAGS rnc1i ii2 * 001 272 1-:::12 1_j.:::1'.:i (1(16 JNZ LIST JUMP TO PAGE C~TPUT 001 ii2 001 002 000 r·t,:1_1p UP i IF NO NUMBER INPUT 001 300 JMP LNOT JUMP TO LINE OUTPUT f11c1i i2D J:1-:::15 PUSH B SAVE B&C 001 303 ;f; OOi i2i .:.:: ... ·i::. 1-;}55 CPI TEST IF NEGATIVE 00:1 303 * RUBOUT COMMAND F~UTINE S? OOi i2:3: ::02 i4i ·~10i .HE U·l'v"v' JUMP IF POSITIVE 00i 303 * SETS NEW F:UBOUT CHARACTER ;f; . 1-::.~1-:::11 i26 30i POP B RESTORE BS,C 00.1 ?0? l5' OOi i27 (106 (11:;:11 MVI B.i SET B FOR SIGN FLAG 00i 303 1;::152 j.:;:155 Ei1..i RBCM LHLD IPNT LOAD IBUF POINTEF: CT 01<1i i3i :;:1-35 PUSH B SAVE B&C 001 306 :176 MDV A,M GET NEW ~J~JUT CHAP ~ ·~11c1i iJ:2 1-:::152 ld55 1-:::1:11 LHLD IF~T GET NUMBER ADDR 00i3~ ]:76 12:14-1. CPI "+i TEST IF BLANK OR _TC WHAT 5" 1-301. :13:5 04:;: INX H INCREMENT PAST -SIGN OOi 3ii 020 002 CONTF:OL CHAR OOi 3i4 062 047 011 STA RUBO VALID. SET F:UBOUT =; ·~1!<1i i36 1.]42 055 0.11. SHLD I~T UPDATE I~JF POINTER EXIT TO EDIT P~~ITOF: §. OOi i4i 1-3:52 055 01.:i CNVV LHLD IPNT GET NUMBER ADDRESS 00:1 3:17 3ii RET 01ai i44 i04 MO\' B,H SET ADDRESS IN 001 320 :f: s, 0£11_ i45 ii5 MDV C,L B& OOi 320 * ~JTPUT ~JOE SET COMMAND n OOi i46 3::1.5 :;:25 1-]f16 CALL DBCV CONVERT TO BINARY 00:1 320 :f; LOAD I~JF ADDRESS o OOi i5i 1-:::145 ~:R H TEST IF LESS THAN ~~~ OOi 320 t-352 055 1-:::11.. 1 MSCF: LHU:o I F'tH 3 12101 152 362 £121-:::1 (1(12 JP WHAT JUMP IF HL > 255 00i :176 MO\' A.. r-1 GET NEW ~~DE CPI ··p ·· 01-31. :155 ~'Di POP B RESTORE B&C 00:1 324 3:76 :t2~:::1 TEST FOP PAGE (11-:::11 :156 ii5 MDV GL # OF LINES TO C ~:::11;::11 ]:26 3i2 3:::;:7 O•cli .Jz STMD JUMP IF PAGE MODE l C:F'I .. L .. n €1t-Z1:1 157 ·~1i4 INR C PLUS i 00i :;::n 376 ii4 TEST IF LINE 2!. OOi i60 :170 MDV A,B SIGN FLAG TO A (1f1i J.:;.J. J:t-32 020 ~3(12 nc ~·lHAT ERF~F: IF NOT P OR N ~ [u;:11 1.61 267 ORA A SET 8080 FLAGS €H]i J:36 .:::::::1.- :' 1~10i i65 of; '313i J:43: * TOP CC~MAND F.~~TINE 0 (1f):.t 165 175 MDV A,L # OF LINES TO A •30i JA3: ;f: ;. l-~)01. :166 (162 1-]67 1-:::111 NXBK STA TEMP SAVE IN TEMP @c1i 3:43: (152 ~:::157 1-:::11.i TOPP LHLD TOPL LOAD TOP ADDF:ESS g_ f10i i7i (152 €157 t-3:11 LHL[:• TOF'L FILE START ADDR f10i :3:46 .f142 06i Oii SHLD PNTR SET LINE POINTER § OOi i74 ]:53: ::<;CHG TO DE REGISTERS f1t2:11. 351 * g. 01-3:1 :175 f152 t16:1 1-:::11:1 LHLC• PtHF: CURRENT ADDRESS (1f1i 351. * JL~P TO LINE OF: PAGE OUTPUT - 01~1i 2•30 1-:::153: r·lATP C•C< H BACK UP 2 [1£11 3:51 * AS DETEF.~INED BY CURRENT ~JOE g' OOi 20i [153: DC:,_,; H CHARACTERS 00i J:5i ;f: " (1'~1i 2•32 ::::::15 J:27 1-303: CALL O"iTS TEST IF AT TOP (11-:::11 J:5:1 f.172 05~:::1 01.:.t LOA MODE c..J 1-:'.:H31. 21-:::15 3:3:2 2:17 Otd.1 .JC t·lAOf< JUMP IF NOT TOP 0•3i 354 267 OF:A A 0 (113i 2i0 J:5]: :' --- f10i 222 J:f12 20i 0•3i ..mz t·lATP+i LOOP UNTIL C/R FOUND i.;:11-:;:11. 3:72 376 (141. CPI '+i STOF:E NEW KILL ·~14:;: m>': H SET ADC•F.: TO LINE START t-3(11. 3:74 020 002 JC WHAT UNLESS SPACE OR 042 f16i f1ii SHLD PNTF: SET LINE POHffEF.: i;::11-;):t 3:77 062 043 01.1. STA KILL CONTF:OL CHARACTEF: ~ gi~ ~~~ 1-;J72 1-:::167- 1-:::111 L[:•A TEMP # OF LINES TO A i.:::1i.:::12 oi.:::12 3ii ~T f10i 2:3:4 1-:::175 DCF.: A SUBTF:ACT i j.:::1i.:::12 ~:::1 f1]: ;f: 1-)(1:1 23:5 302 i66 OOi .Jt-.IZ N>,:E:f< LOOP UNTIL# =.ZEF:O ~] 1-:::12 ~:::1 j.:::13 * NLST GETS NEXT LINE ADDRESS (C1'3i 240 303 263 OOi .JMP t·mot-~ .JUMP TO E:,,:UP* [:oCF: C # OF LINES - i 002 Oif1 _:::(6 01.5 CPI i3 TEST FOP C/R .... (1(1i 244 3:1.2 26:c cn:::1:t _TZ t·mON JUMP IF DONE 002 Oi2 :;:10 F:Z ~JNE IF C/R .... OOi 247 3:1-5 003: £102 CALL t·lLST GET NEXT LINE ADDR (1(12 OiJ: ::22 ~;:!(16 0f12 JNC NLST+3 LOOP IF NOT EDF 013i 252 3:3:2 3:3:6 (1135 JC BOTM .JUMP IF AT EDF 0(12 (1i6 i;;:1;53: DCX H BACK UP i 002 0:17 3:1.:l. RET 002 203 052 063 0:1.:l. DEOF LHLD EFPN LOAD EOF ADDRESS 'ii 002 020 002 206 353 ::<:CHG TO DE REGISTERS 'S 002 020 * ERROR MESSAGE OUTPUT 002 207 00:1. 220 002 LXI B,EMSG LOAD MESSAGE ADDR ... 002 020 * 002 2:12 04:1. 23:1. 002 LXI H,EOLC LOAD STORAGE Al)DR CD 002 020 04:1. 034 002 WHAT LXI H, WTMS LOAD MESSAGE ADDF: 002 2:15 303 :137 002 JMP EEOF JUMP TO DISPLA'T' 002 023 06:1. 200 347 LXI SP,STAK RESET STACK 002 220 :105 :1.:1. 7 :106 040 EMSG D~J ·'EOF <:LC DS 3 * 002 276 040 DB .~ ==~ i:~ * MESSAGE OUTPUT ROUTINE 002 277 DS 3 ;. 002 :102 "' 002 302 2:15 DB SDH ~ 002 :102 :176 OUTR MOV A,M LOAD CHARACTER 002 303 * il" 002 :103 006 002 MVI B,2 B = 2 002 303 * TAPE INPUT COMMAND IP 002 :105 267 ORA A SET FLAGS 002 303 002 :106 362 :l.:14 002 JP OTCH JUMP IF MSB ZERO 002 303 04:1. 075 002 *ITCR LXI H,ADMS OUTPUT ADDR 0 002 :1.:1.:l. 326 200 SUI 80H CLEAR MSB 002 306 3:15 :102 002 CALL OUTR MESSAGE g. 002 :l.:13 005 DCR B B = :1. NOW 002 3:1.:l. 3:15 236 006 CALL HLIN INPUT ADDRESS &. 002 :l.:14 3:15 07:1 003 OTCH CALL TVTO OUTPUT CHARACTER 002 3:14 042 06:1. 0:1.:l. SHLD PNTR SET LI NE PO INTER a 002 :l.:17 005 DCR B B = 0 OR :1. NOW 002 3:17 042 057 0:1.:l. SHLD TOPL SET TOP POINTER ii!" 002 :120 3:10 RZ DONE IF B = 0 002 322 3:15 045 004 CALL DTIN WAIT FOR C.•'R •.. 002 :12:1. 043 mx H INCREMENT ADDRESS 002 325 052 057 0:1.:l. LHLD TOPL LOAD TOP ADDR gi 002 :122 303 :102 002 JMP OUTR LOOP UNTIL DONE 002 330 3:15 263 340 TPIN CALL TAF'I GET DATA FROM TAPE )( 002 :125 002 333 :162 MOV. M,D MOVE DATA TO MEMOR'T' !:l 002 :125 "'* DI SPLA'T' PO INTER 002 334 376 00:1. CPI :1. TEST FOR EOF .0 002 :125 002 336 3:12 345 002 JZ TDIN JUMP IF EOF 31:: 002 :125 052 06:1. 0:1:1 "'DCPL LHLD PNTR LOAD POINTER 002 34:1. 043 INX H INCREMENT AC•DRESS CD 002 :130 353 XCHG TO D&E 002 342 303 330 002 JMP TPIN LOOP ~ 002 :13:1. 00:1. :156 002 LXI B,OTMS LOAD MESSAGE ADDR 002 345 042 063 0:1.:l. TDIN SHLD EFPN SET EOF PO INTER 002 :134 04:1. :173 002 LXI H,OTLC OCTAL STORAGE ADDR 002 350 3:15 302 003 CALL EFFN TEST FOR OVERFLOW B'T' if 002 :137 :173 EEOF MOV A,E LOW BYTE TO A 00:2 353 3:1.:l. RET SEARCHING FOR EOF ~ 002 :140 3:15 064 007 CALL BINH+:l. CONVERT TO OCTAL 002 354 (') 002 :143 :172 MOV A, D HIGH B'T'TE TO A 002 354 * EDIT COMMAND ROUTINE )> 002 :144 043 INX H INCREMENT STORAGE ADDR 002 354 'i 002 :145 3:15 063 007 CALL BINH CONVERT HIGH BYTE 002 354 04:1. 075 002 "'EDCR L::<:I H,ADMS OUTPUT ADDF; cs 002 :150 :140 MOV H,B MESSAGE ADDR 002 357 3:15 :102 002 CALL OUTR MESSAGE l:ll 002 :15:1. :15:1. MOV L,C TO HL REGISTERS 002 362 3:15 236 006 CALL HLit~ INPUT ADDRESS 002 :152 3:15 :102 002 CALL OUTR OUTPUT RESULTS 002 365 042 06:1. 0:1.:l. SHLD PNTR SET LI NE PO INTER 002 :155 3:1:1 RET EXIT 002 370 042 057 0:1.:l. SHLD TOPL SET TOP PO INTER 002 :156 :120 :l.:17 :1.:1.:l. :l.:16 OTMS ow' 'POINTER <:T CHAR ~ 003 07:1. * TVT OUTPUT ROUTINE 003 250 30:1. ROON POP B RESTORE B&C a. 003 07:1. * 003 25:1. 3:1.:1. RET ~ 003 07:1. 323 000 TVTO OUT TVT OUTPUT DATA 003 252 * m 003 073 3:1.:1. RET 003 252 * SINGLE LINE INPUT COMMAND ~ 003 074 * 003 252 * w 003 074 * INPUT COMMAND ROUTINE 003 252 332 074 003 INSL JC INMD JUMP IF NO STRING 0 003 074 * 003 255 0:15 OCR C DECREMENT CHAR COUNT • 003 074 06:1. 200 347 INMD LXI SP,STAK RESET STACK 003 256 0:15 OCR C TWICE ~ 003 077 04:1. 003 0:10 LXI H,INMS MSSG ADDR 003 257· 04:1. 074 0:1.:1. LXI H.IBUF+2 LINE START ADDR ! 003 :102 3:15 :102 002 CALL OUTR OUTPUT MESSAGE 003 262 042 055 0:1.:1. SHLD IPNT SET IBUF POINTER o 003 :105 3:15. 045 004 INLP CALL DTIN INPUT NEW LINE 003 265 3:15 003 002 CALL NLST GET NEXT LINE ADDR ~ ::; ~~~ ~;~ 072 0:1.:1. ~~~ ~:~BUF ~~*DF~~~~ ~~~:~c*~~R ::; ~~~ ::~ =~~ =~~ ~~~~ ~~*~ ~~i ~~~~ ~~~~iER 003 :l.:16 376 0:15 CPI :13 TEST FOR C/R 003 276 3:15 :140 003 CALL CENT INSERT LINE ~ 003 :1.:16 3:12 :132 000 JZ IDON DONE IF C/R 003 30:1. 3:1.:1. RET 003 :12:1. 3:15 003 002 CALL NLST GET NEXT LINE ADDR 003 302 * 8 003 :124 042 06:1. 0:1.:1. SHLD PNTR SET LINE POINTER 003 302 * EFFN ROUTINE ~ FINDS EOF AND N 003 :127 042 065 0:1.:1. SHND MVAD SET MOVE LIMIT 003 302 * TESTS FOR MEMORY OVERFLOW UI 003 :132 3:15 :140 003 CALL CENT INSERT LINE 003 302 * 003 :135 303 :105 003 JMP INLP LOOP FOR ANOTHER INPUT 003 302 052 05:1. 0:1.:1. EFFN LHLD MMAX LOAD MAX MEM VALUE 003 :140 * 003 305 353 XCHG TO DE REGISTERS 003 :140 * LINE INSERT ROUTINE 003 306 052 06:1. 0:1.:1. LHLD PNTR LOAD CURRENT ADDR 003 :140 * 003 3:1.:1. 3:15 327 003 EFF:l. CALL OVTS TEST FOR OVERFLOW ~ 003 :140 052 063 0:1.:1. CENT LHLD EFPN LOAD EOF ADDR 003 3:14 332 :173 004 JC MOFL JUMP IF OVERFLOW r§ 003 :143 0:14 INR C INCREMENT CHAR COUNT . 003 3:17 :176 MOV A> M GET CHARACTER 003 :144 006 000 MVI B,0 B = 0 003 320 376 00:1. CPI :1. TEST FOR EOF ~· 003 :146 0:1.:1. DAD B EOF ADDR + CHAR COUNT 003 322 3:10 RZ RETURN IF EOF ·003 :147 353 ~CHG IS NEW EQF _ ~-0A -~A~ __ J1)'4~- INX H INCREMENT ADDRESS 003 324 303 :;:11 003 JMP EFF1 LOOP 004 050 042 055 011 SHLC• IPNT SET BUFFER POINTER 004 053: 072 043: 011 LDA t(ILL KILL CHARACTER 'J' 003 327 * 'IS 003 327 * HL/DE COMPARE - CAF.:R'T' SET IF 004 056 ::13:7 MO"/ E, A TO E REGISTER 004 057 072 047 011 (\,) 003 327 * HL GF:EATEF.: THAN DE LC•A RUSO RUBOUT CHAF:ACTEF<: 004 062 127 MO\I D,A TO D f':EGISTER 0 003 327 * 004 063: 001 000 001 L:x:I 8.·100H SET B&C (103 327 1.73 O'·/TS M0 1•:1 A .. E 003 330 225 SUB L FORM E - L 004 066 :HS 066 0(G N:x:CH CALL TVTI INPUT FROM T'v'T 003 331 172 MO"/ A, C• 004 071 273 CMP E TEST IF KILL 003 332 234 588 H FOF:f-1 [:•-H-BOF.:F.:Ol·l 004 072 312 045 0(14 JZ DTIN JUMP IF l 255 004 124 176 MO"/ A.· M F.:ECALL CHAR "O 003 357 0:15 DLOC C•CF.: C DECF.'.EMENT LINE COUNT 004 :1.25 043 IW< H I NCF<:EMENT ADDRESS ~ !!1 003: 3:60 J:10 f':Z DONE IF ZERO 004 126 014 It·m c INCREMENT CHAR COUNT 003: 361 052 06:C 011 LHLD EFPN LOAD EOF ADDF.: 004 127 004 H MO"/E. MOVES C•ATA 004 163: J:11 RET ~ 004 012 * FF;:DM DE ADDI': TO HL ADDR UtH IL 004 164 1:15 HH 1J:(1 040 MAC•S [:ol·l ·'MA:X: ME·' (104 170 115 105 _o 004 012 * DE INCF.'.EMENTED TO MVAD LIMIT 004 012 * 004 172 3:15 DE: ···M·'+80H s: 004 012 3£15 LMO"." PUSH B SAVE B&C 004 173: * ~ 004 1a1:;: 102 MOV E: .. D SOURCE ADDR TO BC 004 173: * MEMORY OVERFLOW ERROR 0 004 fH4 11:;: MO'·/ C.. E 004 173 * ..., •304 (115 35:::~ XCHG SA"/E HL IN DE 004 173 041 212 0(14 MOFL LXI H,OFMS MESSAGE ADDR "'~ 004 016 (152 J.365 01.1. LHLD MVAD LOAD LIMIT ADDF: 004 :176 061. 20~1 347 LXI SP,STAK RESET STACK '""":·C::-~· 004 021 J.J..:.:. XCHG ADDR'S TO PROPER REGS 004 201 J:15 076 3:40 CALL CRLF C/R TO TVT £; 004 022 012 LMLF' I C>FI:,.,: E: GET CHARACTER 004 2•34 3::15 1J32 002 CALL OUTR OUTPUT MESSAGE ,-~.-. f r·1uv M,A STORE AT NEW AE>DR 004 «:•i." ..:::1::.1.:::: :.lo.+~J i::.i: ..:. .JMP CMRT RETURN ~ 004 024 i71 MOV A,C TEST LOl~ LIMIT 004 2:12 :115 :1.05 115 040 OFMS Nl .·· MEM 0"/EF.:FLm·J .· 004 025 273 CMP E 004 216 117 126 105 122 ~ 004 026 3:02 036 004 JNZ LMCT JUMP IF NOT AT LIMIT 004 222 :1.06 114 117 :1.27 004 03:1. 170 MOV A,B TEST HIGH LIMIT 004 226 2:15 C•8 8DH 004 032 272 CMP D 004 227 * 004 033 3:1.2 043 004 .JZ LDON .JUMP IF AT LIMIT 004 227 * APPEi C• COMMAt·m 004 036 043: LMCT INi< H INCF:EMENT ADC•RESSES 004 227 * '- 004 0:;:7 003 IN>': E: 004 227 171 APND MC•"/ A.· C CHAF.: COUNT TO A ~ 004 040 3:03: 022 004 JMP LMLP LOOP 004 23(1 326 0~)3: St.I 3: MINUS 3 <::: 004 043 30:1. LDot·J POP 8 RESTORE S&C 004 23:2 3:32 020 002 ,TC l·lHAT ERROR IF ONLY 2 INPUT ~ 004 044 311 RET 004 235 015 DCR C DECF.:EMENT CHAF.: COUNT • 004 045 004 236 015 C•CF: C nncE Ci) 004 045 * DATA INPUT ROUTINE 004 237 315 003: 002 CALL t·JLST t·JE:,q LI NE AC•DF.: .... 004 045 004 242 332 336 005 JC BOTM JUMP IF AT EOF "' 004 045 04:1 072 0:11 *DTIN L:,;r H, IBUF LOA[:• BUFFER ADDR 004 245 053 DC:X: H SET AC•C•R TO C/F.: 004 246 042 067 01.i SHLD TEMP SET TEMP FOR CHANGE 005 024 :174 MOV A, H •!HERE INSERT MOC•E STARTS <- 004 25:1. 04:1. 073 0:1.i LX I H, I BUF +1. STRING ADC•R - 1. 005 025 3:16 00B ACI 0 ADD CARR'r' ~ 004 254 042 045 0:1.i SHLD TEM1. SET TEM:l. FOR CHANGE 005 027 :1.47 MO\I H, A c::: 004 257 006 000 MVI B,0 B = 0 005 030 :1.7:1. MOil A, C NUMBER TO AC•D IS STRING 2 5. 004 26:1. 303: 007 005 JMP CNGO JUMP TO CHANGE ROUTINE 005 03:1. 220 SUB B - STRING 1. :< 004 264 005 032 042 B65 B:l.1. SHU) MVAD SET MOVE LIMIT .... 004 264 * CHANGE COMMAND 005 035 B52 B63 Bii LHLD EFPN LOAD EDF ADDR ~ 004 264 005 040 3B5 PUSH B SAVE STRING LENGTHS en 004 264 33:2 020 002 CCRT* JC WHAT ERROR IF NO STRING 005 04:1 :1.:17 MOV C, A DIFFERENCE TO C 004 267 052 055 0:1.:1 LHLI) IPNT DELIMITER ADDR 005 042 BB6 BB0 MVI B, 0 EDF PLUS DIFFERENCE 004 272 :1.26 MOV D, M FIRST DELIMITER 005 044 0:1.1. DAD B IS NEl-J EDF ADDR 004 273 006 000 MVI B, 0 ZERO CHAR COUNTER 005 045 353: :":CHG NEI~ EDF ADDR TO DE 004 275 005 046 052 B5i 0:1.:1. LHLD MMAX MAX MEM VALUE c 004 275 * COUNT CHARACTERS IN FIRST STRING 005 051. 3:15 327 0B3 CALL OVTS TEST FOR OVERFLOW :"' 004 275 005 054 322 1.73 004 JNC MOFL JUMP IF OVERFLOW c 004 275 043 *CCR1. INX H CHAR ADDRESS 005 057 052 063 0:11. LHLD EFPN LOAD EDF ADDR g. 004 276 :1.76 MDV A,M LOAD CHARACTER 005 062 31.5 22:1. 003 CALL RMOV MOVE FILE UP 0:: 004 277 376 0:1.5 CPI :13: TEST FOR C.-'R 005 065 052 063 0:11. LHLD EFPN LOAD EOF ADDR .. 004 3:0:1. 3:1.2 020 002 JZ WHAT ERROR IF C.-'R 005 070 0:1.i DAD B FORM NEW EOF ADC•R ~ 004 3:04 272 CMP D TEST FOR DELIMITER 005 071. 042 063 0:1.1. SHLD EFPN SAVE NEI~ EDF ADDR 3 004 3:05 3:1.2 3::1.4 004 JZ LSTR JUMP IF DELIMITER 005 074 30:1 POP B RESTORE STRING LENGTHS !!!. 004 3::1.0 004 INR B INCREMENT CHAR COUNT 005 075 3B3 1.42 005 JMP EQUL INSERT NE•! STRING 0 004 3::1.:1. 3:03: 275 004 JMP CCR:!. LOOP 005 1.00 .... 004 3::1.4 042 045 0:1.:I. LSTR SHLD TEM1. SAVE DELIMITER ADDR 005 :100 * HERE IF FILE SIZE DECREASES ~ 004 3::1.7 052 055 0:1.:1 LHLD IPNT FIRST DELIMITER ADDR 005 :1.00 3 004 3:22 043: INX H INCREMENT TO STRING 005 1.00 052 067 0:1:1. *LESS LHLC• TEMP LOAD MATCH ADDR 'B 004 3:23: 042 055 0:1.i SHLD IPNT ADC•R AND SAVE 005 1.03 :1.75 MDV A,L LOW ADDR TO A i; 004 3:26 052 06:1 0:1.:1 LHLD PNTR LOAD CURRENT FILE ADDR 005 1.04 20:1. ADD C ADD ST!<: ING 2 LENGTH ~ 004 3:3::1. :1.:1.0 STSH MDV C,B CHAR COUNT TO C 005 :1.05 :157 MDV LA TO FORM MOVE &1 004 33:2 042 067 0:1.:1 SHLD TEMP SAVE CURRENT ADDR 005 :106 :174 MOV A,H DESTINATION ADDR ![' 004 3:3:5 3:53 XCHG ADDR TO DE 005 1.07 3:1.6 000 ACI 0 ADD CARR'r' ii 004 3:3:6 052 055 0:1.i LHLD IPNT STRING :I. ADDR 005 1.1.:1 1.47 MDV H, A ~· 004 3:4:1. 3:15 1.63 006 CALL SEAR SEARCH FOR STRING 005 1.:1.2 353 XCHG SAVE IN DE .. 004 3:44 3::12 367 004 JZ STMT JUMP IF FOUND 005 1.:1.3 052 063 0:11. LHLD EFPN LOAD EDF ADDR It" 004 347 052 067 0:11. LHLD TEMP FILE ADDR 005 1.1.6 042 065 01.1. SHLD MVAD SET MOVE LIMIT 0 004 3:52 1.76 MDV A,M CHARACTER FROM LINE 005 1.21. 052 067 01.:1. LHLD TEMP LOAD MATCH ADDR ;:::. 004 3:53: 3:76 0:15 CPI :13 TEST FOR C.-'R 005 1.24 1.75 MOV A,L FORM MOVE START 5 004 3:55 3::12 :1.65 005 JZ CCDN JUMP TO EX IT IF c,··R 005 1.25 200 ADD B AS MATCH ADDI': PLUS g- 004 3:60 3:32 336 005 JC BOTM AT BOTTOM IF EDF 005 1.26 1.57 MDV LA STRING 1. LE~lGTH a. 004 3:63 043: IN:><: H INCREMENT ADDR TO NEXT 005 1.27 :1.74 MOV A,H .'" 004 3:64 303 33:1 004 JMP STSH CHAR ANC• CONTINUE SEARCH 005 1.30 31.6 000 ACI 0 ADD CARRY TO HIGH ADDR ID 004 3:67 005 :1.32 1.47 MOV H,A ~ 004 367 * COUNT CHARACTERS IN SECOND ST!<: ING 005 :1.33 353 :><:CHG DE=SOURCE, HL=DEST * 005 1.34 3:15 0:1.2 004 CALL LMO'•' MOVE FILE ~ ::: i~; 052 045 0:1.:1. STMT LHLD TEM1. DELIMITER ADDR 005 1.37 042 063 01.1. SHLC• EFPI~ SET NEW EDF ADDI': .0 004 3:72 01.6 000 M\II c, 0 ZERO CHAR COUNTER 005 1.42 s: 004 3:74 043 STM:I. INX H INCREMENT ADDR 005 1.42 * HERE IF FILE SIZE UNCHANGED g 004 3:75 1.76 MO'v' A, M LOAD STRING 2 CHAI': 005 1.42 0 004 3:76 3:76 0:15 CPI 1.3 TEST FOR C._..R 005 :1.42 052 067 0:1.:1. *EQUL LHLD TEMP MATCH ADDR .,, 005 000 3:12 007 005 JZ CNGO END OF STR It~G 2 IF C/R 005 :145 353 XCHG TO DE ~ 005 003: 01.4 INR C INCREMENT CHAR COUNT 005 1.46 052 045 0:11. LHLD TEM:I. SECOND DELIMITER ADDR 005 004 3:03 374 004 JMP snu LOOP UNTIL C/I': 005 :1.5:1. 043 rm< H TO STRING 2 ADDR ~ 005 007 * 005 :1.52 01.5 EQLP DCR c DECREMENT STRING 2 COUNT 005 007 * BEGIN CHANGE. B CONTAINS # OF CHAR 005 1.53 372 :1.65 005 JM CCDN JUMP IF NEGATI \IE ~ 005 007 * IN STRING :I.; C HAS # IN STRING 2 005 1.56 1.76 MO\/ A, M GET STRING 2 CHAR N 005 007 * 005 1.57 022 STAX D PUT IN FILE UI 005 007 1.70 CNGO MO\/ A, B B TO A 005 1.60 043 INX H INCREMENT ADDRESSES 005 0:1.0 27:1. CMP c COMPARE STRING 2 LENGTH 005 1.6:1 023 INX D 005 0:1.i 3::1.2 1.42 005 JZ EQUL JUMP IF EQUAL 005 1.62 303 1.52 005 JMP EQLP LOOP 005 0:1.4 3:22 :100 005 JNC LESS JUMP IF B > C 005 1.65 052 06:1 01.:1. CCDN LHLD PNTR LI NE START ADDR 005 0:17 005 :1.70 072 050 01.1. LDA MODE OUTPUT MOC•E FLAG .,, 005 0:1.7 * HERE IF FILE LENGTH INCREASES 005 :1.73 267 ORA A SET 8080 FLAGS .g 005 0:1.7 005 1.74 3:12 0:16 003 JZ LNOT LINE MODE OUTPUT 005 0:1.7 052 067 01.:1. * LHLD TEMP LOAD MATCH ADDR 005 :177 303 :1.05 006 JMP LIST PAGE MODE OUTPUT ~ 005 022 205 ADD L ADD STRING 1. LENGTH 005 202 005 023: ;157 MOV LA TO FORM ADDRESS 005 202 * LOC:I. ROUTINE - FINDS LENGTH OF STRING 005 367 005 202 * START I NG Ir~ COLUMN 2 OF I BUF * 005 367 3:1.5 202 (105 FIND CALL LOC:l. GET STRING LENGTH ~ 005 202 * cg 005 202 04:1. 073 0:1.:1. LOC:l. L:x:I H, I8UF+1 :1.ST LOCATION 005 372 04:1. 074 0:1.:1. LXI H, IBUF+2 STF.:ING AC: IF'NT STRING ADDR c 005 222 :1.70 LOC2 MOV A, 8 COUNTER TO A 006 0:1.6 . 3:1.5 :1.63 006 CALL SEAR SEARCH ~ 005 223 267 ORA A SET FLAGS 006 021 1352 (161 0:1.1 LHLD PNTF.: LINE F'OINTEF: c (105 224 372 020 002 ,JM l~HAT ERROR IF STF:ING < 2 006 024 3:1.2 321 005 .JZ LMT1 TO OUTPUT IF MATCH g. 005 227 004 INR 8 SET TO ACTUAL courH 006 027 303: 000 006 JMP FHU CONTINUE SEAl':CH ~ 005 230 3:1.:1. RET 006 032 * '- 005 23:1. * 006 032 * BOTTOM COMMAND F.:OUTINE g 005 23:1 * u:u:::ATE COMMAND - STRING SEAF.:CH 006 032 * 3 005 23:1. * AT EACH CHAF:ACTEF.: POSITiot~. FROM 006 032 052 063: 011 E:TMM LHLD EFPN EOF AC•DR !!!. 005 2:(:1. * NE:•ff LI t~E START TO EOF 006 0:;:5 042 (161 (11:1. SHLC• PNTR SET LINE POINTEF.: 0 005 231 :f; 006 040 311 RET ~ 005 231 3:15 202 005 LOCT CALL LOC:l. GET STF.:ING LENGTH 006 04:1. * ~ 005 234 04:1. 074 0:1.:1. U•:CHG ALSO IN DE (1(16 050 €1:15 DCF: C MINUS 2 ::r (l) 005 255 €152 €155 0:1:1. LHLD IF'NT STF.:ING RDDF.: 006 051 04:1. (17:;: 0:11 L:x:I H .. IE:UF+1 STRING AC•DF: :::> 163 006 CALL SERR SEAF<:CH 006 1354 042 045 011 SHLD TEM1 SAVE FOR CHANGE ROUTINE ~· 005 260 3:15 005 263: :;:12 303 0(15 .JZ LMTH .JUMP IF FOUNC' 0l-36 iz157 052 061. l-J:l:l LHLD F'NTR CURRENT RDDR 20 005 266 052 067 €11.1 LHLD T~P CUF.:F.:ENT ADC•F.: (1(16 €162 042 (167 (11:1. SHLD TEMP SAVE FOR CHANGE 0 005 271 043 I t~:x: H INCF.:EMENT AC•DF.: 1.Jl-:::16 £165 01"16 000 M'.,.'I E: .. •3 CHAF:RCTEF: COUNTEF.: ::.'.. 005 272 :176 MO\' A,M NE:'n CHRF.: 0£16 l-367 :1.76 UKff M0\1 ~M COUNT CHAR IN CURRENT 5 005 273: 376 0 ..3:1 CPI 1 TEST IF EOF 006 070 3:76 0:15 CF' I 13 LINE UNTIL C/F.: FOUND §- 01.:::15 275 312 336 005 .JZ BOTM .JUMP IF EOF 006 072 J:12 (1(17 005 .JZ cr-K;o .JUMP TO CHAt-lGE F~OUT I r·IE ~. 0F.15 :;:.)(1 3:03 25€1 0€15 JMP LNCH CONTINUE SERF.:CH fU36 075 336 l-J05 .JC E:OTM .JUMP IF EOF ...OJ £105 303 * 006 10•:1 0~ I r·I:•< H INCF.:EMErH ADDR tD 005 303 * WHEN FOUND, BACK UP TO STRF.:T OF LINE 006 :1.•31 004 INF: E: IrK:F.:EMENT CHAF: courH ;:J 005 :;:(G * 0(16 102 303 067 006 .JMF' UIGT LOOP w 005 3:03 ..352 ..367 f1:1i LMTH LHLD TEMP MATCH RDDF: (H36 il.35 * ,.c; €105 306 05]: DCX H E:RCf< UP 1 01.:::16 105 * PAGE COMMRr·m 0€15 307 :176 MO'./ A,M LORC• CHAF.: }.]12:16 1.05 * ::s: •305 3:1.0 376 i.3:15 CPI :1.3 TEST FOR C/F.: 1:"::1£16 :ll-Z15 €152 06:1 £11.1 LI ST LHLD F'NTR CUF.:F:ErH ADC•R ~ 005 3:1.2 302 306 005 JNZ LMTH+3 LOOP IF NOT C/F.: •:106 :1.1(1 31.5 22i:::1 J:4(1 CALL CLRS CLERF: SCF.:EEN 0 005 3:1.5 'ic143 INX H I NCF.:EMENT TO LI NE STAF:T rn:16 11:;: 31.5 076 J:4l-J CALL CF:LF C/F.: OUTPUT "'O 005 3:1.6 •:142 06:1. 0:1.1 SHLD F'NTR SET LrnE F'OINTEF.: 006 116 (126 (12}.J M'./I D, 16 LHJE COUNTER ~ (1(15 32:1. 072 05€1 (1:11 LMT:l. LDA MODE OUTPUT MODE FLAG •306 120 €125 r·ILS1 DCF.: C• C•ECF:EMENT LI NE COUNT 005 324 267 ~A A SET FLAGS (H36 121 310 F.:Z [;ot-lE IF ZERO ~ 005 :;:25 302 11.35 1.)06 JNZ LIST PAGE OUTPUT 0(16 :1.22 315 0:.16 003 CALL LNOT LINE OUTPUT 005 330 3::15 22 ..:::1 340 CALL CLF.:S CLEAR SCF:EEN 006 :.125 303 :120 006 .JMF' r·ILS1 LOOP © 005 333 J:03 016 0[G .JMF' UK1T LINE OUTPUT 1.Jft6 :1.:ZCf1 ~ * 005 336 * (106 1:;:0 * LIST COMMAND "' 005 3:;:6 * ERROF.: ROUTINE WHEN EOF PEACHED (1(16 :1.J:•:1 * !.Z105 33:6 * 0€16 :13€1 3:15 22tl J:4€i LCHR CALL CLF.:S CLERF: SCREEN 005 336 061. 2(U3 34 7 E:OTM UH SP .. STAK F.:ESET STACK ~UJ6 1:::::3 052 (157 }.):1.:1 LHLD TOPL TOP ADDRESS 005 34:1. 052 06:;: 011 LHLC• EFF'r·J EOF ADDF.:ESS i.J06 1.J:6 :;::t5 016 oo:;: CALL LNOT OUTPUT 1 L HJE 005 344 042 06:1. •311 SHLD F~TF.: SET LINE POINTER •306 14:1. 322 :.136 l-)06 .JrK LCHF:+6 LOOP IF NOT EOF <- 005 :;:47 041. 36(1 0(15 U