trunk/src/emu/cpu/arcompact/arcompactdasm_ops.c
| r242363 | r242364 | |
| 344 | 344 | // fedc ba98 7654 3210 fedc ba98 7654 3210 |
| 345 | 345 | // fields |
| 346 | 346 | // 0001 0bbb ssss ssss SBBB DaaZ ZXAA AAAA |
| 347 | int size = 4; |
| 347 | 348 | |
| 348 | | |
| 349 | 349 | int A = (op & 0x0000003f) >> 0; //op &= ~0x0000003f; |
| 350 | 350 | int X = (op & 0x00000040) >> 6; //op &= ~0x00000040; |
| 351 | 351 | int Z = (op & 0x00000180) >> 7; //op &= ~0x00000180; |
| r242363 | r242364 | |
| 359 | 359 | int breg = b | (B << 3); |
| 360 | 360 | int sdat = s | (S << 8); // todo - signed |
| 361 | 361 | |
| 362 | UINT32 limm = 0; |
| 363 | if (breg == LIMM_REG) |
| 364 | { |
| 365 | GET_LIMM_32; |
| 366 | size = 8; |
| 367 | } |
| 368 | |
| 362 | 369 | output += sprintf( output, "LD"); |
| 363 | 370 | output += sprintf( output, "%s", datasize[Z]); |
| 364 | 371 | output += sprintf( output, "%s", dataextend[X]); |
| r242363 | r242364 | |
| 367 | 374 | output += sprintf( output, " "); |
| 368 | 375 | output += sprintf( output, "%s, ", regnames[A]); |
| 369 | 376 | 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]); |
| 371 | 379 | output += sprintf( output, "%d", sdat); |
| 372 | 380 | output += sprintf( output, "]"); |
| 373 | 381 | |
| 374 | | return 4; |
| 382 | return size; |
| 375 | 383 | } |
| 376 | 384 | |
| 377 | 385 | int arcompact_handle03_dasm(DASM_OPS_32) |
| 378 | 386 | { |
| 387 | int size = 4; |
| 379 | 388 | // 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 |
| 382 | 391 | // 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; |
| 384 | 397 | |
| 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; |
| 387 | 430 | } |
| 388 | 431 | |
| 389 | 432 | |
| r242363 | r242364 | |
| 703 | 746 | |
| 704 | 747 | // 0010 0bbb aa11 0ZZX DBBB CCCC CCAA AAAA |
| 705 | 748 | // note, bits 11 0ZZX are part of the sub-opcode # already - this is a special encoding |
| 706 | | int arcompact_handle04_30_dasm(DASM_OPS_32) { print("LD r-r (basecase 0x30) (%08x)", op); return 4;} |
| 749 | int 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 | |
| 780 | int arcompact_handle04_30_dasm(DASM_OPS_32) { return arcompact_handle04_3x_helper_dasm(output,pc,op,oprom,0,0); } |
| 707 | 781 | // ZZ value of 0x0 with X of 1 is illegal |
| 708 | | int arcompact_handle04_31_dasm(DASM_OPS_32) { print("LD r-r (illegal 0x31) (%08x)", op); return 4;} |
| 709 | | int arcompact_handle04_32_dasm(DASM_OPS_32) { print("LD r-r (basecase 0x32) (%08x)", op); return 4;} |
| 710 | | int arcompact_handle04_33_dasm(DASM_OPS_32) { print("LD r-r (basecase 0x33) (%08x)", op); return 4;} |
| 711 | | int arcompact_handle04_34_dasm(DASM_OPS_32) { print("LD r-r (basecase 0x34) (%08x)", op); return 4;} |
| 712 | | int arcompact_handle04_35_dasm(DASM_OPS_32) { print("LD r-r (basecase 0x35) (%08x)", op); return 4;} |
| 782 | int arcompact_handle04_31_dasm(DASM_OPS_32) { return arcompact_handle04_3x_helper_dasm(output,pc,op,oprom,0,1); } |
| 783 | int arcompact_handle04_32_dasm(DASM_OPS_32) { return arcompact_handle04_3x_helper_dasm(output,pc,op,oprom,1,0); } |
| 784 | int arcompact_handle04_33_dasm(DASM_OPS_32) { return arcompact_handle04_3x_helper_dasm(output,pc,op,oprom,1,1); } |
| 785 | int arcompact_handle04_34_dasm(DASM_OPS_32) { return arcompact_handle04_3x_helper_dasm(output,pc,op,oprom,2,0); } |
| 786 | int arcompact_handle04_35_dasm(DASM_OPS_32) { return arcompact_handle04_3x_helper_dasm(output,pc,op,oprom,2,1); } |
| 713 | 787 | // ZZ value of 0x3 is illegal |
| 714 | | int arcompact_handle04_36_dasm(DASM_OPS_32) { print("LD r-r (illegal 0x36) (%08x)", op); return 4;} |
| 715 | | int arcompact_handle04_37_dasm(DASM_OPS_32) { print("LD r-r (illegal 0x37) (%08x)", op); return 4;} |
| 788 | int arcompact_handle04_36_dasm(DASM_OPS_32) { return arcompact_handle04_3x_helper_dasm(output,pc,op,oprom,3,0); } |
| 789 | int arcompact_handle04_37_dasm(DASM_OPS_32) { return arcompact_handle04_3x_helper_dasm(output,pc,op,oprom,3,1); } |
| 716 | 790 | |
| 717 | 791 | |
| 718 | 792 | |