Post Reply 
hp41cx named variables in extended memory
02-29-2020, 12:17 PM
Post: #12
RE: hp41cx named variables in extended memory
[quote='Artur - Brasil' pid='128543' dateline='1582919576']
Here the full version 3.0 - using FLAG 10 for sto/rcl 10-19, BUT, with just 263 bytes, against 323 bytes of version 2.1 and 499 of version 1.0!

How it was possible? I modified the registers mapping from what user sees and how to store them.
Version 2.1:
WANTED X-REG
00 ----> 00
01 ----> 01
...
19 (FLAG 10) --> 19

Version 3.0:
00 --> 00
01 --> 02
02 --> 04
03 --> 06
...
09 --> 18
10 --> 01
11 --> 03
12 --> 05
...
18 --> 17
19 --> 19

And instead of add 10, I removed 1, using DSE, which does not disturb stack! Great!

1 LBL "XREG2"
2 SF 25
3 CRFLD
4 FC?C 25
5 RESZFL
6 CLX
7 SEEKPTA
8 RTN
9 LBL "R0"
10 1
11 GTO 00
12 LBL "R1"
13 3
14 GTO 00
15 LBL "R2"
16 5
17 GTO 00
18 LBL "R3"
19 7
20 GTO 00
21 LBL "R4"
22 9
23 GTO 00
24 LBL "R5"
25 11
26 GTO 00
27 LBL "R6"
28 13
29 GTO 00
30 LBL "R7"
31 15
32 GTO 00
33 LBL "R8"
34 17
35 GTO 00
36 LBL "R9"
37 19
38 LBL 00
39 FC?C 10
40 DSE X
41 SEEKPT
42 CLX
43 GETX
44 RTN
45 LBL "S0"
46 X<> L
47 RDN
48 1
49 GTO 01
50 LBL "S1"
51 X<> L
52 RDN
53 3
54 GTO 01
55 LBL "S2"
56 X<> L
57 RDN
58 5
59 GTO 01
60 LBL "S3"
61 X<> L
62 RDN
63 7
64 GTO 01
65 LBL "S4"
66 X<> L
67 RDN
68 9
69 GTO 01
70 LBL "S5"
71 X<> L
72 RDN
73 11
74 LBL 01
75 FC?C 10
76 DSE X
77 SEEKPT
78 X<> L
79 SAVEX
80 RTN
81 LBL "S6"
82 X<> L
83 RDN
84 13
85 GTO 01
86 LBL "S7"
87 X<> L
88 RDN
89 15
90 GTO 01
91 LBL "S8"
92 X<> L
93 RDN
94 17
95 GTO 01
96 LBL "S9"
97 X<> L
98 RDN
99 19
100 GTO 01
101 END

One further improvement: replace all:
X<> L 2 byte
RDN 1 byte = 3byte*9 = 27byte

For:
XEQ 03 2byte * 9 = 18
...
LBL 03 2
X<> L 2
RDN 1
RTN 1 = 6byte + 18 = 24byte,
only 3 bytes of gain. But one more XEQ and subroutine level.

ARTUR MARIO JUNIOR
BRAZIL
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: hp41cx named variables in extended memory - Artur - Brasil - 02-29-2020 12:17 PM



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