Add float printing to supported system calls
MODIFY
src/processorhandler.cpp
src/processorhandler.cpp
@@ -158,6 +158,12 @@ void ProcessorHandler::handleSysCall() {
emit print(QString::fromUtf8(string));
return;
}
+ case SysCall::PrintFloat: {
+ auto v = m_currentProcessor->getRegister(11);
+ auto v_f = reinterpret_cast<float*>(&v);
+ emit print(QString::number(*v_f));
+ return;
+ }
case SysCall::PrintInt: {
emit print(QString::number(static_cast<int>(m_currentProcessor->getRegister(11))));
return;

MODIFY
src/processors/ripesprocessor.h
src/processors/ripesprocessor.h
#include "../isainfo.h"
namespace Ripes {
-enum SysCall { None = 0, PrintInt = 1, PrintChar = 2, PrintStr = 4, Exit = 10 };
+enum SysCall { None = 0, PrintInt = 1, PrintFloat = 2, PrintStr = 4, Exit = 10, PrintChar = 11 };
struct StageInfo {
StageInfo() {}
@@ -129,9 +129,11 @@ public:
*/
virtual bool finished() const = 0;
+ long long getInstructionsRetired() const { return m_instructionsRetired; }
+
private:
// Statistics
- unsigned int m_instructionsRetired = 0;
+ long long m_instructionsRetired = 0;
};
} // namespace core

Add float printing to supported system calls