/// Executes decoded operation, using registers in register_bank and data
/// in memory_bank
Executes decoded operation, using registers in register_bank and data
in memory_bank
Executes decoded operation using registers in register_bank and data in memory_bank
pub fn execute(instruction: &Instruction,
        register_bank: &mut RegisterBank, memory_bank: &mut MemoryBank) {
        match instruction {
            Instruction::Nop => (),
            Instruction::BitManipOp {address, bit, set} =>
                Alu::execute_bit_manip(*address, *bit, *set, memory_bank),
            Instruction::Branch { op, test_set, offset } =>
                Alu::execute_branch(*op, *test_set, *offset, register_bank),
            Instruction::CallJmp {is_call, relative, address} =>
                Alu::execute_calljmp(*is_call, *relative, *address, register_bank, memory_bank),
            Instruction::InOut {is_in, reg, address} =>
                Alu::execute_inout(*is_in, *reg, *address, register_bank, memory_bank),
            Instruction::PushPop {is_pop, reg} =>
                Alu::execute_push_pop(*is_pop, *reg,
                register_bank, memory_bank),
            Instruction::RegConstOp {op, rd, constant} =>
                Alu::execute_arith_with_constant(
                *op, *rd, *constant, register_bank),
            Instruction::SkipOp {address, bit, set} =>
                Alu::execute_skip(*address, *bit, *set, register_bank, memory_bank),
            Instruction::TransferIndirect{is_load, pointer, dest, offset} =>
                Alu::execute_transfer_indirect(*is_load, *pointer, *dest,
                 *offset, register_bank, memory_bank),
            Instruction::TransferChangePointer{is_load, pointer, dest, post_inc} =>
                Alu::execute_transfer_change_pointer(*is_load, *pointer, *dest,
                 *post_inc, register_bank, memory_bank),
            Instruction::TwoRegOp {op, rd, rr} => Alu::execute_arithmetic(
                *op, *rd, *rr, register_bank, memory_bank),
            Instruction::OneRegOp {rd, op} => Alu::execute_one_reg_arithmetic(
                *op, *rd, register_bank),
            Instruction::ZeroRegOp{op} =>
                Alu::execute_zero_reg_op(*op, register_bank, memory_bank),
            _ => warn!("Execute - Unknown Instruction: {}", instruction)
        }
    }
pub fn execute ( instruction : & Instruction , register_bank : & mut RegisterBank , memory_bank : & mut MemoryBank ) { match instruction { Instruction :: Nop => ( ) , Instruction :: BitManipOp { address , bit , set } => Alu :: execute_bit_manip ( * address , * bit , * set , memory_bank ) , Instruction :: Branch { op , test_set , offset } => Alu :: execute_branch ( * op , * test_set , * offset , register_bank ) , Instruction :: CallJmp { is_call , relative , address } => Alu :: execute_calljmp ( * is_call , * relative , * address , register_bank , memory_bank ) , Instruction :: InOut { is_in , reg , address } => Alu :: execute_inout ( * is_in , * reg , * address , register_bank , memory_bank ) , Instruction :: PushPop { is_pop , reg } => Alu :: execute_push_pop ( * is_pop , * reg , register_bank , memory_bank ) , Instruction :: RegConstOp { op , rd , constant } => Alu :: execute_arith_with_constant ( * op , * rd , * constant , register_bank ) , Instruction :: SkipOp { address , bit , set } => Alu :: execute_skip ( * address , * bit , * set , register_bank , memory_bank ) , Instruction :: TransferIndirect { is_load , pointer , dest , offset } => Alu :: execute_transfer_indirect ( * is_load , * pointer , * dest , * offset , register_bank , memory_bank ) , Instruction :: TransferChangePointer { is_load , pointer , dest , post_inc } => Alu :: execute_transfer_change_pointer ( * is_load , * pointer , * dest , * post_inc , register_bank , memory_bank ) , Instruction :: TwoRegOp { op , rd , rr } => Alu :: execute_arithmetic ( * op , * rd , * rr , register_bank , memory_bank ) , Instruction :: OneRegOp { rd , op } => Alu :: execute_one_reg_arithmetic ( * op , * rd , register_bank ) , Instruction :: ZeroRegOp { op } => Alu :: execute_zero_reg_op ( * op , register_bank , memory_bank ) , _ => warn ! ( " " instruction ) } }
Executes decoded operation, using registers in register_bank and data
in memory_bank
Executes decoded operation using registers in register_bank and data in memory_bank
instruction
&Instruction
register_bank
&mut RegisterBank
memory_bank
&mut MemoryBank