Add ecall argument '2' for printing unicode chars
Now, ecall 2 will print the value present in register a1 as the corresponding unicode character
MODIFY
src/pipeline.h
src/pipeline.h
@@ -15,7 +15,7 @@ public:
enum CompOp { BEQ = 1, BNE = 2, BLT = 3, BLTU = 4, BGE = 5, BGEU = 6 };
enum MemRead { LB = 1, LH = 2, LW = 3, LBU = 4, LHU = 5 };
enum MemWrite { SB = 1, SH = 2, SW = 3 };
- enum ECALL { none, print_int = 1, print_string = 4, exit = 10 };
+ enum ECALL { none, print_int = 1, print_char = 2, print_string = 4, exit = 10 };
enum PCSRC { PC4, BR, JALR };
Pipeline();
// Utility functions

MODIFY
src/processortab.cpp
src/processortab.cpp
@@ -209,6 +209,10 @@ bool ProcessorTab::handleEcall(const std::pair<Pipeline::ECALL, int32_t>& ecall_
emit appendToLog(QString::number(ecall_val.second));
break;
}
+ case Pipeline::ECALL::print_char: {
+ emit appendToLog(QChar(ecall_val.second));
+ break;
+ }
case Pipeline::ECALL::exit: {
return true; // The simulator will now take a few cycles to stop
}

Add ecall argument '2' for printing unicode chars

Now, ecall 2 will print the value present in register a1 as the corresponding unicode character