"jal" command fixes
This commit is contained in:
@@ -130,12 +130,14 @@ void Alu::calculate(const std::vector<std::string> &commandVector) {
|
||||
}
|
||||
} else if (command == "jal") {
|
||||
/// Jump and link Befehl
|
||||
/// !!! Funktioniert nicht bei großen Daten aufgrund des casts des stream offsets zu int
|
||||
const auto pos = static_cast<int>(Manager::getInstance()->getStreamPosition().operator std::streamoff());
|
||||
/// !!! Aufgrund des casts des stream offsets zu int funktioniert das nicht bei großen Quellcode Dateien
|
||||
/// und führt zu undefiniertem Verhalten !!!
|
||||
const auto pos = static_cast<int>(Manager::getInstance()->getNextStreamLineOffset().operator std::streamoff());
|
||||
const auto &label = commandVector.at(2);
|
||||
const auto streamPos = ProgramLoader::getInstance()->getStreamPosition(label);
|
||||
Register::getInstance().setRegister(arg1, pos);
|
||||
Manager::getInstance()->setStreamPosition(streamPos);
|
||||
} else if (command == "jalr") {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user