Fix COPY command operation
This commit is contained in:
parent
596aaabb6e
commit
76a55261ea
|
@ -64,7 +64,7 @@ std::string Instruction::Copy::toString() const {
|
|||
std::vector<Instruction::OutputFormat> Instruction::Copy::toOutputFormat(const OutputContext &context) const {
|
||||
return std::vector<OutputFormat>{
|
||||
OutputFormat{getAddress(), dynamic_cast<std::stringstream&>(std::stringstream("") << "COPY" << " " << std::dec << (uint32_t)count << ", " << getAddressRegisterName(addressAA)).str()},
|
||||
OutputFormat{getAddress() + 4, dynamic_cast<std::stringstream&>(std::stringstream("") << " SOURCE " << getAddressRegisterName(addressBB)).str()}
|
||||
OutputFormat{getAddress() + 4, dynamic_cast<std::stringstream&>(std::stringstream("") << " TO " << getAddressRegisterName(addressBB)).str()}
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@ std::vector<std::pair<uint32_t, std::unordered_map<uint32_t, uint32_t>>>
|
|||
Instruction::Copy::execute(AnalysisState &state) const {
|
||||
|
||||
for (uint32_t i = 0; i < count; ++i) {
|
||||
state.setRegister(addressAA.offset + addressAA.address + i, state.getRegister(addressBB.offset + addressBB.address + i));
|
||||
state.setRegister(addressBB.offset + addressBB.address + i, state.getRegister(addressAA.offset + addressAA.address + i));
|
||||
}
|
||||
|
||||
state.current = _endAddress;
|
||||
|
|
Loading…
Reference in a new issue