RCA CDP18S711 manual IV. Machine Language Programming, VIP Machine Coding

Page 18

19

IV. Machine Language Programming

VIP Machine Coding

For a complete description of machine language instructions, refer to the User Manual for the CDP1802 COSMAC Microprocessor MPM201A. Your COSMAC VIP computer incorporates the following special machine-language input and output instructions:

CODE OPERATION

69Turn display on (Bus -> MX,D)

6B Input port byte + MX,D (Optional)

61Turn display off (MX -> Bus,RX+1)

62MX(LSD) -> Hex keyboard latch, RX+1

63MX -> Output port, RX+1 (Optional)

64MX -> Bus,RX+l

One 64 instruction is always executed by the Operating System. It can also be used in expanded systems if desired. Instructions 65, 66, 67, 6A, 6C, 6D, 6E, and 6F are also available for use in expanded systems.

The External Flag lines are used as follows:

FLAG

USE

EF1

Generated by the video interface

 

(CDPI861)

EF2

Serial data from cassette player

EF3

Hex key pressed signal

EF4

Not used in basic system

EF4 can be used for system expansion. EF3 can also be used in expanded systems if no key will be depressed at the same time that an external device is using EF3. EF1 can only be used by an external device when the display is turned off. EF2 should not be used in expanded systems.

The latched Q line output performs several functions in the COSMAC VIP system. When set, it holds the Q light on and generates a continuous speaker tone. Ile Q line is also used for serial output data to a cassette recorder. You can use the Q output line as a control signal in an expanded system if you avoid conflicts with its normal functions.

You can store a machine language program starting at location 0000. It will be executed when you flip the RUN switch up. Initially P=0, X=0, R0=0000, Q=0, and R1=0XFF, where 0X= last page of on-card RAM. (0X =

07in 2048-byte RAM system). The operating system uses the last 84 bytes of on-card RAM. You should avoid using these last 84 RAM bytes when writing machine language programs. With a 2048-byte RAM, locations 07AC-07FF would be reserved for use by the operating system. Note that Rl initially contains the address of the last on-card RAM byte. Your machine language program can use Rl to determine the amount of RAM in your system when required.

Putting Machine Coding and CHIP-8 Language Together

The operating system and the CHIP-8 language interpreter use a video display format that is 64 bits wide by 32 bits high. This 256-byte display can easily be modified by writing your own video refresh interrupt routine as explained in the CDP1861 data sheet provided in Appendix G. Display formats up to 64 bits wide by 128 bits high are possible with no hardware modification. The 4096-bit picture program in Appendix D uses a machine language refresh interrupt routine that provides a format 64 bits wide by 64 bits high.

Image 18
Contents Page RCA COSMAC VIP CDP18S711 Instruction Manual VIP-311ACKNOWLEDGMENT Contents Contents Continued 1. Getting Started What This Manual CoversThe Power Supply What You See Turning It On1. Getting Started Using the Operating System 11.COSMAC VIP OperationMemory Write Memory Read Tape WriteTape Read Testing Your Cassette System 11.COSMAC VIP OperationHow to Change and Use the Variables III.CHIP-8Language ProgrammingBranch Instructions Using the Display Instructions 0206 D125 SHOW 5MI@VlV2 0208 1208 GO 020A F090 III. CHIP-8 Language Programming0200 A20A I=020A 0202 6100 V1=00 0204 6200 V2=00 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 V. Logic Description How Memory Is AddressedHow 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 ConnectionsUsing the Expansion Interface Some Expansion IdeasI RCA COSMAC VIP Instruction Manual Pin Signal V1. Expansion Considerations and ConnectionsTable III - External Option Terminal Connections 2.Composing poetry or pictures with printer output Signal Tracing VIL Troubleshooting HintsOther Problems No SoundLast Resorts Appendix A - Test and Operating Data Byte Pattern for Displaying COSMACBeeper Program Cassette Attachment Diagram Cassette Phase Test SignalsTest Program Cassette Data Test Cassette Recording Guidelines Memory Test ProgramAppendix B - Operating System Operating System ListingOperating System Register Table Operating System SummaryR3 = Machine Language Subroutine Program Counter Appendix C - CHIP-8Interpreter CHIP-8Interpreter ListingCHIP-8Memory Map CDP1802 Register Use for CHIP-8Interpreter Appendix C - CHIP-8Interpreter CHIP-8User Notes RCA COSMAC VIP Instruction ManualPage 1. VIP Kaleidoscope 2. VIP Video Display Drawing Game Fig. E-1Microprocessor and Display Interface Appendix E - Logic DiagramsFig. E-5Power Supply Circuit and Byte 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 2.Parts List for RCA COSMAC VIP CDP18S711 Board Layout, Parts List, and Expansion NotesAppendix F 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