"jal" command fixes

This commit is contained in:
black
2025-07-08 17:21:46 +02:00
parent f9bd85695a
commit 4fdaf3dafa
3 changed files with 23 additions and 2 deletions

View File

@@ -59,3 +59,15 @@ void Manager::init(const std::string &program_path) {
return;
}
}
std::streampos Manager::getNextStreamLineOffset() {
/// Speichert das aktuelle stream offset
const auto positionBefore = m_programFile.tellg();
/// Geht eine Zeile nach vorne zum nächsten Befehl (PC+4) und speichert den offset
std::string line;
std::getline(m_programFile, line);
const auto positionAfter = m_programFile.tellg();
/// Geht zum offset vom Anfang zurück und gibt die nächste Adresse (PC+4) zurück
m_programFile.seekg(positionBefore);
return positionAfter;
}