45 std::cout <<
"Before swapping" << std::endl;
void p_movi(unsigned int result, immed_t immed)
(MOV Immediate) R[result] <– immed
void clear_memory()
Reset to 0 all memory items and mark them as not used.
void println_reg(unsigned int a)
Print the register R[a].
void i_add(unsigned int result, unsigned int a, unsigned int b)
R[result] <– R[a] + R[b].
Instructions set of RiSC16: 8 instructions i_* and 4 pseudo-instructions p_*.
void x_swap(unsigned int a, unsigned int b, unsigned int tmp)
R[a], R[b] <– R[b], R[a].
void clear_registers()
Reset to 0 all registers.
void p_halt(bool print)
If print then call println_all()
void println_all()
Print infos, registers and memory (if used).
void clear_nb_executed()
Reset the number of executed instructions.
Extended instructions set: some extra operations x_* implemented with RiSC16.