xrpn 2.7 → 2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +8 -1
- data/xcmd/isg +1 -1
- data/xlib/_xrpn_version +1 -1
- data/xlib/bei +8 -3
- data/xlib/raw_encoder +3 -3
- data/xrpn.gemspec +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 227fdefaae8453dcf1ae2a78f78e553d8cd4e815ee4d5091626f4a92135714f9
|
|
4
|
+
data.tar.gz: a2e80c27d0193de2f5b3ee7d24958f1bfe70f7a8819c8a1a0e9d54a3e61efb84
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 409299fdc536bffb61dc142ec74cec2ab5ef4895d096103b8d9029dc191fcb23955bdb7b371a9ddf96958ea2f71731bd4b93a4cbcfba6436e023e967e166d506
|
|
7
|
+
data.tar.gz: 900b051ab8436b0b4ae78bc189b33cf4cbf55ad1ab1f6a11134cee4bd7204a5315b10c4aee9cd99919563dba84d85db4291541a2679023c04a71e5e54d032361
|
data/README.md
CHANGED
|
@@ -120,7 +120,14 @@ See `raw.md` for complete technical documentation.
|
|
|
120
120
|
|
|
121
121
|
## Changelog
|
|
122
122
|
|
|
123
|
-
### Version 2.
|
|
123
|
+
### Version 2.8 (Latest)
|
|
124
|
+
**ISG / control-number fixes**
|
|
125
|
+
|
|
126
|
+
- **ISG now increments** — `ISG` ("Increment, Skip if Greater") was decrementing the counter (DSE's behaviour), so count-up loops ran backwards. It now increments and skips the next step when the counter exceeds the end value.
|
|
127
|
+
- **Robust control-number decode** — the `ccc.fffii` decode (`x2bei`) now scales by 100000 and rounds once, so binary-float dust no longer mis-reads controls like `1.003` (previously decoded with end=2 instead of 3).
|
|
128
|
+
- The same corrected semantics ship in the nomad mobile XRPN calculator.
|
|
129
|
+
|
|
130
|
+
### Version 2.7
|
|
124
131
|
**HP-41 RAW Import/Export - 100% Success!**
|
|
125
132
|
|
|
126
133
|
- **Complete HP-41 RAW import/export** - RAWIMPORT and RAWEXPORT commands with 100% decode rate on real HP-41 programs
|
data/xcmd/isg
CHANGED
data/xlib/_xrpn_version
CHANGED
data/xlib/bei
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
def x2bei (x)
|
|
2
|
-
|
|
3
|
-
e
|
|
4
|
-
|
|
2
|
+
# Decode a control number ccc.fffii. Scale by 100000 and round ONCE so
|
|
3
|
+
# binary-float dust does not bite: e.g. 1.003 must decode to e=3, not e=2
|
|
4
|
+
# ((1.003 - 1) = 0.0029999..., and (1000 * that).to_i would give 2).
|
|
5
|
+
b = x.to_i
|
|
6
|
+
total = (x.abs * 100000).round
|
|
7
|
+
rem = total - b.abs * 100000 # fffii as a <=5-digit integer
|
|
8
|
+
e = rem / 100
|
|
9
|
+
i = rem % 100
|
|
5
10
|
i = 1 if i == 0
|
|
6
11
|
return b, e, i
|
|
7
12
|
end
|
data/xlib/raw_encoder
CHANGED
|
@@ -80,13 +80,13 @@ def raw_encode(program, label_name = "PROG")
|
|
|
80
80
|
if line =~ /^LBL\s+"(.+)"$/i
|
|
81
81
|
lbl_name = $1
|
|
82
82
|
if !main_label_written
|
|
83
|
-
# First label
|
|
84
|
-
result += [0xC0, 0x00, 0xF7, 0x00] # Global label
|
|
83
|
+
# First label encountered → encode as global (can appear at any program step)
|
|
84
|
+
result += [0xC0, 0x00, 0xF7, 0x00] # Global label marker
|
|
85
85
|
result += lbl_name.bytes
|
|
86
86
|
# No terminator needed - next opcode (non-ASCII) terminates naturally
|
|
87
87
|
main_label_written = true
|
|
88
88
|
else
|
|
89
|
-
# Subsequent labels
|
|
89
|
+
# Subsequent labels → encode as local (can appear at any program step)
|
|
90
90
|
result += [0xF6, 0x00]
|
|
91
91
|
result += lbl_name.bytes
|
|
92
92
|
# No terminator needed
|
data/xrpn.gemspec
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Gem::Specification.new do |s|
|
|
2
2
|
s.name = 'xrpn'
|
|
3
|
-
s.version = '2.
|
|
3
|
+
s.version = '2.8'
|
|
4
4
|
s.licenses = ['Unlicense']
|
|
5
5
|
s.summary = "XRPN - The eXtended RPN (Reverse Polish Notation) programming language"
|
|
6
6
|
s.description = "A full programming language and environment extending the features of the venerable HP calculator programmable calculators. With XRPN you can accomplish a wide range of modern programming tasks as well as running existing HP-41 FOCAL programs directly. XRPN gives modern life to tens of thousands of old HP calculator programs and opens the possibilities to many, many more. New in 2.7: Complete HP-41 RAW import/export with 100% decode success - convert HP-41 programs to XRPN and back with full support for 165+ opcodes including ALL math functions (SIN, COS, LOG, etc.), flow control, and numbers."
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: xrpn
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: '2.
|
|
4
|
+
version: '2.8'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Geir Isene
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: tty-prompt
|
|
@@ -357,7 +356,6 @@ homepage: https://github.com/isene/XRPN
|
|
|
357
356
|
licenses:
|
|
358
357
|
- Unlicense
|
|
359
358
|
metadata: {}
|
|
360
|
-
post_install_message:
|
|
361
359
|
rdoc_options: []
|
|
362
360
|
require_paths:
|
|
363
361
|
- lib
|
|
@@ -372,8 +370,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
372
370
|
- !ruby/object:Gem::Version
|
|
373
371
|
version: '0'
|
|
374
372
|
requirements: []
|
|
375
|
-
rubygems_version: 3.
|
|
376
|
-
signing_key:
|
|
373
|
+
rubygems_version: 3.6.7
|
|
377
374
|
specification_version: 4
|
|
378
375
|
summary: XRPN - The eXtended RPN (Reverse Polish Notation) programming language
|
|
379
376
|
test_files: []
|