diff options
author | Karel Kočí <cynerd@email.cz> | 2017-08-30 21:37:53 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2017-08-30 21:42:02 +0200 |
commit | 9cf92379d5fcf0076c25dae0935daab446c992cd (patch) | |
tree | dd09a2e996db1e5a8117f01bec76f1e93eaca6e1 /qtmips_cli | |
download | qtmips-9cf92379d5fcf0076c25dae0935daab446c992cd.tar.gz qtmips-9cf92379d5fcf0076c25dae0935daab446c992cd.tar.bz2 qtmips-9cf92379d5fcf0076c25dae0935daab446c992cd.zip |
Initial commit
Adding work done so far.
Diffstat (limited to 'qtmips_cli')
-rw-r--r-- | qtmips_cli/machineapp.cpp | 11 | ||||
-rw-r--r-- | qtmips_cli/machineapp.h | 16 | ||||
-rw-r--r-- | qtmips_cli/main.cpp | 12 | ||||
-rw-r--r-- | qtmips_cli/qtmips_cli.pro | 22 |
4 files changed, 61 insertions, 0 deletions
diff --git a/qtmips_cli/machineapp.cpp b/qtmips_cli/machineapp.cpp new file mode 100644 index 0000000..09fcd3e --- /dev/null +++ b/qtmips_cli/machineapp.cpp @@ -0,0 +1,11 @@ +#include "machineapp.h" +#include <iostream> + +MachineApp::MachineApp(int argc, char **argv) : QCoreApplication(argc, argv) { + connect(this, SIGNAL(aboutToQuit()), this, SLOT(quit())); + // TODO drop hello + std::cout << "Hello\n"; + std::cout.flush(); + // TODO check argc + this->machine = new QtMipsMachine(argv[1]); +} diff --git a/qtmips_cli/machineapp.h b/qtmips_cli/machineapp.h new file mode 100644 index 0000000..6587154 --- /dev/null +++ b/qtmips_cli/machineapp.h @@ -0,0 +1,16 @@ +#ifndef MACHINEAPP_H +#define MACHINEAPP_H + +#include <QCoreApplication> + +#include "qtmipsmachine.h" +#include "programloader.h" + +class MachineApp : public QCoreApplication { +public: + MachineApp(int argc, char **argv); +private: + QtMipsMachine *machine; +}; + +#endif // MACHINEAPP_H diff --git a/qtmips_cli/main.cpp b/qtmips_cli/main.cpp new file mode 100644 index 0000000..780f782 --- /dev/null +++ b/qtmips_cli/main.cpp @@ -0,0 +1,12 @@ +#include <QCoreApplication> +#include <iostream> +#include "machineapp.h" + +#include "instructions/arithmetic.h" + +int main(int argc, char *argv[]) +{ + MachineApp app(argc, argv); + + return app.exec(); +} diff --git a/qtmips_cli/qtmips_cli.pro b/qtmips_cli/qtmips_cli.pro new file mode 100644 index 0000000..a541451 --- /dev/null +++ b/qtmips_cli/qtmips_cli.pro @@ -0,0 +1,22 @@ +QT += core +QT -= gui + +TARGET = qtmips_cli +CONFIG += console +CONFIG -= app_bundle +CONFIG += c++11 + +TEMPLATE = app + +LIBS += -L$$OUT_PWD/../qtmips_machine/ -lqtmips_machine +INCLUDEPATH += $$PWD/../qtmips_machine +DEPENDPATH += $$PWD/../qtmips_machine +QMAKE_CXXFLAGS += -std=c++0x + +DEFINES += QT_DEPRECATED_WARNINGS + +SOURCES += main.cpp \ + machineapp.cpp + +HEADERS += \ + machineapp.h |