Commodore 128 Programmer's Reference Manual page 268

Hide thumbs Also See for 128:
Table of Contents

Advertisement

258
COMMODORE 128
U
|!
Once the X and Y registers have been decremented to zero, the TXTPTR is
U
incremented in line 1890 so that subsequent characters such as 'THIS IS AN EXAM
PLE . . ." can be scrolled. In the first 39 cycles through the loop (in lines 1840 through
\ /
1880) 39 spaces are shifted (scrolled) one character position on the twenty-third character
[J
row on the screen. The next 39 cycles shift 38 spaces and the letter "T" in "THIS" one
character position across the screen. The next 39 cycles, 37 spaces and the letters "TH"
in 'THIS" are shifted in memory and scrolled one character position on the screen and
j
so on. This process occurs until all characters in the data (in lines 2040 through 2130)
i-J
are scrolled.
Line 1900 branches to the label MVTIME while TXTPTR (the low byte of the
U
start of scrolled data) is greater than zero, otherwise TXTPTR +1 incremented to update
the high byte. Lines 1920 through 1970 check to see if the text pointers are at the end of
»
the scrolled character data ($0D70 in the assembled program). If the pointers are not at
| f
the end of the character data, the program branches to the label CHECK and the data is
^
shifted by the VIC chip by seven pixels and the scrolling process repeats again. If the
text pointers are at the end of the scrolled character data, lines 1980 through 2010 set the
{ I
text pointers to the beginning of the scrolled data in memory and the process is repeated
tj
continuously as specified by the JMP CHECK instruction.
Lines 2040 through 2130 represent the data to be scrolled by the program. The
jj
data is stored in .BYTE statements as it appears in the Commodore Assembler 64
Development System. In your case, the Machine Language Monitor handles data by
simply storing it in an absolute memory range. In the assembled object code program
\
the data turns out to be stored in the range $0C98 through $0D70. You will refer to the
u
data with these addresses and not with a label as in this explanation.
THE INTERRUPT SERVICE ROUTINE
U
The program instructions in lines 2170 through the end of the program make up the
\ .
interrupt service routine. Depending upon the value of the raster comparison, particular
) f
segments of the routine are executed upon the detection of an interrupt. For instance, if
the result of the raster comparison detects an interrupt to occur at raster row 49, lines
2290 through 2560 are executed. This selects bit map mode and performs additional
\ j
functions that are explained in a moment. If the raster comparison detects the interrupt
LJ
to occur at raster row 201, lines 2590 through 2900 are executed. These instructions
select standard character mode, among other things. Keep in mind that both segments of
/
the interrupt service routine are executed within a single, complete raster scan of the
^
screen sixty times per second. Instructions 2170 through 2270 are always executed when
an interrupt occurs.
The instruction in line 2170 clears the raster compare IRQ flag after the interrupt
j ■)
has occurred. The address of the label MINE, which is loaded into the IRQ vector in
U
lines 1480 through 1510, tells the 8502 where the interrupt service routine resides upon
the occurrence of an interrupt. In the assembled object code, this is an absolute address
I !
($0D71).
\J
u

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents