Post Reply 
(42S) Roman to Arabic Representation
05-17-2020, 07:07 AM
Post: #13
RE: (42S) Roman to Arabic Representation
Thank you, Werner, for the advice on entering alpha data into a matrix, I couldn't find this explicitly in the manual, do you have a reference?

I had for some time (6 years?) thought there should be an equally economical algorithm for ->ROM as for ->ARB but never found/invented one, so your programme is much appreciated.

The matrix RN occupies 230 Bytes of memory, so total for programme & matrix is 312 Bytes.

The programme below is my previous best attempt & is a little faster than yours.

Code:
0.    { 245-Byte Prgm }
1.    LBL “R→A”
2.    CLST
3.    ALENG
4.    X<> ST Z
5.    LBL 09
6.    ATOX
7.    XTOA
8.    R↓
9.    XEQ IND ST T
10.    X<>Y
11.    X<Y?
12.    +/-
13.    STO+ ST Z
14.    R↓
15.    DSE ST Z
16.    GTO 09
17.    GTO 00
18.    LBL 77
19.    1000
20.    RTN
21.    LBL 68
22.    500
23.    RTN
24.    LBL 67
25.    100
26.    RTN
27.    LBL 76
28.    50
29.    RTN
30.    LBL 88
31.    10
32.    RTN
33.    LBL 86
34.    5
35.    RTN
36.    LBL 73
37.    1
38.    RTN
39.    LBL 00
40.    +
41.    RTN
42.    LBL “A→R”
43.    STO 00
44.    CLA
45.    LBL 01
46.    1E3
47.    X>Y?
48.    GTO 00
49.    –
50.    ├”M”
51.    GTO 01
52.    LBL 00
53.    CLX
54.    900
55.    X≤Y?
56.    ├”CM”
57.    X>Y?
58.    CLX
59.    –
60.    500
61.    X≤Y?
62.    ├”D”
63.    X>Y?
64.    CLX
65.    –
66.    400
67.    X≤Y?
68.    ├”CD”
69.    X>Y?
70.    CLX
71.    –
72.    LBL 02
73.    1E2
74.    X>Y?
75.    GTO 00
76.    –
77.    ├”C”
78.    GTO 02
79.    LBL 00
80.    CLX
81.    90
82.    X≤Y?
83.    ├”XC”
84.    X>Y?
85.    CLX
86.    –
87.    50
88.    X≤Y?
89.    ├”L”
90.    X>Y?
91.    CLX
92.    –
93.    40
94.    X≤Y?
95.    ├”XL”
96.    X>Y?
97.    CLX
98.    –
99.    LBL 03
100.    10
101.    X>Y?
102.    GTO 00
103.    –
104.    ├”X”
105.    GTO 03
106.    LBL 00
107.    DSE ST X
108.    X≤Y?
109.    ├”IX”
110.    X>Y?
111.    CLX
112.    –
113.    5
114.    X≤Y?
115.    ├”V”
116.    X>Y?
117.    CLX
118.    –
119.    4
120.    X≤Y?
121.    ├”IV”
122.    X>Y?
123.    CLX
124.    –
125.    LBL 04
126.    1
127.    X>Y?
128.    GTO 00
129.    –
130.    ├”I”
131.    GTO 04
132.    LBL 00
133.    AVIEW
134.    RCL 00
135.    END
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (42S) Roman to Arabic Representation - Gerald H - 05-17-2020 07:07 AM



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