コード例 #1
0
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;
}
コード例 #2
0
ファイル: main.c プロジェクト: iamgroot42/ARMSim
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;
}