Previous 199869 Revisions Next

r33851 Friday 12th December, 2014 at 18:33:29 UTC by David Haywood
sync (nw)
[src/emu/cpu/arcompact]arcompactdasm_ops.c

trunk/src/emu/cpu/arcompact/arcompactdasm_ops.c
r242362r242363
387387}
388388
389389
390int arcompact_handle04_helper_dasm(char *output, offs_t pc, UINT32 op, const UINT8* oprom, const char* optext, int ignore_dst)
390int arcompact_handle04_helper_dasm(char *output, offs_t pc, UINT32 op, const UINT8* oprom, const char* optext, int ignore_dst, int b_reserved)
391391{
392392   //           PP
393393   // 0010 0bbb 00ii iiii FBBB CCCC CCAA AAAA
r242362r242363
401401
402402   output  += sprintf( output, "%s", optext);
403403   output  += sprintf( output, "%s", flagbit[F]);
404   output  += sprintf( output, " p(%d)", p);
405   output  += sprintf( output, " %s, ", regnames[breg]);
404//   output  += sprintf( output, " p(%d)", p);
405   
406   
407   if (!b_reserved)
408   {
409      output += sprintf(output, " %s, ", regnames[breg]);
410   }
411   else
412   {
413      if (breg) output += sprintf(output, "reserved(%s), ", regnames[breg]);
414   }
406415
416
407417   if (p == 0)
408418   {
409419      // 0010 0bbb 00ii iiii FBBB CCCC CCAA AAAA
r242362r242363
417427         GET_LIMM_32;
418428         size = 8;   
419429         output  += sprintf( output, "(%08x) ", limm );
420         if (!ignore_dst) output  += sprintf( output, "A(%s)", regnames[A]);
421         else  output  += sprintf( output, "unused(%s)", regnames[A]);     
430         if (!ignore_dst) output  += sprintf( output, "DST(%s)", regnames[A]);
431         else
432         {
433            if (A) output += sprintf(output, "unused(%s)", regnames[A]);
434         }
422435      }
423436      else
424437      {
425438         output  += sprintf( output, "C(%s) ", regnames[C]);
426         if (!ignore_dst) output  += sprintf( output, "A(%s)", regnames[A]);
427         else  output  += sprintf( output, "unused(%s)", regnames[A]);     
439         if (!ignore_dst) output  += sprintf( output, "DST(%s)", regnames[A]);
440         else
441         {
442            if (A) output += sprintf(output, "unused(%s)", regnames[A]);
443         }
428444
429445      }
430446   }
r242362r242363
435451      int A = (op & 0x0000003f) >> 0; op &= ~0x0000003f;
436452
437453      output  += sprintf( output, "U(%02x) ", U );
438      if (!ignore_dst) output  += sprintf( output, "A(%s)", regnames[A]);         
439      else  output  += sprintf( output, "unused(%s)", regnames[A]);     
454      if (!ignore_dst) output  += sprintf( output, "DST(%s)", regnames[A]);         
455      else
456      {
457         if (A) output += sprintf(output, "unused(%s)", regnames[A]);
458      }
440459   }
441460   else if (p == 2)
442461   {
r242362r242363
472491
473492int arcompact_handle04_00_dasm(DASM_OPS_32) 
474493{
475   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "ADD", 0);
494   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "ADD", 0,0);
476495}
477496
478497int arcompact_handle04_01_dasm(DASM_OPS_32) 
479498{
480   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "ADC", 0);
499   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "ADC", 0,0);
481500}
482501
483502int arcompact_handle04_02_dasm(DASM_OPS_32) 
484503{
485   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "SUB", 0);
504   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "SUB", 0,0);
486505}
487506
488507int arcompact_handle04_03_dasm(DASM_OPS_32) 
489508{
490   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "SBC", 0);
509   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "SBC", 0,0);
491510}
492511
493512int arcompact_handle04_04_dasm(DASM_OPS_32) 
494513{
495   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "AND", 0);
514   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "AND", 0,0);
496515}
497516
498517int arcompact_handle04_05_dasm(DASM_OPS_32) 
499518{
500   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "OR", 0);
519   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "OR", 0,0);
501520}
502521
503522int arcompact_handle04_06_dasm(DASM_OPS_32) 
504523{
505   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "BIC", 0);
524   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "BIC", 0,0);
506525}
507526
508527int arcompact_handle04_07_dasm(DASM_OPS_32) 
509528{
510   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "XOR", 0);
529   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "XOR", 0,0);
511530}
512531
513532int arcompact_handle04_08_dasm(DASM_OPS_32) 
514533{
515   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "MAX", 0);
534   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "MAX", 0,0);
516535}
517536
518537int arcompact_handle04_09_dasm(DASM_OPS_32)
519538{
520   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "MIN", 0);
539   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "MIN", 0,0);
521540}
522541
523542
524543int arcompact_handle04_0a_dasm(DASM_OPS_32)
525544{
526   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "MOV", 1);
545   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "MOV", 1,0);
527546}
528547
529548int arcompact_handle04_0b_dasm(DASM_OPS_32)
530549{
531   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "TST", 1);
550   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "TST", 1,0);
532551}
533552
534553int arcompact_handle04_0c_dasm(DASM_OPS_32)
535554{
536   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "CMP", 1);
555   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "CMP", 1,0);
537556}
538557
539558int arcompact_handle04_0d_dasm(DASM_OPS_32)
540559{
541   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "RCMP", 1);
560   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "RCMP", 1,0);
542561}
543562
544563int arcompact_handle04_0e_dasm(DASM_OPS_32)
545564{
546   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "RSUB", 0);
565   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "RSUB", 0,0);
547566}
548567
549568int arcompact_handle04_0f_dasm(DASM_OPS_32) 
550569{
551   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "BSET", 0);
570   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "BSET", 0,0);
552571}
553572
554573int arcompact_handle04_10_dasm(DASM_OPS_32) 
555574{
556   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "BCLR", 0);
575   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "BCLR", 0,0);
557576}
558577
559578int arcompact_handle04_11_dasm(DASM_OPS_32) 
560579{
561   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "BTST", 0);
580   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "BTST", 0,0);
562581}
563582
564583int arcompact_handle04_12_dasm(DASM_OPS_32) 
565584{
566   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "BXOR", 0);
585   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "BXOR", 0,0);
567586}
568587
569588int arcompact_handle04_13_dasm(DASM_OPS_32) 
570589{
571   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "BMSK", 0);
590   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "BMSK", 0,0);
572591}
573592
574593int arcompact_handle04_14_dasm(DASM_OPS_32) 
575594{
576   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "ADD1", 0);
595   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "ADD1", 0,0);
577596}
578597
579598int arcompact_handle04_15_dasm(DASM_OPS_32) 
580599{
581   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "ADD2", 0);
600   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "ADD2", 0,0);
582601}
583602
584603int arcompact_handle04_16_dasm(DASM_OPS_32) 
585604{
586   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "ADD3", 0);
605   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "ADD3", 0,0);
587606}
588607
589608int arcompact_handle04_17_dasm(DASM_OPS_32) 
590609{
591   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "SUB1", 0);
610   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "SUB1", 0,0);
592611}
593612
594613int arcompact_handle04_18_dasm(DASM_OPS_32) 
595614{
596   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "SUB2", 0);
615   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "SUB2", 0,0);
597616}
598617
599618int arcompact_handle04_19_dasm(DASM_OPS_32) 
600619{
601   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "SUB3", 0);
620   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "SUB3", 0,0);
602621}
603622
604623int arcompact_handle04_1a_dasm(DASM_OPS_32) 
605624{
606   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "MPY", 0);
625   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "MPY", 0,0);
607626} // *
608627
609628int arcompact_handle04_1b_dasm(DASM_OPS_32) 
610629{
611   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "MPYH", 0);
630   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "MPYH", 0,0);
612631} // *
613632
614633int arcompact_handle04_1c_dasm(DASM_OPS_32) 
615634{
616   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "MPYHU", 0);
635   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "MPYHU", 0,0);
617636} // *
618637
619638int arcompact_handle04_1d_dasm(DASM_OPS_32) 
620639{
621   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "MPYU", 0);
640   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "MPYU", 0,0);
622641} // *
623642
624643
625644
626645int arcompact_handle04_20_dasm(DASM_OPS_32)
627646{
628   // todo, other bits (in none long immediate mode at least)
647   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "J", 1,1);
648}
629649
630   int size = 4;
631   int C = (op & 0x00000fc0) >> 6;
632   UINT8 condition = op & 0x0000001f;
633650
634   op &= ~0x00000fc0;
635   
636   if (C == LIMM_REG)
637   {
638      UINT32 limm;
639      GET_LIMM_32;
640      size = 8;
641     
642      print("J(%s) %08x (%08x)", conditions[condition], limm, op);
643   }
644   else
645   {
646      print("J(%s) (r%d) (%08x)", conditions[condition], C, op);
647   }
648651
649   return size;
652int arcompact_handle04_21_dasm(DASM_OPS_32)
653{
654   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "J.D", 1,1);
650655}
651656
657int arcompact_handle04_22_dasm(DASM_OPS_32)
658{
659   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "JL", 1,1);
660}
652661
662int arcompact_handle04_23_dasm(DASM_OPS_32)
663{
664   return arcompact_handle04_helper_dasm(output, pc, op, oprom, "JL.D", 1,1);
665}
653666
654int arcompact_handle04_21_dasm(DASM_OPS_32)  { print("Jcc.D (%08x)", op); return 4;}
655int arcompact_handle04_22_dasm(DASM_OPS_32)  { print("JLcc (%08x)", op); return 4;}
656int arcompact_handle04_23_dasm(DASM_OPS_32)  { print("JLcc.D (%08x)", op); return 4;}
657667
658668
659669
660
661670int arcompact_handle04_28_dasm(DASM_OPS_32)  { print("LPcc (%08x)", op); return 4;}
662671int arcompact_handle04_29_dasm(DASM_OPS_32)  { print("FLAG (%08x)", op); return 4;}
663672int arcompact_handle04_2a_dasm(DASM_OPS_32)  { print("LR (%08x)", op); return 4;}
r242362r242363
690699
691700
692701
702// format on these is..
693703
694
704// 0010 0bbb aa11 0ZZX DBBB CCCC CCAA AAAA
705// note, bits  11 0ZZX are part of the sub-opcode # already - this is a special encoding
695706int arcompact_handle04_30_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x30) (%08x)", op); return 4;}
696int arcompact_handle04_31_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x31) (%08x)", op); return 4;}
707// ZZ value of 0x0 with X of 1 is illegal
708int arcompact_handle04_31_dasm(DASM_OPS_32)  { print("LD r-r (illegal 0x31) (%08x)", op); return 4;}
697709int arcompact_handle04_32_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x32) (%08x)", op); return 4;}
698710int arcompact_handle04_33_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x33) (%08x)", op); return 4;}
699711int arcompact_handle04_34_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x34) (%08x)", op); return 4;}
700712int arcompact_handle04_35_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x35) (%08x)", op); return 4;}
701int arcompact_handle04_36_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x36) (%08x)", op); return 4;}
702int arcompact_handle04_37_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x37) (%08x)", op); return 4;}
713// ZZ value of 0x3 is illegal
714int arcompact_handle04_36_dasm(DASM_OPS_32)  { print("LD r-r (illegal 0x36) (%08x)", op); return 4;}
715int arcompact_handle04_37_dasm(DASM_OPS_32)  { print("LD r-r (illegal 0x37) (%08x)", op); return 4;}
703716
704717
705718


Previous 199869 Revisions Next


© 1997-2024 The MAME Team