private void executeCallStack(Stack<IndexPair> call_stack, List<ISection> sections) {


        //loop until all instructions have ben executed
        while(!call_stack.empty()){
            IndexPair curr_pair = call_stack.pop();
            
            int curr_section_idx = curr_pair.getIndex1();
            int curr_instr_idx = curr_pair.getIndex2();
            
            //Get all instructions in this section
            List<MemoryInstructionPair> instructions = sections.get(curr_section_idx).getAllInstructionObjects();
  
            //A jump address of zero means no jump
            long jump_addr=0;
            
            //Loop until a branch or the end of the section is reached.
            while(jump_addr == 0 && jump_addr != -1 && curr_instr_idx < instructions.size())
            {
                long mem_loc = instructions.get(curr_instr_idx).getmInstructionAddress();
                //Fetch the current instruction and instruction type
                IInstruction curr_inst = instructions.get(curr_instr_idx).getInstruction();
                curr_inst = reverseOpcodes(curr_inst);
                
                InstructionType curr_inst_type = curr_inst.getInstructiontype();
                
                //Execute the instruction
  //              System.out.println("----------------------------------");
 //               System.out.println("Running instruction " + curr_inst_type.name() + " at " + Long.toHexString(mem_loc));
                jump_addr = m_instructions.get(curr_inst_type).execute(m_env, curr_inst);
                
                //If the instruction caused a jump, then push where to return
                //after the jump has completed and then push the instruction
                //being jumped to.
                if(jump_addr > 0) {
  //                  System.err.println("Jumping to " + Long.toHexString(jump_addr));
                    if(curr_inst_type == InstructionType.CALL || curr_inst_type == InstructionType.CALLQ){
                        call_stack.push(new IndexPair(curr_section_idx, curr_instr_idx+1));
                    }
                    
                    call_stack.push(findInstruction(sections, jump_addr));
                   
                }
                else{
                    curr_instr_idx++;
                }
            }          
        }       
        
    }