added "slli" command
This commit is contained in:
@@ -167,7 +167,7 @@ void Alu::calculate(const std::vector<std::string> &commandVector) {
|
|||||||
const auto posOffset = reg.getRegister(arg2);
|
const auto posOffset = reg.getRegister(arg2);
|
||||||
// Setzt die stream Position auf den gegebenen Wert & erhöht sie um den angegebenen Offset
|
// Setzt die stream Position auf den gegebenen Wert & erhöht sie um den angegebenen Offset
|
||||||
man.setStreamPosition(streamPosLabel);
|
man.setStreamPosition(streamPosLabel);
|
||||||
for (int i = 0; i < posOffset; ++i) {
|
for (int i = 1; i < posOffset; ++i) {
|
||||||
man.gotoNextStreamLine();
|
man.gotoNextStreamLine();
|
||||||
}
|
}
|
||||||
} else if (command == "j") {
|
} else if (command == "j") {
|
||||||
@@ -176,6 +176,12 @@ void Alu::calculate(const std::vector<std::string> &commandVector) {
|
|||||||
for (int i = 1; i < arg1; i++) {
|
for (int i = 1; i < arg1; i++) {
|
||||||
man.gotoNextStreamLine();
|
man.gotoNextStreamLine();
|
||||||
}
|
}
|
||||||
|
} else if (command == "slli") {
|
||||||
|
// Shift Left Logical Immediate Befehl
|
||||||
|
const auto register1 = reg.getRegister(arg2);
|
||||||
|
// Bitshifte den Wert aus Register1 mit dem immediate value
|
||||||
|
const auto result = register1 << arg3;
|
||||||
|
reg.setRegister(arg1, result);
|
||||||
} else {
|
} else {
|
||||||
std::cerr << "Befehl " << command << " wurde nicht gefunden!";
|
std::cerr << "Befehl " << command << " wurde nicht gefunden!";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user