Post Reply 
Save/Restore Display Mode
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
Puts current display mode in X (0 = SCI, 1 = FIX, -1 = ENG), and precision in Y.

This one uses the same method but it's shorter and faster:

Code:
01 LBL"SD"
02 0
03 FS? 39
04 SIGN
05 2
06 FS? 38
07 ST+ Y
08 ST+ X
09 FS? 37
10 ST+ Y
11 ST+ X
12 FS? 36
13 ST+ Y
14 CLx
15 FC? 40
16 FS? 41
17 SIGN
18 FS? 41
19 CHS
20 RTN

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"
02 0
03 FS? 39
04 SIGN
05 2
06 FS? 38
07 ST+ Y
08 ST+ X
09 FS? 37
10 ST+ Y
11 ST+ X
12 FS? 36
13 ST+ Y
14 RDN
15 ,1
16 FC? 40
17 FS? 41
18 ST+ Y
19 CLx
20 +
21 FS? 41
22 CHS
23 RTN

24 LBL"RDSP"
25 FRC
26 x>0?
27 FIX IND L
28 x=0?
29 SCI IND L
30 x<0?
31 ENG IND L
32 X<> L
33 END

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Save/Restore Display Mode - Dave Britten - 05-19-2015, 01:06 PM
RE: Save/Restore Display Mode - Dieter - 05-19-2015 06:07 PM
RE: Save/Restore Display Mode - Dieter - 05-21-2015, 12:12 PM



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