added "jalr" command
This commit is contained in:
@@ -11,6 +11,7 @@ ProgramLoader *ProgramLoader::getInstance() {
|
||||
}
|
||||
|
||||
[[nodiscard]] std::vector<std::string> ProgramLoader::parseLine(const std::string &input) {
|
||||
if (input.empty()) return std::vector<std::string>{};
|
||||
std::vector<std::string> output{};
|
||||
/// Konvertiere den Input String in einen IStringStream, damit dieser bei Leerzeichen gesplittet werden kann
|
||||
std::istringstream iss(input);
|
||||
@@ -40,6 +41,7 @@ void ProgramLoader::indexFile(std::ifstream &m_programFile) {
|
||||
/// Parse Zeile für Zeile
|
||||
while (std::getline(m_programFile, line)) {
|
||||
auto lineVector = parseLine(line);
|
||||
if (lineVector.empty()) continue;
|
||||
/// Sobald ein Label gefunden wurde, speichere die Position des Streams
|
||||
if (const auto first = lineVector.begin(); first->at(first->length() - 1) == ':') {
|
||||
m_labels[first->substr(0, first->length() - 1)] = m_programFile.tellg();
|
||||
|
||||
Reference in New Issue
Block a user