Save/Restore Display Mode
|
05-19-2015, 01:06 PM
(This post was last modified: 05-19-2015 01:07 PM by Dave Britten.)
Post: #1
|
|||
|
|||
Save/Restore Display Mode
This program will save the current display mode (FIX/SCI/ENG and precision) to the stack, or restore same from the stack. Store the output values into temporary registers, and recall them at the end of your program to restore the original display mode.
SD - Save Display Puts current display mode in X (0 = SCI, 1 = FIX, -1 = ENG), and precision in Y. Code: 01 LBL SD RD - Restore Display Restores display settings from stack values. Place display mode in X (0 = SCI, 1 = FIX, -1 = ENG), and precision in Y, then XEQ RD. Code: 29 LBL RD |
|||
05-19-2015, 06:07 PM
(This post was last modified: 05-19-2015 07:02 PM by Dieter.)
Post: #2
|
|||
|
|||
RE: Save/Restore Display Mode
(05-19-2015 01:06 PM)Dave Britten Wrote: SD - Save Display This one uses the same method but it's shorter and faster: Code: 01 LBL"SD" BTW, I really do not use synthetic programming very much, but in this case I would prefer a simple RCL d / STO d. ;-) Addendum: Here's another version that returns the display mode in a single number, i.e. only one register is required. The integer part of the "mode code" represents the number of digits while the fractional part is 0 (FIX), 1 (SCI) or –1 (ENG). So 4.1 stands for FIX 4, 7.0 means SCI 7 and –5.1 is ENG 5. Code: 01 LBL"SDSP" Dieter |
|||
05-20-2015, 01:45 AM
Post: #3
|
|||
|
|||
RE: Save/Restore Display Mode
Store display mode from the PPC ROM P.400 ...
"SD" saves flags 16-55 in a register defined by X, so that the user may then change the contents of register d (particularly display format and trig mode) during a program yet, have the capability of restoring the original format at the end of the program by by calling "RD". Code: LBL "SD" Store Display mode Complete Instructions for SD 1. Insert into X a register number. 2. XEQ "SD" 3. After execution of the program, the register that was chosen will contain an alpha string consisting of a star and the final five bytes of register d. 4. The same register number, followed by XEQ "SD", will restore the previous status of flags 16-55 (just prior to XEQ "SD"). 5. "SD" saves Y, Z, and T in X, Y, and Z. X is placed in L. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Recall display mode, from the PPC ROM P.374 ... "RD" is designed to be used to restore the status of flags 16-55 of register d after "SD" was used to save them. "RD" maintains the status of flags 0-15 when restoring the remaining flags. If you should wish to clear flags 0-15, execute "RF" , then "RD". Code: LBL "RD" Recall Display mode Complete Instructions for RD 1. Insert into X the number of the register that was initialized by "SD". 2. XEQ "RD" to restore flags 16-55. 3. "RD" saves Y, Z, and T in X, Y, and Z. X is placed in L. |
|||
05-21-2015, 12:12 PM
Post: #4
|
|||
|
|||
RE: Save/Restore Display Mode
(05-20-2015 01:45 AM)Sylvain Cote Wrote: Store display mode from the PPC ROM P.400 ... SD and RD store resp. restore most of the 41C mode settings. So not only the display settings are affected (that's merely flags 28/29 and 36-41), but also printer mode (21), data/alpha entry (22/23), overflow and general error flags (24/25), sound setting (26), user mode (27), trig mode (42/43), alpha mode (48) and others. Only flags 00...15 are not affected, which includes some internally used mode flags (e.g. 11..14). I assume this is because SD turns the content of register d into an alpha string (probably to avoid changes due to normalisation), so that two bytes of the original content are lost. However, the important point is that SD and RD also affect many other settings, not just the display mode as their names suggest. Dieter |
|||
05-22-2015, 12:25 AM
Post: #5
|
|||
|
|||
RE: Save/Restore Display Mode
(05-21-2015 12:12 PM)Dieter Wrote: However, the important point is that SD and RD also affect many other settings, not just the display mode as their names suggest. You are perfectly right Dieter and I should have pointed this out, sorry about that. Here is the list of the flags and their usage as described in P7 of the Synthetic QRG by Jeremy Smith. Sylvain |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)