Commodore Computer C16 Instrukcja Użytkownika Strona 9

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 14
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 8
READING THE KEYBOARD
The easiest way to read the keyboard from Basic is to use the GET or GETKEY
commands. Here is a third way: PEEK(198). The computer checks the keyboard every
60th of a second and stores a value corresponding to the key pressed at memory
location 198. The stored value is a bit pattern of the keyboard matrix, not a PET-
ASCII or screen value of the key. Below is a list of all the values. For example,
if you like to test the F1 key: IF PEEK(198)=4 THEN...
=================================================
Key Value Key Value
=================================================
Esc 52 Run/Stop No Effect
1 56 Shift Lock No Effect
2 59 a 10
3 8 s 13
4 11 d 18
5 16 f 21
6 19 g 26
7 24 h 29
8 27 j 34
9 32 k 37
Left Arrow 48 l 42
Right Arrow 51 : 45
Up Arrow 43 ; 50
Down Arrow 40 * 49
Inst/Del 0 Return 1
-------------------------------------------------
Ctrl No Effect Commodore No Effect
q 62 Left Shift No Effect
w 9 z 12
e 14 x 23
r 17 c 20
t 22 v 31
y 25 b 28
u 30 n 34
i 33 m 36
o 38 , 47
p 41 . 44
@ 7 / 55
+ 54 Right Shift No Effect
- 46 £ 2
Clear/Home 57 = 53
-------------------------------------------------
F1 4 Space 60
F2 5 No key 64
F3 6
Help 3
-------------------------------------------------
LIMITING THE BASIC MEMORY
LET'S START WITH THE END
Basic programs use the free memory while running. If you have stored your own
machine language programs into the memory or your own character set, you have to
inform Basic not to use that area of memory, or otherwise Basic will overwrite
your machine language programs or your character set with temporary data.
To protect your machine language programs and/or your custom character set, the
easiest way is to place them at the end of the memory and to inform Basic that the
memory available for Basic ends right before your machine language programs and/or
custom character set begins.
The highest address of Basic memory can be read and set through memory
locations 55 and 56. Location 55 contains the lower 8 bits of the address and 56
the upper 8 bits.
To read the current "Top of Basic memory" (=end position), type the following line
in Basic and press Return:
PRINT PEEK(55) + PEEK(56) * 256
To protect your machine language programs and/or custom character set, follow
9
Przeglądanie stron 8
1 2 3 4 5 6 7 8 9 10 11 12 13 14

Komentarze do niniejszej Instrukcji

Brak uwag