Classic Computer Magazine Archive COMPUTE! ISSUE 77 / OCTOBER 1986 / PAGE 10

Numeric Keypad In 64 Mode

I have just acquired a Commodore 128. Since the numeric keypad does not work in 64 mode, I would like to know if you have any ideas of how to make it operable.

John Ballato

Here is a program that does what you want. It's taken from COMPUTE!'s 128 Programmer's Guide, available from COMPUTE! Books.

100 FOR AD = 830 TO 949 : READ {SPACE} BY : CK = CK + BY
110 POKE AD, BY : NEXT
120 IF CK <> 13099 THEN PRINT TAB(7) "{RVS} ERROR IN {SPACE} DATA STATEMENTS {SPACE}" : STOP
130 SYS 830 : PRINT "{2 DOWN} * * NUMERIC KEYPAD IS NOW ACTIVE ** {2 SOWN}"
140 NEW
830 DATA 120, 169, 75, 141, 20, 3, 169, 3, 141, 21
840 DATA 3, 88, 96, 169, 248, 141, 47, 208, 169, 255
850 DATA 141, 0, 220, 205, 1, 220, 208, 10, 141, 47
860 DATA 208, 74, 141, 0, 220, 76, 49, 234, 160, 0
870 DATA 140, 141, 2, 169, 251, 141, 47, 208, 162, 8
880 DATA 173, 1, 220, 205, 1, 220, 208, 248, 74, 144
890 DATA 9, 200, 202, 208, 249, 110, 47, 208, 176, 234
900 DATA 185, 157, 3, 16, 7, 162, 1, 142, 141, 2
910 DATA 41, 127, 133, 203, 169, 255, 141, 47, 208, 32
920 DATA 72, 235, 76, 126, 234, 64, 35, 44, 135, 7
930 DATA 130, 2, 64, 64, 40, 43, 64, 1, 19, 32
940 DATA 8, 64, 27, 16, 64, 59, 11, 24, 56, 64

Be sure to save the program before you run it, since it erases itself. The program mimics the computer's own keyscan routine to read the numeric keys and the new row of cursor keys. To activate the keypad, enter Commodore 64 mode, load the program, and run it. The numeric keypad keys now act exactly like the normal number keys (however, CTRL, SHIFT, and the Commodore key have no effect on them). RUN/STOP-RESTORE disconnects the program; enter SYS 830 to restart it.