Commodore PET User Manual page 188

Table of Contents

Advertisement

When vou press additional keys while the A is being displayed. the addi-
tional characters are stored in the keyboard buffer beginning at the next available
location. Suppose vou type in A and while A is being displayed vou type in B. C.
D. and E. These characters are ail stored in the keyboard buffer:
Keyboard
Buffer
A
2
B
3
C
4
D
5
E
6
7
8
9
10
If Vou let the program continue, it will successively display ail the letters
stored in the keyboard buffer. After A is finished. the program fetches Band dis-
plays it across the 20 lines. then it fetches C and displays it etc.
What happens if vou type in more than ten characters? At the tenth
character the buffer pointer wraps around, and continues storing the characters
being keyed in from position 1 of the buffer. If vou type in the first eleven letters of
the alphabet A-K. the first ten letters are stored in the ten buffer locations. then
the letter K is stored back in the first buffer location. overlaying the A:
Keyboard
Buffer
2
3
4
5
6
7
8
9
10
K
~
B
C
D
E
F
G
H
1
J
K overlays the A
When the program finishes displaying the A, it returns to fetch another
character. But the PET has already fetched the character in location 1, so it con-
siders the buffer empty! Keying in exactly eleven characters, or multiples of
775

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cbm

Table of Contents