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

Models: CDP18S711

1 55
Download 55 pages 39.85 Kb
Page 18
Image 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.

Page 18
Image 18
RCA CDP18S711 manual IV. Machine Language Programming, VIP Machine Coding