Previous 199869 Revisions Next

r33852 Friday 12th December, 2014 at 20:48:01 UTC by David Haywood
sync (nw)
[src/emu/cpu/arcompact]arcompactdasm_ops.c

trunk/src/emu/cpu/arcompact/arcompactdasm_ops.c
r242363r242364
344344   // fedc ba98 7654 3210 fedc ba98 7654 3210
345345   // fields
346346   // 0001 0bbb ssss ssss SBBB DaaZ ZXAA AAAA
347   int size = 4;
347348
348
349349   int A = (op & 0x0000003f) >> 0;  //op &= ~0x0000003f;
350350   int X = (op & 0x00000040) >> 6;  //op &= ~0x00000040;
351351   int Z = (op & 0x00000180) >> 7;  //op &= ~0x00000180;
r242363r242364
359359   int breg = b | (B << 3);
360360   int sdat = s | (S << 8); // todo - signed
361361
362   UINT32 limm = 0;
363   if (breg == LIMM_REG)
364   {
365      GET_LIMM_32;
366      size = 8;
367   }
368
362369   output  += sprintf( output, "LD");
363370   output  += sprintf( output, "%s", datasize[Z]);
364371   output  += sprintf( output, "%s", dataextend[X]);
r242363r242364
367374   output  += sprintf( output, " ");
368375   output  += sprintf( output, "%s, ", regnames[A]);
369376   output  += sprintf( output, "[");
370   output  += sprintf( output, "%s, ", regnames[breg]);
377   if (breg == LIMM_REG) output  += sprintf( output, "(%08x), ", limm);
378   else output  += sprintf( output, "%s, ", regnames[breg]);
371379   output  += sprintf( output, "%d", sdat);
372380   output  += sprintf( output, "]");
373381
374   return 4;
382   return size;
375383}
376384
377385int arcompact_handle03_dasm(DASM_OPS_32)
378386{
387   int size = 4;
379388   // bitpos
380   // 11111 111 11111111 0 000 000000 0 00 00 0
381   // fedcb a98 76543210 f edc ba9876 5 43 21 0
389   // 1111 1111 1111 1111 0000 0000 0000 0000
390   // fedc ba98 7654 3210 fedc ba98 7654 3210
382391   // fields
383   // 00011 bbb ssssssss S BBB CCCCCC D aa ZZ R
392   // 0001 1bbb ssss ssss SBBB CCCC CCDa aZZR
393   int B = (op & 0x00007000) >> 12;// op &= ~0x00007000;
394   int S = (op & 0x00008000) >> 15;// op &= ~0x00008000;
395   int s = (op & 0x00ff0000) >> 16;// op &= ~0x00ff0000;
396   int b = (op & 0x07000000) >> 24;// op &= ~0x07000000;
384397
385   print("ST r+o (%08x)", op );
386   return 4;
398   int breg = b | (B << 3);
399   int sdat = s | (S << 8); // todo - signed
400
401   int R = (op & 0x00000001) >> 0; op &= ~0x00000001;
402   int Z = (op & 0x00000006) >> 1; op &= ~0x00000006;
403   int a = (op & 0x00000018) >> 3; op &= ~0x00000018;
404   int D = (op & 0x00000020) >> 5; op &= ~0x00000020;
405   int C = (op & 0x00000fc0) >> 6; op &= ~0x00000fc0;
406   
407   UINT32 limm = 0;
408   if (breg == LIMM_REG)
409   {
410      GET_LIMM_32;
411      size = 8;
412   }
413
414
415   output  += sprintf( output, "ST");
416   output  += sprintf( output, "%s", datasize[Z]);
417   output  += sprintf( output, "%s", addressmode[a]);
418   output  += sprintf( output, "%s", cachebit[D]);
419   output  += sprintf( output, " ");
420
421   output  += sprintf( output, "%s, ", regnames[C]);
422   if (breg == LIMM_REG) output  += sprintf( output, "(%08x), ", limm);
423   else output  += sprintf( output, "%s, ", regnames[breg]);
424   output  += sprintf( output, "%d", sdat);
425
426   if (R) output  += sprintf( output, "(reserved bit set)");
427
428
429   return size;
387430}
388431
389432
r242363r242364
703746
704747// 0010 0bbb aa11 0ZZX DBBB CCCC CCAA AAAA
705748// note, bits  11 0ZZX are part of the sub-opcode # already - this is a special encoding
706int arcompact_handle04_30_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x30) (%08x)", op); return 4;}
749int arcompact_handle04_3x_helper_dasm(char *output, offs_t pc, UINT32 op, const UINT8* oprom, int dsize, int extend)
750{
751   int size = 4;
752   output += sprintf(output, "LD");
753   output += sprintf(output, "%s", datasize[dsize]);
754   output += sprintf(output, "%s", dataextend[extend]);
755
756   int mode = (op & 0x00c00000) >> 22; op &= ~0x00c00000;
757   int b = (op & 0x07000000) >> 24; op &= ~0x07000000;
758   int B = (op & 0x00007000) >> 12; op &= ~0x00007000;
759   int breg = b | (B << 3);
760   int D = (op & 0x00008000) >> 15;op &= ~0x00008000;
761   int C = (op & 0x00000fc0) >> 6; op &= ~0x00000fc0;
762   int A = (op & 0x0000003f) >> 0; op &= ~0x0000003f;
763
764   output += sprintf(output, "%s", addressmode[mode]);
765   output += sprintf(output, "%s", cachebit[D]);
766
767   output  += sprintf( output, "DST(%s)", regnames[A]);
768   output  += sprintf( output, "SRC1(%s)", regnames[breg]);
769   output  += sprintf( output, "SRC2(%s)", regnames[C]);
770
771   
772
773
774   return size;
775   
776
777
778}
779
780int arcompact_handle04_30_dasm(DASM_OPS_32)  { return arcompact_handle04_3x_helper_dasm(output,pc,op,oprom,0,0); }
707781// 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;}
709int arcompact_handle04_32_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x32) (%08x)", op); return 4;}
710int arcompact_handle04_33_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x33) (%08x)", op); return 4;}
711int arcompact_handle04_34_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x34) (%08x)", op); return 4;}
712int arcompact_handle04_35_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x35) (%08x)", op); return 4;}
782int arcompact_handle04_31_dasm(DASM_OPS_32)  { return arcompact_handle04_3x_helper_dasm(output,pc,op,oprom,0,1); }
783int arcompact_handle04_32_dasm(DASM_OPS_32)  { return arcompact_handle04_3x_helper_dasm(output,pc,op,oprom,1,0); }
784int arcompact_handle04_33_dasm(DASM_OPS_32)  { return arcompact_handle04_3x_helper_dasm(output,pc,op,oprom,1,1); }
785int arcompact_handle04_34_dasm(DASM_OPS_32)  { return arcompact_handle04_3x_helper_dasm(output,pc,op,oprom,2,0); }
786int arcompact_handle04_35_dasm(DASM_OPS_32)  { return arcompact_handle04_3x_helper_dasm(output,pc,op,oprom,2,1); }
713787// 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;}
788int arcompact_handle04_36_dasm(DASM_OPS_32)  { return arcompact_handle04_3x_helper_dasm(output,pc,op,oprom,3,0); }
789int arcompact_handle04_37_dasm(DASM_OPS_32)  { return arcompact_handle04_3x_helper_dasm(output,pc,op,oprom,3,1); }
716790
717791
718792


Previous 199869 Revisions Next


© 1997-2024 The MAME Team