Post Reply 
(34S) Full Key Scan Map w/ A-Z to 1-26 conversion [highly compressed; <37 steps!]
08-26-2016, 02:14 PM (This post was last modified: 08-27-2016 12:11 AM by Nick.)
Post: #1
(34S) Full Key Scan Map w/ A-Z to 1-26 conversion [highly compressed; <37 steps!]
This key scan / menu converts letters A-Z to 1-26 with the exception of Y which is firmware reserved (substitute any key/chord of your choice for Y/25). The design uses exclusion and accumulating offsets for compression.

If you desire values other than 1-26, insert your additional offset after line 25 (ex. to convert to ASCII).

If you can compress it further, I'd love to see it and learn some new tricks.

The demo returns 1-26 for A-Z and negative values for the remaining scan codes. Insert your code everywhere you like!

Enjoy,
Nick

Code:
01 LBL 'KEY'
02 LBL 00
03 VIEW X
04 PSE 99
05 KEY? X
06 GTO 00
07 LBL?->X
08 GTO->X
09 ENTER
10 SDR 001
11 IP
12 GTO->X
13 LBL 01
14 DEC Y
15 DEC Y
16 LBL 03
17 LBL 04
18 DEC Y
19 LBL 02
20 LBL 05
21 LBL 06
22 LBL 07
23 # 007
24 *
25 -
26 GTO 00
27 LBL 24
28 LBL 25
29 LBL 26
30 LBL 31
31 LBL 35
32 LBL 41
33 LBL 51
34 LBL 61
35 LBL 62
36 LBL 72
37 +/-
38 GTO 00
39 RTN

Comments:

All labels shown (except KEY and 00) are required due to the alpha conversion formula's use of exclusion. If you're not using them, they still need to be in place and you can simply route them to no-action/loop as a group.

Insert your code to respond to A-Z between 25 and 26 including any further offset(s) (ex. ASCII). Step 26 loops to repeat the demo.

Insert your code for other keys after labels at steps 27 through 36, adjusting branching as desired. Step 37 denotes scan codes for the demo and can be removed. Step 38 loops to repeat the demo.

Edit: Updated Subject from 39 to 37 steps!
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(34S) Full Key Scan Map w/ A-Z to 1-26 conversion [highly compressed; <37 steps!] - Nick - 08-26-2016 02:14 PM



User(s) browsing this thread: 1 Guest(s)