From 9cf92379d5fcf0076c25dae0935daab446c992cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 30 Aug 2017 21:37:53 +0200 Subject: Initial commit Adding work done so far. --- qtmips_cli/machineapp.cpp | 11 +++++++++++ qtmips_cli/machineapp.h | 16 ++++++++++++++++ qtmips_cli/main.cpp | 12 ++++++++++++ qtmips_cli/qtmips_cli.pro | 22 ++++++++++++++++++++++ 4 files changed, 61 insertions(+) create mode 100644 qtmips_cli/machineapp.cpp create mode 100644 qtmips_cli/machineapp.h create mode 100644 qtmips_cli/main.cpp create mode 100644 qtmips_cli/qtmips_cli.pro (limited to 'qtmips_cli') 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 + +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 + +#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 +#include +#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 -- cgit v1.2.3