added disasembly and better demo program
This commit is contained in:
parent
280a3b62fc
commit
ad3078ba48
3 changed files with 651 additions and 105 deletions
|
|
@ -32,6 +32,7 @@ public:
|
|||
private slots:
|
||||
void updateRegisterDisplays();
|
||||
void updateMemoryDisplay();
|
||||
void updateDisassemblyDisplay();
|
||||
void onRegisterFieldChanged();
|
||||
void onMemoryInc256();
|
||||
void onMemoryInc4096();
|
||||
|
|
@ -39,12 +40,23 @@ private slots:
|
|||
void onMemoryDec256();
|
||||
void onMemoryDec4096();
|
||||
void onMemoryDec65536();
|
||||
void onMemoryGoToStart();
|
||||
void onMemoryGoToEnd();
|
||||
void onDisassemblyInc();
|
||||
void onDisassemblyInc16();
|
||||
void onDisassemblyInc256();
|
||||
void onDisassemblyDec();
|
||||
void onDisassemblyDec16();
|
||||
void onDisassemblyDec256();
|
||||
void onDisassemblyGoToStart();
|
||||
void onDisassemblyGoToEnd();
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
std::shared_ptr<Machine> m_machine;
|
||||
std::unique_ptr<MachineController> m_controller;
|
||||
int m_memoryOffset = 0;
|
||||
int m_disassemblyOffset = 0;
|
||||
|
||||
void connectRegisterFields();
|
||||
void updateSingleRegisterDisplay(const QString& fieldName, int value);
|
||||
|
|
@ -53,6 +65,18 @@ private:
|
|||
void handleFloatRegisterFieldChanged(QLineEdit* field, const QString& objectName);
|
||||
void loadDemoProgram();
|
||||
void setupMemoryDisplay();
|
||||
void setupDisassemblyDisplay();
|
||||
|
||||
struct DisassembledInstruction {
|
||||
int address;
|
||||
int size;
|
||||
QString mnemonic;
|
||||
QString operand;
|
||||
int effectiveAddr;
|
||||
bool isImmediate;
|
||||
bool isIndirect;
|
||||
};
|
||||
DisassembledInstruction disassembleAt(int address);
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue