RCA CDP18S711 Cassette Player User Manual


 
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.