RCA CDP18S711 manual Machine Language Programming Summed Up

Page 19

20

The CHIP-8 language described in the previous section, permits machine language subroutines to be called with a 0MMM instruction. A D4 machine language instruction at the end of the machine language subroutine returns control to the CHIP-8 instruction following the 0MMM instruction. In Appendix C, the CDP1802 register use for the CHIP8 language is provided. R5 is used as the CHIP-8 program counter. When you call a machine language subroutine with a 0MMM instruction, R5 will be addressing the CHIP-8 instruction following the 0MMM. The machine language subroutine could retrieve the next two CHIP-8 program bytes as parameters by addressing with R5 and incrementing it by 2 before returning control to the CHIP-8 program with a D4 instruction. RC, RD, RE, and RF are available for use in machine language subroutines. RA is the CHIP-8 memory pointer (1). Changing the high-order byte of RB will cause any desired RAM page to be displayed. R3 is the machine language subroutine program counter.

CHIP-8 uses the operating system refresh interrupt routine contained in ROM for display. You can use this ROM interrupt routine for 256-byte display in your own machine language programs. First initialize R1 to 8146 and R2 as a stack pointer before turning on the video interface with a 69 instruction. Set the desired display page into RB.1. This interrupt routine uses R0 as the display refresh pointer and modifies RB.0. R8.1 and R8.0 are decremented by 1 during each interrupt unless they are equal to 00. Interrupts occur 60 times per second when the video interface is turned on. This rate is controlled by a crystal clock so that R8.0 and R8.1 can be used as real-time clocks when needed. -

RCA COSMAC VIP Instruction Manual

While the video interface is turned on, you should not use any of the 3-machine-cycle CDP1802 instructions (except those used for sync in the refresh interrupt routine itself). If you are not using the video interface, then you can use the CDP1802 3-cycle instructions in your machine language programs. When you initiate a machine language program at 0000 by flipping RUN up, the video interface will be off. You must turn it on with a 69 instruction to use the COSMAC VIP graphic display capability.

Machine Language Programming Summed Up

In summary, COSMAC VIP provides you with an easy-to-use language called CHIP-8. You can insert machine language subroutines in CHIP-8 programs for greater flexibility or expanded I/0 capability. You can write complete machine language programs to fully utilize CDP1802 capabilities. The operating svstem facilitates debugging machine language programs by permitting you to examine general registers R3-RF. (See operating system register table in Appendix B). Advanced programmers can even develop their own, interpretive language tailored to special requirements. Direct execution of machine language code starting at location 0000 together with the expansion interface permits the COSMAC VIP system to be used as a low-cost development system as well as a personal recreational or educational computer.

Image 19
Contents Page VIP-311 RCA COSMAC VIP CDP18S711 Instruction ManualACKNOWLEDGMENT Contents Contents Continued What This Manual Covers 1. Getting StartedThe Power Supply Turning It On What You See1. Getting Started 11.COSMAC VIP Operation Using the Operating SystemMemory Write Tape Write Memory ReadTape Read 11.COSMAC VIP Operation Testing Your Cassette SystemIII.CHIP-8Language Programming How to Change and Use the VariablesBranch Instructions Using the Display Instructions 020C F090 020E F000 III. CHIP-8 Language Programming0200 A20A I=020A 0202 6100 V1=00 0204 6200 V2=00 0206 D125 SHOW 5MI@VlV2 0208 1208 GO 020A F090Applying CHIP-8 111. CHIP-8Language Programming Some Program Ideas25.PROGRAMMED SPOT - Introduce children to programming concepts by letting them preprogram the movements of a spot or object on the screen VIP Machine Coding IV. Machine Language ProgrammingMachine 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 V1. Expansion Considerations and Connections Using the Byte Input/OutputSome 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 No Sound VIL Troubleshooting HintsOther Problems Signal TracingLast Resorts Byte Pattern for Displaying COSMAC Appendix A - Test and Operating DataBeeper Program Signals Cassette Attachment Diagram Cassette Phase TestTest Program Cassette Data Test Memory Test Program Cassette Recording GuidelinesOperating System Listing Appendix B - Operating SystemOperating System Summary Operating System Register TableR3 = Machine Language Subroutine Program Counter CHIP-8Interpreter Listing Appendix C - CHIP-8InterpreterCDP1802 Register Use for CHIP-8 CHIP-8Memory MapInterpreter Appendix C - CHIP-8Interpreter RCA COSMAC VIP Instruction Manual CHIP-8User NotesPage 1. VIP Kaleidoscope 2. VIP Video Display Drawing Game Circuits Appendix E - Logic DiagramsFig. E-5Power Supply Circuit and Byte Fig. E-1Microprocessor and Display InterfacePage Appendix E - Logic Diagrams Fig. E-2- ROM Circuits and Expansion InterfacePage Appendix E - Logic Diagrams Fig. E-4- RAM CircuitsRCA COSMAC VIP Instruction Manuel RCA COSMAC VIP Instruction Manual 1.Printed Circuit Board Layout Board Layout, Parts List, and Expansion NotesAppendix F 2.Parts List for RCA COSMAC VIP CDP18S711RCA COSMAC VIP Instruction Manual Page 2. Parts List for RCA COSMAC VIP CDP18S711 Page Resistors - Supplied 1 /4 W except as noted RCA COSMAC VIP Instruction ManualPage 3. COSMAC VIP Expansion Notes