trunk/src/emu/cpu/arcompact/arcompactdasm.c
| r242268 | r242269 | |
| 295 | 295 | int arcompact_handle05_3f_dasm(DASM_OPS_32); |
| 296 | 296 | |
| 297 | 297 | |
| 298 | int arcompact_handle0c_00_dasm(DASM_OPS_16); |
| 299 | int arcompact_handle0c_01_dasm(DASM_OPS_16); |
| 300 | int arcompact_handle0c_02_dasm(DASM_OPS_16); |
| 301 | int arcompact_handle0c_03_dasm(DASM_OPS_16); |
| 298 | 302 | |
| 303 | int arcompact_handle0d_00_dasm(DASM_OPS_16); |
| 304 | int arcompact_handle0d_01_dasm(DASM_OPS_16); |
| 305 | int arcompact_handle0d_02_dasm(DASM_OPS_16); |
| 306 | int arcompact_handle0d_03_dasm(DASM_OPS_16); |
| 299 | 307 | |
| 300 | 308 | int arcompact_handle0e_00_dasm(DASM_OPS_16); |
| 301 | 309 | int arcompact_handle0e_01_dasm(DASM_OPS_16); |
| 302 | 310 | int arcompact_handle0e_02_dasm(DASM_OPS_16); |
| 303 | 311 | int arcompact_handle0e_03_dasm(DASM_OPS_16); |
| 304 | 312 | |
| 313 | int arcompact_handle17_00_dasm(DASM_OPS_16); |
| 314 | int arcompact_handle17_01_dasm(DASM_OPS_16); |
| 315 | int arcompact_handle17_02_dasm(DASM_OPS_16); |
| 316 | int arcompact_handle17_03_dasm(DASM_OPS_16); |
| 317 | int arcompact_handle17_04_dasm(DASM_OPS_16); |
| 318 | int arcompact_handle17_05_dasm(DASM_OPS_16); |
| 319 | int arcompact_handle17_06_dasm(DASM_OPS_16); |
| 320 | int arcompact_handle17_07_dasm(DASM_OPS_16); |
| 321 | |
| 305 | 322 | int arcompact_handle18_00_dasm(DASM_OPS_16); |
| 306 | 323 | int arcompact_handle18_01_dasm(DASM_OPS_16); |
| 307 | 324 | int arcompact_handle18_02_dasm(DASM_OPS_16); |
| r242268 | r242269 | |
| 1332 | 1349 | |
| 1333 | 1350 | int arcompact_handle0c_dasm(DASM_OPS_16) |
| 1334 | 1351 | { |
| 1335 | | print("Load/Add reg-reg (%04x)", op); |
| 1336 | | return 2; |
| 1352 | int size = 2; |
| 1353 | UINT8 subinstr = (op & 0x0018) >> 3; |
| 1354 | op &= ~0x0018; |
| 1355 | |
| 1356 | switch (subinstr) |
| 1357 | { |
| 1358 | case 0x00: size = arcompact_handle0c_00_dasm(DASM_PARAMS); break; // LD_S |
| 1359 | case 0x01: size = arcompact_handle0c_01_dasm(DASM_PARAMS); break; // LDB_S |
| 1360 | case 0x02: size = arcompact_handle0c_02_dasm(DASM_PARAMS); break; // LDW_S |
| 1361 | case 0x03: size = arcompact_handle0c_03_dasm(DASM_PARAMS); break; // ADD_S |
| 1362 | } |
| 1363 | return size; |
| 1337 | 1364 | } |
| 1338 | 1365 | |
| 1366 | |
| 1367 | int arcompact_handle0c_00_dasm(DASM_OPS_16) |
| 1368 | { |
| 1369 | int size = 2; |
| 1370 | print("LD_S a <- m[b + c].long (%04x)", op); |
| 1371 | return size; |
| 1372 | } |
| 1373 | |
| 1374 | int arcompact_handle0c_01_dasm(DASM_OPS_16) |
| 1375 | { |
| 1376 | int size = 2; |
| 1377 | print("LDB_S a <- m[b + c].byte (%04x)", op); |
| 1378 | return size; |
| 1379 | } |
| 1380 | |
| 1381 | int arcompact_handle0c_02_dasm(DASM_OPS_16) |
| 1382 | { |
| 1383 | int size = 2; |
| 1384 | print("LDW_S a <- m[b + c].word (%04x)", op); |
| 1385 | return size; |
| 1386 | } |
| 1387 | |
| 1388 | int arcompact_handle0c_03_dasm(DASM_OPS_16) |
| 1389 | { |
| 1390 | int size = 2; |
| 1391 | print("ADD_S a <- b + c (%04x)", op); |
| 1392 | return size; |
| 1393 | } |
| 1394 | |
| 1395 | |
| 1339 | 1396 | int arcompact_handle0d_dasm(DASM_OPS_16) |
| 1340 | 1397 | { |
| 1341 | | print("Add/Sub/Shft imm (%04x)", op); |
| 1342 | | return 2; |
| 1398 | int size = 2; |
| 1399 | UINT8 subinstr = (op & 0x0018) >> 3; |
| 1400 | op &= ~0x0018; |
| 1401 | |
| 1402 | switch (subinstr) |
| 1403 | { |
| 1404 | case 0x00: size = arcompact_handle0d_00_dasm(DASM_PARAMS); break; // ADD_S |
| 1405 | case 0x01: size = arcompact_handle0d_01_dasm(DASM_PARAMS); break; // SUB_S |
| 1406 | case 0x02: size = arcompact_handle0d_02_dasm(DASM_PARAMS); break; // ASL_S |
| 1407 | case 0x03: size = arcompact_handle0d_03_dasm(DASM_PARAMS); break; // ASR_S |
| 1408 | } |
| 1409 | return size; |
| 1343 | 1410 | } |
| 1344 | 1411 | |
| 1412 | int arcompact_handle0d_00_dasm(DASM_OPS_16) |
| 1413 | { |
| 1414 | int size = 2; |
| 1415 | print("ADD_S c <- b + u3 (%04x)", op); |
| 1416 | return size; |
| 1417 | } |
| 1418 | |
| 1419 | int arcompact_handle0d_01_dasm(DASM_OPS_16) |
| 1420 | { |
| 1421 | int size = 2; |
| 1422 | print("SUB_S c <- b - u3 (%04x)", op); |
| 1423 | return size; |
| 1424 | } |
| 1425 | |
| 1426 | int arcompact_handle0d_02_dasm(DASM_OPS_16) |
| 1427 | { |
| 1428 | int size = 2; |
| 1429 | print("ASL_S c <- b asl u3 (%04x)", op); |
| 1430 | return size; |
| 1431 | } |
| 1432 | |
| 1433 | int arcompact_handle0d_03_dasm(DASM_OPS_16) |
| 1434 | { |
| 1435 | int size = 2; |
| 1436 | print("ASL_S c <- b asr u3 (%04x)", op); |
| 1437 | return size; |
| 1438 | } |
| 1439 | |
| 1440 | |
| 1345 | 1441 | int arcompact_handle0e_dasm(DASM_OPS_16) |
| 1346 | 1442 | { |
| 1347 | 1443 | int size = 2; |
| r242268 | r242269 | |
| 1359 | 1455 | } |
| 1360 | 1456 | |
| 1361 | 1457 | |
| 1458 | |
| 1459 | |
| 1362 | 1460 | #define GROUP_0e_GET_h \ |
| 1363 | 1461 | h = ((op & 0x0007) << 3); \ |
| 1364 | 1462 | h |= ((op & 0x00e0) >> 5); \ |
| r242268 | r242269 | |
| 1543 | 1641 | |
| 1544 | 1642 | int arcompact_handle17_dasm(DASM_OPS_16) |
| 1545 | 1643 | { |
| 1546 | | print("Shift/Sub/Bit (%04x)", op); |
| 1547 | | return 2; |
| 1644 | int size = 2; |
| 1645 | UINT8 subinstr = (op & 0x00e0) >> 5; |
| 1646 | op &= ~0x00e0; |
| 1647 | |
| 1648 | switch (subinstr) |
| 1649 | { |
| 1650 | case 0x00: size = arcompact_handle17_00_dasm(DASM_PARAMS); break; // ASL_S |
| 1651 | case 0x01: size = arcompact_handle17_01_dasm(DASM_PARAMS); break; // LSR_S |
| 1652 | case 0x02: size = arcompact_handle17_02_dasm(DASM_PARAMS); break; // ASR_S |
| 1653 | case 0x03: size = arcompact_handle17_03_dasm(DASM_PARAMS); break; // SUB_S |
| 1654 | case 0x04: size = arcompact_handle17_04_dasm(DASM_PARAMS); break; // BSET_S |
| 1655 | case 0x05: size = arcompact_handle17_05_dasm(DASM_PARAMS); break; // BCLR_S |
| 1656 | case 0x06: size = arcompact_handle17_06_dasm(DASM_PARAMS); break; // BMSK_S |
| 1657 | case 0x07: size = arcompact_handle17_07_dasm(DASM_PARAMS); break; // BTST_S |
| 1658 | } |
| 1659 | |
| 1660 | return size; |
| 1548 | 1661 | } |
| 1549 | 1662 | |
| 1663 | int arcompact_handle17_00_dasm(DASM_OPS_16) |
| 1664 | { |
| 1665 | int size = 2; |
| 1666 | print("ASL_S b <- b asl u5 (%04x)", op); |
| 1667 | return size; |
| 1668 | } |
| 1669 | |
| 1670 | int arcompact_handle17_01_dasm(DASM_OPS_16) |
| 1671 | { |
| 1672 | int size = 2; |
| 1673 | print("LSR_S b <- b lsr u5 (%04x)", op); |
| 1674 | return size; |
| 1675 | } |
| 1676 | |
| 1677 | int arcompact_handle17_02_dasm(DASM_OPS_16) |
| 1678 | { |
| 1679 | int size = 2; |
| 1680 | print("ASR_S b <- b asr u5 (%04x)", op); |
| 1681 | return size; |
| 1682 | } |
| 1683 | |
| 1684 | int arcompact_handle17_03_dasm(DASM_OPS_16) |
| 1685 | { |
| 1686 | int size = 2; |
| 1687 | print("SUB_S b <- b - u5 (%04x)", op); |
| 1688 | return size; |
| 1689 | } |
| 1690 | |
| 1691 | int arcompact_handle17_04_dasm(DASM_OPS_16) |
| 1692 | { |
| 1693 | int size = 2; |
| 1694 | print("BSET_S b <- b | (1 << u5) (%04x)", op); |
| 1695 | return size; |
| 1696 | } |
| 1697 | |
| 1698 | int arcompact_handle17_05_dasm(DASM_OPS_16) |
| 1699 | { |
| 1700 | int size = 2; |
| 1701 | print("BCLR_S b <- b & !(1 << u5) (%04x)", op); |
| 1702 | return size; |
| 1703 | } |
| 1704 | |
| 1705 | int arcompact_handle17_06_dasm(DASM_OPS_16) |
| 1706 | { |
| 1707 | int size = 2; |
| 1708 | print("BMSK_S (%04x)", op); |
| 1709 | return size; |
| 1710 | } |
| 1711 | |
| 1712 | int arcompact_handle17_07_dasm(DASM_OPS_16) |
| 1713 | { |
| 1714 | int size = 2; |
| 1715 | print("BTST_S (%04x)", op); |
| 1716 | return size; |
| 1717 | } |
| 1718 | |
| 1550 | 1719 | int arcompact_handle18_dasm(DASM_OPS_16) |
| 1551 | 1720 | { |
| 1552 | 1721 | int size = 2; |