trunk/src/emu/cpu/arcompact/arcompactdasm_ops.c
| r242426 | r242427 | |
| 198 | 198 | #define GET_01_01_01_BRANCH_ADDR \ |
| 199 | 199 | INT32 address = (op & 0x00fe0000) >> 17; \ |
| 200 | 200 | address |= ((op & 0x00008000) >> 15) << 7; \ |
| 201 | | if (address & 0x80) address = -(address & 0x7f); \ |
| 201 | if (address & 0x80) address = -0x80 + (address & 0x7f); \ |
| 202 | 202 | op &= ~ 0x00fe800f; |
| 203 | 203 | |
| 204 | 204 | |
| r242426 | r242427 | |
| 248 | 248 | limm = oprom[4] | (oprom[5] << 8); \ |
| 249 | 249 | limm |= (oprom[2] << 16) | (oprom[3] << 24); \ |
| 250 | 250 | |
| 251 | #define PC_ALIGNED32 \ |
| 252 | (pc&0xfffffffc) |
| 251 | 253 | |
| 254 | |
| 252 | 255 | /************************************************************************************************************************************ |
| 253 | 256 | * * |
| 254 | 257 | * individual opcode handlers (disassembly) * |
| r242426 | r242427 | |
| 262 | 265 | // 0000 0sss ssss sss0 SSSS SSSS SSNQ QQQQ |
| 263 | 266 | INT32 address = (op & 0x07fe0000) >> 17; |
| 264 | 267 | address |= ((op & 0x0000ffc0) >> 6) << 10; |
| 265 | | if (address & 0x800000) address = -(address & 0x7fffff); |
| 268 | if (address & 0x800000) address = -0x800000 + (address & 0x7fffff); |
| 266 | 269 | int n = (op & 0x00000020) >> 5; op &= ~0x00000020; |
| 267 | 270 | UINT8 condition = op & 0x0000001f; |
| 268 | 271 | |
| 269 | | output += sprintf( output, "B%s(%s) %08x", delaybit[n], conditions[condition], pc + (address * 2)); |
| 272 | output += sprintf( output, "B%s(%s) %08x", delaybit[n], conditions[condition], PC_ALIGNED32 + (address * 2)); |
| 270 | 273 | return size; |
| 271 | 274 | } |
| 272 | 275 | |
| r242426 | r242427 | |
| 278 | 281 | INT32 address = (op & 0x07fe0000) >> 17; |
| 279 | 282 | address |= ((op & 0x0000ffc0) >> 6) << 10; |
| 280 | 283 | address |= ((op & 0x0000000f) >> 0) << 20; |
| 281 | | if (address & 0x800000) address = -(address & 0x7fffff); |
| 284 | if (address & 0x800000) address = -0x800000 + (address & 0x7fffff); |
| 282 | 285 | int n = (op & 0x00000020) >> 5; op &= ~0x00000020; |
| 283 | 286 | int res = (op & 0x00000010) >> 4; op &= ~0x00000010; |
| 284 | 287 | |
| 285 | | output += sprintf( output, "B%s %08x", delaybit[n], pc + (address * 2) ); |
| 288 | output += sprintf( output, "B%s %08x", delaybit[n], PC_ALIGNED32 + (address * 2) ); |
| 286 | 289 | if (res) output += sprintf(output, "(reserved bit set)"); |
| 287 | 290 | |
| 288 | 291 | return size; |
| r242426 | r242427 | |
| 296 | 299 | // 00001 sssssssss 00 SSSSSSSSSS N QQQQQ |
| 297 | 300 | INT32 address = (op & 0x07fc0000) >> 17; |
| 298 | 301 | address |= ((op & 0x0000ffc0) >> 6) << 10; |
| 299 | | if (address & 0x800000) address = -(address&0x7fffff); |
| 302 | if (address & 0x800000) address = -0x800000 + (address&0x7fffff); |
| 300 | 303 | int n = (op & 0x00000020) >> 5; op &= ~0x00000020; |
| 301 | 304 | |
| 302 | 305 | UINT8 condition = op & 0x0000001f; |
| 303 | 306 | |
| 304 | | output += sprintf( output, "BL%s(%s) %08x", delaybit[n], conditions[condition], pc + (address *2) ); |
| 307 | output += sprintf( output, "BL%s(%s) %08x", delaybit[n], conditions[condition], PC_ALIGNED32 + (address *2) ); |
| 305 | 308 | return size; |
| 306 | 309 | } |
| 307 | 310 | |
| r242426 | r242427 | |
| 313 | 316 | INT32 address = (op & 0x07fc0000) >> 17; |
| 314 | 317 | address |= ((op & 0x0000ffc0) >> 6) << 10; |
| 315 | 318 | address |= ((op & 0x0000000f) >> 0) << 20; |
| 316 | | if (address & 0x800000) address = -(address&0x7fffff); |
| 319 | if (address & 0x800000) address = -0x800000 + (address&0x7fffff); |
| 317 | 320 | int n = (op & 0x00000020) >> 5; op &= ~0x00000020; |
| 318 | 321 | int res = (op & 0x00000010) >> 4; op &= ~0x00000010; |
| 319 | 322 | |
| 320 | | output += sprintf( output, "BL%s %08x", delaybit[n], pc + (address *2) ); |
| 323 | output += sprintf( output, "BL%s %08x", delaybit[n], PC_ALIGNED32 + (address *2) ); |
| 321 | 324 | if (res) output += sprintf(output, "(reserved bit set)"); |
| 322 | 325 | |
| 323 | 326 | return size; |
| r242426 | r242427 | |
| 325 | 328 | |
| 326 | 329 | |
| 327 | 330 | |
| 328 | | int arcompact_01_01_00_helper(char *output, offs_t pc, UINT32 op, const UINT8* oprom, const char* optext) |
| 331 | int arcompact_01_01_00_helper(DASM_OPS_32, const char* optext) |
| 329 | 332 | { |
| 330 | 333 | int size = 4; |
| 331 | 334 | |
| r242426 | r242427 | |
| 343 | 346 | |
| 344 | 347 | if ((b != LIMM_REG) && (c != LIMM_REG)) |
| 345 | 348 | { |
| 346 | | print("%s%s %s, %s %08x (%08x)", optext, delaybit[n], regnames[b], regnames[c], pc + (address * 2) + 4, op & ~0xf8fe800f); |
| 349 | print("%s%s %s, %s %08x (%08x)", optext, delaybit[n], regnames[b], regnames[c], PC_ALIGNED32 + (address * 2), op & ~0xf8fe800f); |
| 347 | 350 | } |
| 348 | 351 | else |
| 349 | 352 | { |
| r242426 | r242427 | |
| 353 | 356 | |
| 354 | 357 | if ((b == LIMM_REG) && (c != LIMM_REG)) |
| 355 | 358 | { |
| 356 | | print("%s%s (%08x) %s %08x (%08x)", optext, delaybit[n], limm, regnames[b], pc + (address * 2) + 4, op & ~0xf8fe800f); |
| 359 | print("%s%s (%08x) %s %08x (%08x)", optext, delaybit[n], limm, regnames[b], PC_ALIGNED32 + (address * 2), op & ~0xf8fe800f); |
| 357 | 360 | } |
| 358 | 361 | else if ((c == LIMM_REG) && (b != LIMM_REG)) |
| 359 | 362 | { |
| 360 | | print("%s%s %s, (%08x) %08x (%08x)", optext, delaybit[n], regnames[b], limm, pc + (address * 2) + 4, op & ~0xf8fe800f); |
| 363 | print("%s%s %s, (%08x) %08x (%08x)", optext, delaybit[n], regnames[b], limm, PC_ALIGNED32 + (address * 2), op & ~0xf8fe800f); |
| 361 | 364 | } |
| 362 | 365 | else |
| 363 | 366 | { |
| 364 | 367 | // b and c are LIMM? invalid?? |
| 365 | | print("%s%s (%08x), (%08x) (illegal?) %08x (%08x)", optext, delaybit[n], limm, limm, pc + (address * 2) + 4, op & ~0xf8fe800f); |
| 368 | print("%s%s (%08x), (%08x) (illegal?) %08x (%08x)", optext, delaybit[n], limm, limm, PC_ALIGNED32 + (address * 2), op & ~0xf8fe800f); |
| 366 | 369 | |
| 367 | 370 | } |
| 368 | 371 | } |
| r242426 | r242427 | |
| 372 | 375 | |
| 373 | 376 | |
| 374 | 377 | // register - register cases |
| 375 | | int arcompact_handle01_01_00_00_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( output, pc, op, oprom, "BREQ"); } |
| 376 | | int arcompact_handle01_01_00_01_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( output, pc, op, oprom, "BRNE"); } |
| 377 | | int arcompact_handle01_01_00_02_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( output, pc, op, oprom, "BRLT"); } |
| 378 | | int arcompact_handle01_01_00_03_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( output, pc, op, oprom, "BRGE"); } |
| 379 | | int arcompact_handle01_01_00_04_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( output, pc, op, oprom, "BRLO"); } |
| 380 | | int arcompact_handle01_01_00_05_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( output, pc, op, oprom, "BRHS"); } |
| 381 | | int arcompact_handle01_01_00_0e_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( output, pc, op, oprom, "BBIT0");} |
| 382 | | int arcompact_handle01_01_00_0f_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( output, pc, op, oprom, "BBIT1");} |
| 378 | int arcompact_handle01_01_00_00_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( DASM_PARAMS, "BREQ"); } |
| 379 | int arcompact_handle01_01_00_01_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( DASM_PARAMS, "BRNE"); } |
| 380 | int arcompact_handle01_01_00_02_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( DASM_PARAMS, "BRLT"); } |
| 381 | int arcompact_handle01_01_00_03_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( DASM_PARAMS, "BRGE"); } |
| 382 | int arcompact_handle01_01_00_04_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( DASM_PARAMS, "BRLO"); } |
| 383 | int arcompact_handle01_01_00_05_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( DASM_PARAMS, "BRHS"); } |
| 384 | int arcompact_handle01_01_00_0e_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( DASM_PARAMS, "BBIT0");} |
| 385 | int arcompact_handle01_01_00_0f_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( DASM_PARAMS, "BBIT1");} |
| 383 | 386 | |
| 384 | | int arcompact_01_01_01_helper(char *output, offs_t pc, UINT32 op, const UINT8* oprom, const char* optext) |
| 387 | int arcompact_01_01_01_helper(DASM_OPS_32, const char* optext) |
| 385 | 388 | { |
| 386 | 389 | int size = 4; |
| 387 | 390 | |
| r242426 | r242427 | |
| 399 | 402 | |
| 400 | 403 | op &= ~0x07007fe0; |
| 401 | 404 | |
| 402 | | print("%s%s %s, 0x%02x %08x (%08x)", optext, delaybit[n], regnames[b], u, pc + (address * 2) + 4, op & ~0xf8fe800f); |
| 405 | print("%s%s %s, 0x%02x %08x (%08x)", optext, delaybit[n], regnames[b], u, PC_ALIGNED32 + (address * 2), op & ~0xf8fe800f); |
| 403 | 406 | |
| 404 | 407 | return size; |
| 405 | 408 | } |
| 406 | 409 | |
| 407 | 410 | // register -immediate cases |
| 408 | | int arcompact_handle01_01_01_00_dasm(DASM_OPS_32) { return arcompact_01_01_01_helper(output, pc, op, oprom, "BREQ"); } |
| 409 | | int arcompact_handle01_01_01_01_dasm(DASM_OPS_32) { return arcompact_01_01_01_helper(output, pc, op, oprom, "BRNE"); } |
| 410 | | int arcompact_handle01_01_01_02_dasm(DASM_OPS_32) { return arcompact_01_01_01_helper(output, pc, op, oprom, "BRLT"); } |
| 411 | | int arcompact_handle01_01_01_03_dasm(DASM_OPS_32) { return arcompact_01_01_01_helper(output, pc, op, oprom, "BRGE"); } |
| 412 | | int arcompact_handle01_01_01_04_dasm(DASM_OPS_32) { return arcompact_01_01_01_helper(output, pc, op, oprom, "BRLO"); } |
| 413 | | int arcompact_handle01_01_01_05_dasm(DASM_OPS_32) { return arcompact_01_01_01_helper(output, pc, op, oprom, "BRHS"); } |
| 414 | | int arcompact_handle01_01_01_0e_dasm(DASM_OPS_32) { return arcompact_01_01_01_helper(output, pc, op, oprom, "BBIT0"); } |
| 415 | | int arcompact_handle01_01_01_0f_dasm(DASM_OPS_32) { return arcompact_01_01_01_helper(output, pc, op, oprom, "BBIT1"); } |
| 411 | int arcompact_handle01_01_01_00_dasm(DASM_OPS_32) { return arcompact_01_01_01_helper(DASM_PARAMS, "BREQ"); } |
| 412 | int arcompact_handle01_01_01_01_dasm(DASM_OPS_32) { return arcompact_01_01_01_helper(DASM_PARAMS, "BRNE"); } |
| 413 | int arcompact_handle01_01_01_02_dasm(DASM_OPS_32) { return arcompact_01_01_01_helper(DASM_PARAMS, "BRLT"); } |
| 414 | int arcompact_handle01_01_01_03_dasm(DASM_OPS_32) { return arcompact_01_01_01_helper(DASM_PARAMS, "BRGE"); } |
| 415 | int arcompact_handle01_01_01_04_dasm(DASM_OPS_32) { return arcompact_01_01_01_helper(DASM_PARAMS, "BRLO"); } |
| 416 | int arcompact_handle01_01_01_05_dasm(DASM_OPS_32) { return arcompact_01_01_01_helper(DASM_PARAMS, "BRHS"); } |
| 417 | int arcompact_handle01_01_01_0e_dasm(DASM_OPS_32) { return arcompact_01_01_01_helper(DASM_PARAMS, "BBIT0"); } |
| 418 | int arcompact_handle01_01_01_0f_dasm(DASM_OPS_32) { return arcompact_01_01_01_helper(DASM_PARAMS, "BBIT1"); } |
| 416 | 419 | |
| 417 | 420 | |
| 418 | 421 | int arcompact_handle02_dasm(DASM_OPS_32) |
| r242426 | r242427 | |
| 511 | 514 | } |
| 512 | 515 | |
| 513 | 516 | |
| 514 | | int arcompact_handle04_helper_dasm(char *output, offs_t pc, UINT32 op, const UINT8* oprom, const char* optext, int ignore_dst, int b_reserved) |
| 517 | int arcompact_handle04_helper_dasm(DASM_OPS_32, const char* optext, int ignore_dst, int b_reserved) |
| 515 | 518 | { |
| 516 | 519 | // PP |
| 517 | 520 | // 0010 0bbb 00ii iiii FBBB CCCC CCAA AAAA |
| r242426 | r242427 | |
| 615 | 618 | |
| 616 | 619 | int arcompact_handle04_00_dasm(DASM_OPS_32) |
| 617 | 620 | { |
| 618 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "ADD", 0,0); |
| 621 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "ADD", 0,0); |
| 619 | 622 | } |
| 620 | 623 | |
| 621 | 624 | int arcompact_handle04_01_dasm(DASM_OPS_32) |
| 622 | 625 | { |
| 623 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "ADC", 0,0); |
| 626 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "ADC", 0,0); |
| 624 | 627 | } |
| 625 | 628 | |
| 626 | 629 | int arcompact_handle04_02_dasm(DASM_OPS_32) |
| 627 | 630 | { |
| 628 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "SUB", 0,0); |
| 631 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "SUB", 0,0); |
| 629 | 632 | } |
| 630 | 633 | |
| 631 | 634 | int arcompact_handle04_03_dasm(DASM_OPS_32) |
| 632 | 635 | { |
| 633 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "SBC", 0,0); |
| 636 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "SBC", 0,0); |
| 634 | 637 | } |
| 635 | 638 | |
| 636 | 639 | int arcompact_handle04_04_dasm(DASM_OPS_32) |
| 637 | 640 | { |
| 638 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "AND", 0,0); |
| 641 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "AND", 0,0); |
| 639 | 642 | } |
| 640 | 643 | |
| 641 | 644 | int arcompact_handle04_05_dasm(DASM_OPS_32) |
| 642 | 645 | { |
| 643 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "OR", 0,0); |
| 646 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "OR", 0,0); |
| 644 | 647 | } |
| 645 | 648 | |
| 646 | 649 | int arcompact_handle04_06_dasm(DASM_OPS_32) |
| 647 | 650 | { |
| 648 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "BIC", 0,0); |
| 651 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "BIC", 0,0); |
| 649 | 652 | } |
| 650 | 653 | |
| 651 | 654 | int arcompact_handle04_07_dasm(DASM_OPS_32) |
| 652 | 655 | { |
| 653 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "XOR", 0,0); |
| 656 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "XOR", 0,0); |
| 654 | 657 | } |
| 655 | 658 | |
| 656 | 659 | int arcompact_handle04_08_dasm(DASM_OPS_32) |
| 657 | 660 | { |
| 658 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "MAX", 0,0); |
| 661 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "MAX", 0,0); |
| 659 | 662 | } |
| 660 | 663 | |
| 661 | 664 | int arcompact_handle04_09_dasm(DASM_OPS_32) |
| 662 | 665 | { |
| 663 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "MIN", 0,0); |
| 666 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "MIN", 0,0); |
| 664 | 667 | } |
| 665 | 668 | |
| 666 | 669 | |
| 667 | 670 | int arcompact_handle04_0a_dasm(DASM_OPS_32) |
| 668 | 671 | { |
| 669 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "MOV", 1,0); |
| 672 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "MOV", 1,0); |
| 670 | 673 | } |
| 671 | 674 | |
| 672 | 675 | int arcompact_handle04_0b_dasm(DASM_OPS_32) |
| 673 | 676 | { |
| 674 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "TST", 1,0); |
| 677 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "TST", 1,0); |
| 675 | 678 | } |
| 676 | 679 | |
| 677 | 680 | int arcompact_handle04_0c_dasm(DASM_OPS_32) |
| 678 | 681 | { |
| 679 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "CMP", 1,0); |
| 682 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "CMP", 1,0); |
| 680 | 683 | } |
| 681 | 684 | |
| 682 | 685 | int arcompact_handle04_0d_dasm(DASM_OPS_32) |
| 683 | 686 | { |
| 684 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "RCMP", 1,0); |
| 687 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "RCMP", 1,0); |
| 685 | 688 | } |
| 686 | 689 | |
| 687 | 690 | int arcompact_handle04_0e_dasm(DASM_OPS_32) |
| 688 | 691 | { |
| 689 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "RSUB", 0,0); |
| 692 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "RSUB", 0,0); |
| 690 | 693 | } |
| 691 | 694 | |
| 692 | 695 | int arcompact_handle04_0f_dasm(DASM_OPS_32) |
| 693 | 696 | { |
| 694 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "BSET", 0,0); |
| 697 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "BSET", 0,0); |
| 695 | 698 | } |
| 696 | 699 | |
| 697 | 700 | int arcompact_handle04_10_dasm(DASM_OPS_32) |
| 698 | 701 | { |
| 699 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "BCLR", 0,0); |
| 702 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "BCLR", 0,0); |
| 700 | 703 | } |
| 701 | 704 | |
| 702 | 705 | int arcompact_handle04_11_dasm(DASM_OPS_32) |
| 703 | 706 | { |
| 704 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "BTST", 0,0); |
| 707 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "BTST", 0,0); |
| 705 | 708 | } |
| 706 | 709 | |
| 707 | 710 | int arcompact_handle04_12_dasm(DASM_OPS_32) |
| 708 | 711 | { |
| 709 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "BXOR", 0,0); |
| 712 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "BXOR", 0,0); |
| 710 | 713 | } |
| 711 | 714 | |
| 712 | 715 | int arcompact_handle04_13_dasm(DASM_OPS_32) |
| 713 | 716 | { |
| 714 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "BMSK", 0,0); |
| 717 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "BMSK", 0,0); |
| 715 | 718 | } |
| 716 | 719 | |
| 717 | 720 | int arcompact_handle04_14_dasm(DASM_OPS_32) |
| 718 | 721 | { |
| 719 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "ADD1", 0,0); |
| 722 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "ADD1", 0,0); |
| 720 | 723 | } |
| 721 | 724 | |
| 722 | 725 | int arcompact_handle04_15_dasm(DASM_OPS_32) |
| 723 | 726 | { |
| 724 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "ADD2", 0,0); |
| 727 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "ADD2", 0,0); |
| 725 | 728 | } |
| 726 | 729 | |
| 727 | 730 | int arcompact_handle04_16_dasm(DASM_OPS_32) |
| 728 | 731 | { |
| 729 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "ADD3", 0,0); |
| 732 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "ADD3", 0,0); |
| 730 | 733 | } |
| 731 | 734 | |
| 732 | 735 | int arcompact_handle04_17_dasm(DASM_OPS_32) |
| 733 | 736 | { |
| 734 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "SUB1", 0,0); |
| 737 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "SUB1", 0,0); |
| 735 | 738 | } |
| 736 | 739 | |
| 737 | 740 | int arcompact_handle04_18_dasm(DASM_OPS_32) |
| 738 | 741 | { |
| 739 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "SUB2", 0,0); |
| 742 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "SUB2", 0,0); |
| 740 | 743 | } |
| 741 | 744 | |
| 742 | 745 | int arcompact_handle04_19_dasm(DASM_OPS_32) |
| 743 | 746 | { |
| 744 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "SUB3", 0,0); |
| 747 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "SUB3", 0,0); |
| 745 | 748 | } |
| 746 | 749 | |
| 747 | 750 | int arcompact_handle04_1a_dasm(DASM_OPS_32) |
| 748 | 751 | { |
| 749 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "MPY", 0,0); |
| 752 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "MPY", 0,0); |
| 750 | 753 | } // * |
| 751 | 754 | |
| 752 | 755 | int arcompact_handle04_1b_dasm(DASM_OPS_32) |
| 753 | 756 | { |
| 754 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "MPYH", 0,0); |
| 757 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "MPYH", 0,0); |
| 755 | 758 | } // * |
| 756 | 759 | |
| 757 | 760 | int arcompact_handle04_1c_dasm(DASM_OPS_32) |
| 758 | 761 | { |
| 759 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "MPYHU", 0,0); |
| 762 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "MPYHU", 0,0); |
| 760 | 763 | } // * |
| 761 | 764 | |
| 762 | 765 | int arcompact_handle04_1d_dasm(DASM_OPS_32) |
| 763 | 766 | { |
| 764 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "MPYU", 0,0); |
| 767 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "MPYU", 0,0); |
| 765 | 768 | } // * |
| 766 | 769 | |
| 767 | 770 | |
| 768 | 771 | |
| 769 | 772 | int arcompact_handle04_20_dasm(DASM_OPS_32) |
| 770 | 773 | { |
| 771 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "J", 1,1); |
| 774 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "J", 1,1); |
| 772 | 775 | } |
| 773 | 776 | |
| 774 | 777 | |
| 775 | 778 | |
| 776 | 779 | int arcompact_handle04_21_dasm(DASM_OPS_32) |
| 777 | 780 | { |
| 778 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "J.D", 1,1); |
| 781 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "J.D", 1,1); |
| 779 | 782 | } |
| 780 | 783 | |
| 781 | 784 | int arcompact_handle04_22_dasm(DASM_OPS_32) |
| 782 | 785 | { |
| 783 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "JL", 1,1); |
| 786 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "JL", 1,1); |
| 784 | 787 | } |
| 785 | 788 | |
| 786 | 789 | int arcompact_handle04_23_dasm(DASM_OPS_32) |
| 787 | 790 | { |
| 788 | | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "JL.D", 1,1); |
| 791 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "JL.D", 1,1); |
| 789 | 792 | } |
| 790 | 793 | |
| 791 | 794 | |
| r242426 | r242427 | |
| 797 | 800 | int arcompact_handle04_2b_dasm(DASM_OPS_32) { print("SR (%08x)", op); return 4;} |
| 798 | 801 | |
| 799 | 802 | |
| 800 | | int arcompact_handle04_2f_helper_dasm(char *output, offs_t pc, UINT32 op, const UINT8* oprom, const char* optext) |
| 803 | int arcompact_handle04_2f_helper_dasm(DASM_OPS_32, const char* optext) |
| 801 | 804 | { |
| 802 | 805 | // |
| 803 | 806 | // 0010 0bbb pp10 1111 FBBB CCCC CCII IIII |
| r242426 | r242427 | |
| 851 | 854 | } |
| 852 | 855 | |
| 853 | 856 | |
| 854 | | int arcompact_handle04_2f_00_dasm(DASM_OPS_32) { return arcompact_handle04_2f_helper_dasm(output, pc, op, oprom, "ASL"); } // ASL |
| 855 | | int arcompact_handle04_2f_01_dasm(DASM_OPS_32) { return arcompact_handle04_2f_helper_dasm(output, pc, op, oprom, "ASR"); } // ASR |
| 856 | | int arcompact_handle04_2f_02_dasm(DASM_OPS_32) { return arcompact_handle04_2f_helper_dasm(output, pc, op, oprom, "LSR"); } // LSR |
| 857 | | int arcompact_handle04_2f_03_dasm(DASM_OPS_32) { return arcompact_handle04_2f_helper_dasm(output, pc, op, oprom, "ROR"); } // ROR |
| 858 | | int arcompact_handle04_2f_04_dasm(DASM_OPS_32) { return arcompact_handle04_2f_helper_dasm(output, pc, op, oprom, "RCC"); } // RCC |
| 859 | | int arcompact_handle04_2f_05_dasm(DASM_OPS_32) { return arcompact_handle04_2f_helper_dasm(output, pc, op, oprom, "SEXB"); } // SEXB |
| 860 | | int arcompact_handle04_2f_06_dasm(DASM_OPS_32) { return arcompact_handle04_2f_helper_dasm(output, pc, op, oprom, "SEXW"); } // SEXW |
| 861 | | int arcompact_handle04_2f_07_dasm(DASM_OPS_32) { return arcompact_handle04_2f_helper_dasm(output, pc, op, oprom, "EXTB"); } // EXTB |
| 862 | | int arcompact_handle04_2f_08_dasm(DASM_OPS_32) { return arcompact_handle04_2f_helper_dasm(output, pc, op, oprom, "EXTW"); } // EXTW |
| 863 | | int arcompact_handle04_2f_09_dasm(DASM_OPS_32) { return arcompact_handle04_2f_helper_dasm(output, pc, op, oprom, "ABS"); } // ABS |
| 864 | | int arcompact_handle04_2f_0a_dasm(DASM_OPS_32) { return arcompact_handle04_2f_helper_dasm(output, pc, op, oprom, "NOT"); } // NOT |
| 865 | | int arcompact_handle04_2f_0b_dasm(DASM_OPS_32) { return arcompact_handle04_2f_helper_dasm(output, pc, op, oprom, "RCL"); } // RLC |
| 866 | | int arcompact_handle04_2f_0c_dasm(DASM_OPS_32) { return arcompact_handle04_2f_helper_dasm(output, pc, op, oprom, "EX"); } // EX |
| 857 | int arcompact_handle04_2f_00_dasm(DASM_OPS_32) { return arcompact_handle04_2f_helper_dasm(DASM_PARAMS, "ASL"); } // ASL |
| 858 | int arcompact_handle04_2f_01_dasm(DASM_OPS_32) { return arcompact_handle04_2f_helper_dasm(DASM_PARAMS, "ASR"); } // ASR |
| 859 | int arcompact_handle04_2f_02_dasm(DASM_OPS_32) { return arcompact_handle04_2f_helper_dasm(DASM_PARAMS, "LSR"); } // LSR |
| 860 | int arcompact_handle04_2f_03_dasm(DASM_OPS_32) { return arcompact_handle04_2f_helper_dasm(DASM_PARAMS, "ROR"); } // ROR |
| 861 | int arcompact_handle04_2f_04_dasm(DASM_OPS_32) { return arcompact_handle04_2f_helper_dasm(DASM_PARAMS, "RCC"); } // RCC |
| 862 | int arcompact_handle04_2f_05_dasm(DASM_OPS_32) { return arcompact_handle04_2f_helper_dasm(DASM_PARAMS, "SEXB"); } // SEXB |
| 863 | int arcompact_handle04_2f_06_dasm(DASM_OPS_32) { return arcompact_handle04_2f_helper_dasm(DASM_PARAMS, "SEXW"); } // SEXW |
| 864 | int arcompact_handle04_2f_07_dasm(DASM_OPS_32) { return arcompact_handle04_2f_helper_dasm(DASM_PARAMS, "EXTB"); } // EXTB |
| 865 | int arcompact_handle04_2f_08_dasm(DASM_OPS_32) { return arcompact_handle04_2f_helper_dasm(DASM_PARAMS, "EXTW"); } // EXTW |
| 866 | int arcompact_handle04_2f_09_dasm(DASM_OPS_32) { return arcompact_handle04_2f_helper_dasm(DASM_PARAMS, "ABS"); } // ABS |
| 867 | int arcompact_handle04_2f_0a_dasm(DASM_OPS_32) { return arcompact_handle04_2f_helper_dasm(DASM_PARAMS, "NOT"); } // NOT |
| 868 | int arcompact_handle04_2f_0b_dasm(DASM_OPS_32) { return arcompact_handle04_2f_helper_dasm(DASM_PARAMS, "RCL"); } // RLC |
| 869 | int arcompact_handle04_2f_0c_dasm(DASM_OPS_32) { return arcompact_handle04_2f_helper_dasm(DASM_PARAMS, "EX"); } // EX |
| 867 | 870 | |
| 868 | 871 | |
| 869 | 872 | int arcompact_handle04_2f_3f_01_dasm(DASM_OPS_32) { print("SLEEP (%08x)", op); return 4;} |
| r242426 | r242427 | |
| 880 | 883 | |
| 881 | 884 | // 0010 0bbb aa11 0ZZX DBBB CCCC CCAA AAAA |
| 882 | 885 | // note, bits 11 0ZZX are part of the sub-opcode # already - this is a special encoding |
| 883 | | int arcompact_handle04_3x_helper_dasm(char *output, offs_t pc, UINT32 op, const UINT8* oprom, int dsize, int extend) |
| 886 | int arcompact_handle04_3x_helper_dasm(DASM_OPS_32, int dsize, int extend) |
| 884 | 887 | { |
| 885 | 888 | int size = 4; |
| 886 | 889 | output += sprintf(output, "LD"); |
| r242426 | r242427 | |
| 911 | 914 | |
| 912 | 915 | } |
| 913 | 916 | |
| 914 | | int arcompact_handle04_30_dasm(DASM_OPS_32) { return arcompact_handle04_3x_helper_dasm(output,pc,op,oprom,0,0); } |
| 917 | int arcompact_handle04_30_dasm(DASM_OPS_32) { return arcompact_handle04_3x_helper_dasm(DASM_PARAMS,0,0); } |
| 915 | 918 | // ZZ value of 0x0 with X of 1 is illegal |
| 916 | | int arcompact_handle04_31_dasm(DASM_OPS_32) { return arcompact_handle04_3x_helper_dasm(output,pc,op,oprom,0,1); } |
| 917 | | int arcompact_handle04_32_dasm(DASM_OPS_32) { return arcompact_handle04_3x_helper_dasm(output,pc,op,oprom,1,0); } |
| 918 | | int arcompact_handle04_33_dasm(DASM_OPS_32) { return arcompact_handle04_3x_helper_dasm(output,pc,op,oprom,1,1); } |
| 919 | | int arcompact_handle04_34_dasm(DASM_OPS_32) { return arcompact_handle04_3x_helper_dasm(output,pc,op,oprom,2,0); } |
| 920 | | int arcompact_handle04_35_dasm(DASM_OPS_32) { return arcompact_handle04_3x_helper_dasm(output,pc,op,oprom,2,1); } |
| 919 | int arcompact_handle04_31_dasm(DASM_OPS_32) { return arcompact_handle04_3x_helper_dasm(DASM_PARAMS,0,1); } |
| 920 | int arcompact_handle04_32_dasm(DASM_OPS_32) { return arcompact_handle04_3x_helper_dasm(DASM_PARAMS,1,0); } |
| 921 | int arcompact_handle04_33_dasm(DASM_OPS_32) { return arcompact_handle04_3x_helper_dasm(DASM_PARAMS,1,1); } |
| 922 | int arcompact_handle04_34_dasm(DASM_OPS_32) { return arcompact_handle04_3x_helper_dasm(DASM_PARAMS,2,0); } |
| 923 | int arcompact_handle04_35_dasm(DASM_OPS_32) { return arcompact_handle04_3x_helper_dasm(DASM_PARAMS,2,1); } |
| 921 | 924 | // ZZ value of 0x3 is illegal |
| 922 | | int arcompact_handle04_36_dasm(DASM_OPS_32) { return arcompact_handle04_3x_helper_dasm(output,pc,op,oprom,3,0); } |
| 923 | | int arcompact_handle04_37_dasm(DASM_OPS_32) { return arcompact_handle04_3x_helper_dasm(output,pc,op,oprom,3,1); } |
| 925 | int arcompact_handle04_36_dasm(DASM_OPS_32) { return arcompact_handle04_3x_helper_dasm(DASM_PARAMS,3,0); } |
| 926 | int arcompact_handle04_37_dasm(DASM_OPS_32) { return arcompact_handle04_3x_helper_dasm(DASM_PARAMS,3,1); } |
| 924 | 927 | |
| 925 | 928 | |
| 926 | 929 | |
| r242426 | r242427 | |
| 989 | 992 | |
| 990 | 993 | |
| 991 | 994 | |
| 992 | | int arcompact_handle0c_helper_dasm(char *output, offs_t pc, UINT16 op, const UINT8* oprom, const char* optext) |
| 995 | int arcompact_handle0c_helper_dasm(DASM_OPS_16, const char* optext) |
| 993 | 996 | { |
| 994 | 997 | int areg, breg, creg; |
| 995 | 998 | |
| r242426 | r242427 | |
| 1009 | 1012 | |
| 1010 | 1013 | int arcompact_handle0c_00_dasm(DASM_OPS_16) |
| 1011 | 1014 | { |
| 1012 | | return arcompact_handle0c_helper_dasm(output, pc, op, oprom, "LD_S"); |
| 1015 | return arcompact_handle0c_helper_dasm(DASM_PARAMS, "LD_S"); |
| 1013 | 1016 | } |
| 1014 | 1017 | |
| 1015 | 1018 | int arcompact_handle0c_01_dasm(DASM_OPS_16) |
| 1016 | 1019 | { |
| 1017 | | return arcompact_handle0c_helper_dasm(output, pc, op, oprom, "LDB_S"); |
| 1020 | return arcompact_handle0c_helper_dasm(DASM_PARAMS, "LDB_S"); |
| 1018 | 1021 | } |
| 1019 | 1022 | |
| 1020 | 1023 | int arcompact_handle0c_02_dasm(DASM_OPS_16) |
| 1021 | 1024 | { |
| 1022 | | return arcompact_handle0c_helper_dasm(output, pc, op, oprom, "LDW_S"); |
| 1025 | return arcompact_handle0c_helper_dasm(DASM_PARAMS, "LDW_S"); |
| 1023 | 1026 | } |
| 1024 | 1027 | |
| 1025 | 1028 | int arcompact_handle0c_03_dasm(DASM_OPS_16) |
| 1026 | 1029 | { |
| 1027 | | return arcompact_handle0c_helper_dasm(output, pc, op, oprom, "ADD_S"); |
| 1030 | return arcompact_handle0c_helper_dasm(DASM_PARAMS, "ADD_S"); |
| 1028 | 1031 | } |
| 1029 | 1032 | |
| 1030 | 1033 | |
| 1031 | | int arcompact_handle0d_helper_dasm(char *output, offs_t pc, UINT16 op, const UINT8* oprom, const char* optext) |
| 1034 | int arcompact_handle0d_helper_dasm(DASM_OPS_16, const char* optext) |
| 1032 | 1035 | { |
| 1033 | 1036 | int u, breg, creg; |
| 1034 | 1037 | |
| r242426 | r242427 | |
| 1046 | 1049 | |
| 1047 | 1050 | int arcompact_handle0d_00_dasm(DASM_OPS_16) |
| 1048 | 1051 | { |
| 1049 | | return arcompact_handle0d_helper_dasm(output, pc, op, oprom, "ADD_S"); |
| 1052 | return arcompact_handle0d_helper_dasm(DASM_PARAMS, "ADD_S"); |
| 1050 | 1053 | } |
| 1051 | 1054 | |
| 1052 | 1055 | int arcompact_handle0d_01_dasm(DASM_OPS_16) |
| 1053 | 1056 | { |
| 1054 | | return arcompact_handle0d_helper_dasm(output, pc, op, oprom, "SUB_S"); |
| 1057 | return arcompact_handle0d_helper_dasm(DASM_PARAMS, "SUB_S"); |
| 1055 | 1058 | } |
| 1056 | 1059 | |
| 1057 | 1060 | int arcompact_handle0d_02_dasm(DASM_OPS_16) |
| 1058 | 1061 | { |
| 1059 | | return arcompact_handle0d_helper_dasm(output, pc, op, oprom, "ASL_S"); |
| 1062 | return arcompact_handle0d_helper_dasm(DASM_PARAMS, "ASL_S"); |
| 1060 | 1063 | } |
| 1061 | 1064 | |
| 1062 | 1065 | int arcompact_handle0d_03_dasm(DASM_OPS_16) |
| 1063 | 1066 | { |
| 1064 | | return arcompact_handle0d_helper_dasm(output, pc, op, oprom, "ASR_S"); |
| 1067 | return arcompact_handle0d_helper_dasm(DASM_PARAMS, "ASR_S"); |
| 1065 | 1068 | } |
| 1066 | 1069 | |
| 1067 | 1070 | |
| 1068 | 1071 | |
| 1069 | | int arcompact_handle0e_0x_helper_dasm(char *output, offs_t pc, UINT16 op, const UINT8* oprom, const char* optext, int revop) |
| 1072 | int arcompact_handle0e_0x_helper_dasm(DASM_OPS_16, const char* optext, int revop) |
| 1070 | 1073 | { |
| 1071 | 1074 | int h,breg; |
| 1072 | 1075 | int size = 2; |
| r242426 | r242427 | |
| 1096 | 1099 | |
| 1097 | 1100 | int arcompact_handle0e_00_dasm(DASM_OPS_16) |
| 1098 | 1101 | { |
| 1099 | | return arcompact_handle0e_0x_helper_dasm(output, pc, op, oprom, "ADD_S", 0); |
| 1102 | return arcompact_handle0e_0x_helper_dasm(DASM_PARAMS, "ADD_S", 0); |
| 1100 | 1103 | } |
| 1101 | 1104 | |
| 1102 | 1105 | int arcompact_handle0e_01_dasm(DASM_OPS_16) |
| 1103 | 1106 | { |
| 1104 | | return arcompact_handle0e_0x_helper_dasm(output, pc, op, oprom, "MOV_S", 0); |
| 1107 | return arcompact_handle0e_0x_helper_dasm(DASM_PARAMS, "MOV_S", 0); |
| 1105 | 1108 | } |
| 1106 | 1109 | |
| 1107 | 1110 | int arcompact_handle0e_02_dasm(DASM_OPS_16) |
| 1108 | 1111 | { |
| 1109 | | return arcompact_handle0e_0x_helper_dasm(output, pc, op, oprom, "CMP_S", 0); |
| 1112 | return arcompact_handle0e_0x_helper_dasm(DASM_PARAMS, "CMP_S", 0); |
| 1110 | 1113 | } |
| 1111 | 1114 | |
| 1112 | 1115 | int arcompact_handle0e_03_dasm(DASM_OPS_16) |
| 1113 | 1116 | { |
| 1114 | | return arcompact_handle0e_0x_helper_dasm(output, pc, op, oprom, "MOV_S", 1); |
| 1117 | return arcompact_handle0e_0x_helper_dasm(DASM_PARAMS, "MOV_S", 1); |
| 1115 | 1118 | } |
| 1116 | 1119 | |
| 1117 | 1120 | |
| r242426 | r242427 | |
| 1172 | 1175 | int arcompact_handle0f_1f_dasm(DASM_OPS_16) { print("BRK_S (%08x)", op); return 2;} |
| 1173 | 1176 | |
| 1174 | 1177 | |
| 1175 | | int arcompact_handle_ld_helper_dasm(char *output, offs_t pc, UINT16 op, const UINT8* oprom, const char* optext, int shift, int swap) |
| 1178 | int arcompact_handle_ld_helper_dasm(DASM_OPS_16, const char* optext, int shift, int swap) |
| 1176 | 1179 | { |
| 1177 | 1180 | int breg, creg, u; |
| 1178 | 1181 | |
| r242426 | r242427 | |
| 1194 | 1197 | |
| 1195 | 1198 | int arcompact_handle10_dasm(DASM_OPS_16) |
| 1196 | 1199 | { |
| 1197 | | return arcompact_handle_ld_helper_dasm(output, pc, op, oprom, "LD_S", 2, 0); |
| 1200 | return arcompact_handle_ld_helper_dasm(DASM_PARAMS, "LD_S", 2, 0); |
| 1198 | 1201 | } |
| 1199 | 1202 | |
| 1200 | 1203 | int arcompact_handle11_dasm(DASM_OPS_16) |
| 1201 | 1204 | { |
| 1202 | | return arcompact_handle_ld_helper_dasm(output, pc, op, oprom, "LDB_S", 0, 0); |
| 1205 | return arcompact_handle_ld_helper_dasm(DASM_PARAMS, "LDB_S", 0, 0); |
| 1203 | 1206 | } |
| 1204 | 1207 | |
| 1205 | 1208 | int arcompact_handle12_dasm(DASM_OPS_16) |
| 1206 | 1209 | { |
| 1207 | | return arcompact_handle_ld_helper_dasm(output, pc, op, oprom, "LDW_S", 1, 0); |
| 1210 | return arcompact_handle_ld_helper_dasm(DASM_PARAMS, "LDW_S", 1, 0); |
| 1208 | 1211 | } |
| 1209 | 1212 | |
| 1210 | 1213 | int arcompact_handle13_dasm(DASM_OPS_16) |
| 1211 | 1214 | { |
| 1212 | | return arcompact_handle_ld_helper_dasm(output, pc, op, oprom, "LDW_S.X", 1, 0); |
| 1215 | return arcompact_handle_ld_helper_dasm(DASM_PARAMS, "LDW_S.X", 1, 0); |
| 1213 | 1216 | } |
| 1214 | 1217 | |
| 1215 | 1218 | int arcompact_handle14_dasm(DASM_OPS_16) |
| 1216 | 1219 | { |
| 1217 | | return arcompact_handle_ld_helper_dasm(output, pc, op, oprom, "ST_S", 2, 1); |
| 1220 | return arcompact_handle_ld_helper_dasm(DASM_PARAMS, "ST_S", 2, 1); |
| 1218 | 1221 | } |
| 1219 | 1222 | |
| 1220 | 1223 | int arcompact_handle15_dasm(DASM_OPS_16) |
| 1221 | 1224 | { |
| 1222 | | return arcompact_handle_ld_helper_dasm(output, pc, op, oprom, "STB_S", 0, 1); |
| 1225 | return arcompact_handle_ld_helper_dasm(DASM_PARAMS, "STB_S", 0, 1); |
| 1223 | 1226 | } |
| 1224 | 1227 | |
| 1225 | 1228 | int arcompact_handle16_dasm(DASM_OPS_16) |
| 1226 | 1229 | { |
| 1227 | | return arcompact_handle_ld_helper_dasm(output, pc, op, oprom, "STW_S", 1, 1); |
| 1230 | return arcompact_handle_ld_helper_dasm(DASM_PARAMS, "STW_S", 1, 1); |
| 1228 | 1231 | } |
| 1229 | 1232 | |
| 1230 | 1233 | |
| r242426 | r242427 | |
| 1432 | 1435 | return 2; |
| 1433 | 1436 | } |
| 1434 | 1437 | |
| 1435 | | int arcompact_handle1d_helper_dasm(char *output, offs_t pc, UINT16 op, const UINT8* oprom, const char* optext) |
| 1438 | int arcompact_handle1d_helper_dasm(DASM_OPS_16, const char* optext) |
| 1436 | 1439 | { |
| 1437 | 1440 | int breg; |
| 1438 | 1441 | COMMON16_GET_breg; |
| r242426 | r242427 | |
| 1441 | 1444 | int s = (op & 0x007f) >> 0; op &= ~0x007f; |
| 1442 | 1445 | if (s & 0x40) s = -0x40 + (s & 0x3f); |
| 1443 | 1446 | |
| 1444 | | print("%s %s %08x", optext, regnames[breg], (pc&0xfffffffc) + s*2); |
| 1447 | print("%s %s %08x", optext, regnames[breg], PC_ALIGNED32 + s*2); |
| 1445 | 1448 | return 2; |
| 1446 | 1449 | } |
| 1447 | 1450 | |
| 1448 | 1451 | |
| 1449 | | int arcompact_handle1d_00_dasm(DASM_OPS_16) { return arcompact_handle1d_helper_dasm(output,pc,op,oprom,"BREQ_S"); } |
| 1450 | | int arcompact_handle1d_01_dasm(DASM_OPS_16) { return arcompact_handle1d_helper_dasm(output,pc,op,oprom,"BRNE_S"); } |
| 1452 | int arcompact_handle1d_00_dasm(DASM_OPS_16) { return arcompact_handle1d_helper_dasm(DASM_PARAMS,"BREQ_S"); } |
| 1453 | int arcompact_handle1d_01_dasm(DASM_OPS_16) { return arcompact_handle1d_helper_dasm(DASM_PARAMS,"BRNE_S"); } |
| 1451 | 1454 | |
| 1452 | 1455 | |
| 1453 | | int arcompact_handle1e_0x_helper_dasm(char *output, offs_t pc, UINT16 op, const UINT8* oprom, const char* optext) |
| 1456 | int arcompact_handle1e_0x_helper_dasm(DASM_OPS_16, const char* optext) |
| 1454 | 1457 | { |
| 1455 | 1458 | int s = (op & 0x01ff) >> 0; op &= ~0x01ff; |
| 1456 | 1459 | if (s & 0x100) s = -0x100 + (s & 0xff); |
| 1457 | 1460 | |
| 1458 | | print("%s %08x", optext, (pc&0xfffffffc) + s*2); |
| 1461 | print("%s %08x", optext, PC_ALIGNED32 + s*2); |
| 1459 | 1462 | return 2; |
| 1460 | 1463 | } |
| 1461 | 1464 | |
| 1462 | 1465 | |
| 1463 | 1466 | |
| 1464 | | int arcompact_handle1e_00_dasm(DASM_OPS_16) { return arcompact_handle1e_0x_helper_dasm(output, pc, op, oprom, "BL_S"); } |
| 1465 | | int arcompact_handle1e_01_dasm(DASM_OPS_16) { return arcompact_handle1e_0x_helper_dasm(output, pc, op, oprom, "BEQ_S"); } |
| 1466 | | int arcompact_handle1e_02_dasm(DASM_OPS_16) { return arcompact_handle1e_0x_helper_dasm(output, pc, op, oprom, "BNE_S"); } |
| 1467 | int arcompact_handle1e_00_dasm(DASM_OPS_16) { return arcompact_handle1e_0x_helper_dasm(DASM_PARAMS, "BL_S"); } |
| 1468 | int arcompact_handle1e_01_dasm(DASM_OPS_16) { return arcompact_handle1e_0x_helper_dasm(DASM_PARAMS, "BEQ_S"); } |
| 1469 | int arcompact_handle1e_02_dasm(DASM_OPS_16) { return arcompact_handle1e_0x_helper_dasm(DASM_PARAMS, "BNE_S"); } |
| 1467 | 1470 | |
| 1468 | | int arcompact_handle1e_03_0x_helper_dasm(char *output, offs_t pc, UINT16 op, const UINT8* oprom, const char* optext) |
| 1471 | int arcompact_handle1e_03_0x_helper_dasm(DASM_OPS_16, const char* optext) |
| 1469 | 1472 | { |
| 1470 | 1473 | int s = (op & 0x003f) >> 0; op &= ~0x003f; |
| 1471 | 1474 | if (s & 0x020) s = -0x20 + (s & 0x1f); |
| 1472 | 1475 | |
| 1473 | | print("%s %08x", optext, (pc&0xfffffffc) + s*2); |
| 1476 | print("%s %08x", optext, PC_ALIGNED32 + s*2); |
| 1474 | 1477 | return 2; |
| 1475 | 1478 | } |
| 1476 | 1479 | |
| 1477 | | int arcompact_handle1e_03_00_dasm(DASM_OPS_16) { return arcompact_handle1e_03_0x_helper_dasm(output, pc, op, oprom, "BGT_S"); } |
| 1478 | | int arcompact_handle1e_03_01_dasm(DASM_OPS_16) { return arcompact_handle1e_03_0x_helper_dasm(output, pc, op, oprom, "BGE_S"); } |
| 1479 | | int arcompact_handle1e_03_02_dasm(DASM_OPS_16) { return arcompact_handle1e_03_0x_helper_dasm(output, pc, op, oprom, "BLT_S"); } |
| 1480 | | int arcompact_handle1e_03_03_dasm(DASM_OPS_16) { return arcompact_handle1e_03_0x_helper_dasm(output, pc, op, oprom, "BLE_S"); } |
| 1481 | | int arcompact_handle1e_03_04_dasm(DASM_OPS_16) { return arcompact_handle1e_03_0x_helper_dasm(output, pc, op, oprom, "BHI_S"); } |
| 1482 | | int arcompact_handle1e_03_05_dasm(DASM_OPS_16) { return arcompact_handle1e_03_0x_helper_dasm(output, pc, op, oprom, "BHS_S"); } |
| 1483 | | int arcompact_handle1e_03_06_dasm(DASM_OPS_16) { return arcompact_handle1e_03_0x_helper_dasm(output, pc, op, oprom, "BLO_S"); } |
| 1484 | | int arcompact_handle1e_03_07_dasm(DASM_OPS_16) { return arcompact_handle1e_03_0x_helper_dasm(output, pc, op, oprom, "BLS_S"); } |
| 1480 | int arcompact_handle1e_03_00_dasm(DASM_OPS_16) { return arcompact_handle1e_03_0x_helper_dasm(DASM_PARAMS, "BGT_S"); } |
| 1481 | int arcompact_handle1e_03_01_dasm(DASM_OPS_16) { return arcompact_handle1e_03_0x_helper_dasm(DASM_PARAMS, "BGE_S"); } |
| 1482 | int arcompact_handle1e_03_02_dasm(DASM_OPS_16) { return arcompact_handle1e_03_0x_helper_dasm(DASM_PARAMS, "BLT_S"); } |
| 1483 | int arcompact_handle1e_03_03_dasm(DASM_OPS_16) { return arcompact_handle1e_03_0x_helper_dasm(DASM_PARAMS, "BLE_S"); } |
| 1484 | int arcompact_handle1e_03_04_dasm(DASM_OPS_16) { return arcompact_handle1e_03_0x_helper_dasm(DASM_PARAMS, "BHI_S"); } |
| 1485 | int arcompact_handle1e_03_05_dasm(DASM_OPS_16) { return arcompact_handle1e_03_0x_helper_dasm(DASM_PARAMS, "BHS_S"); } |
| 1486 | int arcompact_handle1e_03_06_dasm(DASM_OPS_16) { return arcompact_handle1e_03_0x_helper_dasm(DASM_PARAMS, "BLO_S"); } |
| 1487 | int arcompact_handle1e_03_07_dasm(DASM_OPS_16) { return arcompact_handle1e_03_0x_helper_dasm(DASM_PARAMS, "BLS_S"); } |
| 1485 | 1488 | |
| 1486 | 1489 | int arcompact_handle1f_dasm(DASM_OPS_16) |
| 1487 | 1490 | { |
| 1488 | 1491 | int s = (op & 0x07ff) >> 0; op &= ~0x07ff; |
| 1489 | 1492 | if (s & 0x400) s = -0x400 + (s & 0x3ff); |
| 1490 | 1493 | |
| 1491 | | print("BL_S %08x", (pc&0xfffffffc) + (s*4)); |
| 1494 | print("BL_S %08x", PC_ALIGNED32 + (s*4)); |
| 1492 | 1495 | return 2; |
| 1493 | 1496 | } |
| 1494 | 1497 | |