(42S) Roman to Arabic Representation
|
05-14-2020, 08:56 AM
Post: #10
|
|||
|
|||
RE: (42S) Roman to Arabic Representation
Making use of a 13x2 matrix "RN":
[[ 1000 77 ] [ 900 "CM" ] [ 500 68 ] [ 400 "CD" ] [ 100 67 ] [ 90 "XC" ] [ 50 76 ] [ 40 "XL" ] [ 10 88 ] [ 9 "IX" ] [ 5 86 ] [ 4 "IV" ] [ 1 73 ]] Both encodings can be written as follows: Code: 00 { 82-Byte Prgm } The →ROM routine appends the Roman numerals to the Alpha register; just add a CLA at the beginning and an AVIEW at the end if you want to see single results. The →ARB routine (a copy of yours, Gerald, but using the RN matrix instead) has a rudimentary error check: when it encounters an unknown character it produces an "Alpha Data is Invalid" message. Cheers, Werner 41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)