int main() 
{
  int i; 
  //reset the processor
  reset_proc();
  
  //load the program memory
  load_program_memory();
  print();
  
  
  
  //$$$$$$$$$$$$$$ set pc=0X0
  R[15]=0;
  ex_flag=0;
  //run the simulator  
  run_armsim();
  printreg();

  // $$$$$$$$$$$  printing the memory array
  MEM[w+1]=R[7]+48; 
 // printf("\n\n%d",R[7]);
  printf("\n\nPrinting the elements of MEM array\n\n");
    for(i=0;i<w+2;i++)
      printf("%d ",MEM[i]-48);
  printf("\n"); 
  swi_exit();
  
  return 0;
}
Beispiel #2
0
/**
 * child process exit signal handler
 */
void
sigchld_handler(int sig)
{
	pid_t pid;
	int status;
	while(1) {
		pid = waitpid(WAIT_ANY, &status, WNOHANG);
		if(pid < 0) {
			break;
		}
		if(pid == 0) { break; }
        int ret = reset_proc(pid);
		log_error("process exit. pid=%d, status=%d, idx=%d", pid, status, ret);
	}
}
Beispiel #3
0
int main(int argc, char** argv) {
  char* prog_mem_file; 
  if(argc < 2) {
    printf("Incorrect number of arguments. Please invoke the simulator \n\t./myARMSim <input mem file> \n");
    exit(1);
  }
  
  //reset the processor
  reset_proc();
  //load the program memory
  load_program_memory(argv[1]);
  //run the simulator
  run_armsim();

  return 1;
}