RCA CDP18S711 manual Some Program Ideas, CHIP-8Language Programming

Page 16

111. CHIP-8 Language Programming

17

lose the CHIP-8 interpreter and will have to reload it. You can insert stopping points in your program for debugging purposes. Suppose you want to stop and examine variables when your program reaches the instruction at 0260. Just write a 1260 instruction at location 0260. Flip RUN down and use operating system mode A to examine variables V0-VF. The memory map in Appendix C shows where you can find them.

After the above practice you are ready to design more sophisticated CHIP-8 programs. Always prepare a flowchart before actually writing a program. The last 352 bytes of on-card RAM are used for variables and display refresh. In a 2048-byte RAM system you can use locations 0200-069F for your programs. This area is enough for 592 CHIP-8 instructions (1184 bytes). In a 4096-byte RAM system you can use locations 0200-0E8F. This area is equal to 1608-CHIP-8 instructions (3216 bytes).

Some Program Ideas

Here are a few ideas for programs to write using the CHIP-8 language:

1.INTOXICATION TESTER - Display a six digit random number on the screen for several seconds. You must remember this number and enter it from the keyboard within ten seconds after the screen goes blank to prove that you're sober and score.

2.NUMBER BASE QUIZ - Display numbers in binary or octal on the screen. You must enter their decimal equivalent to score points.

3.DICE - Push any key to simulate rolling dice displayed on the screen.

4.PUPPETS - Show large face on the screen. Let small children move mouth and roll eyes by pushing keys.

rBUSY BOX - Let small children push keys to make different object appear on the screen, move, and make sounds.

6.SHUFFLEBOARD - Simulate shuffleboard type games on the screen.

7.COMPUTER ART - Design new programs to generate pleasing geometric moving patterns on the screen.

8.INVISIBLE MAZE - Try to move a spot through an invisible maze. Tones indicate when you bump into a wall.

9.LUNAR LANDING - Program a graphic lunar landing game.

10.COLLIDE - Try to maneuver a spot from one edge of the screen to the other without hitting randomly moving obstacles.

Il. CAPTURE - Try to chase and catch randomly moving spots within a specified time limit.

12.LEARNING EXPERIENCES - Program graphic hand and eye coordination exercises for young children or those with learning disabilities.

13.NUMBER RECOGNITION - Show groups of objects or spots on the screen. Young child must press key representing number of objects shown to score.

WALL BALL - Program a wall-ball-type paddle game for one player.

15.FOOTBALL - Each player enters his play via the hex keyboard and the computer moves the ball on the screen.

16.BLACKJACK - Play "21" against the com puter dealer.

17.HOLIDAY DISPLAYS - Design custom, animated displays for birthdays, Halloween, Christmas, etc.

18.METRIC CONVERSION - Help children learn metric by showing lengths on screen in inches and requiring centimeter equivalent to be entered to score.

19.TURING MACHINE - Simulate a simplifed Turing machine on the screen.

20.TIMER - Use the computer to time chess games, etc.

21.HEXAPAWN - Program Hexapawn so that the computer learns to play a perfect game.

22.NIM - Program Nim with groups of spots shown on the screen.

23.BLOCK PUZZLES - You can simulate a variety of sliding block-type puzzles on the screen.

24.BOMBS AWAY - Show a moving ship at the bottom of the screen. Try to hit the ship by releasing bombs from a moving plane at the top of the screen.

Image 16
Contents Page RCA COSMAC VIP CDP18S711 Instruction Manual VIP-311ACKNOWLEDGMENT Contents Contents Continued 1. Getting Started What This Manual CoversThe Power Supply Turning It On What You See1. Getting Started 11.COSMAC VIP Operation Using the Operating SystemMemory Write Tape Write Memory ReadTape Read Testing Your Cassette System 11.COSMAC VIP OperationIII.CHIP-8Language Programming How to Change and Use the VariablesBranch Instructions Using the Display Instructions III. CHIP-8 Language Programming 0200 A20A I=020A 0202 6100 V1=00 0204 6200 V2=000206 D125 SHOW 5MI@VlV2 0208 1208 GO 020A F090 020C F090 020E F000Applying CHIP-8 Some Program Ideas 111. CHIP-8Language Programming25.PROGRAMMED SPOT - Introduce children to programming concepts by letting them preprogram the movements of a spot or object on the screen IV. Machine Language Programming VIP Machine CodingMachine Language Programming Summed Up How Memory Is Addressed V. Logic DescriptionHow the Input/Output Works pressed. A 62 machine instruction causes the least significant 4 bits of memory byte to be latched into U13. These 4 bits are decoded to bring one of the 16 U13 output lines low. If the key that corresponds to this output line is pressed, the CDPI802 EF3 input will go low. The 4-bitcodes latched into U13 correspond to the equivalent key positions. After the program send8 a 4-bitcode to U13, it subsequently examines the EF3 line to see if the key corresponding to this code is pressed or not. In this manner, a program can determine when any specific key is pressed or can sequentially scan all keys while waiting for any one to be pressed. Key debounce delays must be provided in the program when required. A program can also cause a speaker tone to occur when a key is pressed. Only one key at a time should be pressed with this method of interfacing the keyboard Using the Byte Input/Output V1. Expansion Considerations and ConnectionsSome Expansion Ideas Using the Expansion InterfaceI RCA COSMAC VIP Instruction Manual V1. Expansion Considerations and Connections Pin SignalTable III - External Option Terminal Connections 2.Composing poetry or pictures with printer output VIL Troubleshooting Hints Other ProblemsSignal Tracing No SoundLast Resorts Byte Pattern for Displaying COSMAC Appendix A - Test and Operating DataBeeper Program Signals Cassette Attachment Diagram Cassette Phase TestTest Program Cassette Data Test Cassette Recording Guidelines Memory Test ProgramAppendix B - Operating System Operating System ListingOperating System Summary Operating System Register TableR3 = Machine Language Subroutine Program Counter Appendix C - CHIP-8Interpreter CHIP-8Interpreter ListingCDP1802 Register Use for CHIP-8 CHIP-8Memory MapInterpreter Appendix C - CHIP-8Interpreter CHIP-8User Notes RCA COSMAC VIP Instruction ManualPage 1. VIP Kaleidoscope 2. VIP Video Display Drawing Game Appendix E - Logic Diagrams Fig. E-5Power Supply Circuit and ByteFig. E-1Microprocessor and Display Interface CircuitsPage Fig. E-2- ROM Circuits and Expansion Interface Appendix E - Logic DiagramsPage Fig. E-4- RAM Circuits Appendix E - Logic DiagramsRCA COSMAC VIP Instruction Manuel RCA COSMAC VIP Instruction Manual Board Layout, Parts List, and Expansion Notes Appendix F2.Parts List for RCA COSMAC VIP CDP18S711 1.Printed Circuit Board LayoutRCA COSMAC VIP Instruction Manual Page 2. Parts List for RCA COSMAC VIP CDP18S711 Page RCA COSMAC VIP Instruction Manual Resistors - Supplied 1 /4 W except as notedPage 3. COSMAC VIP Expansion Notes