SHARE
TWEET

Untitled

a guest Aug 20th, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int instruction_or(struct s_cpu *cpu, struct s_process *proc) {
  2.   uint8_t pcb;
  3.   uint8_t uvar1;
  4.   int ivar2;
  5.   int type;
  6.   int uvar3;
  7.   int uvar4;
  8.   int uvar5;
  9.   int local_40;
  10.   int local_34;
  11.  
  12.   pcb = read_mem_1(cpu->program, proc->pc + 1);
  13.   uvar4 = check_pcb(pcb, 7);
  14.   if (uvar4 != 0) {
  15.     type = type_from_pcb(pcb, 0);
  16.     ivar2 = size_from_pt(type, 7);
  17.     if (type == T_REG) {
  18.       uvar1 = read_mem_1(cpu->program, proc->pc + 2);
  19.       type = validate_register(uvar1);
  20.       if (type == 0) {
  21.         type = proc->pc;
  22.         uvar3 = size_from_pcb(pcb, 7);
  23.         if (f_verbose & OPT_PCMOVE) {
  24.           print_adv(cpu, proc, type + 2 + uvar3);
  25.         }
  26.         return type + 2 + uvar3;
  27.       }
  28.       uvar4 = read_reg(proc, uvar1);
  29.       local_34 = uvar4;
  30.     } else {
  31.       if (type == T_IND) {
  32.         local_34 =
  33.             read_indirect(cpu, proc, read_mem_2(cpu->program, proc->pc + 2));
  34.       } else {
  35.         local_34 = (int)read_mem_4(cpu->program, proc->pc + 2);
  36.       }
  37.     }
  38.     type = type_from_pcb(pcb, 1);
  39.     uvar4 = size_from_pt(type, 7);
  40.     if (type == T_REG) {
  41.       uvar1 = read_mem_1(cpu->program, proc->pc + 2 + ivar2);
  42.       type = validate_register(uvar1);
  43.       if (type == 0) {
  44.         type = proc->pc;
  45.         uvar3 = size_from_pcb(pcb, 7);
  46.         if (f_verbose & OPT_PCMOVE) {
  47.           print_adv(cpu, proc, type + 2 + uvar3);
  48.         }
  49.         return type + 2 + uvar3;
  50.       }
  51.       uvar5 = read_reg(proc, uvar1);
  52.       local_40 = uvar5;
  53.     } else {
  54.       if (type == T_IND) {
  55.         local_40 = read_indirect(
  56.             cpu, proc, read_mem_2(cpu->program, proc->pc + 2 + ivar2));
  57.       } else {
  58.         local_40 = (int)read_mem_4(cpu->program, proc->pc + 2 + ivar2);
  59.       }
  60.     }
  61.     uvar1 = read_mem_1(cpu->program, proc->pc + 2 + ivar2 + uvar4);
  62.     type = validate_register(uvar1);
  63.     if (type == 0) {
  64.       type = proc->pc;
  65.       uvar3 = size_from_pcb(pcb, 7);
  66.       if (f_verbose & OPT_PCMOVE) {
  67.         print_adv(cpu, proc, type + 2 + uvar3);
  68.       }
  69.       return type + 2 + uvar3;
  70.     }
  71.     if (f_verbose & OPT_INSTR)
  72.       printf("P% 5d | or %d %d r%d\n", proc->pid, local_34, local_40, uvar1);
  73.     mod_carry(proc, (local_34 | local_40) == 0);
  74.     write_reg(proc, uvar1, (local_34 | local_40));
  75.   }
  76.   type = proc->pc;
  77.   uvar3 = size_from_pcb(pcb, 6);
  78.   if (f_verbose & OPT_PCMOVE)
  79.     print_adv(cpu, proc, type + 2 + uvar3);
  80.   return type + 2 + uvar3;
  81. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top