(42S) GETKEY Demonstration
|
07-11-2020, 07:30 PM
Post: #1
|
|||
|
|||
(42S) GETKEY Demonstration
Good day everyone, hope everything is well with you today!
How GETKEY Works To find the GETKEY command: PGM.FCN menu ( [ (shift) ] [ 3 ] ), [ ↑ ], (GETK) GETKEY puts the HP 42S on hold and awaits for you to press a key. Whatever key you press returns a key code. Shift+Key combinations are allowed. Key codes start at the upper left hand corner [ Σ+ ] with key code 1, going right then down, to the bottom right hand corner [ + ] with key code 37. Hence: [ Σ+ ] has code 1 [ 1/x ] has code 2 [ √x ] has code 3 [ LOG ] has code 4 and so on. Shift+Key combinations add 37 to the key code. [ (shift) ] [ Σ+ ] has code 38 [ (shift) ] [ 1/x ] has code 39 [ (shift) ] [ √x ] has code 40 [ (shift) ] [ LOG ] has code 41 and so on. There is no key code for the shift key alone. The key code is returned to the X stack, which can be stored and analyzed. Pretty simple. HP 42S/DM42/Free 42 Program: TABU Raw file: tabulate.raw - Download: https://drive.google.com/file/d/1FKl-rWR...sp=sharing Running TABU: You will see a running total, starting with 0. Press [ 1 ] to add 1, [ 2 ] to add 2, or [ 3 ] to add 3 to the total. Any other key will exit the program. Key codes used: [ 1 ]: 29, [ 2 ]: 30, [ 3 ]: 31 Code: 00 { 62-Byte Prgm } HP 42S/DM42/Free 42 Program: BUILD Raw file: build.raw - Download: https://drive.google.com/file/d/1gOg5oCG...sp=sharing Running BUILD: A mathematical statement is generated with two random integers between -100 and 100. The RAN command uses the range 0 ≤ n < 1 with n ≠ 1 for all results. To get the range wanted, I use the subroutine RAN 201 * 100 - IP (integer(201*RAN) - 100) to get the range -100 ≤ n < 101. Key codes used: [ + ]: 37, [ - ]: 32, [ × ]: 27 Any other key repeats the cycle until one of the acceptable keys are pressed. Code: 00 { 150-Byte Prgm } Example results (results will vary): -53 + -32 = -85 93 - 19 = 74 41 × -15 = -615 And that concludes the demonstration on GETKEY. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)