Home

TOU 6502 - 6502.org

image

Contents

1. INFORMATION FOR ADVERTISERS If vou are interested in reaching the 6502 market consider advertising in MICRO Since MICRO is devoted to the 6502 its readers are activelv interested in 6502 related products and will pay attention to your material Your ad will not be lost among ads for 8080 s Z 80 s ete Since the content of MICRO is primarily useful and factual reference material each issue will be referred to many times giving your ad multiple exposure The cost of advertising in MICRO is quite low Current rates are Full Page 100 00 Half page 60 00 Quarter page 35 00 It is easy to place your ad Provide camera ready copy either one to one or two to one in size Photographs should be glossy and one to one or two to one in size Payment must accompany the ad unless credit terms have been previously established Our current circulation is over 2000 1400 subscriptions and 700 to dealers Dealers report that MICRO sells very well One dealer who specializes in 6502 products reports that MICRO outsells Kilobaud Bulk rates to dealers are 90 per copy with a minimum of ten copies DEADLINES August September Issue Ad reservation July 10 Ad copy July 17 October November Issue Ad reservation Sept 11 Ad copy Sept 18 To reserve your ad or for further information call Judy at 617 256 3649 Mailing address MICRO Ads 3 S Chelmsford MA 01824 2219226 A SLOW LIST F
2. 0102 TIMER USING INTERVAL TIMER 0105 01 0107 PBD 010A PBDD 010D PBD 0110 PBD 0113 NOTE SET OUTPUT TONE OFF TOGGLE OUTPUT SET TO COUNT FOR NOTE LENGTH 0115 C8 500 HZ 0116 TONEX CYCLE IN DOWN COUNTER 0118 TIMER TEST 1 4 SECOND UP 011B TONE 011D 01 011F PBD 0122 TIME 0124 TIMER CONTINUE TONE IF NOT DONE TURN TONE OFF START WAIT BETWEEN BEEPS 0127 NOTONE TIMER WAIT FOR TIME OUT 012A NOTONE 012C DECREMENT NUMBER OF BEEPS COUNTER 012D BEEP ANOTHER BEEP OR DONE 012F RETURN TO CALLING ROUTINE 5 24 2218 22 BASIC 6502 DISASSEMBLER FOR APPLE AND PET Michael J 28 Ravenswood Terrace Cheektowaga NV 14225 A disassembler is a program that ac cepts machine language object code as input and produces a symbolic represen tation that resembles an assembler listing Although disassemblers have a major disadvantage viz that they can not reproduce the labels used by the original programmer they can prove very useful when one is attempting to transplant machine code programs from one 6502 system to another This ar ticle describes a disassembler program written in Commodore BASIC The disassembler see listing and sam ple run uses the mnemonics listed in the Oct Nov 1977 issue of MICRO The output is in this format address byte 1 byte 2 byte 3 mnemonic bytes 2 and 3 The address is outputted in decimal base 10 The contents of the
3. 0949 094B 094C 094E 0950 OD oF 93 02 02 F9 6F oD 93 00 02 03 6F 13 02 14 00 13 12 10 02 FD 01 07 12 2 08 08 08 08 08 SBC BEQ JSR LDXIM NOTEA LDAZX STAZX DEX BPL JSR NOTEB LDA BEQ JSR LDAIM STA STA STA JSR ORG 000 000D NOTEB SCALE 02 OA 02 TIMEC 0000 MAIN SCALE 00 0002 0003 0004 TIMEC 0924 NOTE DURATION QUARTER HALF REST PART OF NOTE IF NOTHING TO DO SCALING ROUTINE START PATTERN LOAD TIMING ROUTINE REST PART OF NOTE IF NOTHING TO DO SCALING ROUTINE ZERO OUT PATTERN FOR REST PART TIMING MAIN PART OF INTERPRETER ENTRY AT ENTRY MAIN INC BNE INC ENTRY LDYIM LDAIX BMI PHA ANDIM ASLA TAX PLA ANDIM LSRA LSRA LSRA ADCIM STA JMP MAINA CMPIM BCC RTS MAINB PHA ASLA BPL PLA ANDIM STA BCS 0013 ENTRY 0014 00 0013 MAINA 0F 70 02 000E NOTE FD MAINB MAINC 3F 0012 MAIN TABLE ADDRESS NEXT TABLE BYTE TO CONTROL SECTION TONE DURATION TOTAL DURATION IN 16THS PAY NOTE CO 3D IS LONGEST NOTE FOR FOR SCALING REASONS NOTE LENGTH UNCONDITIONAL BRANCH 5 34 1219215 0952 0953 0955 0956 0958 0959 0958 0950 095 0960 0961 0963 0965 0967 0968 096A 096B 096D 096E 0970 0971 0973 0974 0975 0976 0978 097 097C 097D 097F 0981 0982 0
4. 20 AD 17F5 00 28 28 021 07 020 OD 20 45 49 52 4B 0D 49 39 60 32 80 00 28 80 28 00 021 OF 020 OD 44 45 49 4B 20 39 32 E 00 43 55 43 52 54 41 00 43 41 37 20 30 20 E 0 00 55 52 54 49 43 37 30 BLOCK STARTING ADDRESS 2800 BLOCK ENDING ADDRESS 1 SELECT MAP OPTION SELECT 8 LOCATIONS PER LINE START 20 20 50 41 4D 20 BLOCK BLOCK PROGRAM AT 0200 20 48 20 52 41 55 50 46 31 20 57 20 00 47 00 4D STARTING ADDRESS 2800 ENDING ADDRESS 1 20 45 41 41 50 54 52 20 49 2D 50 20 70 45 42 58 43 49 52 00 4C 20 24 0D 4D 4c 20 UL 54 00 4C 47 20 30 2 4c 31 00 30 00 4F SELECT NOMAP OPTION ON DWH ty o SELECT 16 LOCATIONS PER START 10 HD 20 59 4D 2 38 30 20 50 HD PROGRAM AT 0200 20 20 41 50 31 57 00 00 NC 444 00 47 30 4C 00 00 2880 G G CG gt O O H PH o o m gt lt lt gt UU 0D 0D 2880 LINE 48 52 55 46 20 47 4D Jj gt 00 00 45 41 54 20 20 45 O O gt tz 58 43 49 52 20 HD O O H GOS gt APPLE II ACCESSORIES AND SOFTWARE Chuck Carpenter W5USJ 2228 Montclair Place Carrollton TX
5. 8K 6 7 50 fus Memory Aide WK 7 50 Study Aide ik 5 75D Don t Fall 750 True False Quiz I AK 5 7 50 li i Matching Quiz 178K 7 50 Applications Co Mesident Assembler M 658 20 00 li ta nm In h s Va Memory Test 15 00 Apple Music 3 Ocraves MI 12K 5 15 00 Floating Point Dorosave M 36K 15 00 Computer Components of Orange County 6794 Westminster Ave Westminster Calif 92708 714 898 8330 Mastercharge Visa nf A accepted No COD Allow two weeks for personal check to char Add S650 for handling aud postage For computer adu 310 00 fur and insurance California residents add 0 vales tax 2 lth w aS E A E 7 aw L DOOKS APPLE POWER CONTROL INTERFACE m This interface plugs into any peripheral slot on the Apple h board and provides 16 channels of control Power Control il modules plug inte the interface via a nbbon coble Each Powe Control module provides 4 seperate 110 A ac 12 amps Up to 4 Power Control Modules uu may be used with each Intedoce 7 Contral Room Lights Stereo Equipment Security Systerns pcs S UN Electrical Appliances Hardie Up so 1000 per Channel Directly From Program Control Complere Isolation of the Computer From the AC Line MUCE Apple Power Interfoce
6. AA BD 85 06 06 07 51 07 E9 07 08 09 09 09 05 07 F8 00 FB 09 SCALEA NOTE PLAYING ROUTINE HALF TONE THIS PART IS PARTICULAR TO APPLE ROUTINE AT FB86 IS USED LDA ADC STA LDA ADC STA DEX BPL INC RTS ORG LDA STA LDA STA LDAIX SEC STA SBCIM STA INX LDAIX STA SBCIM STA LDAIM STA STA STA LDYIM JSR 0006 0050 0006 0007 0051 0007 SCALEX 0007 08BE 0012 0052 000 0010 0010 0054 35 0008 0010 0055 00 0009 00 0050 0051 0053 10 FB86 DUE TO SIMPLE LOGIC IN TIMING ROUTINE INDEX NOTE LENGTH NOTE TABLE OFFSET LOW ORDER BYTE OF MACHINE CYCLES PER PERIOD CYCLES USED UP TIMING OVERHEAD HIGH ORDER BYTE OF MACHINE CYCLES PER PERIOD THE DIVIDE OR PROVIDE A ROUTINE WHICH DIVIDES LOCS 54 55 BY 52 53 AND LEAVES THE RESULT IN 50 51 FOR THE SCALING ROUTINE LDA PHA LSR RORA LSR RORA LSR RORA STA PLA ANDIM TAX 0008 0009 0009 0009 0005 07 OF 8 CXCLE LOOPS LEFT OVER CYCLES DETERMINT ENTRY POINT LDAX TTABLE TABLE OF ENTRY POINTS FOR TIMING LOOP STA 0000 5 33 IVIIIICIR O O8FC O8FE 0901 0903 0906 0908 090 090C 090D 090F 0912 0914 0916 0919 091B 091D 091F 0921 0924 0924 0926 0928 092 092C 092 0930 0931 0933 0934 0935 0936 0938 0939 093A 093B 093D 093F 0942 0944 0946 0947 0948
7. KUN Index by Subject Issues 1 to 6 page 12 Niessen Ron On Verifying Programs in RAM page 12 Pottinger Hardy Greeting Card Generator page 13 5 38 MICRO BLOCK DUMP AND CHARACTER UTILITY PROGRAM FOR THE 1 J C Williams 35 Greenbrook Drive Cranbury NJ 08512 Here s a useful fully relocatable utility program which will dump a spec ified block of memory from a KIM to a terminal At the user s option a hex dump with an ASCII character map is produced The hex dump will allow the programmer to rapidly check memory contents against a master listing when loading or debugging programs With a printing terminal the hex dump produces docu mentation of machine code to complement an assembly listing of a program A character map is useful if the block being dumped is an ASCII file An example would be source code being pre pared with an editor for later assem bly The map shows what the file is and where it is in case a minor tion is needed using the KIM monitor To use this utility program 1 Load the code anywhere you want it in RAM or PROM memory 2 Define the block to be dumped just as for a KIM 1 tape dump BLOCK STARTING ADDRESS 17F5 low 17F6 high BLOCK ENDING ADDRESS 1 1727 low 17F8 high 3 Select the MAP NOMAP option MAP mode NOMAP mode 00 in 17F9 FF in 17F9 4 Run the program starting at the first instruction At the end of the dump
8. VIA ADDRESS BUS A00 A15 IK BYTES OF 2114 STATIC RAM on board with sockets provided for immediate ex pansion to 4K bytes on board with to tal memory expansion to 65 556 bytes USER PROM ROM The system is equipped with 3 PROM ROM expansion sockets for 2316 2332 ROMs or 2716 EPROMs ENHANCED SOFTWARE with simplified user interface STANDARD INTERFACES INCLUDE Audio Cassette Recorder Interface with Remote Control Two modes 135 Baud KIM 1 compatible Hi speed 2400 Baud Full Duplex 20mA Teletype Interface System Expansion Bus Interface TV Controller Board Interface CRT Compatible Interface APPLICATION PORT 15 Bi directional TTL lines for user applications with expan sion capability for added lines EXPANSION PORT FOR ADD ON MODULES 50 1 0 Lines in the basic system RESIDENT ASSEMBLER EDITOR SYN 2316 2332 ROM PROM SRAM SVN 2716 EXPANSION KIT TI 2532 SYN 2114 1 x 4 PWR EXPANSION PORT DATA BUS 000 007 1 amp DIGIT Er DISPLAV ADDRESS BUS 00 15 E ces SOCKET TIMER DATA BUS 000 007 TI wasy DATA BUS D00 D07 CONTROL KEYPAD LOGIC TIMER Te CONTROL BUS PORT EXPANSION KIT 02978 SYNERTEK 5 28 SYSTEMS CORP 120953 APPLAVER MUSIC INTERPRETER Richard F Suitor 166 Tremont Street Newton MA 02158 There have been several routines for making music with the APPLE II includ ing one in MICRO and one
9. control will return to the KIM SYMBOL TABLE CRLF 1E2F DOMAP 026 EAL 17F7 EXT 1CHF LINE 0200 LINEA 0217 MODE 17 9 NXLN 0285 POINTH OOFB POINTL OOFA PTBT 0243 SAH 17F6 TMODE 00 9 TSTEND 0247 monitor The examples following the assembly listing will give you the idea The program as listed dumps 16 decimal bytes per line Users with TVT s may want to initialize the line byte count er for 8 decimal bytes per line to al low the hex with MAP format to fit the display To make this change replace the 0F at 021E with 07 Another possible change is to have the program exit to a location other than the KIM 1 monitor Exit to a text ed itor or tape dump may be convenient Since the MAP NOMAP option is deter mined by the most significant sign bit of what is stored at 17F9 a suit able tape ID number can be placed there for use of the KIM 1 tape dump or Hypertape Use ID s from 01 7F for files needing no character map and ID s from 80 FE for ASCII files Start the tape recorder in RECORD when the dump to the terminal is a few seconds from completion The flowehart will assist users wanting to make major alterations Of neces Sity ASCII non printable characters are mapped as two hex digits other ASCII codes have special meaning for the user s terminal a patch will be necessary to trap them Single step ping through this program can t be done because it uses the monitor s display locations This is
10. structed to decode the ten low order address lines A0 A9 internally For example the 6530 PIA chips on the KIM and the 21L02 memory chips on my memory board decode the ten lowest address lines internally that is they select any one of the 2 1024 flip flops to be written to or read sequently our problem is to decode the high order address lines at least initially These lines are usually de coded to form blocks of address space not unlike home addresses in city blocks Three address lines give eight 27 8 possible blocks and the three highest address lines A15 A13 divide the address 5 into eight blocks each having 266 22 3 loca tions Now 1024 1024 279 locations is usual ly referred to as 1K 2 locations is 23 2 locations which is 8 x 279 locations which is 8K locations Thus the top three address lines divide the address space into eight 8K blocks See Table 2 for more details Each of these 8K blocks may be further divided A15 A14 A13 Hex Addresses 0 0 0 0000 1FFF 0 0 1 2000 3FFF 0 1 0 4000 5FFF 0 1 1 6000 7FFF 1 8000 9FFF 1 0 1 A000 BFFF 1 1 0 C000 DFFF 1 1 1 E000 FFFF Table 2 Blocking the Memory Space 5 16 2219534 into 1K blocks by decoding address lines A12 A10 Table 3 shows how block 8K4 is divided into eight 1K blocks Finally as mentioned before many vices decode the lowest 10 address lines and consequently we have
11. EORIM STAZ SEC LDAZ SBCZ STAZ LDAZ STAZ BCS DECZ BNE CLC ADCZ STAZ BLANK RCSL NEWADR DOT RCSL NXTADR TRLOAD RSTORE RSTORE NBRS RCSL DOT OCC N 03 GENADR 01 TEMPL GENADR N 03 GENADR 02 GENADR 00 TEMPL NXTADR AGAIN RSTORE 00 N 08 OFFSET ADD FF TMP RCSL TMP CHL RCSH CHH EXAM CHH EXAM RCSL CHL 5 12 BLANK SYMBOL STORE IT IN SCREEN COPY THEN ON TO A NEW ADDRESS THE DOT SYMBOL STORE IT IN SCREEN COPY FETCH NEXT ADDRESS IF 0 THEN NOT DONE ELSE DONE RESTORE INIT ADDRESSES FETCH NUMBER OF NEIGHBORS FETCH CURRENT DATA IS IT A DOT IF YES THEN BRANCH OTHERWISE ITS BLANK SO WE CHECK FOR A BIRTH IT GIVES BIRTH STORE IT IN TEMP INCONDITIONAL BRANCH FETCH NUMBER OF NEIGHBORS IF IT HAS 3 OR 2 NEIGHBORS IT SURVIVES IT DIED STORE IT IN TEMP FETCH NEXT ADDRESS IF 0 THEN NOT DONE RESTORE INIT ADDRESSES SAVE Y AND X ON STACK SET Y AND N 0 CHECK 8 NEIGHBORS 01 ADD IF OFFSET IS POSITIVE OTHERWISE GET SET TO SUBTRACT SET CARRY BIT FOR SUBTRACT SUBTRACT TO GET THE CORRECT NEIGHBOR ADDRESS OK FIND OUT WHAT S THERE PAGE CROSS UNCOND BRANCH GET SET TO ADD ADD STORE THE LOW PART 311339 1 57 A5 LDAZ RCSH FETCH THE HIGH PART 1A59 85 23 STAZ 1A5B 90 02 EXAM OK WHAT S THERE 1A5D 23 INCZ CHH PAGE CROSSING 1A5F 1 22 LDAIY CHL FETCH THE NEIGHBOR 1A61 C9 51 CMPIM DOT DATA BYTE AND SEE I
12. NULL O NULL O LDYZX 2 LDAZX 2 LDXZY 2 NULL O CLV 1 LDAY 3 TSX 1 NULL O LDYX 3 LDAX 2 LDXY 3 NULL O CPYIM 2 CMPIX 2 NULL O NULL O CPYZ 2 CMPZ 2 DECZ 2 NULL O INY 1 CMPIM 2 DEX 1 NULL O CPY 2 CMP 2 DEC 3 NULL O BNE 2 CKPIY 2 NULL O NULL 0 NULL 0 CMPZX 2 DECZX 2 NULL 0 CLD 1 CMPY 3 NULL O NULLO NULL O CMPX 3 DECX 3 NULL O CPXIM 2 SBCIX 2 NULL NULL O CPX 2 SBCZ 2 INCZ 2 NULL O INX 1 SBCIM 2 1 NULL O CPX 2 SBC 2 INC 2 NULL O BEQ 2 SECIY 2 NULL O NULL O NULL O SBCZX 2 INCZX 2 NULL O SED 1 SBCY 3 NULL O NULL O NULL O SBCX 2 INCX 2 NULL O 0 1 2 3 4 5 6 7 8 9 A B C D E F K 0 24 24 M a e 090 77 MS commodore MOS 6502 Microprocessor Controlled 53 9 integrated CRT ASCII Keyboard Cassette Full Extended BASIC in ROM Ss Standard to 32K RAM Expansion ICS Peripherals Printer Floppy Available Summer T a Can be interfaced with S 100 BUS Devices DT Dem 9011765 IEEE 488 BUS for intelligent control 3 24 rit a ot Peripheral Devices 4 Another First From PET SHACK a g al Built in Graphics Char for Games Charts i x Personal Computer Full File Control under Operating System F 1 35 a TOO MANY OTHER FEATURES TO LIST z only 35 you get Only T 3 x FO
13. System 16 Mem Serial 1990 00 3 51 Dual Disk Triple Processor 32 Memory 3590 00 The 100 VIDEO TERMINAL BOARD IS 16 LINE 64 CHARACTER DISPLAV GENERATOR WITH CURSOR CONTROL AND EDITING Connect a5V ASCII Keyboard to it Regulated 5 Volt Unregulat 8 Volts or 8 Volts AC and vour KIM Teletype ort to it along with a video monitor and away you go with all the convenience of a Video Terminal on your KIM KIMS AND UPGRADES 1 4K IMHz 125 00 2 2MHz 149 00 CM 3 16K 1 5 MHz Ultra Low Pwr Mem 596 00 CA 7 1 0 4 399 00 480 ane Motherboard 39 00 all above are OSI products available from us VF8 4K Memory assembled amp tested 129 00 for low power RAM add 10 00 same in kit 74 50 full set of sockets for Kit 10 00 VF8 Motherboard buffered for 4 Boards 65 00 Connector Assembly for KIM to VF8 20 00 8K 100 Memory Board with instructions K 165 00 same but fully assembled and tested 199 00 5100 Cabinet cut out for KIM 129 00 3 Connector S100 Motherboard Assembly 75 00 CGRS 5100 TIM Kit 129 00 CGRS 5100 6502 CPU 179 00 BAC
14. The complete source listings also should help novice programmers understand the 6502 better One thing that the above two articles have in common is their use of 6502 as sembly level code Since many users do not have assemblers and will therefore be keying the code into their machine by hand it would be nice to have a disassembler which converted the code in the computer back into a readable form A BASIC 6502 Disassembler for Apple and PET by Michael J McCann can do the job Written entirely in BASIC it will disassemble code on a PET or Apple using the MICRO 6502 Syntax In addition to its obvious utility value the program is particularly instructive in its handling of alphabetic strings KIM 1 owners will find A Block Hex Dump and Character Map Utility Program for the KIM 1 by J C Milliams to present a neat utility for dumping to a terminal While the KIM 1 Monitor has a built in Dump it s format leaves a lot to be desired This utility has a more useable format plus it provides the option of having data printed as alphabetic characters as well as hex When listing to a hardcopy device the faster the printing the better Not so when going to a display For a display you would like to have some way to slow down the display stop it when you get to a particular portion and then con tinue or abort the listing Well if 5 3 you are an Apple owner you are in luck because Bob Sander Cederlof has provi ded A S
15. VISA MC NO CGRS 100 Front Panel Kit 129 00 XITEX Video Terminal Board 16X64K 155 00 SIGNATUR Big so XITEX Video Terminal Board Assembled 185 00 KIM 1 CS100 with CGRS I6GKRAM TV KB 1529 00 Same but Assembled PS 5 Pwr Supp 5V5A9V1A 12V 1A6x6X2 75 00 5 5 4 90 00 Total of Order Circle Items wanted Mass Residents Sales Tax 5 Shipping 1 2 00 min Total Remittance or Charge IN THIS ISSUE It s alwavs nice to be able to have fun while learning Life for vour Dr Frank H Covitz presents the amaz ing game of Life implemented on a PET This remarkable game which was the subject of a number of Martin Gardner Scientific American columns uses a few simple rules to generate a verv complex universe It is ideallv suited to a microcomputer with a displav The pro gram presented here is written in 6502 assemblv code not BASIC and this will be illuminating in itself to manv PET owners In addition it demonstrates how to use the PET display directly While the PET people can be playing Life on their machines the Apple folk can be playing music on theirs thanks to the Applayer Music Interpreter of Richard F Suitor A couple of songs are included but most users will want to generate their own following the techniques described
16. a system based an Apple II board The matter is not totallv resolved but the following is what we have heard I called Steve Wozniak of Apple and asked about the problem He said that he had sent a chip to EDN which had cleared up the problem He did not in dicate that there was anv more to it I then talked to John Conwav of EDN He maintained that a problem still does exist with Apple II interfacing to 6520 or 6522 PIAs It can be done but re quires the addition of a chip to slow down the phase 0 signal to make it the equivalent of the phase 2 signal The PIA can not be directiv interfaced as would normallv be expected in a 6502 based system John stated that the chip required costs about 7 00 Another angle on the picture was also reported to me by John He had found a company on the West Coast that is mak ing interfaces for the Apple II The engineer there had discovered the same problem There is a fairly complete discussion of the problem and the solution in the May 20 1978 edition of EDN If anyone has additional information to shed on the situation MICRO will be happy to publish it problem does not seem to be all that serious and we do not dividing any 8K block of address space which we may select into 1K blocks Into one of these 1K blocks we will put some I 0 ports The more precocious of my attentive readers may already see that the scheme of Figure 3 could also be used to set
17. all of the new goodies that are coming from Apple Especially the documentation Addendum by Robert Tripp Speaking of documentation I was quite Pleased to receive the Apple II BASIC Programming Manual by Jef Raskin Pub lished by Apple Computer Company 1978 This arrived in the mail unsolicited I assume that all Apple II owners have received one If not write Apple and ask for it product A2L0005X The manual is well written and elegantly printed My only minor complaint is that the light green ink used to show the display contents make the book a little difficult to read I hope that this manual is only the first of many that we will be seeing from Apple It is a very good start 340339 QUICK CHANGE ARTISTRV ENGINEERED SPECIFICALLY FOR ATTRACTIVE FUNCTIONAL PACKAGE THE KIM 1 MICRO COMPUTER e Professional Appearance Protection of Chips and e Four Color Combinations Other Components e improves Man Machine Interface Viewing Angle of Readout MADE OF HIGH IMPACT STRENGTH Enhanced THERMOFORMED PLASTIC Improved Keyboard Position e Kydex 100 for Easier Operation Durable EASILY ASSEMBLED e Molded In Color e Absolutely No e Non Conductive Alteration of KIM 1 Required AVAILABLE FROM STOCK e All Fasteners Provided e Allow Two to Three Weeks for e Goes Together in Minutes Processing and Delivery with a Small Screwdriver e No COD s Please e Dealer Inquiries Invited ORDER 1 in this Coupon Prin
18. are grounds and pin 8 is connected to the 5V supply making the power connections Pins 9 through 20 and 22 through 25 are connected to the address bus on the microcomputer while the data pins 26 through 33 are con nected to the data bus All of the re mainder of the pins may be lumped in the general class of control pins In subsequent issues the data bus and the control bus will be discussed Our concern in the first two issues is with addressing The 6502 Address Bus The 6502 receives data from a variety of devices memory keyboard tape reader floppy disc processes it and sends it back to one or more devices The first process is called READ and is accomplished by the LDA or similar instruction The last process is called WRITE and is achieved by a STA type instruction The purpose of the address pins is to put out a signal on the address bus to select the device or location which is going to produce or accept the data In the computer system each device has a unique address and when the 6502 puts that address on the address bus the 5 15 140839 device must be activated Each line on the address bus mav have one of two possible values high or low Hor L 1 or 0 45V or OV are the names most frequentlv given to these values A one address line svstem could select two devices one activated 0 on the address line the other bv a 1 Figure 1 shows how to decode such an idiot microcomputer
19. decoded all 16 address lines at least on paper A12 A11 A10 Hex Address 8000 83FF 8400 87FF 8800 8BFF 8C00 8FFF 9000 93FF 9400 97FF 9800 9BFF 9C00 9FFF 0 0 0 0 1 1 1 1 00m HOO Table 3 Subdivision of 8K4 Block into 1K blocks To begin to see how this is done con struct the circuit shown in Figure 3 5V A13 D 5 14 H 100 ohms Wire Probe O V Computer Ground Figure 3 Decoding the Highest Three Address Lines There are many decoding schemes and circuits the circuit of Figure 3 is just one possible technique Here is where your breadboard becomes useful Connect the address lines from your 6502 system to the 74145 KIM owners can do this with no buffering because lines A15 A13 are not used on the KIM 1 Owners of other systems should check to see if the address lines are properly buffered Now per form the following experiments 1 Load the following program somewhere between 0100 and 1FFF program is relocatable 0200 18 CLC 0201 8D XX 60 LOOP STA 60XX 0204 90 FB BCC LOOP This routine stores Accum in location 60XX X means don t care Then loop back 2 Run the program and with the wire probe shown in Figure 3 test each of the output pins pins 1 7 and 9 Which ones cause the LED to glow 3 Try to explain your results with the help of the truth table Table 4 4 Change the STA instru
20. equivalent to a helix No special effects of this are seen during a simple LIFE evolution since it just gives the impression of disappearing off one edge while appear ing on the other edge For an object like the spaceship see Scientific American articles then the path eventually would cover the whole LIFE arena The fun comes in when a config uration spreads out so much that it spills over both edges and interacts with itself This of course cannot happen in an infinite universe so that some of the more complex patterns will not have the same fate in the present version of LIFE Most of the blink ers including the glider gun come out OK This 80 25 version of LIFE can undoubt edly be made more efficient and other edge algorithms could be found but I chose to leave it in its original form as a benchmark for mv first successful 1 executed program in writing machine language on the PET One confession however I used the KIM 1 to debug most of the subroutines Almost all of them did not run on the first shot Without a good understanding of PET memory allocation particularly in page zero I was bound to crash many times over with no recovery other than pul ling the plug The actual BASIC pro gram consisted of a POKING loop with many DATA statements always save on tape before running Although the LIFE program was designed for use on the PET 8K version no references are made to PET ROM loca tion
21. table for Twinkle Twinkle We now have to tell Applayer where it is and turn it on From BASIC we must set up some zero page locations first and then JSR to Applayer Don t forget to set LOMEM before run ning 2900 will do for this table 100 POKE 19 32 low order byte of the table address 0B20 high order byte of the table address OB20 high order byte of 1st pg of Applayer program 16 amp 17 contain the tone table address 110 POKE 20 11 120 POKE 1 8 130 POKE 17 8 140 POKE 16 0 120 CALL 2346 jump subroutine to 0924 We can also make a short program in as sembly language to set up the zero page locations See routine ZERO location 09CO in the listing This initialization can be used most easily by reserving the A00 page or much of it as a Table of Contents for the various note tables elsewhere in memory To do this with Twinkle Twinkle we add the following table 0A20 02 20 OB Which jumps immediately to the table at 0B20 With this convention we can move from table to table by changing only the byte at 9DO 2512 decimal 1219316 can use this initialization from BASIC too changing the last in 120 CALL 2496 TO RTS Tone Table From the monitor 9 0 20 9 0800 03 68 03 38 03 08 03 will do 0808 EO 02 B8 02 90 02 68 02 0810 48 82 28 02 08 02 01 If I you quickly tire of Twinkle 0818 DO O1 BY 01 9C 01 84 01 Twinkle you may wish
22. 0890 089 08A2 45 05 FU 01 02 02 03 04 03 30 06 05 05 00 00 45 00 06 05 07 06 45 CO 00 APPLAYER MUSIC INTERPRETER R F SUITOR TIMING LOOP LOCATIONS O THROUGH 7 ARE SET BY CALLING ROUTINE 8 CYCLE LOOP TIMES Y REG PLUS 0 7 CYCLES DETERMINED BY ENTRY POINT TIME TIMEA TIMEB TIMEC TIMED TIMEE TIMEF TIMEG ORG NOP NOP NOP DEY STA BNE BEQ DEY NOP NOP BNE BIT SEC BMI NOP CLC ROL ROL ROL BCC LDA DEC BNE DEC BNE RTS NOP NOP BNE LDY JMI 0860 0045 TIMEA TIMEC TIMEA 0004 TIMED 0002 0003 0004 TIMEE C030 0006 TIMEF 0007 TIMEG TIMEG 0005 0000 APRIL 1978 ANY INNOCUOUS 3 CYCLE INSTRUCTION BASIC 8 CYCLE LOOP START CHECK OF BIT PATTERN IN 2 3 AND 4 TOGGLE SPEAKER DURATION OF NOTE IN NO OF CYCLES IN LOCATIONS 6 AND 7 TIMING EOUALIZATION SCALING ROUTINE FOR CYCLE DURATION CALCULATION LOC 6 7 A REG LOC 50 51 SCALE STA 0045 LDAIM 00 STA 0006 STA 0007 LDXIM 05 CLC SCALEX ROR 0007 ROR 0006 LSR 0045 SCALEA 5 32 2229336 0846 0848 OBAA O8AC OBAE 08B0 08B2 08B3 08B5 08B7 O8BE O8BE 08 0 08 2 08C4 08C6 08C8 08C9 08 08 0 08 0850 0802 0804 0806 0808 08DC O8DE 08 0 08 2 08 5 08 7 08 8 O8EA O8 EB O8ED O8EE 0820 O8F 1 08F3 08F4 O8F6 O8F7 O8FA A5 48 46 6A 46 6A 6A 85 68 29
23. 3 INIT LDA SAL STA POINTL LDA SAH STA POINTH JSR CRLF LINE LDAIM 00 STA TMODE JSR CRLF JSR PRTPNT LINEA LDA POINTL PHA LDA POINTH PHA LDXIM 0F JSR OUTSP JSR OUTSP JSR OUTSP LINEB JSR OUTSP LDYIM 00 LDAIY POINTL PHA BIT TMODE BPL PTBT ANDIM 7F CMPIM 20 BMI PTBT PLA 5 CHARACTER MAP KIM 1 78 TEMPORARY MODE FLAG POINTER BLOCK STARTING ADDRESS BLOCK ENDING ADDRESS 1 00 FOR NO MAP FF FOR HEX AND MAP EXIT TO KIM MONITOR MONITOR PRINTS BYTE IN A AS ONE ASCII CHARACTER CARRIAGE RETURN AND LINE FEED PRINTS ONE SPACE PRINTS BYTE IN A AS TWO HEX DIGITS PRINTS POINTER INCREMENTS POINTER INITIALIZE POINTER START A LINE INTI TMODE PRINT POINTER START A LINE SEGMENT INIT BXTE COUNTER OUTPUT SOME SPACES GET THE BYTE AND SAME ON STACK IN MAP MODE NO YES TEST FOR PRINTABLE CHARACTER PRINT AS TWO HEX DIGITS 244 023B 023E 0241 0243 0241 0247 02HA 024C 024F 0251 0254 0256 0259 025B 025D 025F 0260 0262 0265 0268 026B 026C 026E 0270 0271 0273 0274 0276 0277 0279 027A 027C 027 0281 0283 0285 0286 0287 0288 028A 028D 028E 028F AO 04 3 63 8 23 F9 2F F9 2B oc 9 9 9 F9 FB FA 9 F9 F9 9 83 1 1E 1E 1E 1E PTBT TSTEND SPO DOMAP LNTST NXLN 2F 1E DONE 1 JSR JSR BPL PLA JSR JSR LDA CMP LDA SBC BCC B
24. 34 Rindsberg Don Here s HUEY super calculator for the 6502 Kilobaud No 12 pp 94 99 December 1977 The calculating power of FORTRAN with trig functions natural and cm common logs exponential funetions all in 2 5K Finkel LeRoy Every Home School Should Have a PET Caleulators Computers page 83 October 1977 Anon 12 Test Benchmark Study Results Show How Microprocessors Stack Up 8080 6800 6502 EDN page 19 November 20 1977 Gordon Decoding Efficiency and Speed DDJ 3 Issue 2 No 22 pp 5 7 Feb 1978 and of table look up in 650 microprocessors Green Wayne Publishers Remarks Kilobaud No 16 p 4 April 1978 In a column on microprocessors Green indicates that MOS Technologv has SuperKIM being readied and also that books on expanding the KIM system are coming out Carpenter Chuck Letters KIM 1 ACT 1 The Scene Kilobaud p 18 Apr 1978 A generally favorable report of one user s experience in interfacing and using ACT 1 with the KIM 1 Braun Ludwig PET Problems Personal Computing No 3 pp 5 6 March 1978 Some observations by a PET owner Lasher Dana The Exterminator for Buggy KIMs 73 Magazine April 1978 Hardware and Software for a debugging facility Eaton John Now Anyone Can Afford a Keyboard 73 Magazine April 1978 A melding of a surplus keyboard KIM and software Foster Caxton C Programming a Microcomputer 6502 Addison Wesley Publi
25. 341339 THE 6502 JOURNAL LIFE FOR YOUR PET With Complete listings ADD ON MEMORY FOR APPLE Il li R Set of Eight Ser of Eight AT abd gt G WERE THE APPLE EXPERTS Check our low prices and large selection of computers software and peripherals APPLE PERIPHERAL INTERFACE CARDS FLOPPY DISC SYSTEM 2 900 Programs Soved and Loaded by Nome Powerful Firmwore DOS File Handling 252K Dyt1es Storage Capacity 8 Inch Dia Disc Copoble of Utilizing Up ro 4 Drives One Million Bytes Handling os Easy as Inpurinag or Printing Access Methods Steam Purcwoted Relative Direct Dual Disc 2 800 PROGRAMMADLE PRINTER INTERFACE 80 00 Onhoard EPROM Printer Driver Full Handshoke Logic High Speed Porollel Cutout Provision for 256 Byte O Drive in EPROM finter Driver Prograris Available for Centranic SWTPC AQ and thes Printers PROTOTYPING DOARD 224 x 7 24 95 RAM CHIPS 168 RAM CHIPS 2400 240 00 Program Code Program A For Applesoft I For Integer Dosic M For Mochine Language Super MARG 10 00 True Las Vegas Mackjack 10 00 Qubie 3 0 TAC BK G 500 li Saucer Invasi n A TOK GS 10 00 QN Siar Wors 10 00 7 Rocker Pilot M 16K G5 10 00 Education Programs um hl Superman
26. 5 then this is your last issue And you original sub scribers with an 06 will be up for renewal soon MICRO will NOT be sending out reminders So if your number is coming up get your subscription renewal in soon MICRO is published bi monthly The first issue was OCT NOV 1977 Single copy price is 1 50 Subscriptions are 6 00 per year 6 issues in the USA One year subscriptions to other countries are Payment must be in US Surface Canada Mexico 7 00 Name All Other Countries 8 00 Addr Air Mail Europe 14 00 South America 14 00 City Central America 12 00 All Other Countries 16 00 State Zip Amount ija biz tag kar Country Issues 1 2 and 3 have been reprinted so that back issues are now avail able for all issues The price is 1 50 per copy USA Canada or Mexico Other countries add 50 per copy surface or 1 25 per copy air mail Your name and address will be made available to legitimate dealers suppliers and other 6502 interests so that you may be kept informed of new products current developments and so forth unless you specify that you do not wish your name released to these outside sources Send payment to MICRO P O Box 3 S Chelmsford MA 01824 USA
27. 75006 Apple II owners may find a couple of new items as interesting as I did First a renumber and append machine language program This was published in Dr Dobbs Issue 23 April 1978 Renumber lets you change line numbers on your entire program or any part of it It renumbers branching statements too Append lets you link two programs together Any program you have in the machine needs to have higher line num bers than the one being loaded from tape Renumber lets you do this POKE commands load the various starting and ending addresses CALL commands exe cute the renumber or append program Caution Renumber and Append will work only with integer BASIC Second the serial interface board from Electronic Systems San Jose CA They are definitely among the Good Guys I ordered the parts on a Thursday by phone and received them the following Monday That s what I call rapid re sponse I ordered the serial board as sembled and the TTL to RS232 board and the MODEM board as kits I don t have the latter two built yet but I intend to have communicating ability when I get done Workmanship and quality on the assembled board and the kits was satisfactory and I m fussy The ser ial board instructions are a bit vague Unless you are quite familiar with the Apple s monitor BASIC and various I O port commands and addresses you are likely to have some problems Also I couldn t make the terminal program work and there w
28. 8A STLOAD 198D STNEXT 199D STONE 1999 TEMPH 0027 TEMPHO 0029 TEMPL 0026 TEMPLO 0028 TIMES 0038 TMPRCS 19 TMPSCR 1970 TMP 0037 TRLOAD 19 9 TRONE 19 3 TSLOAD 1973 TSNEXT 1981 TSONE 1970 UL 002F UP 002A UR 002 5 13 220936 ROCKWELL S NEW R6500 1 Rockwell International Electronic Devices Division 3310 Miraloma Avenue P O Box 3669 Anaheim CA 92803 ANAHEIM CA May 11 1978 A single chip NMOS microcomputer R6500 1 oper ating at 2 MHz with a 1 microsecond minimum instruction execution time has been developed Rockwell Int l The 40 pin R6500 1 is fully software compatible with the 6500 familv It has the identical instruction set in cluding the 13 addressing modes of the 6502 CPU It operates from a single 5V power supply and features a separate power pin which allows RAM memory to function on 10 of the operating power On chip features include 2K x 8 ROM 64 x 8 RAM 16 bit interval timer event counter and 32 bidirectional I1 0 lines Additionally it has maskable and non maskable interrupts and an event in timer out line The 32 bidirectional 1 0 lines are di vided into four eight bit ports A B C and D Each line be selective ly used as an input or an output Two inputs to Port A can be used as edge sensing software maskable interrupt inputs one senses a rising edge the other a falling edge XTL2 Four different counter modes of oper ation are programmable 1 fr
29. 8D CHECK IF CHAR IS A CARRIAGE RETURN 0356 FO 09 BEQ ABORT YES ABORT LISTING 0358 A9 00 WAIT LDAIM 00 MAKE A LONG DELAY 035A 20 A8 FC JSR FCA8 CALL MONITOR DELAY SUBROUTINE 035D 68 PLA GET CHARACTER FROM STACK 035 FO FD CHROUT JMP FDFO REJOIN COUT SUBROUTINE 0361 HC 03 EO ABORT JMP E003 SOFT ENTRY INTO APPLE BASIC 0364 2C 00 CO STOP BIT 000 WAIT UNTIL KEYBOARD STROBE 0367 10 FB BPL STOP APPEARS ON THE SCENE 0369 8D 10 CO STA 010 CLEAR THE STROBE 036C 30 EA BMI WAIT UNCONDITIONAL BRANCH SUBROUTINE TO DE ACTIVATE SLOW LIST 036 AQ FO OFF LDAIM FO RESTORE FDFO TO 0370 85 36 STAZ 36 LOCATIONS 36 AND 37 0372 A9 FD LDAIM FD 0374 85 37 STAZ 37 0376 60 RTS SUBROUTINE TO ACTIVATE SLOW LIST 0377 AQ 4O ON LDAIM 40 SET 0340 INTO 0379 85 36 STAZ 36 LOCATIONS 36 AND 37 037B A9 03 LDAIM 03 037D 85 37 STAZ 37 037F 60 RTS SYMBOL TABLE ABORT 0361 CHROUT 035E OFF 036E ON 0377 SLOW 0340 STOP 0364 WAIT 0358 SYMBOL TABLE SLOW 0340 WAIT 0358 CHROUT 035E ABORT 0361 STOP 0364 OFF 036E ON 0377 5 22 MBRO THE MICRO SOFTWARE CATALOG II Mike Rowe 3 S Chelmsford 10824 Name ZZYP PAX for PET 1 2 and 3 Svstem PET Memory 8K RAM Language BASIC Hardware Standard PET vescription Each of these three ZZYP for PET includes a cassette with two games and a booklet designed to educate the beginning or intermediate level PET programmer 1 has IRON PLANET Rescue the Princess
30. 983 0985 0986 0987 0989 098B 098C 098 098 0990 0992 0995 0996 0998 0999 099B 099C 099E 099F 0941 08 OF C7 07 OF OD BD 03 B7 FA 2B 13 01 14 00 13 14 98 2 1 13 86 03 13 09 MAINC MAIND MAINE MAINF MAING MAINH MAINI ASLA BPL PLA ANDIM ASLA STA BCC ASLA BPL PLA ANDIM STA BCC ASLA BPL PLA BCC ASLA BMI ASLA BPL PLA TAX LSRA BCC LDA ADCIM PHA LDA ADCIM PHA INY LDALY PHA INY LDAIY STA PLA STA LSRA BCC JSR PLA STA PLA STA CLC BCC PLA LDYIM MAIND 1F 000F MAIN MAINE 0F 000D MAIN MAING MAIN MAINF MAINI MAINH 0013 01 0011 00 0013 0013 0014 0013 ENTRY ENTRY 0014 0013 MAIN 03 MAINJ LDAIY 0013 5 35 TONAL RANGE INDEX UNCONDITIONAL BRANCH AEST FRACTION UNCONDITIONAL BRANCH DUMMY CONTROLS NOT INTERPRETED JSR AND JMP SECTION JSR SECTION PUSH RETURN TABLE ADDRESS ON TO STACK GET NEW ADDRESS AND STORE IT FROM BEGINNING OF SELECTION JMP JSR PULL ADDRESS AND STORE IT UNCONDITIONAL BRANCH GET NEW PATTERN AND STORE IT SAQ 09A3 09A6 09A7 0949 9 O9AD O9AF 09B1 09B3 09 0 09CO 09C1 09C3 09C5 09C7 09 C9 09CB 09CD 09CF 09D1 09D3 09D5 0907 0909 0908 09DD 09DF 09 1 09 09 5 O9E7 O9EA O9F8 09F8 09F9 9 09FB 09 09FD O9FE 09FF ENTRY MAINC MAING MAINK SCALE TIME
31. AO Device 2 evice 1 Figure 1 Decoding a One Address Line Microprocessor Any device which when connected to the address bus puts out a unique signal 1 or 0 for a unique address is called a decoder We have seen that micro computer with a single address line can select two devices which could be memory locations or I 0 ports A some what smarter microprocessor might have two address lines It could be decoded by the device shown in Figure 2 pro vided the truth table of the device were the one given in Table 1 Such a device could be implemented with NAND OR NOR gates or with a 74139 Figure 2 74139 Decoder for a Two Address Line Microprocessor Inputs Outputs A BIO 1 2 3 Table 1 Decoder 74139 Truth Table for Two Line The point is that two address lines allow the microprocessor to select four devices three address lines give eight devices four 16 five 32 six 64 and so on The 6502 being very smart has 16 address lines Anyone who can calculate how many telephones can be addressed by a 7 digit base ten phone number can also calculate how many locations can be addressed by a 16 digit base two address bus The answers 10 10 million and 2 65 536 respectivelv Earth people have not vet made a single device to simultaneously decode 16 address lines to produce 65 536 device select signals Such a monster IC would need at least 65 554 pins Many integrated circuits are con
32. B TIMEF 99 09 00 88 DO F8 A5 13 69 03 85 13 90 02 4c 24 09 D8 9 00 85 10 9 08 85 11 85 01 9 OA 85 14 9 20 85 13 A9 01 85 OD A9 20 85 12 A9 20 85 OF A9 05 85 0A 85 85 0C 20 2 09 4C 69 FF 63 6A 62 6D 61 6C 60 6B 092A 0952 096D 09B3 0893 086A 088A STAY 0009 DEY BNE MAINJ LDA 0013 ADCIM 03 STA 0013 MAINK INC 0014 JMP MAIN ORG 09 0 INITIALIZATION FOR 2 ZERO CLD LDAIM 00 STA 0010 LDAIM 08 STA 0011 STA 0001 LDAIM 0A STA 0014 LDAIM 20 STA 0013 LDAIM 01 STA 000D LDAIM 20 STA 0012 LDAIM 20 STA 000F LDAIM 05 STA 0004 STA 000B STA 000C JSR ENTRY JMP FF69 ORG 09 8 JUMP OVER PATTERN ERO PAGE JUST IN CASE NOTE TABLE PAGE NTOE TABLE BYTE REST 16THS NOTE LENGTH CONTROLS TEMPO 25 TONAL RANGE INDEX WAVE SHAPE PATTERN TO APPLAYER TO MONITOR AFTER THE BEEP TABLE OF ENTRY POINTS FOR TIMING ROUTINE TTABLE 63 6A 62 6D 61 6C 60 6B MAIN 0924 MAIND 0950 MAINH 0982 MAINI NOTE O8BE NOTEA SCALEA 08B2 TIME TIMEC 086 TIMED TIMEG 088 0942 MAINB 0947 0967 MAINF 096A 099 MAINJ 0941 0908 0912 0860 TIMEA 0863 0876 TIMEE 0881 TTABLE 09F8 ZERO 09 0 5 36 2219236 301 302 303 304 305 306 307 308 309 310 312 313 314 315 316 6502 BIBLIOGRAPHY PART IV William Dial 438 Ros
33. Boord and Power Coral Module 495 00 Additional Power Contra Modules Controls Four AC Circuits 525 00 5502 Programming Moral for Apple ll or PET 7 95 Mu 6502 Hardware Marwal for Apple ll PET k 7 98 5 Sound nemor G For Grophics Price a 56 Doth ho Graphics G Saund Draw ing 1 8 amp 7 5 7 50 186 6 7 50 i 8K S 5 7 50 b 8 5 5 00 Display M BK G 5 00 Color Eater Display M GK G 500 Life TOK G 5 00 B Bishop s Dancing Man 55 15 00 ET LL Dusiness ts Word Pro essar Lower Case I 20K 20 00 Word Processor Upper Coase 1 20 30 00 Word Processor Upper and lj Lower Cose A 16 50 00 P Qusiness Inventary 1 20K 50 00 ill Master File Mainrenance 1 208 50 00 Point of Sales 1 20K 50 00 Reorder Report 1720K 50 00 File 20 20 00 Orange County s only AUTHORIZED COMMODORE PET DEALER lu Send for software and hardware information ilz LU UA X JUNE JULV 1978 MISRO ISSUE NUMBER FIVE LIFE For Your PET 5 by Dr Frank H Covitz A Brief Introduction to the Game of LIFE 7 by Mike Rowe 6502 Interfacing for Beginners Address Decoding I 15 by Marvin L De Jong Half a Worm in the APPLE EDN Blasts the 6502 18 by Mike Rowe A Slow List for APPLE BASIC 21 by Bob Sander Ceder lof The MICRO Software Catalog 23 by Mike Rowe BEEPER BLO
34. D LDAIY TEMPL FETCH BYTE FROM TEMP BNE TSONE BRANCH IF NOT ZERO LDAIM BLANK BLANK SYMBOL STAIY SCRL DUMP IT TO SCREEN BNE TSNEXT TSONE LDAIM DOT DOT SYMBOL STAIY SCRL DUMP IT TO SCREEN TSNEXT JSR NXTADR FETCH NEXT ADDRESS BEQ TSLOAD 5 10 2108309 1986 1989 198 1980 198F 1991 1993 1995 1997 1999 199B 199D 19 0 1942 19A5 19A6 19A8 19A9 19AA 19AC 19AE 19 0 19 2 19B4 19B6 19B8 19BA 19BC 19BD 19BF 19C1 19C3 19C4 19C6 19C8 19CA 19CC 19CE 19D0 19D2 19D4 19D6 19D8 19DA 19DC 19DD 19DF 19E6 19E6 19E9 19EB A6 A6 20 51 06 00 26 0h 01 26 BD EB A6 00 20 39 25 21 29 2T 36 3A 26 20 39 33 00 27 21 06 34 21 03 00 01 06 19 19 19 SCRTMP STLOAD STONE STNEXT RSTORE NXTADR PAGECH NALOAD NADONE TMPRCS TRLOAD JSR RSTORE RTS JSR RSTORE LDAIY SCRL CMPIM DOT BEQ STONE LDAIM 00 STAIY TEMPL BEQ 5 LDAIM 01 STAIY TEMPL JSR NXTADR BEQ STLOAD JSR RSTORE RTS LDAIM 00 TAX TAY STAZ SCRL STAZ TEMPL STAZ RCSL LDAZ SCRHO STAZ SCRH LDAZ TEMPHO STAZ TEMPH LDAZ RCSHO STAZ RCSH RTS INCZ TEMPL INCZ SCRL INCZ RCSL INX CPXZ SCRLL BEQ PAGECH CPXIM 00 BNE NALOAD INCZ TEMPH INCZ SCRH INCZ RCSH BNE NALOAD LDAZ SCRLH CMPZ SCRH BEQ NADONE LDAIM 00 RTS LDAIM 01 RTS ORG 19 6 JSR RSTORE LDAIY TEMPL BNE TRONE 5 11 RESTORE INIT ADDRESS
35. E The rules are 1 A seed sur vives to the next generation if and on ly if it has two or three neighbors right left up down and the four diagonally adjacent cells otherwise it dies of loneliness or overcrowding as the case may be 2 A seed is born in a vacant cell on the next genera tion if it has exactly 3 neighbors With these simple rules a surprisingly rich game results The original Scien tific American article and several subsequent articles reveal many curious and surprising initial patterns and results I understand that there even has been formed a LIFE group complete with newsletter although I have not personally seen it The game can of course be played man ually on a piece of graph paper but it is slow and prone to mistakes which have usually disasterous effects on the final results It would seem to be the ideal thing to put to a microprocessor with bare bones graphics since the rules are so simple and there are es 5 5 sentiallv arithmetic operations in voived except for keeping track of ad dresses and locating neighbors As vou know the PET 2001 has an excel lent BASIC interpreter but as vet verv little documentation on machine lang uage operation Mv first stab was to write a BASIC program using the entire PET displav as the arena more about boundaries later and the filled circle graphic displav character as the seed This worked just fine except for one thing it took
36. ES GET INIT ADDRESSES READ DATA FROM SCREEN TEST FOR DOT BRANCH IF DOT OTHERWISE ITS A BLANK STORE IT UNCOND BRANCH A DOT WAS FOUND STORE IT FETCH NEXT ADDRESS RESTORE INIT ADDRESSES ZERO A X Y INIT VALUES GET NEXT LOW ORDER BYTE ADDRESS IS IT THE LAST IS IT THE LAST PAGE IS IT A PAGE BOUNDARY IF NOT THEN NOT DONE OTHERWISE ADVANCE TO NEXT PAGE UNCONDITIONAL BRANCH CHECK FOR LAST PAGE IF YES THEN DONE RETURN WITH A 0 RETURN WITH 1 INIT ADDRESSES FETCH DATA FROM TEMP IF NOT ZERO THEN ITS ALIVE 110339 19ED 19EF 19F1 19F3 19F5 19F7 19FA 19FC 19FF 1A00 1A03 1A06 1A08 1AQA 1A10 1A12 1A14 1A16 1A18 1A1C 1A1E 1420 1422 1424 1426 1429 1A2B 1A2E 1A2F 1430 1431 1432 1433 1435 1A37 1A39 1A3B 1A3D 1A3F 1A41 1442 1A44 1446 1448 1 50 1A52 1A53 1A55 20 39 04 51 39 BD ED A6 A6 2 39 51 32 03 14 01 OE 32 03 08 02 04 00 BD D8 A6 00 32 29 15 FF 37 39 37 22 23 11 23 00 39 22 19 19 19 19 19 TRONE NEWADR GENER AGAIN BIRTH OCC DEATH GENADR NBRS OFFS ADD LDAIM STAIY BNE LDAIM STAIY JSR BEQ JSR RTS JSR JSR LDAIY CMPIM BEQ LDAZ CMPIM BNE LDAIM STAIY BNE LDAZ CMPIM BEQ CMPIM BEQ LDAIM STAIY JSR BEQ JSR RTS LDXIM STYZ LDXIM LDAZX BPL
37. ESS 002 PAGE ZERO DATA AREA POINTER 0051 DOT SYMBOL 81 DECIMAL 0020 BLANK SYMBOL 32 DECIMAL 0020 PAGE ZERO LOCATIONS 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A SAVE EVERYTHING ON STACK CLEAR DECIMAL MODE INIT SCRTMP TMPRCS GENER TMPSCR TIMES REPEAT 255 TIMES GEN BEFORE QUITTING RESTORE EVERYTHING 5 9 UGRO 1921 1922 1923 1924 1925 1926 1930 1930 1932 1935 1937 1938 193A 193B 193C 193D 193E 193F 1940 1981 1942 1943 1944 1945 1946 1947 1948 1949 194A 194B 194C 194D 194E 194F 1950 1951 1952 1953 1970 1970 1973 1975 1977 1979 197B 197D 197F 1981 1984 A2 BD 20 B1 DO A9 91 DO A9 91 20 FO 8B C3 19 3A 19 1F F8 A6 19 26 06 20 20 04 51 BD 19 ED TAY PLA TAX PLA PLP JMP BASIC RETURN TO BASIC ORG 1930 MOVE VALUES INTO PAGE ZERO INIT LDXIM 19 MOVE 25 VALUES LOAD LDAX DATA 01 STAZX 1F STORE IN PAGE ZERO DEX BNE LOAD RTS DATA 00 SCRL 80 SCRH 00 CHL 15 CHH 00 SCRLO 80 SCRHO 00 TEMPL 1B TEMPH 00 TEMPLO 1B TEMPHO D7 UP 57 28 DOWN 01 RIGHT z FE LEFT 08 UR z D6 UL 29 LR 27 LL 00 N 58 SCRLL 83 SCRLH 00 RCSLO 15 RCSHO 00 00 TIMES ORG 1970 TMPSCR JSR RSTORE GET INIT ADDRESSES TSLOA
38. F ITS 1463 DO 02 BNE NEXT OCCUPIED 1A65 E6 32 INCZ N ACCUMULATE NUMBER OF NEIGHBORS 1A67 CA NEXT DEX 1468 DO CF BNE OFFS NOT DONE 1 68 PLA RESTORE X Y FROM STACK 1A6B AA TAX 1A6C 68 PLA 1A6D AB TAY 1A6E 60 RTS SYMBOL TABLE 2000 2186 BLANK 0020 SCRL 0020 SCRH 0021 CHL 0022 CHH 0023 SCRLO 0024 SCRHO 0025 TEMPL 0026 TEMPH 0027 TEMPLO 0028 TEMPHO 0029 OFFSET 002A UP 002A DOWN 0028 RIGHT 002 LEFT 002D UR 002 UL 002 LR 0030 LL 0031 N 0032 SCRLL 0033 SCRLH 0034 RCSLO 0035 RCSHO 0036 TMP 0037 TIMES 0038 RCSL 0039 RCSH 003A DOT 0051 LIFE 1900 MAIN 1900 GEN 1910 INIT 1930 LOAD 1932 DATA 193B TMPSCR 1970 TSLOAD 1973 TSONE 197D TSNEXT 1981 SCRTMP 198A STLOAD 198D STONE 1999 STNEXT 199D RSTORE 19A6 NXTADR 19BD PAGECH 19D4 NALOAD 19DA NADONE 19DD TMPRCS 19E6 TRLOAD 19E9 TRONE 19F3 NEWADR 19F7 GENER 1 00 AGAIN 1 03 BIRTH 1 12 occ 1A18 DEATH 1422 GENADR 1A26 NBRS 1A2F OFFS 1439 ADD 1A52 EXAM 1A5F NEXT 1467 BASIC 38 SYMBOL TABLE 2000 2186 ADD 1A52 AGAIN 1A03 BASIC 38 BIRTH 1412 BLANK 0020 CHH 0023 CHL 0022 DATA 193B DEATH 1422 DOT 0051 DOWN 002 EXAM 1A5F GENADR 1426 GENER 1400 GEN 1910 INIT 1930 LEFT 0020 LIFE 1900 LL 0031 LOAD 1932 LR 0030 MAIN 1900 N 0032 NADONE 19DD NALOAD 19DA NBRS 1A2F NEWADR 19F7 NEXT 1467 NXTADR 19BD OCC 1418 OFFS 1439 OFFSET 002A 19D4 RCSH 003A RCSHO 0036 RCSL 0039 RCSLO 0035 RIGHT 002C RSTORE 1946 SCRH 0021 SCRHO 0025 SCRL 0020 SCRLH 0034 SCRLL 0033 SCRLO 0024 SCRTMP 19
39. GOTO 3000 5 26 1219534 BRK 1 ORA1X 2 NULL 0 NULL O NULL 0 ORAZ 2 ASL 2 NULL 0 PHP 1 ORAIM 2 ASLA 1 NULL 0 NULL 0 ORA 2 ASL 2 NULL 0 BPL 2 ORALY 2 NULL O NULL O NULL O ORAZX 2 ASLZX 2 NULL 0 CLC 1 ORAY 3 NULL O NULL O NULL O ORAX 2 ASLX 3 NULL O JSR 2 ANDIX 2 NULL O NULL O BITZ 2 ANDZ 2 ROLZ 2 NULL O PLP 1 ANDIM 2 1 NULL O B1T 3 AND 2 ROL gt NULL 0 2 2 0 NULL O NULL O ANDZX 2 ROLZX 2 NULL O SEC 1 ANDY 3 NULL O NULL O NULL O ANDX ROLX 3 NULL O RTI 1 EORIX 2 NULL O NULL 0 NULL 0 EORZ 2 LSRZ 2 NULL O PHA 1 EORIM 2 LSRA 1 NULL O 3 EOR 3 LSR 3 NULL O BVC 2 EORIY 2 NULL O NULL O NULL O EORZX 2 LSRZX 2 NULL O CLC 1 2 NULL O NULL O NULLO EORX 3 LSRX 3 NULL O RTS 1 ADCIX 2 NULL O NULL 0 NULL O ADCZ 2 RORZ 2 NULL O PLA 1 ADCIM 2 1 NULL O JMI 3 ADC ROR 2 NULL O BVS 2 ADCIY 2 NULL 0 NULL O NULL O ADCZX 2 RORZX 2 NULL O SEI 1 ADCY 3 NULL O NULL O NULL O ADCX 3 RORX 3 NULL O NULL O STAIX 2 NULL O NULL 0 STYZ 2 STAZ 2 STX2 2 NULLO DEY 1 NULL O TXA 1 NULL O STY 3 STA 2 STX 3 NULL O BCC 2 STAIY 2 NULL O NULL O STYZX 2 STAZX 2 STXZY 2 NULL O TYA 1 STAY 3 TXS 1 NULL 0 NULL O STAX 3 NULL O NULL 0 LDYIM 2 LDA1X 2 LDXIM 2 NULL O LDYZ 2 LDAZ 2 LDXZ 2 NULL 0 1 LDAIM 2 TAX 1 NULL O LDY 3 LDA 3 LDX 2 NULL 0 BCS 2 LDAIY 2
40. IT BPL BIT BMI DEX BMI JSR JSR JSR DEX BPL DEC PLA STA PLA STA SEC BCS DEX BPL BIT BPL BIT BPL PLA PLA SEC BCS JSR PLA PLA JMP OUTCH OUTSP TSTEND PRTBYT INCPT POINTL EAL POINTH EAH LNTST MODE DONE TMODE DONE DOMAP OUTSP OUTSP OUTSP SPO TMODE POINTH POINTL LINEA LINEB MODE NXLN TMODE DOMAP LINE CRLF EXT PRINT AS ONE ASCII CHARACTER AND SPACE UNCONDITIONAL BRANCH RECOVER BYTE AND PRINT AS TWO HEX DIGITS INCREMENT POINTER AND TEST AGAINST ENDING ADDRESS 1 NOT BLOCK END TEST FOR LINE END END OF BLOCK REACHED IS MAP NEEDED DONE IF NOT HAS MAP BEEN DONE YES EXIT NO SPACES NEEDED SPACE OVER TO CHARACTER MAP DO THE MAP FIRST SET THE MAP FLAG AND RESET POINTER TO START OF LINE AND PRINT THE MAP SEGMENT TEST FOR END OF LINE NOT AT END DO THE NEXT BYTE END OF LINE SEGMENT REACHED IS MAP NEEDED NO DO THE NEXT LINE HAS THE MAP SEGMENT BEEN DONE NO DO IT NOW DO THE NEXT LINE FIRST FIXT THE STACK DO THE NEXT LINE DONE REMOVE SAVED POINTER FORM STACK EXIT TO KIM MONITOR 5 42 IVINICIR O KIM 2880 17F5 17F6 17F7 17F8 17F9 17FA 021 0212 0200 2800 2808 2810 2818 2820 2828 2830 2838 2840 2848 2850 2858 2860 2868 2870 2878 KIM 17F5 17F5 17F6 17F7 17F8 17F9 17FA 021 021F 0200 2800 2810 2820 2830 2840 2850 2860 2870 00 28 28 00 oF 20 00 28 80 FF FF 07
41. OPERS and other MICROBES 24 A BASIC 6502 Disassembler for APPLE and PET 25 by Michael J McCann om Applayer Music Interpreter 29 by Richard F Suitor 6502 Bibliography Part IV 37 by William Dial A Block Hex Dump and Character Map Utility Program for the 1 59 3 Williams APPLE Accessories and Software 44 Chuck Carpenter Advertisers Index Computer Components IFC New England Electronics Co 27 Computer Shop 2 Speakeasv Software 31 Riverside Electronics 8 The Computer Store IBC The COMPUTERIST Inc 20 The Enclosures Group BC MICRO is published bi monthly by The COMPUTERIST Inc 56 Central Square Chelmsford MA 01824 Robert M Tripp Editor Publisher Controlled Circulation postage paid at Chelmsford Massachusetts Single Copy 1 50 Annual Subscription 6 00 6 issues in USA Copyright 1978 by The COMPUTERIST Inc All Rights Reserved MIGRA 288 NORFOLK ST CAMBRIDGE MASS 02139 corner of Hampshire amp Norfolk St 617 661 2670 NOW WE HAVE 051 AND YOU CAN GET ONTO THE BUS OHIO SCIENTIFIC We carry the entire line of equipment at the time of writing this ad the items marked with were in stock 500 Computer on a board with 8K ROM Basic Serial 298 00 500 1 as above but with Power Supp Cabinet 498 00 2 4 As above with keyboard and 32 64 Vid amp Cass 598 00 C2 8P Same as 4P but 8 slot MB and Big Power Supply 825 00 C2S1S Single Disk
42. OR APPLE BASIC Bob Sander Cederlof 8413 Midpark Road 3072 Dallas TX 75240 One of the nicest things about Apple BASIC is its speed It runs circles a round most other hobby systems Yet there are times when I honestly wish it were a little slower Have you ever typed in a huge progran and then wanted to review it for er rors You type LIST and the whole thing flashes past your eyes in a few seconds That s no good so you list it piecemeal painfully typing in a long series like LIST 0 99 LIST 100 250 LIST 21250 21399 As the reviewing and editing process continues you have to type these over and over and over Ouch At the March meeting of the Dallas area Apple Corps several members expressed the desire to be able to list long pro grams slowly enough to read without the extra effort of typing separate commands for each screen full One member suggested appending the series of LIST commands to the program itself with a subroutine to wait for a car riage return before proceeding from one screen full to the next For example 9000 LIST 0 99 GOSUB 9500 9010 LIST 100 250 GOSUB 9500 9250 LIST 21250 21399 GOSUB 9500 9260 END 9500 INPUT A RETURN While this method will indeed work it is time consuming to figure out what line ranges to use in each LIST com mand It is also necessary to keep them up to date after adding new lines or deleting old ones But there is a better way I wrote a small
43. PIM 81 dec at hex 1408 OCC checks for survival CMPIM 03 at hex 1 1 and CMPIM 02 at hex 1 1 branching to GENADR when these two conditions are met otherwise the cell dies LDAIM 00 at hex 1A22 The results are stored in TEMP for the 1000 cells NBRS hex 1A2F NBRS is the subroutine that really does most of the work and where most of the speed could be gained by more efficient programming Its job to find the tot al number of occupied neighbors of a given RCS data location is complicated by page crossing and edge boundaries In the present version page crossing is taken care of but edge boundaries left right top and bottom of the are somewhat strange Above the top line and below the bottom line are considered as sort of forbidden re gions where there should practically always be no life data in those re gions are not defined by the program but I have found that there has never been a case where 81 s have been pres ent all other data is considered as unoccupied characters The right and left edges are different however MISRO and lead to a special type of geom etry A cell at either edge is not considered as special by NBRS and so to the right of a right edge location is the next sequential address On the screen this is really the left edge location and one line lower The in verse is true of course for left ad dresses of left edge locations Topo logically this is
44. R ADDITIONAL INFO CALL d AND REQUEST OUR PET INFOR 55 24 X30 schematic of the CPU board RAM MATION PACKAGE 5 plus oversized schematics of the 53 NEECO HAS A LARGE EVER EXPANDING LIBRARY OF PRO 54 x 9 FOR THE PET CALL AND REQUEST OUR Video Monitor and Tape Recorder LIBRARY LISTINGSeSOFTWARE AUTHORSeNEECO OFFERS 5 plus complete Parts layout all 25 ROYALTIES FOR ACCEPTA LE PET PROGRAMS e n x Accu rately and Painstakinziv drawn THE KIM 1 Computer on a Board Instant Delivery to the Hinutest detail 4 6502 Microprocessor C nirolled x 55 a d 13 Addressing Modes Multiple Interrupts x 65K Bytes Address Range 1 n SQ MCS 6530 with 1024 Bytes ROM each 64 Send check money order a Bytes RAM 15 1 0 Pins timer Monitor and 1 m 1 Z TO PET SHACK Software House T and Kev Pad gt Div Marketinz And Research Co a 6 Character LED display 15 2 TTL tines MUCH MORE Attach a power P 0 Box 966 supplv and enter the worid of Microcomputers 3 and the future 74 2 u 3 Mishawaka 46544 a G commodare Z MOST MAJOR BRANDS OF CALCULATORS TOO 8 NEW ENGLAND ELECTRONICS CO nnm pa 55 uar iverv 248 Bridge Street Area Code 413 schedules for all of our Sa ES PET Customers Ca
45. STABLE that is they do not change at all Some are REPEATERS patterns which undergo one or more changes and return to the original pattern A REPEATER may repeat as fast as every other generation or may have a longer period A GLIDER is a pattern which moves as it repeats REPEATERS STABLE ON GLIDERS i ii kk 1 T 5 7 R n ke ok k IPIS GE NOHd3 St H3ININVHOOHd 661 W3M 655 PZOL WAW RI R Hi s M 06 PTW3M HY RAAT 16 25 PS 323348 H SI 099704 34 Hill 9043143 Bp 32 1 12 jt 004008 33005 jim 8200800 puo mau 2012 2 ypim 30891 0070 1 330 bub 4 t4550 0 3584200 MAI 2 ds 3 PROGRAMME 44 0 325484 420000 139000 moj Alr J 2 35 pe 93 53 53 53 93 53 02 bup uium Siyi 19 dj D mm A O e 2 ca 2 L CN m C T CO ta 4 c Lt da c AD LAT XX a 73 da em se LA ATT UN q 0 A WR lt lt D ET IO an lt UO b 14 D LD L ad lt gt on SENE Bogen jii CEDE di3 D 20 4
46. T OR AN APPLE WITH APPLESOFT BASIC 10 D 20 20 R 40 N 60 70 R 80 N 100 110 120 130 180 150 1000 1010 1020 1020 1040 1950 2000 2005 3010 2015 3020 2020 2035 2040 3050 3060 3070 3075 3080 3090 4000 4010 4020 4020 4035 4040 4050 4060 4070 4080 4090 5000 5010 5020 5025 5030 5050 5060 5070 5080 IM MN 256 BYZ 256 CO 16 CR 0 TO 255 EAD MN E BY E EXT E GR 0 TO 15 EAD CO E EXT PRINT CHR 147 PRINT PRINT START ADDRESS INPUT AD PRINT 1 0 GOTO 3000 SXzINT DC 16 Note The two PRINT statements with UN DC SX 16 an are required by APPLESOFT to SX CO SX prevent tne first output line from UN CO UN being mis aligned They may not be HX SX UN reguired by the PET BASIC RETURN 1 I 16 5050 1 1 1 1B PEEK AD IF MN IB lt gt NULL GOTO 2050 IB DC GOSUB 1000 PRINT AD TABE 8 HX AD AD 1 GOTO 5020 ON BY 1B GOTO 2060 2090 4050 DC 1B GOSUB 1000 PRINT AD TAB 8 HX TAB 17 MN IB AD AD 1 GOTO 5020 DC IB GOSUB 1000 B1 HX DC PEEK AD 1 GOSUB 1000 62 PRINT AD TAB 8 B1 B2 TABC 17 MN TAB 21 PEEK ADe 1 AD AD 2 GOTO 5020 DC IB GOSUB 1000 1 DC PEEK AD 1 GOSUB 1000 B2 HX DC PEEK AD42 GOSUB 1000 3 OP PEEK AD 1 AD 2 256 PRINT AD TAB 8 B1 2 B3 TAB 17 MN IB TAB 21 OP AD AD 3 GOTO 3000 INPUT A PRINT 0
47. a small price to pay in order to use the monitor s sub routines If use with a non KIM 650X system is desired the subroutines used must preserve the X register DONE 028A EAH 17F8 INCPT 1F63 INIT 0200 LINEB 0228 LNTST 0279 OUTCH 1EAO OUTSP PRTBYT 1E3B PRTPNT 1E1E SAL 17F5 SPO 0262 5 39 001929 BLOCK DUMP WITH INITIALIZE POINTER PRINT GRIF SET NOMAP TEMPORARX MOD PRINT CRLF SAVE POINTER ON AUK SET BVTE COUNTER FOR 16 PRINT 3 SPACES PRINT 1 SPACE PRINT BYTE POINTL AS 2 HEX DIGITS OR 1 CHARACTER AS REQUIRED BY TEMP MODE AND PRINTABILITV BLOCK FINISHED PRINT CRLF FIX STACK EXIT TO MONITOR SET TMODE RESET POINTER TO LINE START REMOVE SAVED POINTER FROM STACK 5 40 IVINICIR O 0200 0200 0200 0200 0200 0200 0200 0200 0200 0200 0200 0200 0200 0200 0200 0200 0200 0203 0205 0208 020A 020D 020F 0211 0214 0217 0219 021 021C 021D 021 0222 0225 0228 022B 022D o22F 0230 0232 0234 0236 0238 023A 1E 1E 1E 1E 1E 1E BLOCK HEX DUMP AND UTILITY PROGRAM FOR J WILLIAMS 19 ORG 0200 MEMORY LOCATIONS TMODE 4 00F9 POINTL 00FA POINTH 00FB SAL 1725 17F6 EAL 17F7 EAH 17F8 MODE f 17F9 EXT ICUF SUBROUTINES IN KIM OUTCH 4 1EA0 CRLF 4 1E2F OUTSP 1E9E PRTBYT 1E3B PRTPNT 1E1E INCPT 1F6
48. able at byte after address byte N is the number of 16th notes to be silent at the tail of a note Controls rests and note definition AN 160 N lt 32 Selects the tonal range Half tone 0 is set to one of 32 half tones giv ing a basic range of four octaves CN 192 N lt 62 Controls the tempo Len gth of a note is propor tional to N Largest value gives a whole note lasting about 3 5 sec RETURN Stop interpret ing this table Acts as return for 83 JSR in struction or causes re turn from Applayer 82 130 83 131 9 1444N 255 209236 To use 1 with sheet music one must first decide on the range of the half tones This must sometimes be changed in the middle of the song For example the music for Turkey in the Straw which appears later was in the key of C for the first part of the song I used the following table NOTE C D E F G A C D 0 2 4 5 7 9 B C E The tonal range was set with a control byte BO In the chorus the range of the melody shifts up there the tonal range is set with a 7 and the table is NOTE G A B DE F G TONE O 2 U 5 7 9 C E The actual key is determined by the wave shape pattern as well as the tonal range control byte For the pattern used 05 05 05 the fundamental for the note written as C would be about 346Hz which is closen to F Rests can be accomplished with a 9N control byte and a note byte For ex ample 94 10 is a quarter re
49. about 2 1 2 minutes for the interpreter to go through one generation I suppose I shouldn t have been surprised since the program has to check eight neighboring cells to determine the fate of a par ticular cell and do this 1000 times to complete the entire generation 40x25 characters for the PET display The program following is a 6502 version of LIFE written for the PET It needs to be POKE d into the PET memory since I have yet to see or discover a machine language monitor for the PET I did t with a simple BASIC program and many DATA statements taking up much more of the program memory space than the actual machine language pro gram A routine for assembling and saving on tape machine language pro grams on the PET is sorely needed The program is accessed by the SYS com mand and takes advantage of the dis play monitor cursor control for in serting seeds and clearing the arena Without a serious attempt at maximizing for speed the program takes about 1 2 second to go through an entire genera tion about 300 times faster than the BASIC equivalent Enough said about the efficiency of machine language pro gramming versus BASIC interpreters BASIC is great for number crunching where you ean quickly compose your pro gram and have plenty of time to await the results The program may be broken down into manageable chunks by subroutining There follows a brief description of the salient features of each secti
50. and HANGMAN Guess the secret word Included is a 12 page booklet which not only contains game rules but has 5 pages of useful pro gramming techniques including Direct Sereen Access Graphics Flashing Mess ages and Programmed Delays 2 con tains BLACK BART a mean mouthed poker player and BLACK BRET for blackjack one or two players 3 contains BLOCK and FOOTBALL both of which allow either two player or play the PET options Copies Just released 40 copies Price 9 95 each Includes PET tape cassette instruc tions and educational manual with info for program modifications Ordering Info Specify ZZYP PAX number Author Terry Dossey Available from Many PET dealers or ZZYP Data Processing 2313 Morningside Drive Bryan TX 77801 Name BULLS AND BEARS tm System Apple II Memory 16K Language 16K BASIC Hardware Apple II Description A multi player simulation of corporate finance Involves deci sion making regarding production lev els financing dividends buying and selling of stock etc Copies Hundreds sold Price 12 00 Ineludes Game cassette and booklet Ordering Info At computer stores only Author SPEAKEASY SOFTWARE LTD Box 1200 Kemptville Ontario Canada KOG 1JO Dealer inquiries invited Name Variety of Programs System Apple II Memory Most 8 or less Language Mostly Integer BASIC Hardware Mostly standard Apple II Description A varied collection of short programs Some
51. as no explanation of what it was Supposed to do However the price is attractive 62 assembled and tested 42 kit and the Service was great expect eventually that I ll be able to have an inexpen Sive communicating terminal The MODEM board can be originate or answer I ll have to use two if I want to do both A note of caution here too As 5 44 written the machine language program starts at page 3 0300 Applesoft BASIC uses the first few bytes of this page You ll have to relocate the ter minal part of the program to use both integer and floating point BASIC I have the serial board connected to my printer and everything works okay I ll pass along the results when I have the system set up to communicate Finally Apple has a new version of Applesoft called Applesoft II This became available in April 1978 The new version is 1 5K longer but has all the standard integer BASIC commands and a few more It is not compatible with previous versions of Applesoft All the known problems seem to have been corrected It s really nice to be able to go from one BASIC to the other and have to remember only the extended abilities especially for LORES graph ies There are commands to FLASH and RESTORE sereen characters a SPEED com mand to vary the screen writing rate and you can develop HIRES graphics di rectly from program control Maybe we Apple owners should request a retrofit kit This way we can catch up on
52. ble interval timer counters Y UA MT KKM RARE T ien The built in expansion capabilitv in cludes a lill pin Application Connector for peripheral add ons and a 44 pin Ex pansion Connector with the full svstem bus And both connectors are totally KIM 1 compatible TTY and Audio Cassette Interfaces are part of the basic system There is a 20 ma current loop TTY interface just like the KIM 1 and an Audio Cassette Interface which has a KIM 1 compatible format as well as its own special binary blocked file assembler compat ible format The DEBUG MONITOR includes a mini as sembler and a text editor Editing may use the keyboard TTY cassette print er and display The Monitor includes a typical set of memory display modify commands It also has peripheral de vice controllers breakpoint capability and single step trace modes of debug ging An 8K BASIC Interpreter will be available in ROM as an option AIM 65 will be available in August It will cost 375 W MO C 4 H be hal E al y lt T T 1 E E P BILZ 6 8588 AZ LDK FE 8682 ES IHY 5603 DB BNE 8502 8685 EA asas 8587 4 IMP aenn 8688 IS TIME TO RENEW YOUR SUBSCRIPTION If you are a subscriber to MICRO then the two digit code following your name the mailing is the number of the last issue your current subscription covers If your two digit code is 0
53. byte s making up each instruction are printed in hexadecimal base 16 between the address and the mnemonic In three byte instructions the high order byte is multiplied by 256 and added to the contents of the low order byte giving the decimal equivalent of the absolute address This number is printed in the bytes 2 and 3 field In two byte instructions the decimal equivalent of the second byte is printed in the bytes 2 and 3 field SAMPLE RUN RUN START ADDRESS 64004 Programming Comments Lines 10 40 initialize the BY and arrays BY contains the number of bytes in each instruction and MN con tains the mnemonic of each instruction Lines 60 80 initialize the decimal to hexadecimal conversion array CO Lines 100 120 input the starting ad dress Lines 1000 1050 decimal to hexadecimal conversion subroutine Lines 3000 5030 do the disassembly Lines 3010 3030 take care of illegal operation codes Line 3050 transfers control to one of three disassembly routines the choice is determined by the number of bytes in the instruction Lines 6000 6290 contain the data for the arrays Althougn this was originally written in Commodore BASIC it will work with the APPLESOFT BASIC of the APPLE computer 64004 JMP 59006 64007 AD OA 02 LDA 522 64010 FO 08 64012 30 04 5 25 BEQ 8 BMI H 340389 1 REM A 6502 DISASSEMBLER 2 REM EY MICHAEL J MCCANN 2 REM WILL RUN ON AN 8K PE
54. ction to a LDA instruction AD XX 60 and repeat steps 2 and 3 above 5 In turn change the location at which you are getting the data to a location in each of the 8K blocks in Table 2 e g OOXX 20XX etc and test the output pins on the 74145 to see if the LED glows You should be able to explain your results with the truth table 6 Stop the program and check the pins again Inputs Outputs C B 0123 4 5 6 7 L L L L H H H H H H H L L H H L H H H H H H L H L H H L H H H H H L H H H H H L H H H H H L L H H H H L H H H H L H H H H H H L H H H H L H H H H H H L H H H H H H H H H H H L Table 4 Truth Table for 74LS145 when connected as shown in Figure 3 5 17 1401889 In steps 2 and 4 the LED should glow when the probe touches pin 1 and pin 4 Why does it glow more brightly on pin 1 When the program is stopped only pin 1 should cause the LED to light The answers to these questions and the answers to questions you never asked will be given in the next issue What else is coming up in the next column we will see how to take any of the 8 signals from the 74145 to enable a 74LS138 which in turn will decode address lines A12 A10 thus HALF A WORM THE APPLE Mike Rowe P O Box 3 S Chelmsford MA 01824 Last issue we reported a potential problem that had been discovered in the Apple II relating to using PIA a The problem had been uncovered by the staff 5 of EDN in the course of developing
55. e effect was devastating A KIM BEEPER by Gerald C Jenkins appeared in issue 4 on page 43 The corrected listing is given below in full You would have to examine the alphabetic portion of the two listings quite closely to see error The line at address 0118 read BIT TIME but should have read BIT TIMER A minor error only one letter missing but look at the difference in the list ings from that point on A two byte instruction was generated instead of the correct three bytes This in add ition to being wrong caused every sub sequent location to be displaced by one byte 0100 0100 0100 00FF 0100 00C8 0100 1702 0100 1703 0100 1707 0100 In this case the error was our fault We try to check the listings presented in MICRO but we do not have the equip ment or time to run every program We have caught some errors in programs submitted to us and we test what we can There was a slight bug in Complete Morse Code Send Receive Program for the KIM 1 by Marvin L De Jong The sec ond line of the listing read 0057 AQ FF LDAIM FF but should have been 0057 A9 40 LDAIM 40 The only effect this will have will be to set an incorrect initial code speed In An Apple II Programmer s Guide by Rick Auricchio the paragraph which States that control K followed by 5 sets the keyboard to device 5 is in error It is really 5 followed by control START TIMER FOR 1 4 SECOND
56. e first installment of a col umn which will appear on a regular basis as long as reader interest auth or enthusiasm and the editor s approval exist Your response will be vital for our deciding whether to continue the column Do not be afraid to be criti cal or to make suggestions about what subjects you would like to see Hope fully the column will be of interest to anyone who owns a 6502 system One of the more challenging aspects of be ing computer hobbyist is understand ing how your system works and being able to configure and construct I O ports Then one can begin to tie his computer to the outside world Perhaps this column will give you the ability to produce flashing lights clicking relays whirring motors and other re markable phenomena to amaze your fri ends and make your mother proud An educational column has to make some assumptions about where the readers are in terms of their understanding fa miliarity with binary and hex numbers will be assumed as will a nodding quaintance with the 7400 series of in tegrated circuits Lacking such a background I would recommend that you get a book like Bugbook V by Rony Larsen and Titus TTL Cookbook by Lancaster or an equivalent book from your local computer shop or mail order house Ads in Micro Byte Kilobaud Ham Radio 73 Magazine etc will list places where both books and parts may be ordered My own pre ference for hands on exper
57. ee run ning with clock cveles counted for real time reference 2 free running with output signal toggled by each counter overflow 3 external event counter and 4 pulse width measurement mode A 16 bit latch automatically reinitial izes the counter to a preset value Interrupt on overflow is software mask able A 64 pin Emulator part of which 40 pins are electrically identical to the standard R6500 1 part and which comes in either 1 MHz or 2 MHz versions is available now Rockwell expects to be gin receiving codes from customers in July for production deliveries in Sept Quantity prices for 6500 1 production devices are under 10 00 for both the 1 MHz and 2 MHz models Single unit prices for Emulator parts are 75 00 for the 1 MHz model and 95 00 for the 2 MHz version Contact Leo Seanlon 714 632 2321 Pattie Atteberry 213 386 8600 VRAM XILI LE II E Overflow RESET 32 PROGRAMMABLE INPUT OUTPUT LINES NON MASKABLE INTERRUPT NMI ONE CHIP SPEEDSTER Functional diagram of one chip NMOS microcomputer R6500 1 developed by Rockwell International Fully software compatible with the 6500 family the R6500 1 operates from single 5V power supply at 2 MHz with a 1 microsecond minimum execution time 222936 6502 INTERFACING FOR BEGINNERS ADDRESS DECODING I Marvin L De Jong Dept of Math Physics The School of the Ozarks Point Lookout MO 65726 This is th
58. gui n oio n pue n ppe 3911632 04012828019 30 par 3583734 4966 3503 JAMO DUO 4894 ne 1042 2481204042 j0 5004 48120042 1881 ti 488452 31003382000 a NO GHADA 53401931 JHL 30 30 527 31 543 14 E JHL SI SIHL Voisnvaxa HNIM WAY S 3aISH3AIH OG NYO WIN HMOA SI SIHL e m N c 2 L E 3 2 3 x 2 gt 2 c 2 m O F 2 O 5 Oyaa NI 318V1VAV 3JHVML4OS HOLINOW AVIdSIG H3IAIHQ AVIdSIG O3GIA bZOL WAW 1900 1900 1900 1900 1900 1900 1900 1900 1900 1900 1900 1900 1900 1900 1900 1900 1900 1900 1900 1900 1900 1900 1900 1900 1900 1900 1900 1900 1900 1900 1900 1900 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 190A 190D 1910 1913 1916 1919 191B 191D 191E 191F 1920 08 48 8 48 98 48 BA 8 48 D8 20 20 20 E6 DO 68 AA 9 68 19 19 19 1 19 LIFE BASIC OFFSET DOT BLANK SCRL SCRH CHL CHH SCRLO SCRHO TEMPL TEMPH TEMPLO TEMPHO UP DOWN RIGHT LEFT UR UL LR LL N SCRLL SCRLH RCSLO RCSHO TMP TIMES RCSL RCSH MAIN GEN ORG k k k k k k k k k k k k k k k k k PHP PHA TXA PHA TYA PHA TSX TXA PHA CLD JSR JSR JSR JSR JSR INCZ BNE PLA TAX TXS PLA 1900 C38B RETURN TO BASIC ADDR
59. hat this discussion has prevented some of our readers from going nuts trying to add a PIA to their Apple II 5 18 221924 ROCKWELL S AIM IS PRETTY GOOD Rockwell International Microelectronic Devices Box 3669 Anaheim CA 92803 714 632 3729 Rockwell s AIM 65 Advanced Interface Module gives you an assembled versa tile microcomputer system with a full size keyboard 20 character display and 20 character thermal printer AIM 65 s terminal style ASCII keyboard has 54 keys providing 69 different alphabetic numeric and special func tions AIM 65 s 20 character true Alphanumeric Display uses 16 segment font monolithic characters that are both unambiguous and easily readable AIM 65 s 20 column Thermal Printer prints on low cost heat sensitive roll paper at a fast 90 lines per minute It produces all the standard 64 ASCII characters with a crisp printing five by seven dot matrix AIM 65 s on board printer is a unique feature for a low cost computer The CPU is the R6502 operating a 1 MHz The basic system comes with 1K RAM ex pandable on baord to UK It includes a 4K ROM Monitor and can be expanded on board to 16K using 2332 ROMs or can also accept 2716 EPROMs An R6532 RAM Input Output Timer is used to support AIM 65 functions There are also two R6522 Versatile Interface Adaptors Each VIA has two 8 bit bidirectional TTL ports two 2 bit peripheral hand shake control ports and two fully pro gramma
60. ience would be Bugbook V Although this book has some material on the 8080A chip most of the material is very general and the chapters covering the basic 7400 series integrated circuits are very good An other indispensable book is the TTL Data Book published by Texas Instru ments It would be a good idea to get a Proto Board or equivalent breadboarding sys tem for the experiments which will be suggested One can even find wire kits to go with the breadboards I would not purchase all the Outboards from E amp L Instruments since the same circuits can be constructed less expensively from parts Please regard these sug gestions as opinions which may not be shared by all experimenters Finally let me introduce the column by saying that the title is not Interfac ing Made Easy If it were easy there would be no challenge and no need for this column Like mountain climbing satisfaction comes from overcoming the difficult rather than achieving the ob vious The material which you see in this column will usually be something which I am in the process of learning myself I am a hobbyist like yoursel ves I keep the wolf from the door by teaching mathematics and physics not computer science or digital electron ics Expert opinions from readers and guest contributions will always be wel come We begin at the beginning The 6502 pins may be divided into four groups power address data and control pins Pins 1 and 21
61. in the APPLE documentation The program described here is more than a tone making rou tine it is a music interpreter It enables one to generate a table of bvtes that specifv preciselv the half tone and duration of a note with a sin ple coding Its virtue over the sim pler routines is similar to that of any interpreter such as Sweet 16 or more tenuously BASIC over an assembler or hand coding it is easier to achieve one s goal and easier to decipher the coding six months later The immediate motivation for this in terpreter was Martin Gardner s Mathe matical Games Column in the April 1978 Scientific American Several types of algorithmically generated music are discussed in that column this program provides a means of experimenting with them as well as a convenient method of generating familiar tunes The program is written in 6502 assembly language It would be usable on a sys tem other than the APPLE if a speaker were interfaced in a similar way Ac cessing a particular address C030 changes the current through the APPLE speaker from on to off or from off to on it acts like a push button on off switch or of course a flip flop Thus this program makes sound by acces sing this address periodically with an LDA CO30 Any interface that could likewise be activated with a similar 4 clock cycles instruction could be easily used A different interfacing software procedure would change the timing and require m
62. ked directly to his KIM 1 Actually the printer is part of a terminal which talks to the KIM via standard 20MA cur rent loop methods A reader from New Guinea has promised an article on how to directly hook up a Diablo and says that it is easy The ANNOUNCEMENTS The MICROCOMPUTER RESOURCE CENTER Inc offers a number of services including a free publication devoted to the PET the ET GAZETTE PET Cassette ibus is also being set up in which you submit one program and get two to four programs in return For your free or other info write Len Lindsav Editor PET GAZETTE 1929 Northport Drive No 6 Madison WI 53704 5 4 6502 GROUPS Interested in starting a KIM 1 Users Club in the San Fernando Valley Area Jim Zuber 20224 Cohasset No 16 Canoga Park CA 91306 213 341 1610 THE APPLE CORE Scot Kamins Organizer Box 4816 Main Post Office San Francisco CA 94101 THEATER COMPUTER USERS GROUP A number of KIMs being used by members Dues 4 00 include newsletter Mike Firth 104 N St Mary Dallas TX 75214 A P P L E Val J Golding President 6708 39th Avenue SW Seattle WA 98136 206 937 6588 MICRO 6502 New group forming in New England to pursue and support serious 6502 efforts Robert Tripp Organizer 0 Box 3 S Chelmsford MA 01824 617 256 3649 Davs Send us your club information Due to our publication schedule meeting announcements should XXX co
63. ll x Springfield Mass 739 9626 for our PET Package 23 a itikaratafatafafafafafafafatafafafatafatafafafafafafofafafafafofafafafafafafafafafafiafafafafieftafafafafafiefofafiefafiasiafafofafafiofafaftafafafafafaflafafa SYNERTEK S VIM 1 Synertek Incorporated B ox 552 Santa Clara CA 95052 Synertek has announced a new 6502 based microcomputer system with the following features FULLY ASSEMBLED AND COMPLETELY INTE GRATED SYSTEM that s ready to use as soon as you open the box 28 DOUBLE FUNCTION KEYPAD INCLUDING UP TO 24 SPECIAL FUNCTIONS EASY TO VIEW 6 DIGIT HEX LED DISPLAY KIM 1 HARDWARE COMPATIBILITY The powerful 6502 8 bit MICROPROCESSOR whose advanced architectural features have made it one of the largest selling micros on the market today THREE ON BOARD PROGRAMMABLE INTERVAL TIMERS available to the user for timing loops watchdog functions and real ime communication protocols 4K BYTE ROM RESIDENT MONITOR and Oper ating Programs Single 5 Volt power capability is all that is required AUDIO CASSETTE IRF ADAPTER APPLICATIONS PORT KBD TV KBD ALPHA INT FCE NUMERIC MODULE AUX APPLICATIONS CONNECTOR OPTIONAL AUX PORT OPTIONAL AUX PORT B AUDIO pan casi AUX PORT A K JZ AUDIO REMOTE INTERFACE CAT U T 6522 AUX PORT B ERIPHERAL BUS JI Z 1 INT FCE C NCTR TELETYPE km A
64. low List for Apple BASIC The program is written in 6502 assembly language and presents some insights in to the workings of the Apple Monitor We are fortunate to have starting in this issue a series of tutorial arti cles by Marvin L De Jong on 6502 In terfacing for Beginners Marvin has already contributed a number of excel lent articles to MICRO and this series sounds like exactly what many readers have specifically requested This mon ths installment covers Address Decod ing In addition to talking at you the article provides a number of exper iments you can perform to really under stand what is happening William Dial s 6502 Bibliography con tinues with part IV Since so much is being written about the 6502 finally we are having to restrict the coverage somewhat rom now on references to obscure journals new product notes and ads minor letters or notes or correc tions etc will not be included Al so references to the KIM 1 User Notes will be combined and brief since it is assumed that most MICRO readers already get KUN if not they should A few new products are presented Rockwell s New R6500 1 is a new chip that looks very interesting for many of those applications which need process ing power but not a lot of memory or fancy features The R6500 1 combines a 6502 with 2K bytes of 64 bytes of RAM 32 programmable I O lines timer and a few other features all in a single 40 pin
65. lyn Avenue Akron 44320 Michels Richard E How to Buy an Apartment Building Interface Age 3 No 1 pp 94 99 Jan 1978 A 6502 FOCAL based system for handling the many factors involved via a computer decision making program Woods Larry How Are You Feeling Today Kilobaud No 14 pp24 30 Feb 1978 Biorhythms with your KIM are displayed on the KIM readout Craig John Editor s Remarks Kilobaud No 14 p 22 Feb 1978 In a discussion of Microsoft Level II BASIC it is pointed out that Micro soft BASIC is being used on Altair 6800 and 8080 TRS 80 and 6502 based systems OSI PET KIM and Apple floating point version Bishop Robert J Star Wars Kilobaud No 14 pp52 56 Feb 1978 An Apple II graphics game based on the 6502 Blankenship John Expand Your KIM Part 3 Kilobaud pp68 71 Feb 1978 This installment covers bus control board and memory Burhans R W How Much Memory for a KIM Kilobaud p 118 Feb 1978 Decoding the KIM for 28K Pearce Craig A p 6 suggestions for running graphics on the PET Julin George pp6 7 letter on PET graphics Stuck H L p 7 more on the PET Above three are letters in Peoples Computers 6 No 4 Jan Feb 1978 Wells Edna H Program Abstract Peoples Computers p 7 Jan Feb 1978 Program for the Commodore PET with 8K BASIC entitled Graphics to ASCII Utility ASCIIGRAPH Cole Phyllis SPOT The Society of PET Owners and Trainers Peoples Computers No 4 pp 16 19 Jan Feb 1978 Notes fo
66. machine language program which solves our problem After this little 64 byte routine is loaded and activated the LIST command has all the features we wanted 1 The listing proceeds at a more lei surely pace allowing you to see what is going by 2 The listing can be stopped tempor arily by merely pressing the space bar When you are ready pressing the space bar a second time will cause the listing to resume 3 The listing can be aborted before it is finished by typing a carriage return The routine as it is now coded resides in page three of memory from 0340 to 037F It is loaded from cassette tape in the usual way 340 37FR After the routine is loaded you return to BASIC The slow list features are activated by typing CALL 887 They may be de activeted by typing CALL 878 or by hitting the RESET key How does it work The commented assem bly listing should be self explanatory with the exception of the tie in to the Apple firmware All character output in the Apple funnels through the same subroutine COUT at location FDED The instruction at FDED is JMP 0036 This means that the address which is stored in locations 0036 and 0037 in dicates where the character output sub routine really is Every time you hit the RESET key the firmware monitor sets up those two locations to point to FDFO which is where the rest of the COUT subroutine is located If char acters are supposed to go to some other pe
67. on 5210830 MAIN hex 1900 In a fit of overcaution since this was the first time I attempted to write a PET machine language program You will notice the series of pushes at the beginning and pulls at the end I de cided to save all the internal regis ters on the stack in page 1 and also included the CLD clear decimal mode just in ease Then follows a series of subroutine calls to do the LIFE genera tion and display transfers The zero page location TIMES is a counter to permit several loops through LIFE be fore returning As set up TIMES is initialized to zero hex location 1953 so that it will loop 256 times before jumping back This of course can be changed either initially or while in BASIC via the POKE command The return via the JMP BASIC 4C 8B C3 may not be strictly orthodox but it seems to work all right INIT hex 1930 and DATA hex 193B This shorty reads in the constants needed and stores them in page zero SCR refers to the PET screen TEMP is a temporary working area to hold the new generation as it is evolved and RCS is essentially a copy of the PET sereen data which I found to be neces sary to avoid snow on the screen dur ing read write operations directly on the screen locations Up down etc are the offsets to be added or subtrac ted from an address to get all the neighbor addresses The observant reader will note the gap in the addres ses between some of the routines TMPSCR he
68. or clear a flip flop to control an external device for example a heater and all that without even using the data lines If you see all that you can take over this column See you next issue EDM BLASTS THE 6502 Robert M Tripp P O Box 3 S Chelmsford MA 01824 The May 20 1978 issue of EDN which had the information on the Apple II PIA ended with a put down of the 6502 by Jack Hemenway I feel that the attack and that is what I would call it was a very emotional one based on the fact that the author has worked with the 6800 extensively His points were such fatal flaws in the 6502 as the stack is limited to page 1 the index registers are 8 bit the two different methods of indirect indexing are confusing there are too many addressing modes there is only one accumulator and so forth Of course we can all think of things that we would like to have in a micro but there have to be trade offs and a lot of people seem to be happy with the 6502 s set of capabilities I suggest that some of us write to EDN and advise them of the 6502 s good points For example I prefer the stack to be only in page one I have written a lot of code and have never used up very much of the stack And if a program goes wild only page one is destroyed not all of memory So let us set EDN straight by writing a few letters The editor has said he would to a hear from us want to dwell on it but we hope t
69. ore extensive mod ification The tone is generated with a timing loop that counts for a certain number of clock cycles N all of the cycles in a period including the toggling of the speaker are counted Every N cycles a 24 bit pattern is rotated and the speaker is toggled if the high or der bit is set Four cycles are wasted to keep time if the bit is not set There is a severe limit to the versa tility of a waveshape made from on off transitions but tones resembling a 5 29 variety of cheap woodwinds and pipes are possible with fundamentals ranging from about 20 Hz to 8 KHz Applayer interprets bytes to produce different effects There are two types of bytes Note bytes Bit 7 Not Set Control bytes Bit 7 Set to 1 A note byte enables one to choose a note from one of 16 half tones and from one to eight eighth notes in dur ation The low order nybble is the half tone the high order nybble is the duration in eighth notes minus one Bit 7 6 5 4 3 2 10 Note Byte 0 Duration Half Tone The control bytes enable one to change the tempo the tonal range which the 16 half tones cover rests the waveshape of the tone and to jump from one tion of the table to another Control Byte Table HEX DECIMAL FUNCTION 81 129 The next three bytes are the new waveshape pattern JMP New table address follows Low order byte first then page byte JSR new table address follows When finished continuing this t
70. package Synertek s VIM 1 is a new 6502 based system which is an upgrade of the KIM designed as an easily expandable system with many of the KIM 1 features plus a number of new wrinkles The single piece price is 270 and is scheduled for delivery soon Rockwell s AIM is Pretty Good dis cusses an exciting new single board microcomputer which features a full ASCII keyboard 20 character display and a 20 character printer for 375 341389 NOTES ANNOUNCEMENTS The NOTES Henrv Ball of Burbank CA notes that The K7 connection on KIM provides a convenient control for the motor on a cassette tape plaver recorder Just connect a relav circuit to it and without anv further programming it will obedientiv start and stop the re corder for the 1873 READ and anv Super tape routine Trvit you ll like it Robert A Huelsdonk of Seattle WA re ferring to the Apple Printer articles suggests the following Printer CALL Commands Integer BASIC ON CALL 896 OFF PR D Applesoft BASIC ON X USR 896 OFF 54 240 55 253 These commands can be entered from the keyboard or in a program statement If a printer other than a 40 column is used then it is also necessary to POKE 33 40 to return the CRT to it s normal window width Robert M Tripp of Chelmsford MA notes that a number of people were mislead by the Typesetting article into thinking that he had a Diablo Hytype Printer hoo
71. r the Users of the PET Inman Don The Data Handler User s Manual Conclusion Peoples Computers No 4 pp24 31 Jan Feb 1978 The final installment of this series covers simple and inexpensive output devices Inman Don The First Book of KIM Peoples Computers No 4 p34 Jan Feb1978 A good review of this excellent book Braun Ludwig Magic for Educators Microcomputers Personal Computing 2 No 1 pp 30 40 Jan 1978 Discussion of micros includes the 6502 based Apple II and the PET Helmers Carl An Apple to Byte BYTE 3 No 3 p 18 46 Mar 1978 A user s reactions to the Apple II with an example of a simple color sketchboard application Fylstra Dan User s Report The PET 2001 BYTE pp114 127 Mar 1978 A fairly comprehensive report on the PET Brader David KOMPUUTAR Updates BYTE pp131 132 Mar 1978 In a letter Brader responds to some inquiries on his KOMPUUTAR system based on 6502 which was published in BYTE Nov 1977 Jennings Peter R Microchess 1 5 versus Dark Horse BYTE 3 No 3 pp 166 167 March 1978 Microchess 1 5 is Jenning s new extended version of the original Micro chess It occupies 2 5K and runs on KIM 1 with expanded memory It is still being developed but in a test game with Dark Horse a 24K program written in Fortran IV the new version did very well indeed 5 37 317 318 319 320 321 322 323 324 325 326 327 326 329 330 331 332 333 3
72. ripheral device you would patch in the address of your device handler at these same two locations In the case of the slow list program the activa tion routine merely patches locations 0036 and 0037 to point to 0340 The de activation routine makes them point to FDFO again 5 21 MBRO time slow list detects a carriage point 003 If you have typed a return being output it calls a delay space slow list goes into a loop wait subroutine in the firmware at FCA8 ing for you to type another character This has the effect of slowing down the before resuming the listing listing Slow list also keeps looking 2 at the keyboard strobe to see if you That is all there is to it Now go have typed a space or a carriage re turn on your Apple type in the slow turn If you have typed a carriage re list program and list to your heart s turn slow list stops the listing and content jumps back into BASIC at the soft entry 0340 ORG 0240 ROUTINE TO SLOW DOWN APPLE BASIC LISTINGS 0340 C9 8D SLOW 8D CHECK IF CHAR IS CARRIAGE RETURN 0342 DO 1A BNE CHROUT NO SO GO BACK TO COUT 0344 48 PHA SAVE CHARACTER ON STACK 0345 2C 00 CO BIT 000 TEST KEYBOARD STROBE 0348 10 OE BPL WAIT NOTHING TYPED YET AD 00 CO LDA CO00 GET CHARACTER FROM KEYBOARD 4 2C 10 CO BIT CO10 CLEAR KEYBOARD STROBE 0350 C9 CMPIM CHECK IF CHAR IS A SPACE 0352 FO 10 BEQ STOP YES STOP LISTING 035 C9 8D CMPIM
73. s or subroutines and except for MAIN and SUBROUTINE address are fully relocatable The PET screen addresses 8000 83E8 hex are treated as RAM For anyone with a 6502 based system trying to convert the PET program the following points need to be watched 1 The BLANK symbol 20 hex 2 The DOT symbol 51 hex 3 The OFFSETs in DATA must be set for the user s display Editor s Note This seems like an ideal program to convert to an APPLE II and MICRO would be happy to print a list of the required modifications and enhancements that someone develops IL M M A A Brief Introduction to the Game of Life by Mike Rowe One of the interesting properties of the game of LIFE is that such simple rules can lead to such complex activ ity The simplicity comes from the fact that the rules apply to each in dividual cell The complexity comes from the interactions between the indi vidual celis Each individual cell is affected by its eight adjacent neigh bors and nothing else The rules are 1 A cell survives if it has two or three neighbors 2 cell dies from overerowding if it has four or more neighbors It dies from isolation if it has one or zero neighbors 3 A cell is born when an empty space has exactly three neighbors With these few rules many different types of activity can occur Some pat terns are
74. shing Company Reading Mass 1978 Caxton C Foster of the University of Massachusetts Amherst has put together a very helpful book on programming the 6502 using KIM 1 as a m lab tool Barden William Jr Computer Corner 6502 Radio Electronics May 1978 An in depth look at the widely used 6502 microprocessor Wozniak Steve Renumbering and Appending Basic Programs on the Apple II Computer DDJ Issue 3 March 1978 Comments and techniques for joining two BASIC programs into a single larger one Eaton John A KIM Binary Calculator DDJ Issue 3 March 1978 An easier way to solve binary math programs Wells Ralph PET s First Report Card Kilobaud pp 22 30 May 1978 An objective evaluation of PET serial No 171 Blankenship John Expand you KIM Kilobaud pp 60 63 May 1978 Part 5 A D interfacing for joysticks Four channels Holland Hugh KIM Notes BYTE 3 4 163 April 1978 Correction for Hal Chamberlin s Four Part Harmony Program published in September 1977 BYTE Anon Byte s Bits BYTE 3 No 4 p 166 April 1978 Notes on picking the right color television for an Apple KIM 1 User Notes Issue 9 10 January March 1978 Rehnke Eric Have you been on the Bus page 1 Kushnier Ron Space War Phaser Sound page 2 Butterfield Jim Skeet Shoot page 2 Edwards Lew KIM D BUG page 3 Flacco Roy Graphics Interface page 4 Wood James RPN Calculator Interface to KIM page 6 Bennett Timothy
75. st 98 30 is a half rest etc This control is normally set at 91 for notes distinct ly separated or to 90 for notes that should run together Let s try to construct a table that 1 can use to play a tune can start simply with Twinkle Twinkle Little Star That tune has four lines the first and fourth are identical as are the second and third So our table will be constructed to 1 Set up the tonal range tone pat tern and tempo that we want First line table and return Second line table and return 2 JSR to a table for the first line 3 JSR to a table for the second line 4 Repeat 3 5 Repeat 2 6 Return T 8 Since unfortunately 1 is not symbolic it will be easier to con Struct the tables in reverse so that we can know where to go in steps 2 6 The note table for the first line can go at OBOO and looks like 0B00 0B08 10 10 17 17 19 19 37 15 15 14 14 12 12 30 FF FF 5 30 The second line can follow at 0810 0810 17 17 15 15 14 14 32 FF Now we can start on step 1 I ll sug gest the following to start you ll want to make changes OB20 BO 81 05 05 05 EO 91 The above determines the tonal range the tone wave shape the tempo and a Sixteenth note rest out of every note to keep the notes distinct To run them together use 90 instead of 91 Steps 2 6 can follow immediately 0B20 83 0B28 00 OB 83 10 OB 83 10 OB 0B30 83 00 OB FF That completes the
76. t or Type Please 2 Attach Check or Money Order and Mail to Mn PN U C i a the enclosures GIN ta s group STATE ZiP 55 stevenson san francisco 94105 Please Ship Prepaid SKE 1 1 s Color Desired blue O beige 0 23 50 Each black white U California Residents please pav 25 03 Includes Sales Tax Rohm 4 Haas Patent Applied For the Computer Store 63 SOUTH MAIN STREET WINDSOR LOCKS CONNECTICUT 06096 203 627 0188 The Computer Store is pleased to announce off the shelf availa bility of Apple II the personal computer xo Te aT n wa the Computer Store 63 SOUTH MAIN STREET WINDSOR LOCKS CONNECTICUT GIFT CERTIFICATE AT ere ee e THIS COUPON GOOD FOR 2 OFF ANY PURCHASE OVER 55
77. to play with 0820 70 01 5C 01 48 01 34 01 Turkey in the Straw The table fol 0828 24 01 14 01 04 O1 00 lows its structure will be left as an 0830 E8 00 DA 00 00 C2 00 exercise 0838 B8 00 AE 00 00 9A 00 2 0840 92 00 8A 00 82 00 7A 00 From the monitor 900 0 0848 74 00 6D 00 67 00 61 00 9C0G 0850 5C 00 57 00 52 00 4D 00 will play it 0858 49 00 45 00 41 00 3D 00 0A00 03 90 OF 83 90 OF FF OFOO 90 1C 1A 92 38 90 18 1A OFO8 18 13 10 11 91 13 13 33 OF10 33 90 18 1A 92 3 3 90 OF18 1 1A 18 1A 91 1C 38 10 OF20 38 90 1C 1A 92 38 90 18 SPERKERSY OF30 33 90 18 1A 91 3C 90 OF38 1C 18 1C OF4O 94 78 91 FF 12 0200 SOFTWARE 0258 01 05 05 05 FF oe 15 18 18 15 78 OF68 16 1A 16 gt OF70 1D 1D 1D 1D 18 for APE Sead OF78 35 15 15 33 90 OF80 15 18 18 18 90 I OF88 13 91 15 15 13 now available at 90 03 58 OF DH BO 0898 B7 83 60 OF 83 fine computer stores 60 83 50 OFA8 83 50 OF 83 68 OFBO OF 83 70 OF FF SPEAKEASY SOFTWARE LTD 5 31 1220 struction to RTS IMIIICIRIO 100 POKE 2512 32 LOW ORDER TABLE BYTE 110 POKE 2538 96 CHANGE INST AT O9EA KEMPTVILLE ONTARIO 140 0860 0360 0861 0862 0863 0864 0866 0868 0864 086B 056C 086D 086F 0871 0872 0874 0875 0876 0878 087A 087C 087 0881 0883 0885 0887 0889 088 088B 088C 088 0890 0893 0895 0897 0899 089
78. utilities some educational Included are ALPHA SORT MUSIC ROUTINE STOP WATCHBASIC DUMP MULTIPLY ONE ARM BANDIT Copies Varies up to about 20 Price 7 50 to 10 00 each Includes Apple II cassette and pro gram listing Ordering Info Write for catalog Author s Not specified Available from Apple PugetSound Prog Lib Exch 6708 39th Avenue SW Seattle WA 98136 Name HELP Information Retrieval System KIM 1 Memory Basic KIM 1 Language Assembler and HELP Hardware KIM 1 terminal cassettes Description Permits the user to cre ate a data base on cassette and then perform a variety of searches on the data base May make six simultaneous tests on FLAGS associated with the data plus one test on each of the six data fields Permits very complex retrieval from the data base Includes ULTRATAPE which reads writes at 100 char sec 12 times the normal KIM rate Copies 100 Price 15 00 Includes Cassette tape 36 page User Manual a Source Listing book and a Functions Manual which explains the operation of the HELP language Ordering Info Specify HELP Info Ret Author Robert M Tripp Available from Many 6502 Dealers or The COMPUTERIST Inc P O Box 3 S Chelmsford MA 01824 5 23 1829 BEEPER BLOOPER AND OTHER MICROBES We apologize to the many readers who have experienced problems trying to get the simple KIM Beeper to work There was an error in the listing The cause of the error was trivial th
79. ver several months Sept ct for the Aug Sept issue The ETC AUTHORS MICRO is currently paying 10 page for original articles See Writing for MICRO 4 55 and the Manuscript Cover Sheet 4 34 for basic info The dead line for any issue is about the end of the first week in the month prior to publication e g July 10th for the August September issue MNIGRO LIFE FOR VOUR PET Dr Frank H Covitz Deer Hill Road Lebanon NJ 08833 Since this is the first time I have attempted to set down a machine lang uage program for the public eve I will attempt to be as complete as practical without overdoing it The programs I will document here are concerned with the game of LIFE and are written in 6502 machine language specifically for the PET 2001 8K ver sion The principles apply to any 6502 system with graphic display capa bility and can be debugged as I did on non graphic systems such as the 1 The first I heard of LIFE was in Martin Gardner s Recreational Mathematics section in Scientific American Oct Nov 1970 Feb 1971 As I understand it the game was invented by John H Con way an English mathematician In brief LIFE is a cellular automation scheme where the arena is a rectang ular grid ideally of infinite size Each square in the grid is either occu pied or unoccupied with seeds the fate of which are governed by relative ly simple rules i e the facts of LIF
80. x 1970 This subroutine quickly transfers the contents of Temp and dumps it to the Screen using a dot 81 dec symbol for a live cell a 1 in TEMP and a space 32 dec for the absence of a live cell a 0 in TEMP SCRIMP hex 198A This is the inverse of TMPSCR quickly transferring and encoding data from the screen into TEMP RSTORE hex 19A6 This subroutine fetches the initial addresses high and low for the SCR TEMP and RCS memory spaces 5 6 NXTADR hex 19BD Since we are dealing with 1000 bytes of data we need a routine to increment to the next location check for page cros sing adding 1 to the high address when it occurs and checking for the end The end is signaled by returning a 01 in the accumulator otherwise a 00 is returned via the accumulator TMPRCS hex 19E6 The RCS address space is a copy of the screen used as mentioned before to avoid constant snow on the screen if the screen were being continually ac cessed This subroutine dumps data from TEMP where the new generation has been computed to RCS GENER hex 1A00 We finally arrive at a subroutine where LIFE is actually generated After finding out the number of neighbors of the current RCS data byte from NBRS GENER checks for births CMPIM 03 at hex addr 1 0 if the cell was prev iously unoccupied If a birth does not occur there is an immediate branch to GENADR the data byte remains 00 If the cell was occupied CM

Download Pdf Manuals

image

Related Search

Related Contents

MANUALE DI INSTALLAZIONE ED USO SERIE AMERICA Modelli  2. Descrição da Lavadora  BRACES TROUBLESHOOTING  Graco 332919C User's Manual  Forensic Recovery of Evidence from Deleted Oracle VirtualBox  Sandberg Adapter TV-OUT 6p->Comp+S-Vid  EtherNet/IP Option Card  取扱説明書をPDFで開く  Samsung Galaxy Grand Neo Priručnik za korisnike  

Copyright © All rights reserved.
Failed to retrieve file