1
0
mirror of https://github.com/fadden/6502bench.git synced 2026-04-24 13:17:24 +00:00

Change the way string formats are defined

We used to use type="String", with the sub-type indicating whether
the string was null-terminated, prefixed with a length, or whatever.
This didn't leave much room for specifying a character encoding,
which is orthogonal to the sub-type.

What we actually want is to have the type specify the string type,
and then have the sub-type determine the character encoding.  These
sub-types can also be used with the Numeric type to specify the
encoding of character operands.

This change updates the enum definitions and the various bits of
code that use them, but does not add any code for working with
non-ASCII character encodings.

The project file version number was incremented to 2, since the new
FormatDescriptor serialization is mildly incompatible with the old.
(Won't explode, but it'll post a complaint and ignore the stuff
it doesn't recognize.)

While I was at it, I finished removing DciReverse.  It's still part
of the 2005-string-types regression test, which currently fails
because the generated source doesn't match.
This commit is contained in:
Andy McFadden
2019-08-07 15:23:23 -07:00
parent 89288c4d8c
commit 0d0854bda7
12 changed files with 420 additions and 367 deletions
+1 -3
View File
@@ -1047,7 +1047,7 @@ namespace SourceGen {
return FormatDescriptor.Type.NumericBE;
case DataType.Dense:
return FormatDescriptor.Type.Dense;
case DataType.String:
case DataType.StringGeneric:
case DataType.Fill:
default:
// not appropriate for operands, or inline data (?)
@@ -1068,8 +1068,6 @@ namespace SourceGen {
return FormatDescriptor.SubType.Decimal;
case DataSubType.Binary:
return FormatDescriptor.SubType.Binary;
case DataSubType.Ascii:
return FormatDescriptor.SubType.Ascii;
case DataSubType.Address:
return FormatDescriptor.SubType.Address;
case DataSubType.Symbol: