summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-04-29 11:22:06 -0400
committerbd <bdunahu@operationnull.com>2025-04-29 11:22:06 -0400
commitde05860b750f00e6f9c16144d8949add66f1a785 (patch)
tree4e00862339df317100ce5e9e66e2cb199146bf96
parent930ec733e988c4996918065b4656f0508c6e2df6 (diff)
Fix vector register display from accessing oobs, REM instr display
-rw-r--r--gui/gui.h47
-rw-r--r--gui/registerview.cc4
2 files changed, 27 insertions, 24 deletions
diff --git a/gui/gui.h b/gui/gui.h
index 6cbdc94..3f82898 100644
--- a/gui/gui.h
+++ b/gui/gui.h
@@ -72,7 +72,9 @@ class GUI : public QMainWindow
void onWorkerShowStorage(const QVector<QVector<int>> &data, int i);
- void onWorkerShowRegisters(const QVector<signed int> &gprs, const QVector<QVector<signed int>> &vrs);
+ void onWorkerShowRegisters(
+ const QVector<signed int> &gprs,
+ const QVector<QVector<signed int>> &vrs);
void on_upload_intructions_btn_clicked();
@@ -140,32 +142,35 @@ class GUI : public QMainWindow
/**
* The possible step slider values.
*/
- QVector<long> step_values = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 10000000000};
+ QVector<long> step_values = {1, 10, 100, 1000,
+ 10000, 100000, 1000000, 10000000,
+ 100000000, 1000000000, 10000000000};
QThread workerThread;
Worker *worker;
const std::map<Mnemonic, QString> mnemonicNameMap = {
- {Mnemonic::ADD, "ADD"}, {Mnemonic::SUB, "SUB"},
- {Mnemonic::MUL, "MUL"}, {Mnemonic::QUOT, "QUOT"},
- {Mnemonic::SFTR, "SFTR"}, {Mnemonic::SFTL, "SFTL"},
- {Mnemonic::AND, "AND"}, {Mnemonic::OR, "OR"},
- {Mnemonic::NOT, "NOT"}, {Mnemonic::XOR, "XOR"},
- {Mnemonic::ADDV, "ADDV"}, {Mnemonic::SUBV, "SUBV"},
- {Mnemonic::MULV, "MULV"}, {Mnemonic::DIVV, "DIVV"},
- {Mnemonic::CMP, "CMP"}, {Mnemonic::CEV, "CEV"},
- {Mnemonic::LOAD, "LOAD"}, {Mnemonic::LOADV, "LOADV"},
- {Mnemonic::ADDI, "ADDI"}, {Mnemonic::SUBI, "SUBI"},
- {Mnemonic::SFTRI, "SFTRI"}, {Mnemonic::SFTLI, "SFTLI"},
- {Mnemonic::ANDI, "ANDI"}, {Mnemonic::ORI, "ORI"},
- {Mnemonic::XORI, "XORI"}, {Mnemonic::STORE, "STORE"},
- {Mnemonic::STOREV, "STOREV"}, {Mnemonic::JMP, "JMP"},
- {Mnemonic::JRL, "JRL"}, {Mnemonic::JAL, "JAL"},
- {Mnemonic::BEQ, "BEQ"}, {Mnemonic::BGT, "BGT"},
- {Mnemonic::BUF, "BUF"}, {Mnemonic::BOF, "BOF"},
- {Mnemonic::PUSH, "PUSH"}, {Mnemonic::POP, "POP"},
- {Mnemonic::NOP, "NOP"}, {Mnemonic::RET, "RET"},
+ {Mnemonic::ADD, "ADD"}, {Mnemonic::SUB, "SUB"},
+ {Mnemonic::MUL, "MUL"}, {Mnemonic::QUOT, "QUOT"},
+ {Mnemonic::REM, "REM"}, {Mnemonic::SFTR, "SFTR"},
+ {Mnemonic::SFTL, "SFTL"}, {Mnemonic::AND, "AND"},
+ {Mnemonic::OR, "OR"}, {Mnemonic::NOT, "NOT"},
+ {Mnemonic::XOR, "XOR"}, {Mnemonic::ADDV, "ADDV"},
+ {Mnemonic::SUBV, "SUBV"}, {Mnemonic::MULV, "MULV"},
+ {Mnemonic::DIVV, "DIVV"}, {Mnemonic::CMP, "CMP"},
+ {Mnemonic::CEV, "CEV"}, {Mnemonic::LOAD, "LOAD"},
+ {Mnemonic::LOADV, "LOADV"}, {Mnemonic::ADDI, "ADDI"},
+ {Mnemonic::SUBI, "SUBI"}, {Mnemonic::SFTRI, "SFTRI"},
+ {Mnemonic::SFTLI, "SFTLI"}, {Mnemonic::ANDI, "ANDI"},
+ {Mnemonic::ORI, "ORI"}, {Mnemonic::XORI, "XORI"},
+ {Mnemonic::STORE, "STORE"}, {Mnemonic::STOREV, "STOREV"},
+ {Mnemonic::JMP, "JMP"}, {Mnemonic::JRL, "JRL"},
+ {Mnemonic::JAL, "JAL"}, {Mnemonic::BEQ, "BEQ"},
+ {Mnemonic::BGT, "BGT"}, {Mnemonic::BUF, "BUF"},
+ {Mnemonic::BOF, "BOF"}, {Mnemonic::PUSH, "PUSH"},
+ {Mnemonic::POP, "POP"}, {Mnemonic::NOP, "NOP"},
+ {Mnemonic::RET, "RET"},
};
QString mnemonicToString(Mnemonic mnemonic)
{
diff --git a/gui/registerview.cc b/gui/registerview.cc
index b4fdefc..b8251ac 100644
--- a/gui/registerview.cc
+++ b/gui/registerview.cc
@@ -40,7 +40,7 @@ QVariant RegisterView::data(const QModelIndex &i, int role) const
return QVariant();
}
- return this->vrs[i.row() - GPR_NUM][i.column() - GPR_NUM];
+ return this->vrs[i.row() - GPR_NUM][i.column()];
}
QVariant
@@ -69,5 +69,3 @@ void RegisterView::set_data(const QVector<int> &gprs, const QVector<QVector<int>
this->vrs = vrs;
endResetModel();
}
-
-