1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-22 16:33:48 +00:00

Added support for string encoding suffixes as: ASCII, at: ATASCII, sa: Screencode Atari. Closes #575

This commit is contained in:
jespergravgaard 2020-11-15 17:51:04 +01:00
parent 18e50a245b
commit 511e47f69e
11 changed files with 1063 additions and 958 deletions

View File

@ -66,14 +66,20 @@ public enum StringEncoding {
return PETSCII_MIXED;
} else if(suffix.contains("pu")) {
return PETSCII_UPPER;
} else if(suffix.contains("p")) {
return PETSCII_MIXED;
} else if(suffix.contains("sm")) {
return SCREENCODE_MIXED;
} else if(suffix.contains("su")) {
return SCREENCODE_UPPER;
} else if(suffix.contains("as")) {
return ASCII;
} else if(suffix.contains("at")) {
return ATASCII;
} else if(suffix.contains("sa")) {
return SCREENCODE_ATARI;
} else if(suffix.contains("s")) {
return SCREENCODE_MIXED;
} else if(suffix.contains("p")) {
return PETSCII_MIXED;
} else {
return defaultEncoding;
}

View File

@ -143,7 +143,7 @@ fragment NAME_START : [a-zA-Z_];
fragment NAME_CHAR : [a-zA-Z0-9_];
// Strings and chars
STRING : '"' ('\\"' | ~'"')* '"' [z]?([ps][mu]?)?[z]? ;
STRING : '"' ('\\"' | ~'"')* '"' [z]?([aps][tsmua]?)?[z]? ;
CHAR : '\'' ('\\'(['"rfn]|'x'[0-9a-f][0-9a-f]) | ~'\'' ) '\'';
// White space on hidden channel 1

File diff suppressed because one or more lines are too long

View File

@ -446,98 +446,98 @@ public class KickCLexer extends Lexer {
"\u0093\u0135\2\u0137\2\u0139\u0094\u013b\u0095\u013d\u0096\u013f\u0097"+
"\u0141\u0098\u0143\u0099\u0145\u009a\u0147\u009b\5\2\3\4\25\4\2uuww\7"+
"\2dfkknnuuyy\4\2DDdd\3\2\62\63\3\2\62;\5\2\62;CHch\5\2C\\aac|\6\2\62;"+
"C\\aac|\3\2$$\3\2||\4\2rruu\4\2ooww\7\2$$))hhpptt\4\2\62;ch\3\2))\6\2"+
"\13\f\17\17\"\"\u00a2\u00a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\3\u0139\3\2\2\2\3\u013b\3\2\2"+
"\2\3\u013d\3\2\2\2\4\u013f\3\2\2\2\4\u0141\3\2\2\2\4\u0143\3\2\2\2\4\u0145"+
"\3\2\2\2\4\u0147\3\2\2\2\5\u0149\3\2\2\2\7\u014c\3\2\2\2\t\u014e\3\2\2"+
"\2\13\u0150\3\2\2\2\r\u0152\3\2\2\2\17\u0154\3\2\2\2\21\u0156\3\2\2\2"+
"\23\u0158\3\2\2\2\25\u015a\3\2\2\2\27\u015c\3\2\2\2\31\u015f\3\2\2\2\33"+
"\u0163\3\2\2\2\35\u0165\3\2\2\2\37\u0167\3\2\2\2!\u016a\3\2\2\2#\u016c"+
"\3\2\2\2%\u016e\3\2\2\2\'\u0170\3\2\2\2)\u0172\3\2\2\2+\u0174\3\2\2\2"+
"-\u0177\3\2\2\2/\u017a\3\2\2\2\61\u017c\3\2\2\2\63\u017e\3\2\2\2\65\u0180"+
"\3\2\2\2\67\u0182\3\2\2\29\u0185\3\2\2\2;\u0188\3\2\2\2=\u018b\3\2\2\2"+
"?\u018e\3\2\2\2A\u0190\3\2\2\2C\u0193\3\2\2\2E\u0196\3\2\2\2G\u0198\3"+
"\2\2\2I\u019b\3\2\2\2K\u019e\3\2\2\2M\u01b6\3\2\2\2O\u01b8\3\2\2\2Q\u01c0"+
"\3\2\2\2S\u01c6\3\2\2\2U\u01cd\3\2\2\2W\u01d4\3\2\2\2Y\u01da\3\2\2\2["+
"\u01e1\3\2\2\2]\u01ea\3\2\2\2_\u01f1\3\2\2\2a\u01fb\3\2\2\2c\u0204\3\2"+
"\2\2e\u0211\3\2\2\2g\u021b\3\2\2\2i\u0220\3\2\2\2k\u0226\3\2\2\2m\u022c"+
"\3\2\2\2o\u0231\3\2\2\2q\u0251\3\2\2\2s\u0253\3\2\2\2u\u0256\3\2\2\2w"+
"\u025b\3\2\2\2y\u0261\3\2\2\2{\u0264\3\2\2\2}\u0268\3\2\2\2\177\u026f"+
"\3\2\2\2\u0081\u0276\3\2\2\2\u0083\u027c\3\2\2\2\u0085\u0285\3\2\2\2\u0087"+
"\u028b\3\2\2\2\u0089\u0293\3\2\2\2\u008b\u0298\3\2\2\2\u008d\u029f\3\2"+
"\2\2\u008f\u02a4\3\2\2\2\u0091\u02ab\3\2\2\2\u0093\u02b2\3\2\2\2\u0095"+
"\u02ba\3\2\2\2\u0097\u02c2\3\2\2\2\u0099\u02cb\3\2\2\2\u009b\u02d0\3\2"+
"\2\2\u009d\u02d9\3\2\2\2\u009f\u02df\3\2\2\2\u00a1\u02e6\3\2\2\2\u00a3"+
"\u02f6\3\2\2\2\u00a5\u031d\3\2\2\2\u00a7\u0328\3\2\2\2\u00a9\u032a\3\2"+
"\2\2\u00ab\u0336\3\2\2\2\u00ad\u0340\3\2\2\2\u00af\u034b\3\2\2\2\u00b1"+
"\u0353\3\2\2\2\u00b3\u0360\3\2\2\2\u00b5\u0362\3\2\2\2\u00b7\u0369\3\2"+
"\2\2\u00b9\u0370\3\2\2\2\u00bb\u0378\3\2\2\2\u00bd\u037c\3\2\2\2\u00bf"+
"\u0382\3\2\2\2\u00c1\u0388\3\2\2\2\u00c3\u038f\3\2\2\2\u00c5\u0398\3\2"+
"\2\2\u00c7\u039d\3\2\2\2\u00c9\u03a4\3\2\2\2\u00cb\u03b5\3\2\2\2\u00cd"+
"\u03c3\3\2\2\2\u00cf\u03d4\3\2\2\2\u00d1\u03e8\3\2\2\2\u00d3\u03eb\3\2"+
"\2\2\u00d5\u03f4\3\2\2\2\u00d7\u03fb\3\2\2\2\u00d9\u03fd\3\2\2\2\u00db"+
"\u03ff\3\2\2\2\u00dd\u0401\3\2\2\2\u00df\u040a\3\2\2\2\u00e1\u040c\3\2"+
"\2\2\u00e3\u040e\3\2\2\2\u00e5\u0424\3\2\2\2\u00e7\u0432\3\2\2\2\u00e9"+
"\u0438\3\2\2\2\u00eb\u0443\3\2\2\2\u00ed\u0451\3\2\2\2\u00ef\u067d\3\2"+
"\2\2\u00f1\u067f\3\2\2\2\u00f3\u0681\3\2\2\2\u00f5\u0683\3\2\2\2\u00f7"+
"\u0685\3\2\2\2\u00f9\u0687\3\2\2\2\u00fb\u0689\3\2\2\2\u00fd\u068b\3\2"+
"\2\2\u00ff\u068d\3\2\2\2\u0101\u068f\3\2\2\2\u0103\u0692\3\2\2\2\u0105"+
"\u0695\3\2\2\2\u0107\u0697\3\2\2\2\u0109\u0699\3\2\2\2\u010b\u069b\3\2"+
"\2\2\u010d\u069d\3\2\2\2\u010f\u069f\3\2\2\2\u0111\u06a1\3\2\2\2\u0113"+
"\u06a4\3\2\2\2\u0115\u06a9\3\2\2\2\u0117\u06ae\3\2\2\2\u0119\u06b0\3\2"+
"\2\2\u011b\u06c0\3\2\2\2\u011d\u06c9\3\2\2\2\u011f\u06d9\3\2\2\2\u0121"+
"\u06db\3\2\2\2\u0123\u06e2\3\2\2\2\u0125\u06e6\3\2\2\2\u0127\u06ec\3\2"+
"\2\2\u0129\u06ee\3\2\2\2\u012b\u06f0\3\2\2\2\u012d\u06f2\3\2\2\2\u012f"+
"\u06fa\3\2\2\2\u0131\u0700\3\2\2\2\u0133\u0707\3\2\2\2\u0135\u070e\3\2"+
"\2\2\u0137\u0710\3\2\2\2\u0139\u0713\3\2\2\2\u013b\u0719\3\2\2\2\u013d"+
"\u0724\3\2\2\2\u013f\u0732\3\2\2\2\u0141\u073b\3\2\2\2\u0143\u0748\3\2"+
"\2\2\u0145\u074e\3\2\2\2\u0147\u0759\3\2\2\2\u0149\u014a\7}\2\2\u014a"+
"\u014b\b\2\2\2\u014b\6\3\2\2\2\u014c\u014d\7\177\2\2\u014d\b\3\2\2\2\u014e"+
"\u014f\7]\2\2\u014f\n\3\2\2\2\u0150\u0151\7_\2\2\u0151\f\3\2\2\2\u0152"+
"\u0153\7*\2\2\u0153\16\3\2\2\2\u0154\u0155\7+\2\2\u0155\20\3\2\2\2\u0156"+
"\u0157\7=\2\2\u0157\22\3\2\2\2\u0158\u0159\7<\2\2\u0159\24\3\2\2\2\u015a"+
"\u015b\7.\2\2\u015b\26\3\2\2\2\u015c\u015d\7\60\2\2\u015d\u015e\7\60\2"+
"\2\u015e\30\3\2\2\2\u015f\u0160\7\60\2\2\u0160\u0161\7\60\2\2\u0161\u0162"+
"\7\60\2\2\u0162\32\3\2\2\2\u0163\u0164\7A\2\2\u0164\34\3\2\2\2\u0165\u0166"+
"\7\60\2\2\u0166\36\3\2\2\2\u0167\u0168\7/\2\2\u0168\u0169\7@\2\2\u0169"+
" \3\2\2\2\u016a\u016b\7-\2\2\u016b\"\3\2\2\2\u016c\u016d\7/\2\2\u016d"+
"$\3\2\2\2\u016e\u016f\7,\2\2\u016f&\3\2\2\2\u0170\u0171\7\61\2\2\u0171"+
"(\3\2\2\2\u0172\u0173\7\'\2\2\u0173*\3\2\2\2\u0174\u0175\7-\2\2\u0175"+
"\u0176\7-\2\2\u0176,\3\2\2\2\u0177\u0178\7/\2\2\u0178\u0179\7/\2\2\u0179"+
".\3\2\2\2\u017a\u017b\7(\2\2\u017b\60\3\2\2\2\u017c\u017d\7\u0080\2\2"+
"\u017d\62\3\2\2\2\u017e\u017f\7`\2\2\u017f\64\3\2\2\2\u0180\u0181\7~\2"+
"\2\u0181\66\3\2\2\2\u0182\u0183\7>\2\2\u0183\u0184\7>\2\2\u01848\3\2\2"+
"\2\u0185\u0186\7@\2\2\u0186\u0187\7@\2\2\u0187:\3\2\2\2\u0188\u0189\7"+
"?\2\2\u0189\u018a\7?\2\2\u018a<\3\2\2\2\u018b\u018c\7#\2\2\u018c\u018d"+
"C\\aac|\3\2$$\3\2||\5\2ccrruu\5\2ccoouw\7\2$$))hhpptt\4\2\62;ch\3\2))"+
"\6\2\13\f\17\17\"\"\u00a2\u00a2\4\2\f\f\17\17\4\2--//\7\2/;C\\^^aac|\2"+
"\u0854\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2"+
"\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2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2\2\t\u014e"+
"\3\2\2\2\13\u0150\3\2\2\2\r\u0152\3\2\2\2\17\u0154\3\2\2\2\21\u0156\3"+
"\2\2\2\23\u0158\3\2\2\2\25\u015a\3\2\2\2\27\u015c\3\2\2\2\31\u015f\3\2"+
"\2\2\33\u0163\3\2\2\2\35\u0165\3\2\2\2\37\u0167\3\2\2\2!\u016a\3\2\2\2"+
"#\u016c\3\2\2\2%\u016e\3\2\2\2\'\u0170\3\2\2\2)\u0172\3\2\2\2+\u0174\3"+
"\2\2\2-\u0177\3\2\2\2/\u017a\3\2\2\2\61\u017c\3\2\2\2\63\u017e\3\2\2\2"+
"\65\u0180\3\2\2\2\67\u0182\3\2\2\29\u0185\3\2\2\2;\u0188\3\2\2\2=\u018b"+
"\3\2\2\2?\u018e\3\2\2\2A\u0190\3\2\2\2C\u0193\3\2\2\2E\u0196\3\2\2\2G"+
"\u0198\3\2\2\2I\u019b\3\2\2\2K\u019e\3\2\2\2M\u01b6\3\2\2\2O\u01b8\3\2"+
"\2\2Q\u01c0\3\2\2\2S\u01c6\3\2\2\2U\u01cd\3\2\2\2W\u01d4\3\2\2\2Y\u01da"+
"\3\2\2\2[\u01e1\3\2\2\2]\u01ea\3\2\2\2_\u01f1\3\2\2\2a\u01fb\3\2\2\2c"+
"\u0204\3\2\2\2e\u0211\3\2\2\2g\u021b\3\2\2\2i\u0220\3\2\2\2k\u0226\3\2"+
"\2\2m\u022c\3\2\2\2o\u0231\3\2\2\2q\u0251\3\2\2\2s\u0253\3\2\2\2u\u0256"+
"\3\2\2\2w\u025b\3\2\2\2y\u0261\3\2\2\2{\u0264\3\2\2\2}\u0268\3\2\2\2\177"+
"\u026f\3\2\2\2\u0081\u0276\3\2\2\2\u0083\u027c\3\2\2\2\u0085\u0285\3\2"+
"\2\2\u0087\u028b\3\2\2\2\u0089\u0293\3\2\2\2\u008b\u0298\3\2\2\2\u008d"+
"\u029f\3\2\2\2\u008f\u02a4\3\2\2\2\u0091\u02ab\3\2\2\2\u0093\u02b2\3\2"+
"\2\2\u0095\u02ba\3\2\2\2\u0097\u02c2\3\2\2\2\u0099\u02cb\3\2\2\2\u009b"+
"\u02d0\3\2\2\2\u009d\u02d9\3\2\2\2\u009f\u02df\3\2\2\2\u00a1\u02e6\3\2"+
"\2\2\u00a3\u02f6\3\2\2\2\u00a5\u031d\3\2\2\2\u00a7\u0328\3\2\2\2\u00a9"+
"\u032a\3\2\2\2\u00ab\u0336\3\2\2\2\u00ad\u0340\3\2\2\2\u00af\u034b\3\2"+
"\2\2\u00b1\u0353\3\2\2\2\u00b3\u0360\3\2\2\2\u00b5\u0362\3\2\2\2\u00b7"+
"\u0369\3\2\2\2\u00b9\u0370\3\2\2\2\u00bb\u0378\3\2\2\2\u00bd\u037c\3\2"+
"\2\2\u00bf\u0382\3\2\2\2\u00c1\u0388\3\2\2\2\u00c3\u038f\3\2\2\2\u00c5"+
"\u0398\3\2\2\2\u00c7\u039d\3\2\2\2\u00c9\u03a4\3\2\2\2\u00cb\u03b5\3\2"+
"\2\2\u00cd\u03c3\3\2\2\2\u00cf\u03d4\3\2\2\2\u00d1\u03e8\3\2\2\2\u00d3"+
"\u03eb\3\2\2\2\u00d5\u03f4\3\2\2\2\u00d7\u03fb\3\2\2\2\u00d9\u03fd\3\2"+
"\2\2\u00db\u03ff\3\2\2\2\u00dd\u0401\3\2\2\2\u00df\u040a\3\2\2\2\u00e1"+
"\u040c\3\2\2\2\u00e3\u040e\3\2\2\2\u00e5\u0424\3\2\2\2\u00e7\u0432\3\2"+
"\2\2\u00e9\u0438\3\2\2\2\u00eb\u0443\3\2\2\2\u00ed\u0451\3\2\2\2\u00ef"+
"\u067d\3\2\2\2\u00f1\u067f\3\2\2\2\u00f3\u0681\3\2\2\2\u00f5\u0683\3\2"+
"\2\2\u00f7\u0685\3\2\2\2\u00f9\u0687\3\2\2\2\u00fb\u0689\3\2\2\2\u00fd"+
"\u068b\3\2\2\2\u00ff\u068d\3\2\2\2\u0101\u068f\3\2\2\2\u0103\u0692\3\2"+
"\2\2\u0105\u0695\3\2\2\2\u0107\u0697\3\2\2\2\u0109\u0699\3\2\2\2\u010b"+
"\u069b\3\2\2\2\u010d\u069d\3\2\2\2\u010f\u069f\3\2\2\2\u0111\u06a1\3\2"+
"\2\2\u0113\u06a4\3\2\2\2\u0115\u06a9\3\2\2\2\u0117\u06ae\3\2\2\2\u0119"+
"\u06b0\3\2\2\2\u011b\u06c0\3\2\2\2\u011d\u06c9\3\2\2\2\u011f\u06d9\3\2"+
"\2\2\u0121\u06db\3\2\2\2\u0123\u06e2\3\2\2\2\u0125\u06e6\3\2\2\2\u0127"+
"\u06ec\3\2\2\2\u0129\u06ee\3\2\2\2\u012b\u06f0\3\2\2\2\u012d\u06f2\3\2"+
"\2\2\u012f\u06fa\3\2\2\2\u0131\u0700\3\2\2\2\u0133\u0707\3\2\2\2\u0135"+
"\u070e\3\2\2\2\u0137\u0710\3\2\2\2\u0139\u0713\3\2\2\2\u013b\u0719\3\2"+
"\2\2\u013d\u0724\3\2\2\2\u013f\u0732\3\2\2\2\u0141\u073b\3\2\2\2\u0143"+
"\u0748\3\2\2\2\u0145\u074e\3\2\2\2\u0147\u0759\3\2\2\2\u0149\u014a\7}"+
"\2\2\u014a\u014b\b\2\2\2\u014b\6\3\2\2\2\u014c\u014d\7\177\2\2\u014d\b"+
"\3\2\2\2\u014e\u014f\7]\2\2\u014f\n\3\2\2\2\u0150\u0151\7_\2\2\u0151\f"+
"\3\2\2\2\u0152\u0153\7*\2\2\u0153\16\3\2\2\2\u0154\u0155\7+\2\2\u0155"+
"\20\3\2\2\2\u0156\u0157\7=\2\2\u0157\22\3\2\2\2\u0158\u0159\7<\2\2\u0159"+
"\24\3\2\2\2\u015a\u015b\7.\2\2\u015b\26\3\2\2\2\u015c\u015d\7\60\2\2\u015d"+
"\u015e\7\60\2\2\u015e\30\3\2\2\2\u015f\u0160\7\60\2\2\u0160\u0161\7\60"+
"\2\2\u0161\u0162\7\60\2\2\u0162\32\3\2\2\2\u0163\u0164\7A\2\2\u0164\34"+
"\3\2\2\2\u0165\u0166\7\60\2\2\u0166\36\3\2\2\2\u0167\u0168\7/\2\2\u0168"+
"\u0169\7@\2\2\u0169 \3\2\2\2\u016a\u016b\7-\2\2\u016b\"\3\2\2\2\u016c"+
"\u016d\7/\2\2\u016d$\3\2\2\2\u016e\u016f\7,\2\2\u016f&\3\2\2\2\u0170\u0171"+
"\7\61\2\2\u0171(\3\2\2\2\u0172\u0173\7\'\2\2\u0173*\3\2\2\2\u0174\u0175"+
"\7-\2\2\u0175\u0176\7-\2\2\u0176,\3\2\2\2\u0177\u0178\7/\2\2\u0178\u0179"+
"\7/\2\2\u0179.\3\2\2\2\u017a\u017b\7(\2\2\u017b\60\3\2\2\2\u017c\u017d"+
"\7\u0080\2\2\u017d\62\3\2\2\2\u017e\u017f\7`\2\2\u017f\64\3\2\2\2\u0180"+
"\u0181\7~\2\2\u0181\66\3\2\2\2\u0182\u0183\7>\2\2\u0183\u0184\7>\2\2\u0184"+
"8\3\2\2\2\u0185\u0186\7@\2\2\u0186\u0187\7@\2\2\u0187:\3\2\2\2\u0188\u0189"+
"\7?\2\2\u0189\u018a\7?\2\2\u018a<\3\2\2\2\u018b\u018c\7#\2\2\u018c\u018d"+
"\7?\2\2\u018d>\3\2\2\2\u018e\u018f\7>\2\2\u018f@\3\2\2\2\u0190\u0191\7"+
">\2\2\u0191\u0192\7?\2\2\u0192B\3\2\2\2\u0193\u0194\7@\2\2\u0194\u0195"+
"\7?\2\2\u0195D\3\2\2\2\u0196\u0197\7@\2\2\u0197F\3\2\2\2\u0198\u0199\7"+

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -1,23 +1,34 @@
// Test string encoding via literals
byte petscii_mixed[] = "abcABC1"pm;
byte petscii_upper[] = "abcABC2"pu;
byte petscii_standard[] = "abcABC3"p;
byte screencode_mixed[] = "abcABC4"sm;
byte screencode_upper[] = "abcABC5"su;
byte screencode_standard[] = "abcABC6"s;
byte standard[] = "abcABC7";
char no_null[] = "abcABC1"z;
char petscii_mixed[] = "abcABC1"pm;
char petscii_upper[] = "abcABC2"pu;
char petscii_standard[] = "abcABC3"p;
char screencode_mixed[] = "abcABC4"sm;
char screencode_upper[] = "abcABC5"su;
char screencode_standard[] = "abcABC6"s;
char ascii[] = "abcABC7"as;
char atascii[] = "abcABC8"at;
char screencode_atari[] = "abcABC9"sa;
char standard[] = "abcABC0";
void main() {
byte* SCREEN = 0x0400;
for( byte i: 0..5 ) {
char* const SCREEN = 0x0400;
char * const D018 = 0xd018;
*D018 = 0x16;
for( char i: 0..7 ) {
(SCREEN+40*0)[i] = petscii_mixed[i];
(SCREEN+40*1)[i] = petscii_upper[i];
(SCREEN+40*2)[i] = petscii_standard[i];
(SCREEN+40*3)[i] = screencode_mixed[i];
(SCREEN+40*4)[i] = screencode_upper[i];
(SCREEN+40*5)[i] = screencode_standard[i];
(SCREEN+40*6)[i] = standard[i];
(SCREEN+40*6)[i] = ascii[i];
(SCREEN+40*7)[i] = atascii[i];
(SCREEN+40*8)[i] = screencode_atari[i];
(SCREEN+40*9)[i] = standard[i];
(SCREEN+40*10)[i] = no_null[i];
}
}

View File

@ -4,6 +4,10 @@
.pc = $80d "Program"
main: {
.label SCREEN = $400
.label D018 = $d018
// *D018 = 0x16
lda #$16
sta D018
ldx #0
__b1:
// (SCREEN+40*0)[i] = petscii_mixed[i]
@ -24,16 +28,29 @@ main: {
// (SCREEN+40*5)[i] = screencode_standard[i]
lda screencode_standard,x
sta SCREEN+$28*5,x
// (SCREEN+40*6)[i] = standard[i]
lda standard,x
// (SCREEN+40*6)[i] = ascii[i]
lda ascii,x
sta SCREEN+$28*6,x
// for( byte i: 0..5 )
// (SCREEN+40*7)[i] = atascii[i]
lda atascii,x
sta SCREEN+$28*7,x
// (SCREEN+40*8)[i] = screencode_atari[i]
lda screencode_atari,x
sta SCREEN+$28*8,x
// (SCREEN+40*9)[i] = standard[i]
lda standard,x
sta SCREEN+$28*9,x
// (SCREEN+40*10)[i] = no_null[i]
lda no_null,x
sta SCREEN+$28*$a,x
// for( char i: 0..7 )
inx
cpx #6
cpx #8
bne __b1
// }
rts
}
no_null: .text "abcABC1"
.encoding "petscii_mixed"
petscii_mixed: .text "abcABC1"
.byte 0
@ -52,5 +69,15 @@ main: {
.encoding "screencode_mixed"
screencode_standard: .text "abcABC6"
.byte 0
standard: .text "abcABC7"
.encoding "ascii"
ascii: .text "abcABC7"
.byte 0
.encoding "ascii"
atascii: .text "abcABC8"
.byte 0
.encoding "ascii"
screencode_atari: .text @"abc\$21\$22\$23\$19"
.byte 0
.encoding "screencode_mixed"
standard: .text "abcABC0"
.byte 0

View File

@ -1,7 +1,7 @@
void main()
main: scope:[main] from
[0] phi()
[0] *main::D018 = $16
to:main::@1
main::@1: scope:[main] from main main::@1
[1] main::i#2 = phi( main/0, main::@1/main::i#1 )
@ -11,10 +11,14 @@ main::@1: scope:[main] from main main::@1
[5] (main::SCREEN+(byte)$28*3)[main::i#2] = screencode_mixed[main::i#2]
[6] (main::SCREEN+(byte)$28*4)[main::i#2] = screencode_upper[main::i#2]
[7] (main::SCREEN+(byte)$28*5)[main::i#2] = screencode_standard[main::i#2]
[8] (main::SCREEN+(byte)$28*6)[main::i#2] = standard[main::i#2]
[9] main::i#1 = ++ main::i#2
[10] if(main::i#1!=6) goto main::@1
[8] (main::SCREEN+(byte)$28*6)[main::i#2] = ascii[main::i#2]
[9] (main::SCREEN+(word)$28*7)[main::i#2] = atascii[main::i#2]
[10] (main::SCREEN+(word)$28*8)[main::i#2] = screencode_atari[main::i#2]
[11] (main::SCREEN+(word)$28*9)[main::i#2] = standard[main::i#2]
[12] (main::SCREEN+(word)$28*$a)[main::i#2] = no_null[main::i#2]
[13] main::i#1 = ++ main::i#2
[14] if(main::i#1!=8) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@1
[11] return
[15] return
to:@return

View File

@ -3,27 +3,25 @@ CONTROL FLOW GRAPH SSA
void main()
main: scope:[main] from __start
*main::D018 = $16
main::i#0 = 0
to:main::@1
main::@1: scope:[main] from main main::@1
main::i#2 = phi( main/main::i#0, main::@1/main::i#1 )
main::$0 = main::SCREEN + $28*0
main::$0[main::i#2] = petscii_mixed[main::i#2]
main::$1 = main::SCREEN + $28*1
main::$1[main::i#2] = petscii_upper[main::i#2]
main::$2 = main::SCREEN + $28*2
main::$2[main::i#2] = petscii_standard[main::i#2]
main::$3 = main::SCREEN + $28*3
main::$3[main::i#2] = screencode_mixed[main::i#2]
main::$4 = main::SCREEN + $28*4
main::$4[main::i#2] = screencode_upper[main::i#2]
main::$5 = main::SCREEN + $28*5
main::$5[main::i#2] = screencode_standard[main::i#2]
main::$6 = main::SCREEN + $28*6
main::$6[main::i#2] = standard[main::i#2]
main::i#1 = main::i#2 + rangenext(0,5)
main::$7 = main::i#1 != rangelast(0,5)
if(main::$7) goto main::@1
(main::SCREEN+$28*0)[main::i#2] = petscii_mixed[main::i#2]
(main::SCREEN+$28*1)[main::i#2] = petscii_upper[main::i#2]
(main::SCREEN+$28*2)[main::i#2] = petscii_standard[main::i#2]
(main::SCREEN+$28*3)[main::i#2] = screencode_mixed[main::i#2]
(main::SCREEN+$28*4)[main::i#2] = screencode_upper[main::i#2]
(main::SCREEN+$28*5)[main::i#2] = screencode_standard[main::i#2]
(main::SCREEN+$28*6)[main::i#2] = ascii[main::i#2]
(main::SCREEN+$28*7)[main::i#2] = atascii[main::i#2]
(main::SCREEN+$28*8)[main::i#2] = screencode_atari[main::i#2]
(main::SCREEN+$28*9)[main::i#2] = standard[main::i#2]
(main::SCREEN+$28*$a)[main::i#2] = no_null[main::i#2]
main::i#1 = main::i#2 + rangenext(0,7)
main::$0 = main::i#1 != rangelast(0,7)
if(main::$0) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@1
return
@ -41,99 +39,84 @@ __start::@return: scope:[__start] from __start::@1
SYMBOL TABLE SSA
void __start()
const byte* ascii[] = "abcABC7"as
const byte* atascii[] = "abcABC8"at
void main()
byte*~ main::$0
byte*~ main::$1
byte*~ main::$2
byte*~ main::$3
byte*~ main::$4
byte*~ main::$5
byte*~ main::$6
bool~ main::$7
const byte* main::SCREEN = (byte*)$400
bool~ main::$0
const nomodify byte* main::D018 = (byte*)$d018
const nomodify byte* main::SCREEN = (byte*)$400
byte main::i
byte main::i#0
byte main::i#1
byte main::i#2
const byte* no_null[] = "abcABC1"z
const byte* petscii_mixed[] = "abcABC1"pm
const byte* petscii_standard[] = "abcABC3"pm
const byte* petscii_upper[] = "abcABC2"pu
const byte* screencode_atari[] = "abcABC9"sa
const byte* screencode_mixed[] = "abcABC4"
const byte* screencode_standard[] = "abcABC6"
const byte* screencode_upper[] = "abcABC5"su
const byte* standard[] = "abcABC7"
const byte* standard[] = "abcABC0"
Adding number conversion cast (unumber) $28*0 in main::$0 = main::SCREEN + $28*0
Adding number conversion cast (unumber) $28*1 in main::$1 = main::SCREEN + $28*1
Adding number conversion cast (unumber) $28*2 in main::$2 = main::SCREEN + $28*2
Adding number conversion cast (unumber) $28*3 in main::$3 = main::SCREEN + $28*3
Adding number conversion cast (unumber) $28*4 in main::$4 = main::SCREEN + $28*4
Adding number conversion cast (unumber) $28*5 in main::$5 = main::SCREEN + $28*5
Adding number conversion cast (unumber) $28*6 in main::$6 = main::SCREEN + $28*6
Adding number conversion cast (unumber) $16 in *main::D018 = $16
Adding number conversion cast (unumber) $28*0 in (main::SCREEN+$28*0)[main::i#2] = petscii_mixed[main::i#2]
Adding number conversion cast (unumber) $28*1 in (main::SCREEN+$28*1)[main::i#2] = petscii_upper[main::i#2]
Adding number conversion cast (unumber) $28*2 in (main::SCREEN+$28*2)[main::i#2] = petscii_standard[main::i#2]
Adding number conversion cast (unumber) $28*3 in (main::SCREEN+$28*3)[main::i#2] = screencode_mixed[main::i#2]
Adding number conversion cast (unumber) $28*4 in (main::SCREEN+$28*4)[main::i#2] = screencode_upper[main::i#2]
Adding number conversion cast (unumber) $28*5 in (main::SCREEN+$28*5)[main::i#2] = screencode_standard[main::i#2]
Adding number conversion cast (unumber) $28*6 in (main::SCREEN+$28*6)[main::i#2] = ascii[main::i#2]
Adding number conversion cast (unumber) $28*7 in (main::SCREEN+$28*7)[main::i#2] = atascii[main::i#2]
Adding number conversion cast (unumber) $28*8 in (main::SCREEN+$28*8)[main::i#2] = screencode_atari[main::i#2]
Adding number conversion cast (unumber) $28*9 in (main::SCREEN+$28*9)[main::i#2] = standard[main::i#2]
Adding number conversion cast (unumber) $28*$a in (main::SCREEN+$28*$a)[main::i#2] = no_null[main::i#2]
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast *main::D018 = (unumber)$16
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant pointer cast (byte*) 53272
Simplifying constant integer cast $16
Successful SSA optimization PassNCastSimplification
Simple Condition main::$7 [18] if(main::i#1!=rangelast(0,5)) goto main::@1
Finalized unsigned number type $16
Successful SSA optimization PassNFinalizeNumberTypeConversions
Simple Condition main::$0 [16] if(main::i#1!=rangelast(0,7)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [2] main::$0 = main::SCREEN + (byte)$28*0
Constant right-side identified [4] main::$1 = main::SCREEN + (byte)$28*1
Constant right-side identified [6] main::$2 = main::SCREEN + (byte)$28*2
Constant right-side identified [8] main::$3 = main::SCREEN + (byte)$28*3
Constant right-side identified [10] main::$4 = main::SCREEN + (byte)$28*4
Constant right-side identified [12] main::$5 = main::SCREEN + (byte)$28*5
Constant right-side identified [14] main::$6 = main::SCREEN + (byte)$28*6
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant main::i#0 = 0
Constant main::$0 = main::SCREEN+(byte)$28*0
Constant main::$1 = main::SCREEN+(byte)$28*1
Constant main::$2 = main::SCREEN+(byte)$28*2
Constant main::$3 = main::SCREEN+(byte)$28*3
Constant main::$4 = main::SCREEN+(byte)$28*4
Constant main::$5 = main::SCREEN+(byte)$28*5
Constant main::$6 = main::SCREEN+(byte)$28*6
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [16] main::i#1 = ++ main::i#2 to ++
Resolved ranged comparison value [18] if(main::i#1!=rangelast(0,5)) goto main::@1 to 6
Simplifying constant evaluating to zero (byte)$28*0 in
Resolved ranged next value [14] main::i#1 = ++ main::i#2 to ++
Resolved ranged comparison value [16] if(main::i#1!=rangelast(0,7)) goto main::@1 to 8
Simplifying constant evaluating to zero (byte)$28*0 in [3] (main::SCREEN+(byte)$28*0)[main::i#2] = petscii_mixed[main::i#2]
Successful SSA optimization PassNSimplifyConstantZero
Simplifying expression containing zero main::SCREEN in
Simplifying expression containing zero main::SCREEN in [3] (main::SCREEN+0)[main::i#2] = petscii_mixed[main::i#2]
Successful SSA optimization PassNSimplifyExpressionWithZero
Removing unused procedure __start
Removing unused procedure block __start
Removing unused procedure block __start::@1
Removing unused procedure block __start::@return
Successful SSA optimization PassNEliminateEmptyStart
Adding number conversion cast (unumber) 6 in [9] if(main::i#1!=6) goto main::@1
Adding number conversion cast (unumber) 8 in [14] if(main::i#1!=8) goto main::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast 6
Simplifying constant integer cast 8
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type 6
Finalized unsigned number type 8
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inlining constant with var siblings main::i#0
Constant inlined main::$1 = main::SCREEN+(byte)$28*1
Constant inlined main::$2 = main::SCREEN+(byte)$28*2
Constant inlined main::$0 = main::SCREEN
Constant inlined main::$5 = main::SCREEN+(byte)$28*5
Constant inlined main::i#0 = 0
Constant inlined main::$6 = main::SCREEN+(byte)$28*6
Constant inlined main::$3 = main::SCREEN+(byte)$28*3
Constant inlined main::$4 = main::SCREEN+(byte)$28*4
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting main::@2(between main::@1 and main::@1)
Adding NOP phi() at start of main
CALL GRAPH
Created 1 initial phi equivalence classes
Coalesced [12] main::i#3 = main::i#1
Coalesced [16] main::i#3 = main::i#1
Coalesced down to 1 phi equivalence classes
Culled Empty Block label main::@2
Adding NOP phi() at start of main
FINAL CONTROL FLOW GRAPH
void main()
main: scope:[main] from
[0] phi()
[0] *main::D018 = $16
to:main::@1
main::@1: scope:[main] from main main::@1
[1] main::i#2 = phi( main/0, main::@1/main::i#1 )
@ -143,12 +126,16 @@ main::@1: scope:[main] from main main::@1
[5] (main::SCREEN+(byte)$28*3)[main::i#2] = screencode_mixed[main::i#2]
[6] (main::SCREEN+(byte)$28*4)[main::i#2] = screencode_upper[main::i#2]
[7] (main::SCREEN+(byte)$28*5)[main::i#2] = screencode_standard[main::i#2]
[8] (main::SCREEN+(byte)$28*6)[main::i#2] = standard[main::i#2]
[9] main::i#1 = ++ main::i#2
[10] if(main::i#1!=6) goto main::@1
[8] (main::SCREEN+(byte)$28*6)[main::i#2] = ascii[main::i#2]
[9] (main::SCREEN+(word)$28*7)[main::i#2] = atascii[main::i#2]
[10] (main::SCREEN+(word)$28*8)[main::i#2] = screencode_atari[main::i#2]
[11] (main::SCREEN+(word)$28*9)[main::i#2] = standard[main::i#2]
[12] (main::SCREEN+(word)$28*$a)[main::i#2] = no_null[main::i#2]
[13] main::i#1 = ++ main::i#2
[14] if(main::i#1!=8) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@1
[11] return
[15] return
to:@return
@ -156,7 +143,7 @@ VARIABLE REGISTER WEIGHTS
void main()
byte main::i
byte main::i#1 16.5
byte main::i#2 22.0
byte main::i#2 22.000000000000004
Initial phi equivalence classes
[ main::i#2 main::i#1 ]
@ -164,6 +151,7 @@ Complete equivalence classes
[ main::i#2 main::i#1 ]
Allocated zp[1]:2 [ main::i#2 main::i#1 ]
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [0] *main::D018 = $16 [ ] ( [ ] { } ) always clobbers reg byte a
Statement [2] main::SCREEN[main::i#2] = petscii_mixed[main::i#2] [ main::i#2 ] ( [ main::i#2 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:2 [ main::i#2 main::i#1 ]
Statement [3] (main::SCREEN+(byte)$28*1)[main::i#2] = petscii_upper[main::i#2] [ main::i#2 ] ( [ main::i#2 ] { } ) always clobbers reg byte a
@ -171,22 +159,31 @@ Statement [4] (main::SCREEN+(byte)$28*2)[main::i#2] = petscii_standard[main::i#2
Statement [5] (main::SCREEN+(byte)$28*3)[main::i#2] = screencode_mixed[main::i#2] [ main::i#2 ] ( [ main::i#2 ] { } ) always clobbers reg byte a
Statement [6] (main::SCREEN+(byte)$28*4)[main::i#2] = screencode_upper[main::i#2] [ main::i#2 ] ( [ main::i#2 ] { } ) always clobbers reg byte a
Statement [7] (main::SCREEN+(byte)$28*5)[main::i#2] = screencode_standard[main::i#2] [ main::i#2 ] ( [ main::i#2 ] { } ) always clobbers reg byte a
Statement [8] (main::SCREEN+(byte)$28*6)[main::i#2] = standard[main::i#2] [ main::i#2 ] ( [ main::i#2 ] { } ) always clobbers reg byte a
Statement [8] (main::SCREEN+(byte)$28*6)[main::i#2] = ascii[main::i#2] [ main::i#2 ] ( [ main::i#2 ] { } ) always clobbers reg byte a
Statement [9] (main::SCREEN+(word)$28*7)[main::i#2] = atascii[main::i#2] [ main::i#2 ] ( [ main::i#2 ] { } ) always clobbers reg byte a
Statement [10] (main::SCREEN+(word)$28*8)[main::i#2] = screencode_atari[main::i#2] [ main::i#2 ] ( [ main::i#2 ] { } ) always clobbers reg byte a
Statement [11] (main::SCREEN+(word)$28*9)[main::i#2] = standard[main::i#2] [ main::i#2 ] ( [ main::i#2 ] { } ) always clobbers reg byte a
Statement [12] (main::SCREEN+(word)$28*$a)[main::i#2] = no_null[main::i#2] [ main::i#2 ] ( [ main::i#2 ] { } ) always clobbers reg byte a
Statement [0] *main::D018 = $16 [ ] ( [ ] { } ) always clobbers reg byte a
Statement [2] main::SCREEN[main::i#2] = petscii_mixed[main::i#2] [ main::i#2 ] ( [ main::i#2 ] { } ) always clobbers reg byte a
Statement [3] (main::SCREEN+(byte)$28*1)[main::i#2] = petscii_upper[main::i#2] [ main::i#2 ] ( [ main::i#2 ] { } ) always clobbers reg byte a
Statement [4] (main::SCREEN+(byte)$28*2)[main::i#2] = petscii_standard[main::i#2] [ main::i#2 ] ( [ main::i#2 ] { } ) always clobbers reg byte a
Statement [5] (main::SCREEN+(byte)$28*3)[main::i#2] = screencode_mixed[main::i#2] [ main::i#2 ] ( [ main::i#2 ] { } ) always clobbers reg byte a
Statement [6] (main::SCREEN+(byte)$28*4)[main::i#2] = screencode_upper[main::i#2] [ main::i#2 ] ( [ main::i#2 ] { } ) always clobbers reg byte a
Statement [7] (main::SCREEN+(byte)$28*5)[main::i#2] = screencode_standard[main::i#2] [ main::i#2 ] ( [ main::i#2 ] { } ) always clobbers reg byte a
Statement [8] (main::SCREEN+(byte)$28*6)[main::i#2] = standard[main::i#2] [ main::i#2 ] ( [ main::i#2 ] { } ) always clobbers reg byte a
Statement [8] (main::SCREEN+(byte)$28*6)[main::i#2] = ascii[main::i#2] [ main::i#2 ] ( [ main::i#2 ] { } ) always clobbers reg byte a
Statement [9] (main::SCREEN+(word)$28*7)[main::i#2] = atascii[main::i#2] [ main::i#2 ] ( [ main::i#2 ] { } ) always clobbers reg byte a
Statement [10] (main::SCREEN+(word)$28*8)[main::i#2] = screencode_atari[main::i#2] [ main::i#2 ] ( [ main::i#2 ] { } ) always clobbers reg byte a
Statement [11] (main::SCREEN+(word)$28*9)[main::i#2] = standard[main::i#2] [ main::i#2 ] ( [ main::i#2 ] { } ) always clobbers reg byte a
Statement [12] (main::SCREEN+(word)$28*$a)[main::i#2] = no_null[main::i#2] [ main::i#2 ] ( [ main::i#2 ] { } ) always clobbers reg byte a
Potential registers zp[1]:2 [ main::i#2 main::i#1 ] : zp[1]:2 , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 38.5: zp[1]:2 [ main::i#2 main::i#1 ]
Uplift Scope []
Uplifting [main] best 846 combination reg byte x [ main::i#2 main::i#1 ]
Uplifting [] best 846 combination
Uplifting [main] best 1232 combination reg byte x [ main::i#2 main::i#1 ]
Uplifting [] best 1232 combination
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
@ -199,6 +196,10 @@ ASSEMBLER BEFORE OPTIMIZATION
// main
main: {
.label SCREEN = $400
.label D018 = $d018
// [0] *main::D018 = $16 -- _deref_pbuc1=vbuc2
lda #$16
sta D018
// [1] phi from main to main::@1 [phi:main->main::@1]
__b1_from_main:
// [1] phi main::i#2 = 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
@ -228,21 +229,34 @@ main: {
// [7] (main::SCREEN+(byte)$28*5)[main::i#2] = screencode_standard[main::i#2] -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx
lda screencode_standard,x
sta SCREEN+$28*5,x
// [8] (main::SCREEN+(byte)$28*6)[main::i#2] = standard[main::i#2] -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx
lda standard,x
// [8] (main::SCREEN+(byte)$28*6)[main::i#2] = ascii[main::i#2] -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx
lda ascii,x
sta SCREEN+$28*6,x
// [9] main::i#1 = ++ main::i#2 -- vbuxx=_inc_vbuxx
// [9] (main::SCREEN+(word)$28*7)[main::i#2] = atascii[main::i#2] -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx
lda atascii,x
sta SCREEN+$28*7,x
// [10] (main::SCREEN+(word)$28*8)[main::i#2] = screencode_atari[main::i#2] -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx
lda screencode_atari,x
sta SCREEN+$28*8,x
// [11] (main::SCREEN+(word)$28*9)[main::i#2] = standard[main::i#2] -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx
lda standard,x
sta SCREEN+$28*9,x
// [12] (main::SCREEN+(word)$28*$a)[main::i#2] = no_null[main::i#2] -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx
lda no_null,x
sta SCREEN+$28*$a,x
// [13] main::i#1 = ++ main::i#2 -- vbuxx=_inc_vbuxx
inx
// [10] if(main::i#1!=6) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
cpx #6
// [14] if(main::i#1!=8) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
cpx #8
bne __b1_from___b1
jmp __breturn
// main::@return
__breturn:
// [11] return
// [15] return
rts
}
// File Data
no_null: .text "abcABC1"
.encoding "petscii_mixed"
petscii_mixed: .text "abcABC1"
.byte 0
@ -261,7 +275,17 @@ main: {
.encoding "screencode_mixed"
screencode_standard: .text "abcABC6"
.byte 0
standard: .text "abcABC7"
.encoding "ascii"
ascii: .text "abcABC7"
.byte 0
.encoding "ascii"
atascii: .text "abcABC8"
.byte 0
.encoding "ascii"
screencode_atari: .text @"abc\$21\$22\$23\$19"
.byte 0
.encoding "screencode_mixed"
standard: .text "abcABC0"
.byte 0
ASSEMBLER OPTIMIZATIONS
@ -278,24 +302,29 @@ Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination
FINAL SYMBOL TABLE
const byte* ascii[] = "abcABC7"as
const byte* atascii[] = "abcABC8"at
void main()
const byte* main::SCREEN = (byte*) 1024
const nomodify byte* main::D018 = (byte*) 53272
const nomodify byte* main::SCREEN = (byte*) 1024
byte main::i
byte main::i#1 reg byte x 16.5
byte main::i#2 reg byte x 22.0
byte main::i#2 reg byte x 22.000000000000004
const byte* no_null[] = "abcABC1"z
const byte* petscii_mixed[] = "abcABC1"pm
const byte* petscii_standard[] = "abcABC3"pm
const byte* petscii_upper[] = "abcABC2"pu
const byte* screencode_atari[] = "abcABC9"sa
const byte* screencode_mixed[] = "abcABC4"
const byte* screencode_standard[] = "abcABC6"
const byte* screencode_upper[] = "abcABC5"su
const byte* standard[] = "abcABC7"
const byte* standard[] = "abcABC0"
reg byte x [ main::i#2 main::i#1 ]
FINAL ASSEMBLER
Score: 756
Score: 1142
// File Comments
// Test string encoding via literals
@ -307,6 +336,11 @@ Score: 756
// main
main: {
.label SCREEN = $400
.label D018 = $d018
// *D018 = 0x16
// [0] *main::D018 = $16 -- _deref_pbuc1=vbuc2
lda #$16
sta D018
// [1] phi from main to main::@1 [phi:main->main::@1]
// [1] phi main::i#2 = 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
ldx #0
@ -338,22 +372,39 @@ main: {
// [7] (main::SCREEN+(byte)$28*5)[main::i#2] = screencode_standard[main::i#2] -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx
lda screencode_standard,x
sta SCREEN+$28*5,x
// (SCREEN+40*6)[i] = standard[i]
// [8] (main::SCREEN+(byte)$28*6)[main::i#2] = standard[main::i#2] -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx
lda standard,x
// (SCREEN+40*6)[i] = ascii[i]
// [8] (main::SCREEN+(byte)$28*6)[main::i#2] = ascii[main::i#2] -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx
lda ascii,x
sta SCREEN+$28*6,x
// for( byte i: 0..5 )
// [9] main::i#1 = ++ main::i#2 -- vbuxx=_inc_vbuxx
// (SCREEN+40*7)[i] = atascii[i]
// [9] (main::SCREEN+(word)$28*7)[main::i#2] = atascii[main::i#2] -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx
lda atascii,x
sta SCREEN+$28*7,x
// (SCREEN+40*8)[i] = screencode_atari[i]
// [10] (main::SCREEN+(word)$28*8)[main::i#2] = screencode_atari[main::i#2] -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx
lda screencode_atari,x
sta SCREEN+$28*8,x
// (SCREEN+40*9)[i] = standard[i]
// [11] (main::SCREEN+(word)$28*9)[main::i#2] = standard[main::i#2] -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx
lda standard,x
sta SCREEN+$28*9,x
// (SCREEN+40*10)[i] = no_null[i]
// [12] (main::SCREEN+(word)$28*$a)[main::i#2] = no_null[main::i#2] -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx
lda no_null,x
sta SCREEN+$28*$a,x
// for( char i: 0..7 )
// [13] main::i#1 = ++ main::i#2 -- vbuxx=_inc_vbuxx
inx
// [10] if(main::i#1!=6) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
cpx #6
// [14] if(main::i#1!=8) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
cpx #8
bne __b1
// main::@return
// }
// [11] return
// [15] return
rts
}
// File Data
no_null: .text "abcABC1"
.encoding "petscii_mixed"
petscii_mixed: .text "abcABC1"
.byte 0
@ -372,6 +423,16 @@ main: {
.encoding "screencode_mixed"
screencode_standard: .text "abcABC6"
.byte 0
standard: .text "abcABC7"
.encoding "ascii"
ascii: .text "abcABC7"
.byte 0
.encoding "ascii"
atascii: .text "abcABC8"
.byte 0
.encoding "ascii"
screencode_atari: .text @"abc\$21\$22\$23\$19"
.byte 0
.encoding "screencode_mixed"
standard: .text "abcABC0"
.byte 0

View File

@ -1,14 +1,19 @@
const byte* ascii[] = "abcABC7"as
const byte* atascii[] = "abcABC8"at
void main()
const byte* main::SCREEN = (byte*) 1024
const nomodify byte* main::D018 = (byte*) 53272
const nomodify byte* main::SCREEN = (byte*) 1024
byte main::i
byte main::i#1 reg byte x 16.5
byte main::i#2 reg byte x 22.0
byte main::i#2 reg byte x 22.000000000000004
const byte* no_null[] = "abcABC1"z
const byte* petscii_mixed[] = "abcABC1"pm
const byte* petscii_standard[] = "abcABC3"pm
const byte* petscii_upper[] = "abcABC2"pu
const byte* screencode_atari[] = "abcABC9"sa
const byte* screencode_mixed[] = "abcABC4"
const byte* screencode_standard[] = "abcABC6"
const byte* screencode_upper[] = "abcABC5"su
const byte* standard[] = "abcABC7"
const byte* standard[] = "abcABC0"
reg byte x [ main::i#2 main::i#1 ]