diff options
Diffstat (limited to 'instruction.cpp')
-rw-r--r-- | instruction.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/instruction.cpp b/instruction.cpp index 2b67c8e..8509eb6 100644 --- a/instruction.cpp +++ b/instruction.cpp @@ -48,3 +48,17 @@ add_instruction::execute(emulator & emulator) emulator.set_value(m_dst[i], val); } } + +mov_instruction::mov_instruction(std::vector<register_address> dst) : + instruction("MOV", NULL, dst, 1) + { } + +void +mov_instruction::execute(emulator & emulator) +{ + unsigned int i; + for (i = 0; i < m_dst.size(); i++) { + emulator.set_value(m_dst[i], + emulator.get_value(m_src_regs[0][i])); + } +} |