(41CX, DM41X): Assign User Keys Through a Program
|
08-07-2022, 05:52 PM
Post: #1
|
|||
|
|||
(41CX, DM41X): Assign User Keys Through a Program
Introduction - Template
Give the user a choice to clear or load the user keys: LBL ^T (main name of the program) ^T 0 CLR 1 LOAD PROMPT STO 00 GTO IND 00 Fortunately we can use indirect addressing with the GTO command. This section clears all the keys. I put a DONE message to tell the user that the process is done. LBL 00 CLRKEYS ^T DONE AVIEW RTN This section loads the commands and programs to user keys. Detailed programs will follow. LBL 01 ^T (program or command name) (key code) PASN ... RTN Now for the programs and calculations created: LBL ^T (program or command name) (contents) RTN ... END Add an END command after the last RTN. The Program UFX The program UFX presents the user with two options: enter 0 to clear all the user keys. Entering 1 loads the following functions: SSPH: Surface area of a sphere. Assigned to the user key [ Σ+ ], key code 11. Surface area of a sphere = 4 * π * x^2 VSPH: Volume of a sphere. Assigned to the user key [ x<>y ], key code 21. Volume of a sphere = 4/3 * π * x^3 STOR: Surface area of a torus. Assigned to the user key [ 1/x ], key code 12. Surface area of a torus = 4 * π * y * x y = larger radius, x = smaller radius VTOR: Volume of a torus. Assigned to the user key [ R↓ ], key code 22. Volume of a torus = 2 * π^2 * y * x^2 y = larger radius, x = smaller radius Code: Code: (^T: alpha string indicator) Source for the Torus formulas: Mathematics Program Library: Sinclair Enterprise Programmable Sinclair Radionics Inc. New York; Cambridgeshire, London. 1975 |
|||
08-07-2022, 08:36 PM
Post: #2
|
|||
|
|||
RE: (41CX, DM41X): Assign User Keys Through a Program
It looks like you're not using Reg 00 again; so instead of STO 00, GTO IND 00, can you just do GTO IND X? (Press the decimal point before X to specify that you're not doing a numbered register.)
Instead of AVIEW, RTN, how about just PROMPT? http://WilsonMinesCo.com (Lots of HP-41 links at the bottom of the links page, at http://wilsonminesco.com/links.html#hp41 ) |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)