colorize MVSASM {
    SyntaxParser = 'SIMPLE';

    color {
        { 'Normal',        'Editor_Default' },
        { 'Number',        'Lang_DecimalNumber' },
        { 'HexNumber',     'Lang_HexNumber' },
        { 'Punctuation',   'Lang_Punctuation' },
        { 'String',        'Lang_String' },
        { 'Comment',       'Lang_Comment' },
        { 'CPreprocessor', 'Lang_Preprocessor' },
        { 'Function',      'Lang_Function' },
        { 'Label',         'Lang_Label' },
    };

    keyword 'Editor_Keywords' {
        'mov', 'push', 'pop', 'movzx', 'movsx',
        'shl', 'shr', 'and', 'or', 'xor', 'not',
        'add', 'sub', 'neg', 'mul', 'div', 'idiv', 'imul',
        'test', 'cmp',
        'inc', 'dec',
        'enter', 'leave',
    };

    h_state 0 { 'Normal' }
    h_trans { 1, '^', '*', 'Comment' }        # '*' at bol is COMMENT
    h_trans { 2, '^-S', ' ', 'Label' }        # word at bol is LABEL
    h_trans { 3, '-S', ' ', 'Normal' }        # word at non-bol is INSTRUCTION

    h_state 1 { 'Comment' }        # comment
    h_trans { 0, '$', '', 'Normal' }

    h_state 2 { 'Label' }          # first column is LABEL
    h_trans { 0, '$', '', 'Normal' }
    h_trans { 0, '-s', ' ', 'Label' }

    h_state 3 { 'Normal' }         # keywords in second column
    h_trans { 0, '$', '', 'Normal' }
    h_trans { 1, '-s', ' ', 'Comment' }
    h_wtype { 1, 1, 1, '', 'a-zA-Z_' }

    # keywords here or global

    h_state 4 { 'Normal' }         # eat non-keywords in second col
    h_trans { 0, '$', '', 'Normal' }
    h_trans { 1, '-s', ' ', 'Comment' }
}

mode MVSASM: PLAIN {
    FileNameRx          = /\.\cMVSA$/;
    HilitOn             = 1;
    Colorizer           = 'MVSASM';
    AutoHilitParen      = 1;

    SaveFolds           = 2;      # save fold info at end of line
    CommentStart        = ' ;';
    CommentEnd          = '';
}
