11.07.2015 Views

Here - 1000 BiT

Here - 1000 BiT

Here - 1000 BiT

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

LOOKING IN THE KEYBOARD'S BOX<strong>Here</strong> is how to tell if a key is being pressed.There is a memory box which tells if a key is being pressed. Its address is 197.The box holds the number 64 if no key is being pressed.If a key is being pressed, it holds a number from 0 to 63 to tell which one. (If two keysare being pressed, it holds the higher number of the two).Try this:10 REM KEYBOARD'S BOX20 PRINT "clr"30 PRINT "PRESS ANY KEY"40N=PEEK(197]50 PRINT N60 GOTO 40Notice that the number keeps printing as long as you hold the key down.Try holding two keys down at once. The bigger number is the one which is in the box.The only keys which do not put numbers into the box are CTRL, RUN STOP, RESTORE,SHIFT, SHIFT LOCK and the COMMODORE FLAG.Assignment 28A:1. Make a table showing the number in box 197 for each key on the keyboard. (Note:there is no key giving numbers 15, 52, 58, 60, 61 and 63.) This table will be useful whenyou design games.159

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!