Commodore 128 Programmer's Reference Manual page 264

Hide thumbs Also See for 128:
Table of Contents

Advertisement

0
254
COMMODORE 128
editor. You will enter the program into a memory location number (address) in the
'—'
Machine Language Monitor. In this case, the program is stored in memory starting at
address $0C00. Line 1120 specifies this start address with:
j
* = $ocoo
^
Here's an instruction-by-instruction explanation of the scrolling split screen program.
x ,
Line 1010 assigns the variable IVEC to the address $0314, the hardware interrupt
j j
request (IRQ) vector. The interrupt vector is the means by which the Commodore 128
^
displays split screens and scrolling. By wedging your own routine into the hardware
interrupt vector (in this case scrolling and splitting the screen), it enables you to perform
] j
operations that usually take too long for the microprocessor to perform under an
lJ
application program not using interrupts. The interrupt vector is checked for an interrupt
routine every 60th of a second. In this program, the screen is split 60 times per second,
( ,
so it appears you have two different screens displayed at the same time. You could not
M
split the screen without requesting an interrupt; the microprocessor is not able to perform
all the required operations fast enough to keep up with the raster scan of the video
controller. The speed that the screen is continually updated, known as the raster scan,
I |
also occurs at the speed of 60 times per second. For a split screen to occur, you tell the
^-J
computer the point on the screen where one type of display ends and the new one (bit
map for example) begins. The way you tell the computer this is by placing the number
j i
of a pixel row, also called a raster row, in the raster compare register located at address
[J
$D012. Line 1030 assigns this address to the variable RASTRO.
You'll see later in the program that the value placed in the Raster Compare Register
{ i
starts the text screen at raster row 201. The raster scan is again interrupted at raster row
M
50 at the top of the screen to display the bit map screen. This is repeated 60 times every
second, so it appears to the human eye that two different display modes are active at the
same time.
j
On with the program explanation. Line 1040 defines the BACOL variable for the
^
background color register zero, located at address $D021. Line 1050 assigns the variable
POINT to location $1802. POINT is used to store the raster row value where the text
j j
screen begins. Line 1060 assigns the variable FLAG to location $FC. FLAG is used later
U
in the program (lines 2200-2270) to determine where the interrupt occurred, either raster
row 50 or raster row 200.
\ j
Lines 1070 and 1080 assign the variables FLAG2 to location $FD and SCROLL to
(J
location $FE respectively. Both FLAG2 and SCROLL store the value of the scrolling
register. SREG is assigned to location $D016, the scrolling register. Only bits 0 through
>
2 are used as the scrolling bits. The other bits in this address are used for other
i
purposes. Three scrolling bits are necessary since characters that are scrolled are moved
over seven pixels then shifted to the next character position to the left or right, then
scrolled smoothly again seven more pixels.
j j
Line 1100 assigns the variable TXTPTR to address $FA. This variable marks the
^
starting address in memory where the scrolled characters are stored.
As was mentioned earlier, line 1120 specifies where the program storage begins in
( 1
memory. This is the address where the execution of the program begins in memory. You
LJ

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents