tdata ___ _ Issue# 4

finished, stop the program arrl jump to tle life program, 0100 Either load (J), 01, 00 at cxm or use option 00 of Super Monitor to execute at CXEO. This will display the initial arrl then generations. The calculates about 33 generations each By minute en t:re 30x48 grid. Ray 1\tLly The program requires a minimum of lK bytes of This program is based on the "Life" game memory, arrl an 1861 graphics chip. 1le devised by Chirles r, 1970 isStE of "Scientific American" (p. two generatioos in storage at any given time are 120). The game is initialized by placifl\ into a on pages 02 an:i 03. grid a pattern of "cells" (i.e., bits on the video display). The cclls then live, reproduce, arrl die to these three "genetic laws": fuw The Program Y.brks 1. Survivals - every cell with 2 or 3 neighbors survives to tre rext generation: 2. Deaths - an Each bit in memory has eight nearest isolated cell, or rne overcrowded with 4 or more reighbors, ruml:x;>red as follows: neighbors, will not survive to the next gereration: 3. Births - an empty grid location with exactly 3 reighbors will contain a cell in the rext generation. Frcxn a tome canputerist's point of view, the object of the game is to devise patterns that will evolve into as spectacular a series of succeeding gererations as possible.

fuw to Run t:re Program where t:re shaded block is the hit beifl\ tested. Consider rext a coltnn of three bytes in memory, pointed to by R(S), R(6), and R(7): First, tre pattern (first generation) must be drawn on the display. Jump to the "Pattern Initialization Program" at 006G. Eitrer load 30, 60, at (XXX) arrl press arrl release "R" arrl ''G'' or use Q.Jest Super Monitor to execute at 0000. Page 02 will be erased arrl displayed. It is divided into six columns of bytes (see diagram \Uler 'ibw the" Program Works"). First, tte lEe keY}Bl enter tre column in which you want to regin by typing the data on tre rex keY}Bl ani arrl releasirg 'T' where M(R(6)) contains the particular bit urrler (01--ai). Next, enter the data for the drawirl!,. test. 'There are three generalized positions for 'The data will be entered into the display this bit: left errl of byte (L), middle of byte vertically. Each column is 30 bytes deep; wren (M), or right errl of byte (R). 'The routine for you reach tle bottom, Q turn:; on. You can tren the rumber of of a given bit enter another column rumber arrl continue the is thus divided into three sectiorn, deperrling drawing, if desired. When the is oo whetrer the bit is in L, M, or R.

C£RII1C CllJB llB:VU: ClUS CIB1R: ClUS Cl13r.IAC ClUS liHIAC Cl.US Page 2 "Subroutire to Set Next Generation" at 002C J (DC instruction), whose job it is to set the The starting diagram (first generation) is bits for th2 lEtt generaticn, deperrling en the made Cl1 page 02. The top and oottom lines of state of the bits in the first. The bits in tre arrl tre page, tre far left ani right column of OOKt generatien are pointed to by M(R(9)). 'fu.!y bytes, are kept blank (for ease are set by placing M(R(9)) into the accumulator R(5), R(6), and R(7) are initialized to the after havirg set DF to 0 or 1, shifting DF into upper left corner: tre byte, and oock into M(R(9)). J 01 02 03 04 05 06 For each byte, the procedure is to test the leftmost bit (0136-{)156), the middle six bits (by passing through the loop 0157-0184 six times), and the rightmost bit (0185-01A2). The current generaticn pointers (R(5)-R(7)) ani rext generation p:>inter (R(9)) are then incremented J appropriately, arrl a test is made to see if the process is finished (0 1A4-Q 1B A.). If so, then with the solid bit at '1.:' in M(R(6)) the tre rexr generation is dispJayed arrl made into first ore unier test. the current genPrc,tion, and vice versa.

The neighbors are counted by placing the 0185 appropriate bytes into the Data Register, • 0100 Count right the i.OOividual en or off bits into DF, bit's arrl incrementing R(B).O for each ore that is on neighbors (by calling the subroutine at 0050 with a DE 0\32 instruction). After tre neighbors, the 01A2 state of the bit under test in M(R(6)) is Se't nexT gtMUM"at I Oft determined (by shiftirg into DF). If it is on, J then Q is turred en. A branch is then m00e to bit.

01,&.3 01J6 __..... _ __, 0060 lncreaent Count lett display bit's pointers 11elghbors 0092 01 --...1.---., Set next g-ere't I ot1 bit Erase

m 01,

Count 111ld bit's Mlghbors

0177 Set next s-eretlon bit Set reglsttM"s to upper lett bit

In-terchange OOBE 02 & 03 pointers

P.O. Box 4430, Santa Clara, CA 95054 QUESTDATA COSMAC CLUB Page 3

REGISTER INITIALIZATION STATUS QUO (I() CHANGES TO NEXT GENl

Atm COOE COMMENT CODE CCH4ENT

0000 co 004C 31 48 If Q•1, go 0001 00 60 Lo!ld 0060 11t set next first then 0100 generation (see text) bit to 1 0003 F8 01 BD A5 004E 30 3B E I se, set to 0 0007 F8 19 AD OOOA F8 02 50 85 86 67 SUBROUT I NE TO COUNT NE I GHBffiS 0010 FS 11 A7 0013 FS 00 AS BE BC 0050 03 Return 0018 F8 09 A6 A9 005 1 38 50 If OF • O, 001C F8 31 AC return o0 1f r8 03 B9 0053 18 30 50 EI se Increment 0022 F8 51 AE count, return 0025 co 01 36 Return to ma in program STANDARD VIDEO ROUTINE ro DISPLAY I PAGE OF MEMCRY REGISTER ASSIGNMENTS AOOR COOE COfo'MENT

RC5>-Polnts to ne ighbors #1-3 of current generation. 0060 90 Bl 82 83 84 RC6>-Polnts to bit under test, 11nd neighbors 14 and 5. 0065 F8 91 A3 fH1>-Polnts to neighbors 16-8 of current gener!ltlon. 0068 F8 8F A2 RC9l-Polnts to next generetlon. 006B F8 71 AI RCBl.O-Hotds count of neighbors. 006E 03 72 70 RCC>-Polnts to subroutine to set next generation. 0071 22 78 22 52 RCDl-Polnts to location In video routine which 0075 C4 C4 C4 contains page of memory be ing displayed. This 0078 F8 02 BO page Is lnltillllzed l!lt 02 for the first gen- 0078 F8 00 AO eration. 007E 80 E2 RCEl-Points to subroutine to count neighbors of bit. 0080 E2 20 AO 0083 E2 20 AO SUBROUTINE TO SET NEXT GENERATION 0086 E2 20 AO 0089 3C 7E AOOR CODE COI+lENT 0086 30 6F 0080 00 00 00 00 002C 7A F8 00 AB Turn 0 oft, 0091 E2 61 reset neighbor count to 00 ERASE PAGES 02 AND 03 0030 0.3 Return to ml!l in program AOOO CODE CO""'ENT 00.31 8B FB 02 32 4C it neighbors=02 go to Status 0093 E5 X = 5 Quo 0094 F8 03 85 0036 86 FF 02 33 43 If count> I, go 0097 F8 FF A5 R(5) points to test if =3 area to be erased SET NEXT GENERATION 8 IT TO 0 009A F8 00 73 Enter 00, wor k your way down 95 Continue erasing ADDR CODE COI+lENT 0090 FB 01 unti I you hit 00.38 F8 00 F6 Set OF to 0 page 01 003E 09 7E 59 30 2C Sh Ift OF into OOAO 3A 9A MCR(9)), return ENTER DATA INTO DESIRED COLUMN TEST FCR MORE THAN 3 NEIGI-EORS ADffi COOE CCH4ENT ADDR CODE CCH4ENT OOA2 F8 02 B5 R(5) points to coiiJnn "0" 004.3 8B 70 03 Test for count = >03 0209 0046 3B 3B It so, set next OOA5 F8 08 A5 genera-tion To 0 00A8 E6 X = 6 OOA9 FB 00 86 OOAC FB FF A6 M(R(6)) s-tores SET GENERATION BIT TO 1 input dat-a from keys COfo'MENT OOAF 7B 0 on to prompt- AODR CODE entry of des ired coiiJnn I 0048 F8 FF Set OF to 1 004A 30 30 Go shifT OF into M(R(9))

QUESTDATA COSMAC CLUB P.O. Box 4430, Santa Clara, CA 95054 Page 4 J AOOR CODE AOCR CODE COI+1ENT 0000 3F BO Enter col ,..nl, 0128 30 Of Push l 0120 00 00 00 00 Stack area 0002 6C 64 26 7A Store and display 0131 E2 61 Turn on TV col,..n I, turn 0133 co 00 03 Go i n i t i a I i ze 0 off reg !sters 0006 8S F4 AS Add column I to J RCSJ.O ROUTINE FOR LEFTMOST BIT 00139 37 89 Release I 0008 E5 Reset X to 5 AOOR CODE COI+IENT OOBC 3F BC Enter data tor pattern, push I 0136 05 FE DE Shift neighbor OOOE 6C 64 Write data Into 12 into DF, display area, count it on R(X)+l 0139 FE DE Shift neighbor J OOCO 85 fC 07 AS R(XJ +7 to point #3 into OF, to next byte down count it on c a l umn 0138 07 A: DE FE DE IIIith OOC4 F6 F6 F6 FB IF You're at bottom neighbors 17 if RI Xl.O>=FB an d 8 (IF i t shifted) 0140 25 05 F6 DE 15 Repeat with OOC9 37 C9 Re lease I neighbor #1, OOCB 3A ElC Not yet at restore R

QUESTDATA COSMAC CLUB P .0. Box 4430, Santa Clara, CA 95054 J Page 5

ROUTINE FOR RIGHTMOST BIT

AOOR CODE CQt.IMENT ADOR CODE CM.ENT 0165 05 F6 DE F6 DE Count neighbors 0100 f8 02 69 Set next #1 2 generation 018A 07 F6 DE F6 DE Count nel ghbors pointer 116 and 7 to page 02 OIBF 06 F6 38 94 78 0 on If bit on 0103 30 36 Go back to the 0194 F6 DE Count neighbor beginning 14 0105 f8 02 85 86 87 50 Set current 0196 15 16 17 Po I nt to column gener11tlon of 3 bytes to pointers right to pege 02 0199 05 FE DE Count neighbor 0108 F8 03 89 Set next 13 generation 019C 06 FE DE Count neighbor pointer 15 to page 03 019F 07 FE DE Count neighbor 01DE 30 36 Go bl!ck to the IB beg Inn lng 01A2 DC Set next generation 01A3 19 Advesnce byte 0000 3060 OOFB 0180 A5F8 19AD F802 5085 8687 pointer In next 0010 FB11 A7F8 OOAB BE8C F809 A6A9 F831 ACFB generl!tlon 0020 0389 F851 AECO 0136 0000 0000 7AF8 OOAB 0030 0388 F802 324C 88FF 0233 43F8 OOF6 097E TEST IF AT RIGHT MARGIN OR PAGE END 0040 5930 2C88 7003 3838 F8FF 3030 3148 3038 0050 0338 5019 3050 0000 0000 0000 0000 0000 AOOR CODE COMMENT 0060 9081 9283 B4F8 91A3 FB8F A2F8 71AI 0372 0070 7022 7822 52C4 C4C4 F802 80F8 OOAO BOE2 OIA4 86 FE FE FE FE FE If byte pointer 0080 E220 AOE2 20AO £220 A03C 7E30 6FOO 0000 R(6l.O, when 0090 OOE2 61E5 FB03 H5F8 FFA5 FBOO 7395 FB01 sh I tted I eft by OOAO 3A9A F802 85F8 08A5 E6FB 0086 F8FF A67B 5 bits, equa Is 0080 3F80 6C64 267A 85F4 A537 89E5 3F8C 6C64 "EO", then you OOCO 85FC 07A5 F6F6 F6FR IF37 C93A 9C30 A200 are at the edge. 0000 F860 AOF8 90A2 9380 9252 7000 0000 0000 Else continue OOEO FBOI 8082 F830 A293 A052 7000 0000 0000 looping OOFO 0000 0000 0000 0000 0000 0000 0000 0000 OIM FB EO 0100 908 1 8283 84F8 31A3 F82F A2F8 1 1A1 0372 01AC 3A 36 0110 7022 7822 52C4 C4C4 F802 BOF8 OOAO 80E2 OIAE 15 15 16 16 17 17 Advance pointers 0120 E220 AOE2 20AO E220 A03C 1E30 OFOO 0000 to ne>Ct I I ne 0130 OOE2 61CO 0003 05FE DEFE DE07 FEDE FE OE 0184 19 19 Do same for next 0 140 2505 F6DE 1526 06F6 DE16 2707 F60E 1706 generatIon page 0150 FE39 5478 FE OE DCF8 06A8 05AA 068A 0798 0186 86 FB F9 If R<6l.O points 0160 BAFE OEFE OEFE OE98 FEOE FEOE FEOE 9AFE to F9, you are 0170 OEFE 3075 7BFE OEDC SAFE AA9A FEBA 9BFE at The end of 0180 8828 883A 6005 F6DE F6DE 07F6 OEF6 DE06 the pege. Else 0190 F638 9478 F6DE 1516 1705 FEDE 06FE DE07 continue loop 01AO FEDE OCI9 86FE FEFE FEFE F8EO 3A36 1515 0189 3A 36 0190 1616 1717 1919 86F8 F93A 36F8 OIA5 F809 01CO A6A9 F811 A700 FB02 3AD5 F803 8586 8750 DISPLAY NEXT GENERATION 0100 F802 8930 36F8 0285 8687 50F8 0389 3036 AOOR CODE COMMENT 0168 F8 01 AS ReseT R(5) JilCI.E BELCS???? 018E F8 09 A6 A9 ReseT R(6) and RC9l We at Questdatn. rmlize it's a little azroly to 01C2F811A7 Reset R(7) CJrr>ist;nu.s, 01C5 OD FB 02 If video be thirik:iYYJ a1:out but it cb?s to routine 'WI? urf' wfom lP' 1ovw it. 'lhemfom, this is displays page a titt'Le rnrrrinJ.ero, to all !PU geniuses, 02, change it that we nea:1 ''hol Uby type" We need To 03. Else them in the near> futur>e in o-rder> that we may change back to th:m fOT' [Ublicxrtim. 02 OIC8 3A 05 OICA F8 03 85 86 87 50 Set current Mmy thmks, generation pointers (JESI'DATA SI'AFF to page 03

QUESTDATA COSMAC CLUB P.O. Box 4430, Santa Clara, CA 95054 Page 6 ANNOTATED BIBLI06RAPHY by Richard H. Johnson Harris, Gregory "EI f Meets a New Friend," Kilobaud/ M i crocomput i ng, 143 p. 54 (Ju I y 1980), I ntertac i ng basic E If to SS-50 .

Hudspeth, Forrest and James Champ, "Put Something Beringer, John "Disassembler for the 1802," Kilobaud/ Super in Your Life," #28, p. Microcomputing, #43, p. 196 (July 1980). 100 (April 1979), Source I i sting of a 2 K disassembler. Generates a Review of tho Quest Super El f. video display of output, Hutchinson, Thomas E. "Modify Your COSMAC Elf," Rronstein, Martin "A Hex Keyboard with Applications Ki lobau(}, 623, p. 105 (Novemb,Jr 1978), for the 1802 E If," Dr. Dobb's Journa I, 5, #3, p. 40 Addition of sophisti c ated keyboard hardware which ( 19801. includes capabi I ity to j ump to a desired location with the 1802 in the l nad 8unn, John R., "Memor y-Gheck i ng Program for the 1802," K i I obaud / M i crocomput ins; , #44, p, 162 (August 1980). Hutchinson, Thomas E. "The Cosmac Connection Part 1", Flow chart and machine language I i sting, 73 Amateur Radio Jan. 1979 p. 102; Part 2, Feb. 1979 p, 106 Cotter, Robert J., "Interfacing the Elf II," Kilobaud, Schematics, F I ow charts an d r:>rograms tor an 1802 based #24, p, 40 (December 1978). machine as a electro11ic keyer. Hex address displays and 61-bytA operating system. McCorrooick, Edwar .-1 r.J, "A Tir-Tac-Toe Game for your El t Cotter, Robert J., ''Programming the 1802," Kilobaud/ ComputP.r," Popular E l e ctronics Magazine, November Microcomputing, #27, p. 122 (March 1979). 1978, p, 98. _ , I nteger addition, subtraction, and multiplication. Requires 1K of mcmorv. Oeser i bes addition and usc ot I i ght pen. Cot tor, Robert J,, "The Amazing 1802: D/A and A/D Applications," Kilobaud, #20, p. 102 (August 1978), McCormick, Edwcr ri M. ·•Ho1oo1 to Upgrade a Basic t1 t E lvish hardware and software for 8-bit 0/A (digitial- Microcomputer·," Pc)pular El ectronics Magazine, February to-analogl conversion, 12 - bit D/A, and 8-bit A/D. 1978, p. 65. Hardware: Coss;, tte I / 0 and 20-mA current I oop, Cotter, Robert J., "The E If EPROMmer ," K i I obaud/ Programs: Memory-to-cassette, c assette-to-m emory, '-...../ M i crocom put i ng, #38, p. 76 (February 1980). teletype 1/0 , mem ory prenumbering, music, frequency Hardware and software for programming and verifying counter, i nterva I timer. 27 0 8 EPROM's. McCormick, Edward t·l. ''Promab! e 1 K Operating system Devaux, Edward C,, ''PIXIE Animation Program," Popular tor RCA E\ fs," Dr. Dobb's Journal, 2, #9, p, 34 Electronics Magazine, July 1977, p. 42. ( 1977), Hoi I ing and shifting display under keyboard control. McCormick, Edward M. "Utilit i es"' Music on the COSMAC Dolce, Larry 11 COSMAC Double Play," Kilobaud/ Elf," Dr. Dobb's Journal, 2, #9, p, 30 (1977), Microcomputing, #29, p. 66

Feldman, Michael A. and Fay A. Dion, "Computerized I e, George 11M i croprocessor App I i cations tor the Climate Control," Kilobaud/Microcomputing, #26, p. 38 1980's ••• It's a who! e New Ba I I Gamel," Popu I ar -

QUESTDATA COSMAC CLUB P .0. Box 4430, Santa Clara, CA 95054 Page 7

Paul C. "Programs tor the COSMAC Elf: RCA Publication VP-311. "VP-711 Instruction Manual," !nterpreters," published by Paul C. Moews. For VIP computer. Documents original CHIP-8 language, Demonstration interpreter for basic 1/4 K Elf, Source Includes twenty video games, I isting of CHIP-8 interpreter for 1 1/4 and 4 K Elves. Machine language I isting of relocatable CHIP-8 RCA Publ icatlon VP-320, "VP-711 User Guide Manual," interpreter for 4 K Elf, Moews has added several For VIP computer, Discusses CHIP-8 usage, instructions to the original RCA CHIP-8 interpreter for the VIP such as multi pi ication and division. 31 Redstone, Allan "Analog-to-Digital Conversion," pages. Kilobaud/Microcomputing, #40, p. 28 (April Hardware: 8-blt A/0 and 0/A conversion; use of Moews, Paul C. ''Programs for the COSMAC Elf: Music potentiometers for analog input, Software: A/D and Games," Published by Paul C. Moews. conversion routine and Etch-a-Sketch program. Music, display subroutine, hex-to-decimal and decimal- to-hex subroutines, register examine subroutine, dice Shroyer, Oonald R. "Elf Video from Netronics," program, random number generator, "Morra" game, Br i dg- Ki lobautl/Microcomputing, 141, p. 142 (May 19801. it game, reaction time program, and Tic-Tac-Toe, Review ot Netronics Video display board kit. Written for basic 1/4 K Elf, 44 pages. Shroyer, Don a I d R. "PI ay 'Space Batt! e' On Your Video Petty, Bob "Putting the 1802 on the S-100 Bus," Monitor," , June 1980, p. 61. Ki lobaud/Microcomputing, #30, p. 68 (June 1979). Players car. move space ships up or down. Requires W ire'Wrapping of an 1802 CPU board for the S-100 bus, push button switches attached to EF3 and EF4 for Uses the RCA UT4 monitor on ROM. firing.

Petty, R,W, "1802 PILOT," Ki lobaud/Microcomputing, Thurm, J, H, "A COSMAC CDP1802, CDP1854 Monitor," #31, p, 78 (July 1979), K i I obaud/M i crocomput i ng, 141, p. 132 (May 1980). Machine language listing only of a 2K PILOT Hardware: Use of COP 1854 UART. Software: Source interpreter. Includes a text editor and uses I isting of EC-Bug, an 856- byte prommable monitor, subroutines in the UT4 monitor ROM. Tully, Ray "Eitin Echow; ," Ki lobaud/Microcompuiing, Petty, R.W. "Tiny Text Editor for the 1802," #35, p. 127 (Novemhf!r 1979>. Microcomputing, 1136, p. 116 (December 1979). pattern for monitoring Elf II i ne I anguage I i sting on I y of text editor used in cassetto I /0. Potty's 1802 PILOT, Program occupies 0000 - 02E6 and uses subroutines in UT4 monitor ROM. Wasserman, Paul "A Floating Point Subroutine Packagn tor the 1802," Dr. flobb's Journal, 4, #7, p. 17 Pittman, Tom ''OOTS, Part 1," Kilobaud/Microcomputing, ( 1979). #26, p. 84 (February 1979). Machine listing onl y, no source listing. TV-Typewriter approach developed by author of Tiny Requires 2K of memory; 'Wr itten for location 0 100 - Basic. Pointer, mask, and data tables tor variable- OBFF, but instruction<; given for relocat ion. User width ASCII characters. Flo'W charts tor program, must provide code for the Standarad Ca II and Return Technique

RCA Publication VP-710. "Game Manual," Weisbecker, Joseph A, "Build the COSMAC 'EI f,' Part Programs in CHIP-8. ·Blackjack, biorhythm, pinball, 2," Popu 1ar E 1ectron ics Magazine, September 1976, p,:n bo'WI ing, plus ten more.

RCA Publication MPM-920A. "Instruction Summary for '-...../ the SDP 1802 COS MAC Micro-processor,"

QUESTDATA COSMAC CLUB P.O. Box 4430, Santa Clara, CA 95054 Page 8 J

Weisbecker, Joseph A. "Build the COSMAC 'Elf,' Part 3," Popular Electronics Magazine, March 1977 p. 61 ff Weisbecker, Joseph A. "Build the PIXIE Graphic Display," Popular Electronics Magazine, July 1977, P• 41

Weisbecker, Joseph A. 11COSMAC VIP the RCA Fun concerning the use of biorhythms as they pertain Machine," Byte Mag!!zlne, 2, 18, p. 30 August (1977). to our daily lives. I decided to firrl out oow they related to me by writing a program to calculate tre current level of each biorhythm and the composite of the three. Two inputs are requirt..>d; first your birth date (month/day/yffir), and secoru, today's date For availabi l ity of megazlne reprints and back Issues (month/day/year). Tre three biorhythm levels write to: along with the canposite are then the ootput. Lines 10 thru 180 are the input section. Dr. Dobb's Journal 1263 El Camino Real llre 19) calculates the ruml:er of leap year days Box E since your birth day that are to be added. Lire Menlo Park, CA 94025 260 determines whe ther the current month is before of after your birth date. Lires 210 thru Popular Electronics Reprints 6(X) calculate the total tll.nnber of days lived. P.o. Box 278 llres 610, 620, & 630 determine th= number of Pratt Station in Brooklyn, NY 11205 days each biorhythm eye le. Lines 650 thru 730 assign a numerical value to each ore of the Byte Magazine cycles (numbers are expressed as integers rather 70 Main St. · than decimals, as in traditional biorhythm Peterborough, NH 03456 plots). Finally, l ines 760 thru 790 are the Attn: Back Issues outPJt,. Also included are a flow diagram and Kilobaud/Microcomputing Back Issues Catalog Microcomputlng examples. Peterborough, NH 03458 Tol !-free telephone number: 1-800-258-5473

The Paul C. Moews booklets and several of the RCA CHECK EXAMPLES publ i cations are avai I able from Quest Electronics. BIRTH DATE 2-22-46 BIRTH DATE 2-22-46 The RCA publ icatlons may also be ordered directly from TOOAYS DATE 1-15-79 TOOAYS DATE 2-23-79 RCA Microcomputer Products Customer Service DAYS Ll VED DAYS L1 VED New Holland Avenue YEARS 12045 YEARS 12045 Lancaster, PA 17604 LEAP YEAR 8 LEAP YEAR 8 DAYS .37 DAYS I l'2'UT5" TIU54

I= 12015/33 364 R3 I= 12054/33 365 R9 J= +9 J= 22 Note from Editor : S= 12015/28 429 R3 S= 12054/28 430 R14 T= 0 I f you come across any d I screpanc I es or om Iss Ions, T= +12 pI case I et us know and we wI II pub I ish correct Ions In· P= 12015/23 522 R9 P= 12054/23 524 R2 a future issue. Your participation is greatly Q= +5 Q= 4 - appreciated by the Ques'tdata staff. C= 26 C= 26

Variables Variables B- 12045 B- 12045 L= 8 L= 8 W= -28 W= 0 F= -7 F= 1 A= 12015 A= 12054

QUESTDATA COSMAC CLUB P.O. Box 4430, Santa Clara, CA 95054 Page 9

660 IF 1>=9 IF 1<=24 THEN J=\9+(10-1 )*3 10 REM BIORHYTHM------PROGRAM 670 IF 1>=25 IF 1<=33 THEN J= -24+{1-25)*3 20 PR "8 IOOHYTHM 11 680 IF S>=t IF 5<=7 THEN T=5*4 30 PR 690 IF S>=B IF 5<=21 THEN T=24-(S-8l*4 40 PR "BIRTH DATE"· 700 IF 5>=21 IF 5<=28 THEN T= -24+(5-221*4 50 PR 60 INPUT M ' 710 IF P>=l IF P<=5 THEN Q=P*2 720 IF P>=6 IF P<=17 THEN Q=11+(6-PJ*2 70 PR "------DAY---"· 730 IF P>=18 IF P<=23 THEN Q= -12+(P-17J*2 80 INPUT D I 740 C:J+T+Q 90 PR "-----YEAR---". 100 INPUT Y ' 750 PR 760 J 110 PR PR "INTELLECTUAL-" 770 PR 11 SENSITIVITY-- 111 T 120 PR "TODAY5 DATE" 780 PR 11 PHY51CAL-----":Q 130 PR 11 -----...f.IONTH-" · 140 INPUT N • 790 PR 11 COMP051TE----",C 799 END 150 PR 11 ------DAY---" · 160 INPUT E • 170 PR "- ----YEAR---"· 180 INPUT Z • 190 L=(Z-Y>/4 Line No. 200 R=0 GOTO 431 270 IF M=N THEN GOTO 415 280 IF M=1 THEN W=W+31 200 290 IF M=3 THEN W=W+31 Calculate days 300 IF M=5 THEN W=W+31 lived fro. birth 310 IF M=7 THEN W=W+31 day -to current 320 IF THEN W=W+31 birth day 530 IF M=lO THEN W=W+31 340 IF M=12 THEN W=W+31 550 IF M=4 THEN W=W+30 360 IF M=6 THEN W=W+30 370 IF M=9 THEN W=W+30 260 380 IF M=11 THEN W=W+30 390 IF M=2 THEN W=W+31 YES 400 M=M+1 410 GOTO 270 415 F=E-0 420 A=L+B+W+F 430 - GOTO 610 431 N=N - 1 114onth x In 431 - -(Month x Days 432 M=M-1 114onth & Add to 600 In IIIOflth) & 433 IF M=O THEN M=12 Days Ll ved In Add to Days 434 IF N=O THEN N=12 Years & Add to Z10 _ lived In years 435 IF M=N THEN GOTO 590 =1 IF 1<=8 THEN J=1*3 760 - 790

799

QUESTDATA COSMAC CLUB P.O. Box 4430, Santa Clara, CA 95054 Page 10 J f?l!JlJ[EQJ [E(b(l lBGJf?f?(EUU(E UGJIJ(E J

by Van C. Baker J If you have a need to read cassettes record defining the total rumber of bytes en the generated by Super Monitor, or wish to read tape, it is necessary only to input the starting QJest-supplia:! cassette software, but neal to address ·for the cassette load; the program cbes relocate tape data or program in a location the rest. Use caution, however, to avoid other than that from which the tape was loading the cassette data over the tape read originally created, use the program listed program. below. To use the routine, load the program If ''rn'' sl:vuld appear m tl-v= display while into memory, noting that it may be located the tape is read, it indicates that a read m any J:Xl&e tnundary. Also oote that error (e.g., a parity error) occured. The location XXOl (where "XX'' represents J:Xl&e address of the byte at which the error occured number) must contain the byte the J:Xl&e can determined by locaticos XXffi in which routine is located. The program and XXFF (High and low address bytes, lista::l below, for example, nms in J:Xl&e zero, respectively). To reccNer fran a read error, hence, byte OCXH is ''(XJ". press the 'T' key en! proceed from step 2 arove. The program assumes f11lg line EFJ is used for the cassette serial inp.1t; if your system 0000 .·**************************************** differs from this convention, patch in the 0000 EFh 0000 MANUAL CASSETTE LOAD ROUTINE appropriate corrlitional braoch instructims 0000 at XX38,XX3F ,XX4F ,XXBE,xx95 ani 'l:f.A2 0000 BY V C BAKER 0000 To use the program, proceed as follows: 0000 * THIS ROUTINE READS A STANDARD 0000 * "SUPER MONITOR" CASSETIE, 1. r;xecute the program using your mmitor 0000 * LOADING THE DATA INTO USER - 0000 * DESIGNATED MEMORY AREA. or other means. It does not matter 0000 what register is tl-v= program rounter 0000 when the progran is entered. 0000 * TO USE: 0000 * 2. that "M' will displayro en the 0000 * (1) LOAD THE FOLLOWING hex display. Enter the high byte of 0000 * ROUTINE INTO MEMORY. 0000 * ALTHOUGH THE ROUTINE the starting address into which the 0000 * LISTED HERE STARTS AT 0000 tape contents are to loaded. Press 0000 * (HEX), IT MAY BE LOCATED the '1" key m w rex keypad. 0000 * ANYWHERE AS LONG AS IT 0000 * BEG INS ON A PAGE BOUNDARY, 0000 I.E., AT XXOO. PATCH IN 3. Enter the low 1 byte of the starting * J address. Press the '1" key. 0000 * THE ACTUAL PAGE NUMBER AT 0000 • BYTE XXOl • 0000 * 4. Enter file number to read (01-FF). 0000 * (2) EXECUTE THE PROGRAM Press the 'T' key. 0000 * USING ANY REGISTER FOR THE 0000 * . 5. Start the recorder ( m playback). 0000 0000 * (3) WHEN "AA" IS DIS- .J As the tape advan"ces, the current file 0000 * PLAYED ON THE HEX DISPLAY, 0000 * ENTER THE FOLLOWING USING number skipped (if the file entered in 4 0000 * THE HEX KEYPAD: was greater than 1) will displayed tu1til tl-v= 0000 * requestffi file is readcl As the contents of 0000 * (A) HIGH BYTE (MSH) OF the tape are being loaded into the requested 0000 * STARTING ADDRESS INTO memory locati(J[E, tre hex display will rapidly 0000 * WHICH TAPE CONTENTS ARE * TO BE LOADED. flicker. wren w tape has read, "M' will 0000 .J 0000 * appear m the hex display. & this point, you 0000 * PRESS THE "I" KEY. may load another tape by proceeding with step 2 0000 • above. Since the Super Monitor tapes have a 0000 * (C) LOW BYTE (LSH) OF 0000 * STARTING ADDRESS.

QUESTDATA COSMAC CLUB P.O. Box 4430, Santa Clara, CA 95054 J Page 11 ADOR CODE LABEL OPCOOE OPERAND COMMENT 0000 * 0000 * (0) PRESS THE "I" KEY. ADER CODE LABEL OPCODE OPERAND COMMENT 0000 * 0008 BB PHI RB RB = BOTM2 PC. 0000 * (E) TAPE FILE NUMBER 0009 B8 PHI R8 R6 Dl PC. 0000 * (1-FF) OOOA B6 PHI R6 R6 = ERR PC. 0000 * 0000 B5 PHI R5 R5 = HEXIN PC. 0000 * (f) PRESS THE "I" KEY. oooc B2 PHI R2 R2 = Stack 0000 * oooc pointer 0000 * (4) START THE RECORDER OOOD 0000 * ON PLAYBACK. 0000 0000 * 0000 0000 * (5l AS THE TAPE IS READ, OOOD F8 6A LDI BOTM2 BOTM2 address 0000 * ITS CONTENTS WILL BE OOOF AB PLO RB 0000 * LOADED INTO THE DESIGNATED 0010 FB 8A LDI Dl 01 address 0000 * MEMORY LOCATIONS. SINCE 0012 A8 PLO RB 0000 * THE STANDARD SUPER MONITOR 0013 FB 7A LDI ERR ERR address 0000 * TAPES CONTAIN RECORDS 0015 A6 PLO R6 0000 * GIVING THE NUMBER OF BYTES 0016 F8 FF LDI IFF Stack at XXFF 0000 * STORED ON THE TAPE, THE 0018 A2 PLO R2 0000 * ROUTINE WILL STORE THE 0019 E2 SEX R2 SP = R2 0000 * ENT IRE CONTENTS OF THE 001A F8 71 LDI HEX IN HEX IN address 0000 * TAPE AT CON SECUTIVE MEMORY 001C A5 PLO R5 0000 * LOCATIONS. CAUTI ON MUST 0010 0000 * BE USED TO ASSURE THAT THE 0010 *BEGIN MAIN PROGRAM 0000 * CASSETTE ROUTINE ITSELF IS 0010 0000 * NOT WR ITTEN OVER AS THE 001D 0000 * TAPE IS LOADED! I F FILE 0010 * DISPLAY "AA" ON LED'S 0000 2 OR GREATER WAS SPECIFIED 0010 * ' 0000 * IN STEP 3-K, THE CURRENT 001D FB AA BEGIN: LDI IAA Load "AA" 0000 * FI LE NUMBER BEING SKIPPED OO IF 52 STR R2 Store it 0000 * WILL BE DIS PLAYED UNTIL 0020 64 OUT 4 Output it. 0000 * THE REQUE STED FILE IS 0021 22 DEC R2 Repos ition SP. 0000 * REACHED. THE DISPLAY WILL 0022 0000 * FLICKER AS THE TAPE IS 0022 * GET STARTING ADDRESS FROM 0000 * BEING READ. 0022 * KEYPAD 0000 * 0022 0000 * (6) WHEN THE TAPE HAS 0022 05 SEP R5 Get MSH of 0000 * BEEN SUCCESSFULLY REA D, 0022 address 0000 * "AA" WILL APPEAR ON THE 0023 BE PH I RE 0000 * HEX DI SPLAY. IF " EE " 0024 D5 SEP R5 Get LSH 0000 * APPEARS, A READ ERROR 0025 AE PLO RE Start address 0000 * OCCURED D START OVER FROM STEP 3 0026 05 SEP R5 Get t i I e number 0000 * THE ADDRE SS OF THE BYTE 0026 (1-Ff). 0000 * BEING READ WHEN THE ERROR 0027 A4 PLO R4 Save In R4. 0000 * OCCURED CAN BE DETERMINED 0028 0000 * BY INSPECTING MEMORY LOC- 0028 * SET TIMING VALUE FOR A ONE BI T 0000 * ATIONS XXFE (fOR THE HIGH 0028 0000 * BYTE OF ADDR ESS) AND XXFF 0028 F8 OD LOI ONECT 0000 * . 002A B9 PHI R9 11 1" TIMir-.K; VALUE 0000 002A IN R9. 1 0000 002B 0000 CODE LABEL OPCODE OPERAND COt+IENT 002B 0000 ORG #0000 Start of program 002B F8 00 LDI 600 Initi a l I ze 0000 START: EQL #0000 0028 current f i I e 0000 ONECT: EQL #OOOD One-bit timing 002B num ber 0000 value 002D 0000 LERCT: EQL #OOOA Lead er one' s 002D ; 0000 t iming 002D 52 FTST: STR R2 Save current 0000 0020 file number 0000 002E 64 OUT 4 Displ a y i t-. 0000 F8 00 GO:' LDI START Load page number 002F 22 DEC R2 0002 B3 PHI R3 tor this routine 0030 84 GLO R4 Get requested 0003 F8 07 LDI !NIT initializat ion 0030 f i Ie n urn ber • 0003 address 0031 F3 XOR Check if aqua I 0005 A3 PLO R3 0031 t o c ur r ent. 0006 D3 SEP R3 SEP to PC = R3 0032 32 4F BZ ROF Branch if so . 0007 93 I NIT: GHI R3 In it i a I i ze 0034 0007 reg i st ar s . 0034 11 CHECK FOR LEADER 0034

QUESTDATA COSMAC CLUB P.O. Box 4430, Santa Clara, CA 95054 Page 12 J

AflOR CODE LABEL OPCOOE OPERAND COMMENT ADrn CODE LABEL OPCOOE OPERAND COt.f-1ENT '---/ 0034 F8 OA LOft{): LDI LDRCT Load test value 006.3 26 DEC R6 De(':rement byte 0034 for leader. 006.3 counter 0036 87 PHI R7 Save In R7 .1 0064 96 GHI R6 0037 DB OZTST: SEP RB Check for abort 0065 lA 5C BNZ RDOPT Loop back If not 0037 CBOTM2l 0065 done J 0038 36 37 8.3 OZTST Find data pulse 0067 30 10 BR BEGIN Else, go disp lay 0038 transition 0067 11 AA". 003A 99 GHI R9 Test pulse width 0069 0038 FF 01 PTIM: SMI 101 Is It too long 0069 00.38 for a one? 0069 ; 0030 38 47 BNF ZER JMP It so. 0069 ·**************************************** 003F 3E .38 . 8N3 PTIM e I se I oop t I II 0069 ;**************************************** J 003F pulse Is over. 0069 ; 0041 97 GHI R7 ThIs bit Is a 0069 . ****** 80TM2 ROUTINE ABOOT THE READ 0041 "1". Count the 0069 . 0042 32 37 BZ OZTST ones till LDRCT 0069 03 BTMRET: SEP R3 Return 0042 of them ere 006A .3F 69 BOTM2: BN4 BTMRET Return it 1-Key 0044 found. (Verify 006A is not in 0044 leader located.) 006C 37 6C WAIT: 94 WA IT software "de- 0044 27 DEC R7 006C bounce" step. 0045 30 37 BR OZTST 006E 30 00 E1R GO Abort. Start 0047 97 ZER: GHI R7 the recleved bit 006E all over 0047 must be a "0". 0070 004B 3A 34 8NZ LDFt;O Is le11der done 0070 .·**************************************** 0048 yet? 0070 .· **************************************** 004A 02 LON R2 Yes. Increment 0070 . 004A f i I e counter and 0070 ; ROUTINE -- HEX KEYPA D IN PUT 0048 FC 01 ADI 101 then go check 0070 .J 0048 file number to 0070 D3 HEXREl : SEP R3 Return 0040 30 20 BR FTST If It is the 0071 3f 71 HEX IN: 8N4 HEX IN Wait for 1-key 0040 one requested. 0071 i n. 004F 0073 6C INP 4 Got Input byte 004F * REQUESTED FILE FOUND 0074 64 OUT 4 Display it 004F . 0075 37 75 WAIT2: 84 WA IT2 Wa lt ti II key 004F 3E 4F RDF: BN3 RDF WaIt for end ot 0075 released 004F leader bit. 0077 22 DEC R2 .J '---/ 0051 007B 30 70 BR HEXRET . Return 0051 * NOW READ TAPE FOO START ADDRESS 007A 007A .· ****************************************. 0051 ' 0051 DB SEP RB Read (But 007A . 0051 Ignore) sh1rt 007A .·****** ERR ROUTINE ERROR "PROCE SSOR" 0051 address. 007A . 0052 DB SEP R8 FIn I sh read I ng 007A FB EE ERR: LOI lEE Load "EE" 0052 start address. 007C 52 STR R2 0053 007D 64 OUT 4 Display "EE" 0053 *NEXT, READ NUMBER OF BYTES 007E 22 DEC R2 0053 * STORED ON TAPE 007F BE GLO RE Get low address 0053 007F byte 0053 DB SEP R8 0080 7J STXD 0054 86 PHI R6 0081 9E GHI RE Get high address 0055 DB SEP R8 0081 byte 0056 A6 PLO R6 0082 52 STR R2 Save error 0057 0082 address on stack 0057 *SET lP FOR DATA READ 0083 .3F 83 LOOP: BN4 LOOP loop "til I 1-key 0057 0083 is pressed". 0057 26 CNTSET:. DEC R6 Set up byte 0085 37 85 LOOP2 : 84 LOOP2 0057 counter 0087 30 00 BR GO Start a II over 0058 96 GHI R6 so that when 0086 ; aga in 0059 FC 01 ADI #01 all bytes have 0089 ;**************************************** 0059 been read. 0089 ·**************************************** 0058 86 PHI R6 0089 ;******DI ROUTINE --READ A BYTE FROM TAPE 005C 0089 ; 005C 08 ROOPT: SEP RB Read a data byte OOB9 DB DIRET: SEP RB Test for abort 0050 SE STR RE Store It In 0089 and return 0050 memory 008A FB 08 Dl: LDI #08 Set up counters 005E IE INC RE Increment memory OOOC A7 PLO R7 005E 11ddress 0080 A9 PLO R9 005F BE GLO RE 008E 36 BE LHTRAN: 83 LHTRAN Wait for end of 0060 52 STR R2 008E current 0061 64 OUT 4 Display low- 0090 High input level 0061 order address. 0090 99 GHI R9 Test for bit 0062 22 DEC R2 Reposition SP 0090 value. '---../ 0063 0091 FF 01 BTST: SMI #0 1 0063 * CHECK IF FINISHED 0093 38 9A BNF AHZER 0063 0095 3E 91 BN3 BTST J QUESTDATA COSMAC CLUB P.O. Box 4430, Santa Clara, CA 95054 Page 13

ADOR COOE LABEL OPCOOE OPERAND COMMENT 0097 0097 27 DEC R7 0000 FBOO B3F8 07A3 0393 8888 8685 92F8 6AAB 0098 30 A4 BR DNCHK Got a 11 111 Bit. 0010 F88A A8F8 7AA6 FBFF A2£2 F871 A5F8 AA52 009A F8 00 AHZER: LOI 100 Got a zero bIt. 0020 6422 058£ 05AE D5A4 F800 89F8 0052 6422 009A Test 0030 84F3 324F F80A 8708 3637 99FF 0138 473£ 009C FC 01 TLTST: ADI 101 For excessive 0040 3997 3237 2730 3797 3A34 02FC 0130 203E 009C pulse width. 009E A2 9NF' 0050 4FD8 0808 8608 A626 96FC 0196 085E IEBE 38 HLTRAN 0060 5264 2226 963A 5C30 1003 3F69 376C 3000 OOAO 30 7A BR ERR Error OOA2 0070 D33F 716C 6437 7522 3070 FBEE 5264 228£ 3E 9C HLTRAN: 8N3 TLTST 0080 739E 523F 8337 8530 0008 F808 A}A9 368£ OOA4 I OOA4 89 0090 99FF 0138 9A3E 9127 30A4 FBOO FCOI 3BA2 DOCHK: GLO R9 Got a byte? OOAO 307A 3E9C 8932 AD02 7E52 2930 8£87 F602 OOA5 32 AD 9Z PARCHK check parity if 0080 3989 307A OOA5 so. OOA7 OOA7 02 LON R2 Not fu I I byte OOA7 yet. 00A8 7E RSHL Insert bit into OOAB buffer QUESTDATA 00A9 52 STR R2 OOM 29 P.o. Box 4430 DEC R9 Santa Clara, CA 95054 OOA9 30 BE BR LHTRAN OOAD ; Publ lsher •••••••••••• Quest Electronics OOAD 87 PARCHK: GLO R7 Check for even Editor ••••••••••••••••••Paul Messinger OOAD parity. Assistant to Editor ••• Jeanette Johnson OOAE F6 SHR Associate Editor ••••••• AI ian Armstrong OOAF 02 LDN R2 Put data value Contributing Editors Ron Canker OOAF Into D-Reg. Van Baker 0090 38 89 9NF DIRET Return if parity Art and Graphics •••••••••••Holly Olson 0080 okay. Proof Reading ••••••••••••••Judy Pitkin 0082 30 7A 9R ERR Call error Production ••••••••••••••••John Larimer 0092 routine Circulation ••••••••••••••••••••Sue Orr 0094 The contents of this publication are copyright and sha II not be reproduced without permission of QUESTOATA. Permission is granted to quote short sections ot articles when used in reviews of this publ icatlon. QUESTDATA welcomes contribu-tions from its readers. Manuscripts Note fmn the FJ:litor>: will be returned only when accompan ied by a self addressed stamped envelope. Articles or The proeceeding assembl.y l.istiri{J is the programs submitted will appear with the authors Q,e8t name un I ess The contributor wishes otherwise, outp.lt of the FJ:litor> Payment Is at the rate of S15 per publIshed page. QUESTDATA exists for the purpose of exchijnging information about The RCA 1802 microcomputer,

------QUESTDATA A 12 issue subscription to the publication devoted P.O. Box 4430 entiroel.y to the C09-1AC 1802 is $12. Santa Clara, CA 9SOS4 (Add $6.00 for> air>mail. postage to al.l. for>eign count-ries e:x:cept Canada crrti Me:cico. ) Your> oommen.ts crre aluxzys welcome and q:ppyoeeiated. We lJXU/.t to Payment. be your> 1802's best fnend. 0 Check or Money Order Enclosed Made payable to Quest Electronics NAME 0 Master Charge No . ---·------. ----·-·· ·. 0 Bank Americard No . ---··· ADDRESS 0 Visa Card No . ______------Expiration Date:...: ------

Signature ______CITY STATE ZIP

0 Renewal 0 New Subscription Page 14 J

J

by Gary Gehl.roff 140 INPUT D,C 150 IF D=O THEN If C=O THEN GOTO 190 160 M,..-+{) The program title has included the word 170 P=PiC "reckoning" because when it comes to the em of 180 GOTO 130 tre .month that's my day of (Or I'm in 190 P/100 J tre RED again). 200 P=P- P/100 * 100 The program uses the standard method of 210 PR "------" 220 PR "TOTAL $ 11 ;M;".";P checkbook balancing, by subtracting the 230 PR outstanding checks from the sum of the l:a1aree 240 PR "DEPOSITS N)T SHOWN" sh::Jwn m tre bank statement an:! tre deposits mt 250 PR 11 $ 11 ; shown en the statement. 260 INPUT D,C Each inp.lt requires the oollars rumt:er to 270 If 0=0 THEN I F C=O THEN GOTO 310 J t:e separated by a cOO!l'lla fran tre cents number. 280 N•N-+=O THEN GOTO 450 60 0=0 430 D= 0-1 70 Q=O 440 C= C+100 80 R=O 450 D= 0+ C/100 90 PR "CHECKBOOK" 460 C=C- C/100 * 100 95 PR 470 PR 11 $";0;"."; 100 PR 11 CHECKS 11 460 IF C<10 THEN PR "0"; 110 PR "OUTSTAND 1NG" 490 PR C 120 PR "DOLS, CTS 11 495 PR 130 PR "$"; 499 END

J

... 6 QUESTDATA BULK RATE ... P.O. Box 4430 U.S. Postege Paid Santa Clara, CA 95054. QUEST Electronics

ADDRESS CORRECTION REQUESTED Permh No. 11•11 S•nt• Cl•r•, CA

J

j