Allow .short and .long assembler directives
MODIFY
src/assembler.cpp
src/assembler.cpp
@@ -100,14 +100,13 @@ const QStringList branchInstructions = QStringList() << "beq"
<< "bgeu";
const QStringList DataAssemblerDirectives = QStringList() << ".word"
<< ".half"
+ << ".short"
<< ".byte"
<< ".2byte"
- << ".4byte";
-const static QMap<QString, size_t> DataAssemblerSizes{{".word", 4},
- {".half", 2},
- {".byte", 1},
- {".2byte", 2},
- {".4byte", 4}};
+ << ".4byte"
+ << ".long";
+const static QMap<QString, size_t> DataAssemblerSizes{{".word", 4}, {".half", 2}, {".short", 2}, {".byte", 1},
+ {".2byte", 2}, {".4byte", 4}, {".long", 4}};
} // namespace
Assembler::Assembler() {}

MODIFY
src/syntaxhighlighter.cpp
src/syntaxhighlighter.cpp
@@ -552,6 +552,8 @@ void SyntaxHighlighter::createSyntaxRules() {
m_syntaxRules.insert(rule.instr, QList<SyntaxRule>() << rule);
rule.instr = ".half";
m_syntaxRules.insert(rule.instr, QList<SyntaxRule>() << rule);
+ rule.instr = ".short";
+ m_syntaxRules.insert(rule.instr, QList<SyntaxRule>() << rule);
// .4byte & word
types.clear();
@@ -562,6 +564,8 @@ void SyntaxHighlighter::createSyntaxRules() {
rule.inputs = types;
m_syntaxRules.insert(rule.instr, QList<SyntaxRule>() << rule);
rule.instr = ".word";
+ m_syntaxRules.insert(rule.instr, QList<SyntaxRule>() << rule);
+ rule.instr = ".long";
m_syntaxRules.insert(rule.instr, QList<SyntaxRule>() << rule);
rule.hasListField = false;

Allow .short and .long assembler directives